001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.dstu3.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046import org.hl7.fhir.exceptions.FHIRFormatError;
047// added from java-adornments.txt:
048import org.hl7.fhir.dstu3.utils.StructureMapUtilities;
049
050// end addition
051/**
052 * A Map of relationships between 2 structures that can be used to transform data.
053 */
054@ResourceDef(name="StructureMap", profile="http://hl7.org/fhir/StructureDefinition/StructureMap")
055@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "structure", "import", "group"})
056public class StructureMap extends MetadataResource {
057
058    public enum StructureMapModelMode {
059        /**
060         * This structure describes an instance passed to the mapping engine that is used a source of data
061         */
062        SOURCE, 
063        /**
064         * This structure describes an instance that the mapping engine may ask for that is used a source of data
065         */
066        QUERIED, 
067        /**
068         * This structure describes an instance passed to the mapping engine that is used a target of data
069         */
070        TARGET, 
071        /**
072         * This structure describes an instance that the mapping engine may ask to create that is used a target of data
073         */
074        PRODUCED, 
075        /**
076         * added to help the parsers with the generic types
077         */
078        NULL;
079        public static StructureMapModelMode fromCode(String codeString) throws FHIRException {
080            if (codeString == null || "".equals(codeString))
081                return null;
082        if ("source".equals(codeString))
083          return SOURCE;
084        if ("queried".equals(codeString))
085          return QUERIED;
086        if ("target".equals(codeString))
087          return TARGET;
088        if ("produced".equals(codeString))
089          return PRODUCED;
090        if (Configuration.isAcceptInvalidEnums())
091          return null;
092        else
093          throw new FHIRException("Unknown StructureMapModelMode code '"+codeString+"'");
094        }
095        public String toCode() {
096          switch (this) {
097            case SOURCE: return "source";
098            case QUERIED: return "queried";
099            case TARGET: return "target";
100            case PRODUCED: return "produced";
101            default: return "?";
102          }
103        }
104        public String getSystem() {
105          switch (this) {
106            case SOURCE: return "http://hl7.org/fhir/map-model-mode";
107            case QUERIED: return "http://hl7.org/fhir/map-model-mode";
108            case TARGET: return "http://hl7.org/fhir/map-model-mode";
109            case PRODUCED: return "http://hl7.org/fhir/map-model-mode";
110            default: return "?";
111          }
112        }
113        public String getDefinition() {
114          switch (this) {
115            case SOURCE: return "This structure describes an instance passed to the mapping engine that is used a source of data";
116            case QUERIED: return "This structure describes an instance that the mapping engine may ask for that is used a source of data";
117            case TARGET: return "This structure describes an instance passed to the mapping engine that is used a target of data";
118            case PRODUCED: return "This structure describes an instance that the mapping engine may ask to create that is used a target of data";
119            default: return "?";
120          }
121        }
122        public String getDisplay() {
123          switch (this) {
124            case SOURCE: return "Source Structure Definition";
125            case QUERIED: return "Queried Structure Definition";
126            case TARGET: return "Target Structure Definition";
127            case PRODUCED: return "Produced Structure Definition";
128            default: return "?";
129          }
130        }
131    }
132
133  public static class StructureMapModelModeEnumFactory implements EnumFactory<StructureMapModelMode> {
134    public StructureMapModelMode fromCode(String codeString) throws IllegalArgumentException {
135      if (codeString == null || "".equals(codeString))
136            if (codeString == null || "".equals(codeString))
137                return null;
138        if ("source".equals(codeString))
139          return StructureMapModelMode.SOURCE;
140        if ("queried".equals(codeString))
141          return StructureMapModelMode.QUERIED;
142        if ("target".equals(codeString))
143          return StructureMapModelMode.TARGET;
144        if ("produced".equals(codeString))
145          return StructureMapModelMode.PRODUCED;
146        throw new IllegalArgumentException("Unknown StructureMapModelMode code '"+codeString+"'");
147        }
148        public Enumeration<StructureMapModelMode> fromType(Base code) throws FHIRException {
149          if (code == null)
150            return null;
151          if (code.isEmpty())
152            return new Enumeration<StructureMapModelMode>(this);
153          String codeString = ((PrimitiveType) code).asStringValue();
154          if (codeString == null || "".equals(codeString))
155            return null;
156        if ("source".equals(codeString))
157          return new Enumeration<StructureMapModelMode>(this, StructureMapModelMode.SOURCE);
158        if ("queried".equals(codeString))
159          return new Enumeration<StructureMapModelMode>(this, StructureMapModelMode.QUERIED);
160        if ("target".equals(codeString))
161          return new Enumeration<StructureMapModelMode>(this, StructureMapModelMode.TARGET);
162        if ("produced".equals(codeString))
163          return new Enumeration<StructureMapModelMode>(this, StructureMapModelMode.PRODUCED);
164        throw new FHIRException("Unknown StructureMapModelMode code '"+codeString+"'");
165        }
166    public String toCode(StructureMapModelMode code) {
167      if (code == StructureMapModelMode.SOURCE)
168        return "source";
169      if (code == StructureMapModelMode.QUERIED)
170        return "queried";
171      if (code == StructureMapModelMode.TARGET)
172        return "target";
173      if (code == StructureMapModelMode.PRODUCED)
174        return "produced";
175      return "?";
176      }
177    public String toSystem(StructureMapModelMode code) {
178      return code.getSystem();
179      }
180    }
181
182    public enum StructureMapGroupTypeMode {
183        /**
184         * This group is not a default group for the types
185         */
186        NONE, 
187        /**
188         * This group is a default mapping group for the specified types and for the primary source type
189         */
190        TYPES, 
191        /**
192         * This group is a default mapping group for the specified types
193         */
194        TYPEANDTYPES, 
195        /**
196         * added to help the parsers with the generic types
197         */
198        NULL;
199        public static StructureMapGroupTypeMode fromCode(String codeString) throws FHIRException {
200            if (codeString == null || "".equals(codeString))
201                return null;
202        if ("none".equals(codeString))
203          return NONE;
204        if ("types".equals(codeString))
205          return TYPES;
206        if ("type-and-types".equals(codeString))
207          return TYPEANDTYPES;
208        if (Configuration.isAcceptInvalidEnums())
209          return null;
210        else
211          throw new FHIRException("Unknown StructureMapGroupTypeMode code '"+codeString+"'");
212        }
213        public String toCode() {
214          switch (this) {
215            case NONE: return "none";
216            case TYPES: return "types";
217            case TYPEANDTYPES: return "type-and-types";
218            default: return "?";
219          }
220        }
221        public String getSystem() {
222          switch (this) {
223            case NONE: return "http://hl7.org/fhir/map-group-type-mode";
224            case TYPES: return "http://hl7.org/fhir/map-group-type-mode";
225            case TYPEANDTYPES: return "http://hl7.org/fhir/map-group-type-mode";
226            default: return "?";
227          }
228        }
229        public String getDefinition() {
230          switch (this) {
231            case NONE: return "This group is not a default group for the types";
232            case TYPES: return "This group is a default mapping group for the specified types and for the primary source type";
233            case TYPEANDTYPES: return "This group is a default mapping group for the specified types";
234            default: return "?";
235          }
236        }
237        public String getDisplay() {
238          switch (this) {
239            case NONE: return "Not a Default";
240            case TYPES: return "Default for Type Combination";
241            case TYPEANDTYPES: return "Default for type + combination";
242            default: return "?";
243          }
244        }
245    }
246
247  public static class StructureMapGroupTypeModeEnumFactory implements EnumFactory<StructureMapGroupTypeMode> {
248    public StructureMapGroupTypeMode fromCode(String codeString) throws IllegalArgumentException {
249      if (codeString == null || "".equals(codeString))
250            if (codeString == null || "".equals(codeString))
251                return null;
252        if ("none".equals(codeString))
253          return StructureMapGroupTypeMode.NONE;
254        if ("types".equals(codeString))
255          return StructureMapGroupTypeMode.TYPES;
256        if ("type-and-types".equals(codeString))
257          return StructureMapGroupTypeMode.TYPEANDTYPES;
258        throw new IllegalArgumentException("Unknown StructureMapGroupTypeMode code '"+codeString+"'");
259        }
260        public Enumeration<StructureMapGroupTypeMode> fromType(Base code) throws FHIRException {
261          if (code == null)
262            return null;
263          if (code.isEmpty())
264            return new Enumeration<StructureMapGroupTypeMode>(this);
265          String codeString = ((PrimitiveType) code).asStringValue();
266          if (codeString == null || "".equals(codeString))
267            return null;
268        if ("none".equals(codeString))
269          return new Enumeration<StructureMapGroupTypeMode>(this, StructureMapGroupTypeMode.NONE);
270        if ("types".equals(codeString))
271          return new Enumeration<StructureMapGroupTypeMode>(this, StructureMapGroupTypeMode.TYPES);
272        if ("type-and-types".equals(codeString))
273          return new Enumeration<StructureMapGroupTypeMode>(this, StructureMapGroupTypeMode.TYPEANDTYPES);
274        throw new FHIRException("Unknown StructureMapGroupTypeMode code '"+codeString+"'");
275        }
276    public String toCode(StructureMapGroupTypeMode code) {
277      if (code == StructureMapGroupTypeMode.NONE)
278        return "none";
279      if (code == StructureMapGroupTypeMode.TYPES)
280        return "types";
281      if (code == StructureMapGroupTypeMode.TYPEANDTYPES)
282        return "type-and-types";
283      return "?";
284      }
285    public String toSystem(StructureMapGroupTypeMode code) {
286      return code.getSystem();
287      }
288    }
289
290    public enum StructureMapInputMode {
291        /**
292         * Names an input instance used a source for mapping
293         */
294        SOURCE, 
295        /**
296         * Names an instance that is being populated
297         */
298        TARGET, 
299        /**
300         * added to help the parsers with the generic types
301         */
302        NULL;
303        public static StructureMapInputMode fromCode(String codeString) throws FHIRException {
304            if (codeString == null || "".equals(codeString))
305                return null;
306        if ("source".equals(codeString))
307          return SOURCE;
308        if ("target".equals(codeString))
309          return TARGET;
310        if (Configuration.isAcceptInvalidEnums())
311          return null;
312        else
313          throw new FHIRException("Unknown StructureMapInputMode code '"+codeString+"'");
314        }
315        public String toCode() {
316          switch (this) {
317            case SOURCE: return "source";
318            case TARGET: return "target";
319            default: return "?";
320          }
321        }
322        public String getSystem() {
323          switch (this) {
324            case SOURCE: return "http://hl7.org/fhir/map-input-mode";
325            case TARGET: return "http://hl7.org/fhir/map-input-mode";
326            default: return "?";
327          }
328        }
329        public String getDefinition() {
330          switch (this) {
331            case SOURCE: return "Names an input instance used a source for mapping";
332            case TARGET: return "Names an instance that is being populated";
333            default: return "?";
334          }
335        }
336        public String getDisplay() {
337          switch (this) {
338            case SOURCE: return "Source Instance";
339            case TARGET: return "Target Instance";
340            default: return "?";
341          }
342        }
343    }
344
345  public static class StructureMapInputModeEnumFactory implements EnumFactory<StructureMapInputMode> {
346    public StructureMapInputMode fromCode(String codeString) throws IllegalArgumentException {
347      if (codeString == null || "".equals(codeString))
348            if (codeString == null || "".equals(codeString))
349                return null;
350        if ("source".equals(codeString))
351          return StructureMapInputMode.SOURCE;
352        if ("target".equals(codeString))
353          return StructureMapInputMode.TARGET;
354        throw new IllegalArgumentException("Unknown StructureMapInputMode code '"+codeString+"'");
355        }
356        public Enumeration<StructureMapInputMode> fromType(Base code) throws FHIRException {
357          if (code == null)
358            return null;
359          if (code.isEmpty())
360            return new Enumeration<StructureMapInputMode>(this);
361          String codeString = ((PrimitiveType) code).asStringValue();
362          if (codeString == null || "".equals(codeString))
363            return null;
364        if ("source".equals(codeString))
365          return new Enumeration<StructureMapInputMode>(this, StructureMapInputMode.SOURCE);
366        if ("target".equals(codeString))
367          return new Enumeration<StructureMapInputMode>(this, StructureMapInputMode.TARGET);
368        throw new FHIRException("Unknown StructureMapInputMode code '"+codeString+"'");
369        }
370    public String toCode(StructureMapInputMode code) {
371      if (code == StructureMapInputMode.SOURCE)
372        return "source";
373      if (code == StructureMapInputMode.TARGET)
374        return "target";
375      return "?";
376      }
377    public String toSystem(StructureMapInputMode code) {
378      return code.getSystem();
379      }
380    }
381
382    public enum StructureMapSourceListMode {
383        /**
384         * Only process this rule for the first in the list
385         */
386        FIRST, 
387        /**
388         * Process this rule for all but the first
389         */
390        NOTFIRST, 
391        /**
392         * Only process this rule for the last in the list
393         */
394        LAST, 
395        /**
396         * Process this rule for all but the last
397         */
398        NOTLAST, 
399        /**
400         * Only process this rule is there is only item
401         */
402        ONLYONE, 
403        /**
404         * added to help the parsers with the generic types
405         */
406        NULL;
407        public static StructureMapSourceListMode fromCode(String codeString) throws FHIRException {
408            if (codeString == null || "".equals(codeString))
409                return null;
410        if ("first".equals(codeString))
411          return FIRST;
412        if ("not_first".equals(codeString))
413          return NOTFIRST;
414        if ("last".equals(codeString))
415          return LAST;
416        if ("not_last".equals(codeString))
417          return NOTLAST;
418        if ("only_one".equals(codeString))
419          return ONLYONE;
420        if (Configuration.isAcceptInvalidEnums())
421          return null;
422        else
423          throw new FHIRException("Unknown StructureMapSourceListMode code '"+codeString+"'");
424        }
425        public String toCode() {
426          switch (this) {
427            case FIRST: return "first";
428            case NOTFIRST: return "not_first";
429            case LAST: return "last";
430            case NOTLAST: return "not_last";
431            case ONLYONE: return "only_one";
432            default: return "?";
433          }
434        }
435        public String getSystem() {
436          switch (this) {
437            case FIRST: return "http://hl7.org/fhir/map-source-list-mode";
438            case NOTFIRST: return "http://hl7.org/fhir/map-source-list-mode";
439            case LAST: return "http://hl7.org/fhir/map-source-list-mode";
440            case NOTLAST: return "http://hl7.org/fhir/map-source-list-mode";
441            case ONLYONE: return "http://hl7.org/fhir/map-source-list-mode";
442            default: return "?";
443          }
444        }
445        public String getDefinition() {
446          switch (this) {
447            case FIRST: return "Only process this rule for the first in the list";
448            case NOTFIRST: return "Process this rule for all but the first";
449            case LAST: return "Only process this rule for the last in the list";
450            case NOTLAST: return "Process this rule for all but the last";
451            case ONLYONE: return "Only process this rule is there is only item";
452            default: return "?";
453          }
454        }
455        public String getDisplay() {
456          switch (this) {
457            case FIRST: return "First";
458            case NOTFIRST: return "All but the first";
459            case LAST: return "Last";
460            case NOTLAST: return "All but the last";
461            case ONLYONE: return "Enforce only one";
462            default: return "?";
463          }
464        }
465    }
466
467  public static class StructureMapSourceListModeEnumFactory implements EnumFactory<StructureMapSourceListMode> {
468    public StructureMapSourceListMode fromCode(String codeString) throws IllegalArgumentException {
469      if (codeString == null || "".equals(codeString))
470            if (codeString == null || "".equals(codeString))
471                return null;
472        if ("first".equals(codeString))
473          return StructureMapSourceListMode.FIRST;
474        if ("not_first".equals(codeString))
475          return StructureMapSourceListMode.NOTFIRST;
476        if ("last".equals(codeString))
477          return StructureMapSourceListMode.LAST;
478        if ("not_last".equals(codeString))
479          return StructureMapSourceListMode.NOTLAST;
480        if ("only_one".equals(codeString))
481          return StructureMapSourceListMode.ONLYONE;
482        throw new IllegalArgumentException("Unknown StructureMapSourceListMode code '"+codeString+"'");
483        }
484        public Enumeration<StructureMapSourceListMode> fromType(Base code) throws FHIRException {
485          if (code == null)
486            return null;
487          if (code.isEmpty())
488            return new Enumeration<StructureMapSourceListMode>(this);
489          String codeString = ((PrimitiveType) code).asStringValue();
490          if (codeString == null || "".equals(codeString))
491            return null;
492        if ("first".equals(codeString))
493          return new Enumeration<StructureMapSourceListMode>(this, StructureMapSourceListMode.FIRST);
494        if ("not_first".equals(codeString))
495          return new Enumeration<StructureMapSourceListMode>(this, StructureMapSourceListMode.NOTFIRST);
496        if ("last".equals(codeString))
497          return new Enumeration<StructureMapSourceListMode>(this, StructureMapSourceListMode.LAST);
498        if ("not_last".equals(codeString))
499          return new Enumeration<StructureMapSourceListMode>(this, StructureMapSourceListMode.NOTLAST);
500        if ("only_one".equals(codeString))
501          return new Enumeration<StructureMapSourceListMode>(this, StructureMapSourceListMode.ONLYONE);
502        throw new FHIRException("Unknown StructureMapSourceListMode code '"+codeString+"'");
503        }
504    public String toCode(StructureMapSourceListMode code) {
505      if (code == StructureMapSourceListMode.FIRST)
506        return "first";
507      if (code == StructureMapSourceListMode.NOTFIRST)
508        return "not_first";
509      if (code == StructureMapSourceListMode.LAST)
510        return "last";
511      if (code == StructureMapSourceListMode.NOTLAST)
512        return "not_last";
513      if (code == StructureMapSourceListMode.ONLYONE)
514        return "only_one";
515      return "?";
516      }
517    public String toSystem(StructureMapSourceListMode code) {
518      return code.getSystem();
519      }
520    }
521
522    public enum StructureMapContextType {
523        /**
524         * The context specifies a type
525         */
526        TYPE, 
527        /**
528         * The context specifies a variable
529         */
530        VARIABLE, 
531        /**
532         * added to help the parsers with the generic types
533         */
534        NULL;
535        public static StructureMapContextType fromCode(String codeString) throws FHIRException {
536            if (codeString == null || "".equals(codeString))
537                return null;
538        if ("type".equals(codeString))
539          return TYPE;
540        if ("variable".equals(codeString))
541          return VARIABLE;
542        if (Configuration.isAcceptInvalidEnums())
543          return null;
544        else
545          throw new FHIRException("Unknown StructureMapContextType code '"+codeString+"'");
546        }
547        public String toCode() {
548          switch (this) {
549            case TYPE: return "type";
550            case VARIABLE: return "variable";
551            default: return "?";
552          }
553        }
554        public String getSystem() {
555          switch (this) {
556            case TYPE: return "http://hl7.org/fhir/map-context-type";
557            case VARIABLE: return "http://hl7.org/fhir/map-context-type";
558            default: return "?";
559          }
560        }
561        public String getDefinition() {
562          switch (this) {
563            case TYPE: return "The context specifies a type";
564            case VARIABLE: return "The context specifies a variable";
565            default: return "?";
566          }
567        }
568        public String getDisplay() {
569          switch (this) {
570            case TYPE: return "Type";
571            case VARIABLE: return "Variable";
572            default: return "?";
573          }
574        }
575    }
576
577  public static class StructureMapContextTypeEnumFactory implements EnumFactory<StructureMapContextType> {
578    public StructureMapContextType fromCode(String codeString) throws IllegalArgumentException {
579      if (codeString == null || "".equals(codeString))
580            if (codeString == null || "".equals(codeString))
581                return null;
582        if ("type".equals(codeString))
583          return StructureMapContextType.TYPE;
584        if ("variable".equals(codeString))
585          return StructureMapContextType.VARIABLE;
586        throw new IllegalArgumentException("Unknown StructureMapContextType code '"+codeString+"'");
587        }
588        public Enumeration<StructureMapContextType> fromType(Base code) throws FHIRException {
589          if (code == null)
590            return null;
591          if (code.isEmpty())
592            return new Enumeration<StructureMapContextType>(this);
593          String codeString = ((PrimitiveType) code).asStringValue();
594          if (codeString == null || "".equals(codeString))
595            return null;
596        if ("type".equals(codeString))
597          return new Enumeration<StructureMapContextType>(this, StructureMapContextType.TYPE);
598        if ("variable".equals(codeString))
599          return new Enumeration<StructureMapContextType>(this, StructureMapContextType.VARIABLE);
600        throw new FHIRException("Unknown StructureMapContextType code '"+codeString+"'");
601        }
602    public String toCode(StructureMapContextType code) {
603      if (code == StructureMapContextType.TYPE)
604        return "type";
605      if (code == StructureMapContextType.VARIABLE)
606        return "variable";
607      return "?";
608      }
609    public String toSystem(StructureMapContextType code) {
610      return code.getSystem();
611      }
612    }
613
614    public enum StructureMapTargetListMode {
615        /**
616         * when the target list is being assembled, the items for this rule go first. If more that one rule defines a first item (for a given instance of mapping) then this is an error
617         */
618        FIRST, 
619        /**
620         * the target instance is shared with the target instances generated by another rule (up to the first common n items, then create new ones)
621         */
622        SHARE, 
623        /**
624         * when the target list is being assembled, the items for this rule go last. If more that one rule defines a last item (for a given instance of mapping) then this is an error
625         */
626        LAST, 
627        /**
628         * re-use the first item in the list, and keep adding content to it
629         */
630        COLLATE, 
631        /**
632         * added to help the parsers with the generic types
633         */
634        NULL;
635        public static StructureMapTargetListMode fromCode(String codeString) throws FHIRException {
636            if (codeString == null || "".equals(codeString))
637                return null;
638        if ("first".equals(codeString))
639          return FIRST;
640        if ("share".equals(codeString))
641          return SHARE;
642        if ("last".equals(codeString))
643          return LAST;
644        if ("collate".equals(codeString))
645          return COLLATE;
646        if (Configuration.isAcceptInvalidEnums())
647          return null;
648        else
649          throw new FHIRException("Unknown StructureMapTargetListMode code '"+codeString+"'");
650        }
651        public String toCode() {
652          switch (this) {
653            case FIRST: return "first";
654            case SHARE: return "share";
655            case LAST: return "last";
656            case COLLATE: return "collate";
657            default: return "?";
658          }
659        }
660        public String getSystem() {
661          switch (this) {
662            case FIRST: return "http://hl7.org/fhir/map-target-list-mode";
663            case SHARE: return "http://hl7.org/fhir/map-target-list-mode";
664            case LAST: return "http://hl7.org/fhir/map-target-list-mode";
665            case COLLATE: return "http://hl7.org/fhir/map-target-list-mode";
666            default: return "?";
667          }
668        }
669        public String getDefinition() {
670          switch (this) {
671            case FIRST: return "when the target list is being assembled, the items for this rule go first. If more that one rule defines a first item (for a given instance of mapping) then this is an error";
672            case SHARE: return "the target instance is shared with the target instances generated by another rule (up to the first common n items, then create new ones)";
673            case LAST: return "when the target list is being assembled, the items for this rule go last. If more that one rule defines a last item (for a given instance of mapping) then this is an error";
674            case COLLATE: return "re-use the first item in the list, and keep adding content to it";
675            default: return "?";
676          }
677        }
678        public String getDisplay() {
679          switch (this) {
680            case FIRST: return "First";
681            case SHARE: return "Share";
682            case LAST: return "Last";
683            case COLLATE: return "Collate";
684            default: return "?";
685          }
686        }
687    }
688
689  public static class StructureMapTargetListModeEnumFactory implements EnumFactory<StructureMapTargetListMode> {
690    public StructureMapTargetListMode fromCode(String codeString) throws IllegalArgumentException {
691      if (codeString == null || "".equals(codeString))
692            if (codeString == null || "".equals(codeString))
693                return null;
694        if ("first".equals(codeString))
695          return StructureMapTargetListMode.FIRST;
696        if ("share".equals(codeString))
697          return StructureMapTargetListMode.SHARE;
698        if ("last".equals(codeString))
699          return StructureMapTargetListMode.LAST;
700        if ("collate".equals(codeString))
701          return StructureMapTargetListMode.COLLATE;
702        throw new IllegalArgumentException("Unknown StructureMapTargetListMode code '"+codeString+"'");
703        }
704        public Enumeration<StructureMapTargetListMode> fromType(Base code) throws FHIRException {
705          if (code == null)
706            return null;
707          if (code.isEmpty())
708            return new Enumeration<StructureMapTargetListMode>(this);
709          String codeString = ((PrimitiveType) code).asStringValue();
710          if (codeString == null || "".equals(codeString))
711            return null;
712        if ("first".equals(codeString))
713          return new Enumeration<StructureMapTargetListMode>(this, StructureMapTargetListMode.FIRST);
714        if ("share".equals(codeString))
715          return new Enumeration<StructureMapTargetListMode>(this, StructureMapTargetListMode.SHARE);
716        if ("last".equals(codeString))
717          return new Enumeration<StructureMapTargetListMode>(this, StructureMapTargetListMode.LAST);
718        if ("collate".equals(codeString))
719          return new Enumeration<StructureMapTargetListMode>(this, StructureMapTargetListMode.COLLATE);
720        throw new FHIRException("Unknown StructureMapTargetListMode code '"+codeString+"'");
721        }
722    public String toCode(StructureMapTargetListMode code) {
723      if (code == StructureMapTargetListMode.FIRST)
724        return "first";
725      if (code == StructureMapTargetListMode.SHARE)
726        return "share";
727      if (code == StructureMapTargetListMode.LAST)
728        return "last";
729      if (code == StructureMapTargetListMode.COLLATE)
730        return "collate";
731      return "?";
732      }
733    public String toSystem(StructureMapTargetListMode code) {
734      return code.getSystem();
735      }
736    }
737
738    public enum StructureMapTransform {
739        /**
740         * create(type : string) - type is passed through to the application on the standard API, and must be known by it
741         */
742        CREATE, 
743        /**
744         * copy(source)
745         */
746        COPY, 
747        /**
748         * truncate(source, length) - source must be stringy type
749         */
750        TRUNCATE, 
751        /**
752         * escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped
753         */
754        ESCAPE, 
755        /**
756         * cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known
757         */
758        CAST, 
759        /**
760         * append(source...) - source is element or string
761         */
762        APPEND, 
763        /**
764         * translate(source, uri_of_map) - use the translate operation
765         */
766        TRANSLATE, 
767        /**
768         * reference(source : object) - return a string that references the provided tree properly
769         */
770        REFERENCE, 
771        /**
772         * Perform a date operation. *Parameters to be documented*
773         */
774        DATEOP, 
775        /**
776         * Generate a random UUID (in lowercase). No Parameters
777         */
778        UUID, 
779        /**
780         * Return the appropriate string to put in a reference that refers to the resource provided as a parameter
781         */
782        POINTER, 
783        /**
784         * Execute the supplied fluentpath expression and use the value returned by that
785         */
786        EVALUATE, 
787        /**
788         * Create a CodeableConcept. Parameters = (text) or (system. Code[, display])
789         */
790        CC, 
791        /**
792         * Create a Coding. Parameters = (system. Code[, display])
793         */
794        C, 
795        /**
796         * Create a quantity. Parameters = (text) or (value, unit, [system, code]) where text is the natural representation e.g. [comparator]value[space]unit
797         */
798        QTY, 
799        /**
800         * Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value set
801         */
802        ID, 
803        /**
804         * Create a contact details. Parameters = (value) or (system, value). If no system is provided, the system should be inferred from the content of the value
805         */
806        CP, 
807        /**
808         * added to help the parsers with the generic types
809         */
810        NULL;
811        public static StructureMapTransform fromCode(String codeString) throws FHIRException {
812            if (codeString == null || "".equals(codeString))
813                return null;
814        if ("create".equals(codeString))
815          return CREATE;
816        if ("copy".equals(codeString))
817          return COPY;
818        if ("truncate".equals(codeString))
819          return TRUNCATE;
820        if ("escape".equals(codeString))
821          return ESCAPE;
822        if ("cast".equals(codeString))
823          return CAST;
824        if ("append".equals(codeString))
825          return APPEND;
826        if ("translate".equals(codeString))
827          return TRANSLATE;
828        if ("reference".equals(codeString))
829          return REFERENCE;
830        if ("dateOp".equals(codeString))
831          return DATEOP;
832        if ("uuid".equals(codeString))
833          return UUID;
834        if ("pointer".equals(codeString))
835          return POINTER;
836        if ("evaluate".equals(codeString))
837          return EVALUATE;
838        if ("cc".equals(codeString))
839          return CC;
840        if ("c".equals(codeString))
841          return C;
842        if ("qty".equals(codeString))
843          return QTY;
844        if ("id".equals(codeString))
845          return ID;
846        if ("cp".equals(codeString))
847          return CP;
848        if (Configuration.isAcceptInvalidEnums())
849          return null;
850        else
851          throw new FHIRException("Unknown StructureMapTransform code '"+codeString+"'");
852        }
853        public String toCode() {
854          switch (this) {
855            case CREATE: return "create";
856            case COPY: return "copy";
857            case TRUNCATE: return "truncate";
858            case ESCAPE: return "escape";
859            case CAST: return "cast";
860            case APPEND: return "append";
861            case TRANSLATE: return "translate";
862            case REFERENCE: return "reference";
863            case DATEOP: return "dateOp";
864            case UUID: return "uuid";
865            case POINTER: return "pointer";
866            case EVALUATE: return "evaluate";
867            case CC: return "cc";
868            case C: return "c";
869            case QTY: return "qty";
870            case ID: return "id";
871            case CP: return "cp";
872            default: return "?";
873          }
874        }
875        public String getSystem() {
876          switch (this) {
877            case CREATE: return "http://hl7.org/fhir/map-transform";
878            case COPY: return "http://hl7.org/fhir/map-transform";
879            case TRUNCATE: return "http://hl7.org/fhir/map-transform";
880            case ESCAPE: return "http://hl7.org/fhir/map-transform";
881            case CAST: return "http://hl7.org/fhir/map-transform";
882            case APPEND: return "http://hl7.org/fhir/map-transform";
883            case TRANSLATE: return "http://hl7.org/fhir/map-transform";
884            case REFERENCE: return "http://hl7.org/fhir/map-transform";
885            case DATEOP: return "http://hl7.org/fhir/map-transform";
886            case UUID: return "http://hl7.org/fhir/map-transform";
887            case POINTER: return "http://hl7.org/fhir/map-transform";
888            case EVALUATE: return "http://hl7.org/fhir/map-transform";
889            case CC: return "http://hl7.org/fhir/map-transform";
890            case C: return "http://hl7.org/fhir/map-transform";
891            case QTY: return "http://hl7.org/fhir/map-transform";
892            case ID: return "http://hl7.org/fhir/map-transform";
893            case CP: return "http://hl7.org/fhir/map-transform";
894            default: return "?";
895          }
896        }
897        public String getDefinition() {
898          switch (this) {
899            case CREATE: return "create(type : string) - type is passed through to the application on the standard API, and must be known by it";
900            case COPY: return "copy(source)";
901            case TRUNCATE: return "truncate(source, length) - source must be stringy type";
902            case ESCAPE: return "escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped";
903            case CAST: return "cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known";
904            case APPEND: return "append(source...) - source is element or string";
905            case TRANSLATE: return "translate(source, uri_of_map) - use the translate operation";
906            case REFERENCE: return "reference(source : object) - return a string that references the provided tree properly";
907            case DATEOP: return "Perform a date operation. *Parameters to be documented*";
908            case UUID: return "Generate a random UUID (in lowercase). No Parameters";
909            case POINTER: return "Return the appropriate string to put in a reference that refers to the resource provided as a parameter";
910            case EVALUATE: return "Execute the supplied fluentpath expression and use the value returned by that";
911            case CC: return "Create a CodeableConcept. Parameters = (text) or (system. Code[, display])";
912            case C: return "Create a Coding. Parameters = (system. Code[, display])";
913            case QTY: return "Create a quantity. Parameters = (text) or (value, unit, [system, code]) where text is the natural representation e.g. [comparator]value[space]unit";
914            case ID: return "Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value set";
915            case CP: return "Create a contact details. Parameters = (value) or (system, value). If no system is provided, the system should be inferred from the content of the value";
916            default: return "?";
917          }
918        }
919        public String getDisplay() {
920          switch (this) {
921            case CREATE: return "create";
922            case COPY: return "copy";
923            case TRUNCATE: return "truncate";
924            case ESCAPE: return "escape";
925            case CAST: return "cast";
926            case APPEND: return "append";
927            case TRANSLATE: return "translate";
928            case REFERENCE: return "reference";
929            case DATEOP: return "dateOp";
930            case UUID: return "uuid";
931            case POINTER: return "pointer";
932            case EVALUATE: return "evaluate";
933            case CC: return "cc";
934            case C: return "c";
935            case QTY: return "qty";
936            case ID: return "id";
937            case CP: return "cp";
938            default: return "?";
939          }
940        }
941    }
942
943  public static class StructureMapTransformEnumFactory implements EnumFactory<StructureMapTransform> {
944    public StructureMapTransform fromCode(String codeString) throws IllegalArgumentException {
945      if (codeString == null || "".equals(codeString))
946            if (codeString == null || "".equals(codeString))
947                return null;
948        if ("create".equals(codeString))
949          return StructureMapTransform.CREATE;
950        if ("copy".equals(codeString))
951          return StructureMapTransform.COPY;
952        if ("truncate".equals(codeString))
953          return StructureMapTransform.TRUNCATE;
954        if ("escape".equals(codeString))
955          return StructureMapTransform.ESCAPE;
956        if ("cast".equals(codeString))
957          return StructureMapTransform.CAST;
958        if ("append".equals(codeString))
959          return StructureMapTransform.APPEND;
960        if ("translate".equals(codeString))
961          return StructureMapTransform.TRANSLATE;
962        if ("reference".equals(codeString))
963          return StructureMapTransform.REFERENCE;
964        if ("dateOp".equals(codeString))
965          return StructureMapTransform.DATEOP;
966        if ("uuid".equals(codeString))
967          return StructureMapTransform.UUID;
968        if ("pointer".equals(codeString))
969          return StructureMapTransform.POINTER;
970        if ("evaluate".equals(codeString))
971          return StructureMapTransform.EVALUATE;
972        if ("cc".equals(codeString))
973          return StructureMapTransform.CC;
974        if ("c".equals(codeString))
975          return StructureMapTransform.C;
976        if ("qty".equals(codeString))
977          return StructureMapTransform.QTY;
978        if ("id".equals(codeString))
979          return StructureMapTransform.ID;
980        if ("cp".equals(codeString))
981          return StructureMapTransform.CP;
982        throw new IllegalArgumentException("Unknown StructureMapTransform code '"+codeString+"'");
983        }
984        public Enumeration<StructureMapTransform> fromType(Base code) throws FHIRException {
985          if (code == null)
986            return null;
987          if (code.isEmpty())
988            return new Enumeration<StructureMapTransform>(this);
989          String codeString = ((PrimitiveType) code).asStringValue();
990          if (codeString == null || "".equals(codeString))
991            return null;
992        if ("create".equals(codeString))
993          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.CREATE);
994        if ("copy".equals(codeString))
995          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.COPY);
996        if ("truncate".equals(codeString))
997          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.TRUNCATE);
998        if ("escape".equals(codeString))
999          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.ESCAPE);
1000        if ("cast".equals(codeString))
1001          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.CAST);
1002        if ("append".equals(codeString))
1003          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.APPEND);
1004        if ("translate".equals(codeString))
1005          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.TRANSLATE);
1006        if ("reference".equals(codeString))
1007          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.REFERENCE);
1008        if ("dateOp".equals(codeString))
1009          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.DATEOP);
1010        if ("uuid".equals(codeString))
1011          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.UUID);
1012        if ("pointer".equals(codeString))
1013          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.POINTER);
1014        if ("evaluate".equals(codeString))
1015          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.EVALUATE);
1016        if ("cc".equals(codeString))
1017          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.CC);
1018        if ("c".equals(codeString))
1019          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.C);
1020        if ("qty".equals(codeString))
1021          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.QTY);
1022        if ("id".equals(codeString))
1023          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.ID);
1024        if ("cp".equals(codeString))
1025          return new Enumeration<StructureMapTransform>(this, StructureMapTransform.CP);
1026        throw new FHIRException("Unknown StructureMapTransform code '"+codeString+"'");
1027        }
1028    public String toCode(StructureMapTransform code) {
1029      if (code == StructureMapTransform.CREATE)
1030        return "create";
1031      if (code == StructureMapTransform.COPY)
1032        return "copy";
1033      if (code == StructureMapTransform.TRUNCATE)
1034        return "truncate";
1035      if (code == StructureMapTransform.ESCAPE)
1036        return "escape";
1037      if (code == StructureMapTransform.CAST)
1038        return "cast";
1039      if (code == StructureMapTransform.APPEND)
1040        return "append";
1041      if (code == StructureMapTransform.TRANSLATE)
1042        return "translate";
1043      if (code == StructureMapTransform.REFERENCE)
1044        return "reference";
1045      if (code == StructureMapTransform.DATEOP)
1046        return "dateOp";
1047      if (code == StructureMapTransform.UUID)
1048        return "uuid";
1049      if (code == StructureMapTransform.POINTER)
1050        return "pointer";
1051      if (code == StructureMapTransform.EVALUATE)
1052        return "evaluate";
1053      if (code == StructureMapTransform.CC)
1054        return "cc";
1055      if (code == StructureMapTransform.C)
1056        return "c";
1057      if (code == StructureMapTransform.QTY)
1058        return "qty";
1059      if (code == StructureMapTransform.ID)
1060        return "id";
1061      if (code == StructureMapTransform.CP)
1062        return "cp";
1063      return "?";
1064      }
1065    public String toSystem(StructureMapTransform code) {
1066      return code.getSystem();
1067      }
1068    }
1069
1070    @Block()
1071    public static class StructureMapStructureComponent extends BackboneElement implements IBaseBackboneElement {
1072        /**
1073         * The canonical URL that identifies the structure.
1074         */
1075        @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1076        @Description(shortDefinition="Canonical URL for structure definition", formalDefinition="The canonical URL that identifies the structure." )
1077        protected UriType url;
1078
1079        /**
1080         * How the referenced structure is used in this mapping.
1081         */
1082        @Child(name = "mode", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1083        @Description(shortDefinition="source | queried | target | produced", formalDefinition="How the referenced structure is used in this mapping." )
1084        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-model-mode")
1085        protected Enumeration<StructureMapModelMode> mode;
1086
1087        /**
1088         * The name used for this type in the map.
1089         */
1090        @Child(name = "alias", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1091        @Description(shortDefinition="Name for type in this map", formalDefinition="The name used for this type in the map." )
1092        protected StringType alias;
1093
1094        /**
1095         * Documentation that describes how the structure is used in the mapping.
1096         */
1097        @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1098        @Description(shortDefinition="Documentation on use of structure", formalDefinition="Documentation that describes how the structure is used in the mapping." )
1099        protected StringType documentation;
1100
1101        private static final long serialVersionUID = -277986558L;
1102
1103    /**
1104     * Constructor
1105     */
1106      public StructureMapStructureComponent() {
1107        super();
1108      }
1109
1110    /**
1111     * Constructor
1112     */
1113      public StructureMapStructureComponent(UriType url, Enumeration<StructureMapModelMode> mode) {
1114        super();
1115        this.url = url;
1116        this.mode = mode;
1117      }
1118
1119        /**
1120         * @return {@link #url} (The canonical URL that identifies the structure.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1121         */
1122        public UriType getUrlElement() { 
1123          if (this.url == null)
1124            if (Configuration.errorOnAutoCreate())
1125              throw new Error("Attempt to auto-create StructureMapStructureComponent.url");
1126            else if (Configuration.doAutoCreate())
1127              this.url = new UriType(); // bb
1128          return this.url;
1129        }
1130
1131        public boolean hasUrlElement() { 
1132          return this.url != null && !this.url.isEmpty();
1133        }
1134
1135        public boolean hasUrl() { 
1136          return this.url != null && !this.url.isEmpty();
1137        }
1138
1139        /**
1140         * @param value {@link #url} (The canonical URL that identifies the structure.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1141         */
1142        public StructureMapStructureComponent setUrlElement(UriType value) { 
1143          this.url = value;
1144          return this;
1145        }
1146
1147        /**
1148         * @return The canonical URL that identifies the structure.
1149         */
1150        public String getUrl() { 
1151          return this.url == null ? null : this.url.getValue();
1152        }
1153
1154        /**
1155         * @param value The canonical URL that identifies the structure.
1156         */
1157        public StructureMapStructureComponent setUrl(String value) { 
1158            if (this.url == null)
1159              this.url = new UriType();
1160            this.url.setValue(value);
1161          return this;
1162        }
1163
1164        /**
1165         * @return {@link #mode} (How the referenced structure is used in this mapping.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
1166         */
1167        public Enumeration<StructureMapModelMode> getModeElement() { 
1168          if (this.mode == null)
1169            if (Configuration.errorOnAutoCreate())
1170              throw new Error("Attempt to auto-create StructureMapStructureComponent.mode");
1171            else if (Configuration.doAutoCreate())
1172              this.mode = new Enumeration<StructureMapModelMode>(new StructureMapModelModeEnumFactory()); // bb
1173          return this.mode;
1174        }
1175
1176        public boolean hasModeElement() { 
1177          return this.mode != null && !this.mode.isEmpty();
1178        }
1179
1180        public boolean hasMode() { 
1181          return this.mode != null && !this.mode.isEmpty();
1182        }
1183
1184        /**
1185         * @param value {@link #mode} (How the referenced structure is used in this mapping.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
1186         */
1187        public StructureMapStructureComponent setModeElement(Enumeration<StructureMapModelMode> value) { 
1188          this.mode = value;
1189          return this;
1190        }
1191
1192        /**
1193         * @return How the referenced structure is used in this mapping.
1194         */
1195        public StructureMapModelMode getMode() { 
1196          return this.mode == null ? null : this.mode.getValue();
1197        }
1198
1199        /**
1200         * @param value How the referenced structure is used in this mapping.
1201         */
1202        public StructureMapStructureComponent setMode(StructureMapModelMode value) { 
1203            if (this.mode == null)
1204              this.mode = new Enumeration<StructureMapModelMode>(new StructureMapModelModeEnumFactory());
1205            this.mode.setValue(value);
1206          return this;
1207        }
1208
1209        /**
1210         * @return {@link #alias} (The name used for this type in the map.). This is the underlying object with id, value and extensions. The accessor "getAlias" gives direct access to the value
1211         */
1212        public StringType getAliasElement() { 
1213          if (this.alias == null)
1214            if (Configuration.errorOnAutoCreate())
1215              throw new Error("Attempt to auto-create StructureMapStructureComponent.alias");
1216            else if (Configuration.doAutoCreate())
1217              this.alias = new StringType(); // bb
1218          return this.alias;
1219        }
1220
1221        public boolean hasAliasElement() { 
1222          return this.alias != null && !this.alias.isEmpty();
1223        }
1224
1225        public boolean hasAlias() { 
1226          return this.alias != null && !this.alias.isEmpty();
1227        }
1228
1229        /**
1230         * @param value {@link #alias} (The name used for this type in the map.). This is the underlying object with id, value and extensions. The accessor "getAlias" gives direct access to the value
1231         */
1232        public StructureMapStructureComponent setAliasElement(StringType value) { 
1233          this.alias = value;
1234          return this;
1235        }
1236
1237        /**
1238         * @return The name used for this type in the map.
1239         */
1240        public String getAlias() { 
1241          return this.alias == null ? null : this.alias.getValue();
1242        }
1243
1244        /**
1245         * @param value The name used for this type in the map.
1246         */
1247        public StructureMapStructureComponent setAlias(String value) { 
1248          if (Utilities.noString(value))
1249            this.alias = null;
1250          else {
1251            if (this.alias == null)
1252              this.alias = new StringType();
1253            this.alias.setValue(value);
1254          }
1255          return this;
1256        }
1257
1258        /**
1259         * @return {@link #documentation} (Documentation that describes how the structure is used in the mapping.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
1260         */
1261        public StringType getDocumentationElement() { 
1262          if (this.documentation == null)
1263            if (Configuration.errorOnAutoCreate())
1264              throw new Error("Attempt to auto-create StructureMapStructureComponent.documentation");
1265            else if (Configuration.doAutoCreate())
1266              this.documentation = new StringType(); // bb
1267          return this.documentation;
1268        }
1269
1270        public boolean hasDocumentationElement() { 
1271          return this.documentation != null && !this.documentation.isEmpty();
1272        }
1273
1274        public boolean hasDocumentation() { 
1275          return this.documentation != null && !this.documentation.isEmpty();
1276        }
1277
1278        /**
1279         * @param value {@link #documentation} (Documentation that describes how the structure is used in the mapping.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
1280         */
1281        public StructureMapStructureComponent setDocumentationElement(StringType value) { 
1282          this.documentation = value;
1283          return this;
1284        }
1285
1286        /**
1287         * @return Documentation that describes how the structure is used in the mapping.
1288         */
1289        public String getDocumentation() { 
1290          return this.documentation == null ? null : this.documentation.getValue();
1291        }
1292
1293        /**
1294         * @param value Documentation that describes how the structure is used in the mapping.
1295         */
1296        public StructureMapStructureComponent setDocumentation(String value) { 
1297          if (Utilities.noString(value))
1298            this.documentation = null;
1299          else {
1300            if (this.documentation == null)
1301              this.documentation = new StringType();
1302            this.documentation.setValue(value);
1303          }
1304          return this;
1305        }
1306
1307        protected void listChildren(List<Property> children) {
1308          super.listChildren(children);
1309          children.add(new Property("url", "uri", "The canonical URL that identifies the structure.", 0, 1, url));
1310          children.add(new Property("mode", "code", "How the referenced structure is used in this mapping.", 0, 1, mode));
1311          children.add(new Property("alias", "string", "The name used for this type in the map.", 0, 1, alias));
1312          children.add(new Property("documentation", "string", "Documentation that describes how the structure is used in the mapping.", 0, 1, documentation));
1313        }
1314
1315        @Override
1316        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1317          switch (_hash) {
1318          case 116079: /*url*/  return new Property("url", "uri", "The canonical URL that identifies the structure.", 0, 1, url);
1319          case 3357091: /*mode*/  return new Property("mode", "code", "How the referenced structure is used in this mapping.", 0, 1, mode);
1320          case 92902992: /*alias*/  return new Property("alias", "string", "The name used for this type in the map.", 0, 1, alias);
1321          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Documentation that describes how the structure is used in the mapping.", 0, 1, documentation);
1322          default: return super.getNamedProperty(_hash, _name, _checkValid);
1323          }
1324
1325        }
1326
1327      @Override
1328      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1329        switch (hash) {
1330        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1331        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<StructureMapModelMode>
1332        case 92902992: /*alias*/ return this.alias == null ? new Base[0] : new Base[] {this.alias}; // StringType
1333        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
1334        default: return super.getProperty(hash, name, checkValid);
1335        }
1336
1337      }
1338
1339      @Override
1340      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1341        switch (hash) {
1342        case 116079: // url
1343          this.url = castToUri(value); // UriType
1344          return value;
1345        case 3357091: // mode
1346          value = new StructureMapModelModeEnumFactory().fromType(castToCode(value));
1347          this.mode = (Enumeration) value; // Enumeration<StructureMapModelMode>
1348          return value;
1349        case 92902992: // alias
1350          this.alias = castToString(value); // StringType
1351          return value;
1352        case 1587405498: // documentation
1353          this.documentation = castToString(value); // StringType
1354          return value;
1355        default: return super.setProperty(hash, name, value);
1356        }
1357
1358      }
1359
1360      @Override
1361      public Base setProperty(String name, Base value) throws FHIRException {
1362        if (name.equals("url")) {
1363          this.url = castToUri(value); // UriType
1364        } else if (name.equals("mode")) {
1365          value = new StructureMapModelModeEnumFactory().fromType(castToCode(value));
1366          this.mode = (Enumeration) value; // Enumeration<StructureMapModelMode>
1367        } else if (name.equals("alias")) {
1368          this.alias = castToString(value); // StringType
1369        } else if (name.equals("documentation")) {
1370          this.documentation = castToString(value); // StringType
1371        } else
1372          return super.setProperty(name, value);
1373        return value;
1374      }
1375
1376      @Override
1377      public Base makeProperty(int hash, String name) throws FHIRException {
1378        switch (hash) {
1379        case 116079:  return getUrlElement();
1380        case 3357091:  return getModeElement();
1381        case 92902992:  return getAliasElement();
1382        case 1587405498:  return getDocumentationElement();
1383        default: return super.makeProperty(hash, name);
1384        }
1385
1386      }
1387
1388      @Override
1389      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1390        switch (hash) {
1391        case 116079: /*url*/ return new String[] {"uri"};
1392        case 3357091: /*mode*/ return new String[] {"code"};
1393        case 92902992: /*alias*/ return new String[] {"string"};
1394        case 1587405498: /*documentation*/ return new String[] {"string"};
1395        default: return super.getTypesForProperty(hash, name);
1396        }
1397
1398      }
1399
1400      @Override
1401      public Base addChild(String name) throws FHIRException {
1402        if (name.equals("url")) {
1403          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.url");
1404        }
1405        else if (name.equals("mode")) {
1406          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.mode");
1407        }
1408        else if (name.equals("alias")) {
1409          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.alias");
1410        }
1411        else if (name.equals("documentation")) {
1412          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation");
1413        }
1414        else
1415          return super.addChild(name);
1416      }
1417
1418      public StructureMapStructureComponent copy() {
1419        StructureMapStructureComponent dst = new StructureMapStructureComponent();
1420        copyValues(dst);
1421        dst.url = url == null ? null : url.copy();
1422        dst.mode = mode == null ? null : mode.copy();
1423        dst.alias = alias == null ? null : alias.copy();
1424        dst.documentation = documentation == null ? null : documentation.copy();
1425        return dst;
1426      }
1427
1428      @Override
1429      public boolean equalsDeep(Base other_) {
1430        if (!super.equalsDeep(other_))
1431          return false;
1432        if (!(other_ instanceof StructureMapStructureComponent))
1433          return false;
1434        StructureMapStructureComponent o = (StructureMapStructureComponent) other_;
1435        return compareDeep(url, o.url, true) && compareDeep(mode, o.mode, true) && compareDeep(alias, o.alias, true)
1436           && compareDeep(documentation, o.documentation, true);
1437      }
1438
1439      @Override
1440      public boolean equalsShallow(Base other_) {
1441        if (!super.equalsShallow(other_))
1442          return false;
1443        if (!(other_ instanceof StructureMapStructureComponent))
1444          return false;
1445        StructureMapStructureComponent o = (StructureMapStructureComponent) other_;
1446        return compareValues(url, o.url, true) && compareValues(mode, o.mode, true) && compareValues(alias, o.alias, true)
1447           && compareValues(documentation, o.documentation, true);
1448      }
1449
1450      public boolean isEmpty() {
1451        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, mode, alias, documentation
1452          );
1453      }
1454
1455  public String fhirType() {
1456    return "StructureMap.structure";
1457
1458  }
1459
1460  }
1461
1462    @Block()
1463    public static class StructureMapGroupComponent extends BackboneElement implements IBaseBackboneElement {
1464        /**
1465         * A unique name for the group for the convenience of human readers.
1466         */
1467        @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1468        @Description(shortDefinition="Human-readable label", formalDefinition="A unique name for the group for the convenience of human readers." )
1469        protected IdType name;
1470
1471        /**
1472         * Another group that this group adds rules to.
1473         */
1474        @Child(name = "extends", type = {IdType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1475        @Description(shortDefinition="Another group that this group adds rules to", formalDefinition="Another group that this group adds rules to." )
1476        protected IdType extends_;
1477
1478        /**
1479         * If this is the default rule set to apply for thie source type, or this combination of types.
1480         */
1481        @Child(name = "typeMode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
1482        @Description(shortDefinition="none | types | type-and-types", formalDefinition="If this is the default rule set to apply for thie source type, or this combination of types." )
1483        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-group-type-mode")
1484        protected Enumeration<StructureMapGroupTypeMode> typeMode;
1485
1486        /**
1487         * Additional supporting documentation that explains the purpose of the group and the types of mappings within it.
1488         */
1489        @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1490        @Description(shortDefinition="Additional description/explaination for group", formalDefinition="Additional supporting documentation that explains the purpose of the group and the types of mappings within it." )
1491        protected StringType documentation;
1492
1493        /**
1494         * A name assigned to an instance of data. The instance must be provided when the mapping is invoked.
1495         */
1496        @Child(name = "input", type = {}, order=5, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1497        @Description(shortDefinition="Named instance provided when invoking the map", formalDefinition="A name assigned to an instance of data. The instance must be provided when the mapping is invoked." )
1498        protected List<StructureMapGroupInputComponent> input;
1499
1500        /**
1501         * Transform Rule from source to target.
1502         */
1503        @Child(name = "rule", type = {}, order=6, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1504        @Description(shortDefinition="Transform Rule from source to target", formalDefinition="Transform Rule from source to target." )
1505        protected List<StructureMapGroupRuleComponent> rule;
1506
1507        private static final long serialVersionUID = -1474595081L;
1508
1509    /**
1510     * Constructor
1511     */
1512      public StructureMapGroupComponent() {
1513        super();
1514      }
1515
1516    /**
1517     * Constructor
1518     */
1519      public StructureMapGroupComponent(IdType name, Enumeration<StructureMapGroupTypeMode> typeMode) {
1520        super();
1521        this.name = name;
1522        this.typeMode = typeMode;
1523      }
1524
1525        /**
1526         * @return {@link #name} (A unique name for the group for the convenience of human readers.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1527         */
1528        public IdType getNameElement() { 
1529          if (this.name == null)
1530            if (Configuration.errorOnAutoCreate())
1531              throw new Error("Attempt to auto-create StructureMapGroupComponent.name");
1532            else if (Configuration.doAutoCreate())
1533              this.name = new IdType(); // bb
1534          return this.name;
1535        }
1536
1537        public boolean hasNameElement() { 
1538          return this.name != null && !this.name.isEmpty();
1539        }
1540
1541        public boolean hasName() { 
1542          return this.name != null && !this.name.isEmpty();
1543        }
1544
1545        /**
1546         * @param value {@link #name} (A unique name for the group for the convenience of human readers.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1547         */
1548        public StructureMapGroupComponent setNameElement(IdType value) { 
1549          this.name = value;
1550          return this;
1551        }
1552
1553        /**
1554         * @return A unique name for the group for the convenience of human readers.
1555         */
1556        public String getName() { 
1557          return this.name == null ? null : this.name.getValue();
1558        }
1559
1560        /**
1561         * @param value A unique name for the group for the convenience of human readers.
1562         */
1563        public StructureMapGroupComponent setName(String value) { 
1564            if (this.name == null)
1565              this.name = new IdType();
1566            this.name.setValue(value);
1567          return this;
1568        }
1569
1570        /**
1571         * @return {@link #extends_} (Another group that this group adds rules to.). This is the underlying object with id, value and extensions. The accessor "getExtends" gives direct access to the value
1572         */
1573        public IdType getExtendsElement() { 
1574          if (this.extends_ == null)
1575            if (Configuration.errorOnAutoCreate())
1576              throw new Error("Attempt to auto-create StructureMapGroupComponent.extends_");
1577            else if (Configuration.doAutoCreate())
1578              this.extends_ = new IdType(); // bb
1579          return this.extends_;
1580        }
1581
1582        public boolean hasExtendsElement() { 
1583          return this.extends_ != null && !this.extends_.isEmpty();
1584        }
1585
1586        public boolean hasExtends() { 
1587          return this.extends_ != null && !this.extends_.isEmpty();
1588        }
1589
1590        /**
1591         * @param value {@link #extends_} (Another group that this group adds rules to.). This is the underlying object with id, value and extensions. The accessor "getExtends" gives direct access to the value
1592         */
1593        public StructureMapGroupComponent setExtendsElement(IdType value) { 
1594          this.extends_ = value;
1595          return this;
1596        }
1597
1598        /**
1599         * @return Another group that this group adds rules to.
1600         */
1601        public String getExtends() { 
1602          return this.extends_ == null ? null : this.extends_.getValue();
1603        }
1604
1605        /**
1606         * @param value Another group that this group adds rules to.
1607         */
1608        public StructureMapGroupComponent setExtends(String value) { 
1609          if (Utilities.noString(value))
1610            this.extends_ = null;
1611          else {
1612            if (this.extends_ == null)
1613              this.extends_ = new IdType();
1614            this.extends_.setValue(value);
1615          }
1616          return this;
1617        }
1618
1619        /**
1620         * @return {@link #typeMode} (If this is the default rule set to apply for thie source type, or this combination of types.). This is the underlying object with id, value and extensions. The accessor "getTypeMode" gives direct access to the value
1621         */
1622        public Enumeration<StructureMapGroupTypeMode> getTypeModeElement() { 
1623          if (this.typeMode == null)
1624            if (Configuration.errorOnAutoCreate())
1625              throw new Error("Attempt to auto-create StructureMapGroupComponent.typeMode");
1626            else if (Configuration.doAutoCreate())
1627              this.typeMode = new Enumeration<StructureMapGroupTypeMode>(new StructureMapGroupTypeModeEnumFactory()); // bb
1628          return this.typeMode;
1629        }
1630
1631        public boolean hasTypeModeElement() { 
1632          return this.typeMode != null && !this.typeMode.isEmpty();
1633        }
1634
1635        public boolean hasTypeMode() { 
1636          return this.typeMode != null && !this.typeMode.isEmpty();
1637        }
1638
1639        /**
1640         * @param value {@link #typeMode} (If this is the default rule set to apply for thie source type, or this combination of types.). This is the underlying object with id, value and extensions. The accessor "getTypeMode" gives direct access to the value
1641         */
1642        public StructureMapGroupComponent setTypeModeElement(Enumeration<StructureMapGroupTypeMode> value) { 
1643          this.typeMode = value;
1644          return this;
1645        }
1646
1647        /**
1648         * @return If this is the default rule set to apply for thie source type, or this combination of types.
1649         */
1650        public StructureMapGroupTypeMode getTypeMode() { 
1651          return this.typeMode == null ? null : this.typeMode.getValue();
1652        }
1653
1654        /**
1655         * @param value If this is the default rule set to apply for thie source type, or this combination of types.
1656         */
1657        public StructureMapGroupComponent setTypeMode(StructureMapGroupTypeMode value) { 
1658            if (this.typeMode == null)
1659              this.typeMode = new Enumeration<StructureMapGroupTypeMode>(new StructureMapGroupTypeModeEnumFactory());
1660            this.typeMode.setValue(value);
1661          return this;
1662        }
1663
1664        /**
1665         * @return {@link #documentation} (Additional supporting documentation that explains the purpose of the group and the types of mappings within it.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
1666         */
1667        public StringType getDocumentationElement() { 
1668          if (this.documentation == null)
1669            if (Configuration.errorOnAutoCreate())
1670              throw new Error("Attempt to auto-create StructureMapGroupComponent.documentation");
1671            else if (Configuration.doAutoCreate())
1672              this.documentation = new StringType(); // bb
1673          return this.documentation;
1674        }
1675
1676        public boolean hasDocumentationElement() { 
1677          return this.documentation != null && !this.documentation.isEmpty();
1678        }
1679
1680        public boolean hasDocumentation() { 
1681          return this.documentation != null && !this.documentation.isEmpty();
1682        }
1683
1684        /**
1685         * @param value {@link #documentation} (Additional supporting documentation that explains the purpose of the group and the types of mappings within it.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
1686         */
1687        public StructureMapGroupComponent setDocumentationElement(StringType value) { 
1688          this.documentation = value;
1689          return this;
1690        }
1691
1692        /**
1693         * @return Additional supporting documentation that explains the purpose of the group and the types of mappings within it.
1694         */
1695        public String getDocumentation() { 
1696          return this.documentation == null ? null : this.documentation.getValue();
1697        }
1698
1699        /**
1700         * @param value Additional supporting documentation that explains the purpose of the group and the types of mappings within it.
1701         */
1702        public StructureMapGroupComponent setDocumentation(String value) { 
1703          if (Utilities.noString(value))
1704            this.documentation = null;
1705          else {
1706            if (this.documentation == null)
1707              this.documentation = new StringType();
1708            this.documentation.setValue(value);
1709          }
1710          return this;
1711        }
1712
1713        /**
1714         * @return {@link #input} (A name assigned to an instance of data. The instance must be provided when the mapping is invoked.)
1715         */
1716        public List<StructureMapGroupInputComponent> getInput() { 
1717          if (this.input == null)
1718            this.input = new ArrayList<StructureMapGroupInputComponent>();
1719          return this.input;
1720        }
1721
1722        /**
1723         * @return Returns a reference to <code>this</code> for easy method chaining
1724         */
1725        public StructureMapGroupComponent setInput(List<StructureMapGroupInputComponent> theInput) { 
1726          this.input = theInput;
1727          return this;
1728        }
1729
1730        public boolean hasInput() { 
1731          if (this.input == null)
1732            return false;
1733          for (StructureMapGroupInputComponent item : this.input)
1734            if (!item.isEmpty())
1735              return true;
1736          return false;
1737        }
1738
1739        public StructureMapGroupInputComponent addInput() { //3
1740          StructureMapGroupInputComponent t = new StructureMapGroupInputComponent();
1741          if (this.input == null)
1742            this.input = new ArrayList<StructureMapGroupInputComponent>();
1743          this.input.add(t);
1744          return t;
1745        }
1746
1747        public StructureMapGroupComponent addInput(StructureMapGroupInputComponent t) { //3
1748          if (t == null)
1749            return this;
1750          if (this.input == null)
1751            this.input = new ArrayList<StructureMapGroupInputComponent>();
1752          this.input.add(t);
1753          return this;
1754        }
1755
1756        /**
1757         * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist
1758         */
1759        public StructureMapGroupInputComponent getInputFirstRep() { 
1760          if (getInput().isEmpty()) {
1761            addInput();
1762          }
1763          return getInput().get(0);
1764        }
1765
1766        /**
1767         * @return {@link #rule} (Transform Rule from source to target.)
1768         */
1769        public List<StructureMapGroupRuleComponent> getRule() { 
1770          if (this.rule == null)
1771            this.rule = new ArrayList<StructureMapGroupRuleComponent>();
1772          return this.rule;
1773        }
1774
1775        /**
1776         * @return Returns a reference to <code>this</code> for easy method chaining
1777         */
1778        public StructureMapGroupComponent setRule(List<StructureMapGroupRuleComponent> theRule) { 
1779          this.rule = theRule;
1780          return this;
1781        }
1782
1783        public boolean hasRule() { 
1784          if (this.rule == null)
1785            return false;
1786          for (StructureMapGroupRuleComponent item : this.rule)
1787            if (!item.isEmpty())
1788              return true;
1789          return false;
1790        }
1791
1792        public StructureMapGroupRuleComponent addRule() { //3
1793          StructureMapGroupRuleComponent t = new StructureMapGroupRuleComponent();
1794          if (this.rule == null)
1795            this.rule = new ArrayList<StructureMapGroupRuleComponent>();
1796          this.rule.add(t);
1797          return t;
1798        }
1799
1800        public StructureMapGroupComponent addRule(StructureMapGroupRuleComponent t) { //3
1801          if (t == null)
1802            return this;
1803          if (this.rule == null)
1804            this.rule = new ArrayList<StructureMapGroupRuleComponent>();
1805          this.rule.add(t);
1806          return this;
1807        }
1808
1809        /**
1810         * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
1811         */
1812        public StructureMapGroupRuleComponent getRuleFirstRep() { 
1813          if (getRule().isEmpty()) {
1814            addRule();
1815          }
1816          return getRule().get(0);
1817        }
1818
1819        protected void listChildren(List<Property> children) {
1820          super.listChildren(children);
1821          children.add(new Property("name", "id", "A unique name for the group for the convenience of human readers.", 0, 1, name));
1822          children.add(new Property("extends", "id", "Another group that this group adds rules to.", 0, 1, extends_));
1823          children.add(new Property("typeMode", "code", "If this is the default rule set to apply for thie source type, or this combination of types.", 0, 1, typeMode));
1824          children.add(new Property("documentation", "string", "Additional supporting documentation that explains the purpose of the group and the types of mappings within it.", 0, 1, documentation));
1825          children.add(new Property("input", "", "A name assigned to an instance of data. The instance must be provided when the mapping is invoked.", 0, java.lang.Integer.MAX_VALUE, input));
1826          children.add(new Property("rule", "", "Transform Rule from source to target.", 0, java.lang.Integer.MAX_VALUE, rule));
1827        }
1828
1829        @Override
1830        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1831          switch (_hash) {
1832          case 3373707: /*name*/  return new Property("name", "id", "A unique name for the group for the convenience of human readers.", 0, 1, name);
1833          case -1305664359: /*extends*/  return new Property("extends", "id", "Another group that this group adds rules to.", 0, 1, extends_);
1834          case -676524035: /*typeMode*/  return new Property("typeMode", "code", "If this is the default rule set to apply for thie source type, or this combination of types.", 0, 1, typeMode);
1835          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Additional supporting documentation that explains the purpose of the group and the types of mappings within it.", 0, 1, documentation);
1836          case 100358090: /*input*/  return new Property("input", "", "A name assigned to an instance of data. The instance must be provided when the mapping is invoked.", 0, java.lang.Integer.MAX_VALUE, input);
1837          case 3512060: /*rule*/  return new Property("rule", "", "Transform Rule from source to target.", 0, java.lang.Integer.MAX_VALUE, rule);
1838          default: return super.getNamedProperty(_hash, _name, _checkValid);
1839          }
1840
1841        }
1842
1843      @Override
1844      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1845        switch (hash) {
1846        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType
1847        case -1305664359: /*extends*/ return this.extends_ == null ? new Base[0] : new Base[] {this.extends_}; // IdType
1848        case -676524035: /*typeMode*/ return this.typeMode == null ? new Base[0] : new Base[] {this.typeMode}; // Enumeration<StructureMapGroupTypeMode>
1849        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
1850        case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // StructureMapGroupInputComponent
1851        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // StructureMapGroupRuleComponent
1852        default: return super.getProperty(hash, name, checkValid);
1853        }
1854
1855      }
1856
1857      @Override
1858      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1859        switch (hash) {
1860        case 3373707: // name
1861          this.name = castToId(value); // IdType
1862          return value;
1863        case -1305664359: // extends
1864          this.extends_ = castToId(value); // IdType
1865          return value;
1866        case -676524035: // typeMode
1867          value = new StructureMapGroupTypeModeEnumFactory().fromType(castToCode(value));
1868          this.typeMode = (Enumeration) value; // Enumeration<StructureMapGroupTypeMode>
1869          return value;
1870        case 1587405498: // documentation
1871          this.documentation = castToString(value); // StringType
1872          return value;
1873        case 100358090: // input
1874          this.getInput().add((StructureMapGroupInputComponent) value); // StructureMapGroupInputComponent
1875          return value;
1876        case 3512060: // rule
1877          this.getRule().add((StructureMapGroupRuleComponent) value); // StructureMapGroupRuleComponent
1878          return value;
1879        default: return super.setProperty(hash, name, value);
1880        }
1881
1882      }
1883
1884      @Override
1885      public Base setProperty(String name, Base value) throws FHIRException {
1886        if (name.equals("name")) {
1887          this.name = castToId(value); // IdType
1888        } else if (name.equals("extends")) {
1889          this.extends_ = castToId(value); // IdType
1890        } else if (name.equals("typeMode")) {
1891          value = new StructureMapGroupTypeModeEnumFactory().fromType(castToCode(value));
1892          this.typeMode = (Enumeration) value; // Enumeration<StructureMapGroupTypeMode>
1893        } else if (name.equals("documentation")) {
1894          this.documentation = castToString(value); // StringType
1895        } else if (name.equals("input")) {
1896          this.getInput().add((StructureMapGroupInputComponent) value);
1897        } else if (name.equals("rule")) {
1898          this.getRule().add((StructureMapGroupRuleComponent) value);
1899        } else
1900          return super.setProperty(name, value);
1901        return value;
1902      }
1903
1904      @Override
1905      public Base makeProperty(int hash, String name) throws FHIRException {
1906        switch (hash) {
1907        case 3373707:  return getNameElement();
1908        case -1305664359:  return getExtendsElement();
1909        case -676524035:  return getTypeModeElement();
1910        case 1587405498:  return getDocumentationElement();
1911        case 100358090:  return addInput(); 
1912        case 3512060:  return addRule(); 
1913        default: return super.makeProperty(hash, name);
1914        }
1915
1916      }
1917
1918      @Override
1919      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1920        switch (hash) {
1921        case 3373707: /*name*/ return new String[] {"id"};
1922        case -1305664359: /*extends*/ return new String[] {"id"};
1923        case -676524035: /*typeMode*/ return new String[] {"code"};
1924        case 1587405498: /*documentation*/ return new String[] {"string"};
1925        case 100358090: /*input*/ return new String[] {};
1926        case 3512060: /*rule*/ return new String[] {};
1927        default: return super.getTypesForProperty(hash, name);
1928        }
1929
1930      }
1931
1932      @Override
1933      public Base addChild(String name) throws FHIRException {
1934        if (name.equals("name")) {
1935          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name");
1936        }
1937        else if (name.equals("extends")) {
1938          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.extends");
1939        }
1940        else if (name.equals("typeMode")) {
1941          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.typeMode");
1942        }
1943        else if (name.equals("documentation")) {
1944          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation");
1945        }
1946        else if (name.equals("input")) {
1947          return addInput();
1948        }
1949        else if (name.equals("rule")) {
1950          return addRule();
1951        }
1952        else
1953          return super.addChild(name);
1954      }
1955
1956      public StructureMapGroupComponent copy() {
1957        StructureMapGroupComponent dst = new StructureMapGroupComponent();
1958        copyValues(dst);
1959        dst.name = name == null ? null : name.copy();
1960        dst.extends_ = extends_ == null ? null : extends_.copy();
1961        dst.typeMode = typeMode == null ? null : typeMode.copy();
1962        dst.documentation = documentation == null ? null : documentation.copy();
1963        if (input != null) {
1964          dst.input = new ArrayList<StructureMapGroupInputComponent>();
1965          for (StructureMapGroupInputComponent i : input)
1966            dst.input.add(i.copy());
1967        };
1968        if (rule != null) {
1969          dst.rule = new ArrayList<StructureMapGroupRuleComponent>();
1970          for (StructureMapGroupRuleComponent i : rule)
1971            dst.rule.add(i.copy());
1972        };
1973        return dst;
1974      }
1975
1976      @Override
1977      public boolean equalsDeep(Base other_) {
1978        if (!super.equalsDeep(other_))
1979          return false;
1980        if (!(other_ instanceof StructureMapGroupComponent))
1981          return false;
1982        StructureMapGroupComponent o = (StructureMapGroupComponent) other_;
1983        return compareDeep(name, o.name, true) && compareDeep(extends_, o.extends_, true) && compareDeep(typeMode, o.typeMode, true)
1984           && compareDeep(documentation, o.documentation, true) && compareDeep(input, o.input, true) && compareDeep(rule, o.rule, true)
1985          ;
1986      }
1987
1988      @Override
1989      public boolean equalsShallow(Base other_) {
1990        if (!super.equalsShallow(other_))
1991          return false;
1992        if (!(other_ instanceof StructureMapGroupComponent))
1993          return false;
1994        StructureMapGroupComponent o = (StructureMapGroupComponent) other_;
1995        return compareValues(name, o.name, true) && compareValues(extends_, o.extends_, true) && compareValues(typeMode, o.typeMode, true)
1996           && compareValues(documentation, o.documentation, true);
1997      }
1998
1999      public boolean isEmpty() {
2000        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, extends_, typeMode
2001          , documentation, input, rule);
2002      }
2003
2004  public String fhirType() {
2005    return "StructureMap.group";
2006
2007  }
2008
2009// added from java-adornments.txt:
2010
2011  public String toString() {
2012    return StructureMapUtilities.groupToString(this);
2013  }
2014
2015
2016// end addition
2017  }
2018
2019    @Block()
2020    public static class StructureMapGroupInputComponent extends BackboneElement implements IBaseBackboneElement {
2021        /**
2022         * Name for this instance of data.
2023         */
2024        @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2025        @Description(shortDefinition="Name for this instance of data", formalDefinition="Name for this instance of data." )
2026        protected IdType name;
2027
2028        /**
2029         * Type for this instance of data.
2030         */
2031        @Child(name = "type", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2032        @Description(shortDefinition="Type for this instance of data", formalDefinition="Type for this instance of data." )
2033        protected StringType type;
2034
2035        /**
2036         * Mode for this instance of data.
2037         */
2038        @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
2039        @Description(shortDefinition="source | target", formalDefinition="Mode for this instance of data." )
2040        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-input-mode")
2041        protected Enumeration<StructureMapInputMode> mode;
2042
2043        /**
2044         * Documentation for this instance of data.
2045         */
2046        @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2047        @Description(shortDefinition="Documentation for this instance of data", formalDefinition="Documentation for this instance of data." )
2048        protected StringType documentation;
2049
2050        private static final long serialVersionUID = -25050724L;
2051
2052    /**
2053     * Constructor
2054     */
2055      public StructureMapGroupInputComponent() {
2056        super();
2057      }
2058
2059    /**
2060     * Constructor
2061     */
2062      public StructureMapGroupInputComponent(IdType name, Enumeration<StructureMapInputMode> mode) {
2063        super();
2064        this.name = name;
2065        this.mode = mode;
2066      }
2067
2068        /**
2069         * @return {@link #name} (Name for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2070         */
2071        public IdType getNameElement() { 
2072          if (this.name == null)
2073            if (Configuration.errorOnAutoCreate())
2074              throw new Error("Attempt to auto-create StructureMapGroupInputComponent.name");
2075            else if (Configuration.doAutoCreate())
2076              this.name = new IdType(); // bb
2077          return this.name;
2078        }
2079
2080        public boolean hasNameElement() { 
2081          return this.name != null && !this.name.isEmpty();
2082        }
2083
2084        public boolean hasName() { 
2085          return this.name != null && !this.name.isEmpty();
2086        }
2087
2088        /**
2089         * @param value {@link #name} (Name for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2090         */
2091        public StructureMapGroupInputComponent setNameElement(IdType value) { 
2092          this.name = value;
2093          return this;
2094        }
2095
2096        /**
2097         * @return Name for this instance of data.
2098         */
2099        public String getName() { 
2100          return this.name == null ? null : this.name.getValue();
2101        }
2102
2103        /**
2104         * @param value Name for this instance of data.
2105         */
2106        public StructureMapGroupInputComponent setName(String value) { 
2107            if (this.name == null)
2108              this.name = new IdType();
2109            this.name.setValue(value);
2110          return this;
2111        }
2112
2113        /**
2114         * @return {@link #type} (Type for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2115         */
2116        public StringType getTypeElement() { 
2117          if (this.type == null)
2118            if (Configuration.errorOnAutoCreate())
2119              throw new Error("Attempt to auto-create StructureMapGroupInputComponent.type");
2120            else if (Configuration.doAutoCreate())
2121              this.type = new StringType(); // bb
2122          return this.type;
2123        }
2124
2125        public boolean hasTypeElement() { 
2126          return this.type != null && !this.type.isEmpty();
2127        }
2128
2129        public boolean hasType() { 
2130          return this.type != null && !this.type.isEmpty();
2131        }
2132
2133        /**
2134         * @param value {@link #type} (Type for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2135         */
2136        public StructureMapGroupInputComponent setTypeElement(StringType value) { 
2137          this.type = value;
2138          return this;
2139        }
2140
2141        /**
2142         * @return Type for this instance of data.
2143         */
2144        public String getType() { 
2145          return this.type == null ? null : this.type.getValue();
2146        }
2147
2148        /**
2149         * @param value Type for this instance of data.
2150         */
2151        public StructureMapGroupInputComponent setType(String value) { 
2152          if (Utilities.noString(value))
2153            this.type = null;
2154          else {
2155            if (this.type == null)
2156              this.type = new StringType();
2157            this.type.setValue(value);
2158          }
2159          return this;
2160        }
2161
2162        /**
2163         * @return {@link #mode} (Mode for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
2164         */
2165        public Enumeration<StructureMapInputMode> getModeElement() { 
2166          if (this.mode == null)
2167            if (Configuration.errorOnAutoCreate())
2168              throw new Error("Attempt to auto-create StructureMapGroupInputComponent.mode");
2169            else if (Configuration.doAutoCreate())
2170              this.mode = new Enumeration<StructureMapInputMode>(new StructureMapInputModeEnumFactory()); // bb
2171          return this.mode;
2172        }
2173
2174        public boolean hasModeElement() { 
2175          return this.mode != null && !this.mode.isEmpty();
2176        }
2177
2178        public boolean hasMode() { 
2179          return this.mode != null && !this.mode.isEmpty();
2180        }
2181
2182        /**
2183         * @param value {@link #mode} (Mode for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
2184         */
2185        public StructureMapGroupInputComponent setModeElement(Enumeration<StructureMapInputMode> value) { 
2186          this.mode = value;
2187          return this;
2188        }
2189
2190        /**
2191         * @return Mode for this instance of data.
2192         */
2193        public StructureMapInputMode getMode() { 
2194          return this.mode == null ? null : this.mode.getValue();
2195        }
2196
2197        /**
2198         * @param value Mode for this instance of data.
2199         */
2200        public StructureMapGroupInputComponent setMode(StructureMapInputMode value) { 
2201            if (this.mode == null)
2202              this.mode = new Enumeration<StructureMapInputMode>(new StructureMapInputModeEnumFactory());
2203            this.mode.setValue(value);
2204          return this;
2205        }
2206
2207        /**
2208         * @return {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2209         */
2210        public StringType getDocumentationElement() { 
2211          if (this.documentation == null)
2212            if (Configuration.errorOnAutoCreate())
2213              throw new Error("Attempt to auto-create StructureMapGroupInputComponent.documentation");
2214            else if (Configuration.doAutoCreate())
2215              this.documentation = new StringType(); // bb
2216          return this.documentation;
2217        }
2218
2219        public boolean hasDocumentationElement() { 
2220          return this.documentation != null && !this.documentation.isEmpty();
2221        }
2222
2223        public boolean hasDocumentation() { 
2224          return this.documentation != null && !this.documentation.isEmpty();
2225        }
2226
2227        /**
2228         * @param value {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2229         */
2230        public StructureMapGroupInputComponent setDocumentationElement(StringType value) { 
2231          this.documentation = value;
2232          return this;
2233        }
2234
2235        /**
2236         * @return Documentation for this instance of data.
2237         */
2238        public String getDocumentation() { 
2239          return this.documentation == null ? null : this.documentation.getValue();
2240        }
2241
2242        /**
2243         * @param value Documentation for this instance of data.
2244         */
2245        public StructureMapGroupInputComponent setDocumentation(String value) { 
2246          if (Utilities.noString(value))
2247            this.documentation = null;
2248          else {
2249            if (this.documentation == null)
2250              this.documentation = new StringType();
2251            this.documentation.setValue(value);
2252          }
2253          return this;
2254        }
2255
2256        protected void listChildren(List<Property> children) {
2257          super.listChildren(children);
2258          children.add(new Property("name", "id", "Name for this instance of data.", 0, 1, name));
2259          children.add(new Property("type", "string", "Type for this instance of data.", 0, 1, type));
2260          children.add(new Property("mode", "code", "Mode for this instance of data.", 0, 1, mode));
2261          children.add(new Property("documentation", "string", "Documentation for this instance of data.", 0, 1, documentation));
2262        }
2263
2264        @Override
2265        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2266          switch (_hash) {
2267          case 3373707: /*name*/  return new Property("name", "id", "Name for this instance of data.", 0, 1, name);
2268          case 3575610: /*type*/  return new Property("type", "string", "Type for this instance of data.", 0, 1, type);
2269          case 3357091: /*mode*/  return new Property("mode", "code", "Mode for this instance of data.", 0, 1, mode);
2270          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Documentation for this instance of data.", 0, 1, documentation);
2271          default: return super.getNamedProperty(_hash, _name, _checkValid);
2272          }
2273
2274        }
2275
2276      @Override
2277      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2278        switch (hash) {
2279        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType
2280        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType
2281        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<StructureMapInputMode>
2282        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
2283        default: return super.getProperty(hash, name, checkValid);
2284        }
2285
2286      }
2287
2288      @Override
2289      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2290        switch (hash) {
2291        case 3373707: // name
2292          this.name = castToId(value); // IdType
2293          return value;
2294        case 3575610: // type
2295          this.type = castToString(value); // StringType
2296          return value;
2297        case 3357091: // mode
2298          value = new StructureMapInputModeEnumFactory().fromType(castToCode(value));
2299          this.mode = (Enumeration) value; // Enumeration<StructureMapInputMode>
2300          return value;
2301        case 1587405498: // documentation
2302          this.documentation = castToString(value); // StringType
2303          return value;
2304        default: return super.setProperty(hash, name, value);
2305        }
2306
2307      }
2308
2309      @Override
2310      public Base setProperty(String name, Base value) throws FHIRException {
2311        if (name.equals("name")) {
2312          this.name = castToId(value); // IdType
2313        } else if (name.equals("type")) {
2314          this.type = castToString(value); // StringType
2315        } else if (name.equals("mode")) {
2316          value = new StructureMapInputModeEnumFactory().fromType(castToCode(value));
2317          this.mode = (Enumeration) value; // Enumeration<StructureMapInputMode>
2318        } else if (name.equals("documentation")) {
2319          this.documentation = castToString(value); // StringType
2320        } else
2321          return super.setProperty(name, value);
2322        return value;
2323      }
2324
2325      @Override
2326      public Base makeProperty(int hash, String name) throws FHIRException {
2327        switch (hash) {
2328        case 3373707:  return getNameElement();
2329        case 3575610:  return getTypeElement();
2330        case 3357091:  return getModeElement();
2331        case 1587405498:  return getDocumentationElement();
2332        default: return super.makeProperty(hash, name);
2333        }
2334
2335      }
2336
2337      @Override
2338      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2339        switch (hash) {
2340        case 3373707: /*name*/ return new String[] {"id"};
2341        case 3575610: /*type*/ return new String[] {"string"};
2342        case 3357091: /*mode*/ return new String[] {"code"};
2343        case 1587405498: /*documentation*/ return new String[] {"string"};
2344        default: return super.getTypesForProperty(hash, name);
2345        }
2346
2347      }
2348
2349      @Override
2350      public Base addChild(String name) throws FHIRException {
2351        if (name.equals("name")) {
2352          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name");
2353        }
2354        else if (name.equals("type")) {
2355          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.type");
2356        }
2357        else if (name.equals("mode")) {
2358          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.mode");
2359        }
2360        else if (name.equals("documentation")) {
2361          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation");
2362        }
2363        else
2364          return super.addChild(name);
2365      }
2366
2367      public StructureMapGroupInputComponent copy() {
2368        StructureMapGroupInputComponent dst = new StructureMapGroupInputComponent();
2369        copyValues(dst);
2370        dst.name = name == null ? null : name.copy();
2371        dst.type = type == null ? null : type.copy();
2372        dst.mode = mode == null ? null : mode.copy();
2373        dst.documentation = documentation == null ? null : documentation.copy();
2374        return dst;
2375      }
2376
2377      @Override
2378      public boolean equalsDeep(Base other_) {
2379        if (!super.equalsDeep(other_))
2380          return false;
2381        if (!(other_ instanceof StructureMapGroupInputComponent))
2382          return false;
2383        StructureMapGroupInputComponent o = (StructureMapGroupInputComponent) other_;
2384        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(mode, o.mode, true)
2385           && compareDeep(documentation, o.documentation, true);
2386      }
2387
2388      @Override
2389      public boolean equalsShallow(Base other_) {
2390        if (!super.equalsShallow(other_))
2391          return false;
2392        if (!(other_ instanceof StructureMapGroupInputComponent))
2393          return false;
2394        StructureMapGroupInputComponent o = (StructureMapGroupInputComponent) other_;
2395        return compareValues(name, o.name, true) && compareValues(type, o.type, true) && compareValues(mode, o.mode, true)
2396           && compareValues(documentation, o.documentation, true);
2397      }
2398
2399      public boolean isEmpty() {
2400        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type, mode, documentation
2401          );
2402      }
2403
2404  public String fhirType() {
2405    return "StructureMap.group.input";
2406
2407  }
2408
2409  }
2410
2411    @Block()
2412    public static class StructureMapGroupRuleComponent extends BackboneElement implements IBaseBackboneElement {
2413        /**
2414         * Name of the rule for internal references.
2415         */
2416        @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2417        @Description(shortDefinition="Name of the rule for internal references", formalDefinition="Name of the rule for internal references." )
2418        protected IdType name;
2419
2420        /**
2421         * Source inputs to the mapping.
2422         */
2423        @Child(name = "source", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2424        @Description(shortDefinition="Source inputs to the mapping", formalDefinition="Source inputs to the mapping." )
2425        protected List<StructureMapGroupRuleSourceComponent> source;
2426
2427        /**
2428         * Content to create because of this mapping rule.
2429         */
2430        @Child(name = "target", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2431        @Description(shortDefinition="Content to create because of this mapping rule", formalDefinition="Content to create because of this mapping rule." )
2432        protected List<StructureMapGroupRuleTargetComponent> target;
2433
2434        /**
2435         * Rules contained in this rule.
2436         */
2437        @Child(name = "rule", type = {StructureMapGroupRuleComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2438        @Description(shortDefinition="Rules contained in this rule", formalDefinition="Rules contained in this rule." )
2439        protected List<StructureMapGroupRuleComponent> rule;
2440
2441        /**
2442         * Which other rules to apply in the context of this rule.
2443         */
2444        @Child(name = "dependent", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2445        @Description(shortDefinition="Which other rules to apply in the context of this rule", formalDefinition="Which other rules to apply in the context of this rule." )
2446        protected List<StructureMapGroupRuleDependentComponent> dependent;
2447
2448        /**
2449         * Documentation for this instance of data.
2450         */
2451        @Child(name = "documentation", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
2452        @Description(shortDefinition="Documentation for this instance of data", formalDefinition="Documentation for this instance of data." )
2453        protected StringType documentation;
2454
2455        private static final long serialVersionUID = 773925517L;
2456
2457    /**
2458     * Constructor
2459     */
2460      public StructureMapGroupRuleComponent() {
2461        super();
2462      }
2463
2464    /**
2465     * Constructor
2466     */
2467      public StructureMapGroupRuleComponent(IdType name) {
2468        super();
2469        this.name = name;
2470      }
2471
2472        /**
2473         * @return {@link #name} (Name of the rule for internal references.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2474         */
2475        public IdType getNameElement() { 
2476          if (this.name == null)
2477            if (Configuration.errorOnAutoCreate())
2478              throw new Error("Attempt to auto-create StructureMapGroupRuleComponent.name");
2479            else if (Configuration.doAutoCreate())
2480              this.name = new IdType(); // bb
2481          return this.name;
2482        }
2483
2484        public boolean hasNameElement() { 
2485          return this.name != null && !this.name.isEmpty();
2486        }
2487
2488        public boolean hasName() { 
2489          return this.name != null && !this.name.isEmpty();
2490        }
2491
2492        /**
2493         * @param value {@link #name} (Name of the rule for internal references.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2494         */
2495        public StructureMapGroupRuleComponent setNameElement(IdType value) { 
2496          this.name = value;
2497          return this;
2498        }
2499
2500        /**
2501         * @return Name of the rule for internal references.
2502         */
2503        public String getName() { 
2504          return this.name == null ? null : this.name.getValue();
2505        }
2506
2507        /**
2508         * @param value Name of the rule for internal references.
2509         */
2510        public StructureMapGroupRuleComponent setName(String value) { 
2511            if (this.name == null)
2512              this.name = new IdType();
2513            this.name.setValue(value);
2514          return this;
2515        }
2516
2517        /**
2518         * @return {@link #source} (Source inputs to the mapping.)
2519         */
2520        public List<StructureMapGroupRuleSourceComponent> getSource() { 
2521          if (this.source == null)
2522            this.source = new ArrayList<StructureMapGroupRuleSourceComponent>();
2523          return this.source;
2524        }
2525
2526        /**
2527         * @return Returns a reference to <code>this</code> for easy method chaining
2528         */
2529        public StructureMapGroupRuleComponent setSource(List<StructureMapGroupRuleSourceComponent> theSource) { 
2530          this.source = theSource;
2531          return this;
2532        }
2533
2534        public boolean hasSource() { 
2535          if (this.source == null)
2536            return false;
2537          for (StructureMapGroupRuleSourceComponent item : this.source)
2538            if (!item.isEmpty())
2539              return true;
2540          return false;
2541        }
2542
2543        public StructureMapGroupRuleSourceComponent addSource() { //3
2544          StructureMapGroupRuleSourceComponent t = new StructureMapGroupRuleSourceComponent();
2545          if (this.source == null)
2546            this.source = new ArrayList<StructureMapGroupRuleSourceComponent>();
2547          this.source.add(t);
2548          return t;
2549        }
2550
2551        public StructureMapGroupRuleComponent addSource(StructureMapGroupRuleSourceComponent t) { //3
2552          if (t == null)
2553            return this;
2554          if (this.source == null)
2555            this.source = new ArrayList<StructureMapGroupRuleSourceComponent>();
2556          this.source.add(t);
2557          return this;
2558        }
2559
2560        /**
2561         * @return The first repetition of repeating field {@link #source}, creating it if it does not already exist
2562         */
2563        public StructureMapGroupRuleSourceComponent getSourceFirstRep() { 
2564          if (getSource().isEmpty()) {
2565            addSource();
2566          }
2567          return getSource().get(0);
2568        }
2569
2570        /**
2571         * @return {@link #target} (Content to create because of this mapping rule.)
2572         */
2573        public List<StructureMapGroupRuleTargetComponent> getTarget() { 
2574          if (this.target == null)
2575            this.target = new ArrayList<StructureMapGroupRuleTargetComponent>();
2576          return this.target;
2577        }
2578
2579        /**
2580         * @return Returns a reference to <code>this</code> for easy method chaining
2581         */
2582        public StructureMapGroupRuleComponent setTarget(List<StructureMapGroupRuleTargetComponent> theTarget) { 
2583          this.target = theTarget;
2584          return this;
2585        }
2586
2587        public boolean hasTarget() { 
2588          if (this.target == null)
2589            return false;
2590          for (StructureMapGroupRuleTargetComponent item : this.target)
2591            if (!item.isEmpty())
2592              return true;
2593          return false;
2594        }
2595
2596        public StructureMapGroupRuleTargetComponent addTarget() { //3
2597          StructureMapGroupRuleTargetComponent t = new StructureMapGroupRuleTargetComponent();
2598          if (this.target == null)
2599            this.target = new ArrayList<StructureMapGroupRuleTargetComponent>();
2600          this.target.add(t);
2601          return t;
2602        }
2603
2604        public StructureMapGroupRuleComponent addTarget(StructureMapGroupRuleTargetComponent t) { //3
2605          if (t == null)
2606            return this;
2607          if (this.target == null)
2608            this.target = new ArrayList<StructureMapGroupRuleTargetComponent>();
2609          this.target.add(t);
2610          return this;
2611        }
2612
2613        /**
2614         * @return The first repetition of repeating field {@link #target}, creating it if it does not already exist
2615         */
2616        public StructureMapGroupRuleTargetComponent getTargetFirstRep() { 
2617          if (getTarget().isEmpty()) {
2618            addTarget();
2619          }
2620          return getTarget().get(0);
2621        }
2622
2623        /**
2624         * @return {@link #rule} (Rules contained in this rule.)
2625         */
2626        public List<StructureMapGroupRuleComponent> getRule() { 
2627          if (this.rule == null)
2628            this.rule = new ArrayList<StructureMapGroupRuleComponent>();
2629          return this.rule;
2630        }
2631
2632        /**
2633         * @return Returns a reference to <code>this</code> for easy method chaining
2634         */
2635        public StructureMapGroupRuleComponent setRule(List<StructureMapGroupRuleComponent> theRule) { 
2636          this.rule = theRule;
2637          return this;
2638        }
2639
2640        public boolean hasRule() { 
2641          if (this.rule == null)
2642            return false;
2643          for (StructureMapGroupRuleComponent item : this.rule)
2644            if (!item.isEmpty())
2645              return true;
2646          return false;
2647        }
2648
2649        public StructureMapGroupRuleComponent addRule() { //3
2650          StructureMapGroupRuleComponent t = new StructureMapGroupRuleComponent();
2651          if (this.rule == null)
2652            this.rule = new ArrayList<StructureMapGroupRuleComponent>();
2653          this.rule.add(t);
2654          return t;
2655        }
2656
2657        public StructureMapGroupRuleComponent addRule(StructureMapGroupRuleComponent t) { //3
2658          if (t == null)
2659            return this;
2660          if (this.rule == null)
2661            this.rule = new ArrayList<StructureMapGroupRuleComponent>();
2662          this.rule.add(t);
2663          return this;
2664        }
2665
2666        /**
2667         * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
2668         */
2669        public StructureMapGroupRuleComponent getRuleFirstRep() { 
2670          if (getRule().isEmpty()) {
2671            addRule();
2672          }
2673          return getRule().get(0);
2674        }
2675
2676        /**
2677         * @return {@link #dependent} (Which other rules to apply in the context of this rule.)
2678         */
2679        public List<StructureMapGroupRuleDependentComponent> getDependent() { 
2680          if (this.dependent == null)
2681            this.dependent = new ArrayList<StructureMapGroupRuleDependentComponent>();
2682          return this.dependent;
2683        }
2684
2685        /**
2686         * @return Returns a reference to <code>this</code> for easy method chaining
2687         */
2688        public StructureMapGroupRuleComponent setDependent(List<StructureMapGroupRuleDependentComponent> theDependent) { 
2689          this.dependent = theDependent;
2690          return this;
2691        }
2692
2693        public boolean hasDependent() { 
2694          if (this.dependent == null)
2695            return false;
2696          for (StructureMapGroupRuleDependentComponent item : this.dependent)
2697            if (!item.isEmpty())
2698              return true;
2699          return false;
2700        }
2701
2702        public StructureMapGroupRuleDependentComponent addDependent() { //3
2703          StructureMapGroupRuleDependentComponent t = new StructureMapGroupRuleDependentComponent();
2704          if (this.dependent == null)
2705            this.dependent = new ArrayList<StructureMapGroupRuleDependentComponent>();
2706          this.dependent.add(t);
2707          return t;
2708        }
2709
2710        public StructureMapGroupRuleComponent addDependent(StructureMapGroupRuleDependentComponent t) { //3
2711          if (t == null)
2712            return this;
2713          if (this.dependent == null)
2714            this.dependent = new ArrayList<StructureMapGroupRuleDependentComponent>();
2715          this.dependent.add(t);
2716          return this;
2717        }
2718
2719        /**
2720         * @return The first repetition of repeating field {@link #dependent}, creating it if it does not already exist
2721         */
2722        public StructureMapGroupRuleDependentComponent getDependentFirstRep() { 
2723          if (getDependent().isEmpty()) {
2724            addDependent();
2725          }
2726          return getDependent().get(0);
2727        }
2728
2729        /**
2730         * @return {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2731         */
2732        public StringType getDocumentationElement() { 
2733          if (this.documentation == null)
2734            if (Configuration.errorOnAutoCreate())
2735              throw new Error("Attempt to auto-create StructureMapGroupRuleComponent.documentation");
2736            else if (Configuration.doAutoCreate())
2737              this.documentation = new StringType(); // bb
2738          return this.documentation;
2739        }
2740
2741        public boolean hasDocumentationElement() { 
2742          return this.documentation != null && !this.documentation.isEmpty();
2743        }
2744
2745        public boolean hasDocumentation() { 
2746          return this.documentation != null && !this.documentation.isEmpty();
2747        }
2748
2749        /**
2750         * @param value {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2751         */
2752        public StructureMapGroupRuleComponent setDocumentationElement(StringType value) { 
2753          this.documentation = value;
2754          return this;
2755        }
2756
2757        /**
2758         * @return Documentation for this instance of data.
2759         */
2760        public String getDocumentation() { 
2761          return this.documentation == null ? null : this.documentation.getValue();
2762        }
2763
2764        /**
2765         * @param value Documentation for this instance of data.
2766         */
2767        public StructureMapGroupRuleComponent setDocumentation(String value) { 
2768          if (Utilities.noString(value))
2769            this.documentation = null;
2770          else {
2771            if (this.documentation == null)
2772              this.documentation = new StringType();
2773            this.documentation.setValue(value);
2774          }
2775          return this;
2776        }
2777
2778        protected void listChildren(List<Property> children) {
2779          super.listChildren(children);
2780          children.add(new Property("name", "id", "Name of the rule for internal references.", 0, 1, name));
2781          children.add(new Property("source", "", "Source inputs to the mapping.", 0, java.lang.Integer.MAX_VALUE, source));
2782          children.add(new Property("target", "", "Content to create because of this mapping rule.", 0, java.lang.Integer.MAX_VALUE, target));
2783          children.add(new Property("rule", "@StructureMap.group.rule", "Rules contained in this rule.", 0, java.lang.Integer.MAX_VALUE, rule));
2784          children.add(new Property("dependent", "", "Which other rules to apply in the context of this rule.", 0, java.lang.Integer.MAX_VALUE, dependent));
2785          children.add(new Property("documentation", "string", "Documentation for this instance of data.", 0, 1, documentation));
2786        }
2787
2788        @Override
2789        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2790          switch (_hash) {
2791          case 3373707: /*name*/  return new Property("name", "id", "Name of the rule for internal references.", 0, 1, name);
2792          case -896505829: /*source*/  return new Property("source", "", "Source inputs to the mapping.", 0, java.lang.Integer.MAX_VALUE, source);
2793          case -880905839: /*target*/  return new Property("target", "", "Content to create because of this mapping rule.", 0, java.lang.Integer.MAX_VALUE, target);
2794          case 3512060: /*rule*/  return new Property("rule", "@StructureMap.group.rule", "Rules contained in this rule.", 0, java.lang.Integer.MAX_VALUE, rule);
2795          case -1109226753: /*dependent*/  return new Property("dependent", "", "Which other rules to apply in the context of this rule.", 0, java.lang.Integer.MAX_VALUE, dependent);
2796          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Documentation for this instance of data.", 0, 1, documentation);
2797          default: return super.getNamedProperty(_hash, _name, _checkValid);
2798          }
2799
2800        }
2801
2802      @Override
2803      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2804        switch (hash) {
2805        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType
2806        case -896505829: /*source*/ return this.source == null ? new Base[0] : this.source.toArray(new Base[this.source.size()]); // StructureMapGroupRuleSourceComponent
2807        case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // StructureMapGroupRuleTargetComponent
2808        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // StructureMapGroupRuleComponent
2809        case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : this.dependent.toArray(new Base[this.dependent.size()]); // StructureMapGroupRuleDependentComponent
2810        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
2811        default: return super.getProperty(hash, name, checkValid);
2812        }
2813
2814      }
2815
2816      @Override
2817      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2818        switch (hash) {
2819        case 3373707: // name
2820          this.name = castToId(value); // IdType
2821          return value;
2822        case -896505829: // source
2823          this.getSource().add((StructureMapGroupRuleSourceComponent) value); // StructureMapGroupRuleSourceComponent
2824          return value;
2825        case -880905839: // target
2826          this.getTarget().add((StructureMapGroupRuleTargetComponent) value); // StructureMapGroupRuleTargetComponent
2827          return value;
2828        case 3512060: // rule
2829          this.getRule().add((StructureMapGroupRuleComponent) value); // StructureMapGroupRuleComponent
2830          return value;
2831        case -1109226753: // dependent
2832          this.getDependent().add((StructureMapGroupRuleDependentComponent) value); // StructureMapGroupRuleDependentComponent
2833          return value;
2834        case 1587405498: // documentation
2835          this.documentation = castToString(value); // StringType
2836          return value;
2837        default: return super.setProperty(hash, name, value);
2838        }
2839
2840      }
2841
2842      @Override
2843      public Base setProperty(String name, Base value) throws FHIRException {
2844        if (name.equals("name")) {
2845          this.name = castToId(value); // IdType
2846        } else if (name.equals("source")) {
2847          this.getSource().add((StructureMapGroupRuleSourceComponent) value);
2848        } else if (name.equals("target")) {
2849          this.getTarget().add((StructureMapGroupRuleTargetComponent) value);
2850        } else if (name.equals("rule")) {
2851          this.getRule().add((StructureMapGroupRuleComponent) value);
2852        } else if (name.equals("dependent")) {
2853          this.getDependent().add((StructureMapGroupRuleDependentComponent) value);
2854        } else if (name.equals("documentation")) {
2855          this.documentation = castToString(value); // StringType
2856        } else
2857          return super.setProperty(name, value);
2858        return value;
2859      }
2860
2861      @Override
2862      public Base makeProperty(int hash, String name) throws FHIRException {
2863        switch (hash) {
2864        case 3373707:  return getNameElement();
2865        case -896505829:  return addSource(); 
2866        case -880905839:  return addTarget(); 
2867        case 3512060:  return addRule(); 
2868        case -1109226753:  return addDependent(); 
2869        case 1587405498:  return getDocumentationElement();
2870        default: return super.makeProperty(hash, name);
2871        }
2872
2873      }
2874
2875      @Override
2876      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2877        switch (hash) {
2878        case 3373707: /*name*/ return new String[] {"id"};
2879        case -896505829: /*source*/ return new String[] {};
2880        case -880905839: /*target*/ return new String[] {};
2881        case 3512060: /*rule*/ return new String[] {"@StructureMap.group.rule"};
2882        case -1109226753: /*dependent*/ return new String[] {};
2883        case 1587405498: /*documentation*/ return new String[] {"string"};
2884        default: return super.getTypesForProperty(hash, name);
2885        }
2886
2887      }
2888
2889      @Override
2890      public Base addChild(String name) throws FHIRException {
2891        if (name.equals("name")) {
2892          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name");
2893        }
2894        else if (name.equals("source")) {
2895          return addSource();
2896        }
2897        else if (name.equals("target")) {
2898          return addTarget();
2899        }
2900        else if (name.equals("rule")) {
2901          return addRule();
2902        }
2903        else if (name.equals("dependent")) {
2904          return addDependent();
2905        }
2906        else if (name.equals("documentation")) {
2907          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation");
2908        }
2909        else
2910          return super.addChild(name);
2911      }
2912
2913      public StructureMapGroupRuleComponent copy() {
2914        StructureMapGroupRuleComponent dst = new StructureMapGroupRuleComponent();
2915        copyValues(dst);
2916        dst.name = name == null ? null : name.copy();
2917        if (source != null) {
2918          dst.source = new ArrayList<StructureMapGroupRuleSourceComponent>();
2919          for (StructureMapGroupRuleSourceComponent i : source)
2920            dst.source.add(i.copy());
2921        };
2922        if (target != null) {
2923          dst.target = new ArrayList<StructureMapGroupRuleTargetComponent>();
2924          for (StructureMapGroupRuleTargetComponent i : target)
2925            dst.target.add(i.copy());
2926        };
2927        if (rule != null) {
2928          dst.rule = new ArrayList<StructureMapGroupRuleComponent>();
2929          for (StructureMapGroupRuleComponent i : rule)
2930            dst.rule.add(i.copy());
2931        };
2932        if (dependent != null) {
2933          dst.dependent = new ArrayList<StructureMapGroupRuleDependentComponent>();
2934          for (StructureMapGroupRuleDependentComponent i : dependent)
2935            dst.dependent.add(i.copy());
2936        };
2937        dst.documentation = documentation == null ? null : documentation.copy();
2938        return dst;
2939      }
2940
2941      @Override
2942      public boolean equalsDeep(Base other_) {
2943        if (!super.equalsDeep(other_))
2944          return false;
2945        if (!(other_ instanceof StructureMapGroupRuleComponent))
2946          return false;
2947        StructureMapGroupRuleComponent o = (StructureMapGroupRuleComponent) other_;
2948        return compareDeep(name, o.name, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true)
2949           && compareDeep(rule, o.rule, true) && compareDeep(dependent, o.dependent, true) && compareDeep(documentation, o.documentation, true)
2950          ;
2951      }
2952
2953      @Override
2954      public boolean equalsShallow(Base other_) {
2955        if (!super.equalsShallow(other_))
2956          return false;
2957        if (!(other_ instanceof StructureMapGroupRuleComponent))
2958          return false;
2959        StructureMapGroupRuleComponent o = (StructureMapGroupRuleComponent) other_;
2960        return compareValues(name, o.name, true) && compareValues(documentation, o.documentation, true);
2961      }
2962
2963      public boolean isEmpty() {
2964        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, source, target, rule
2965          , dependent, documentation);
2966      }
2967
2968  public String fhirType() {
2969    return "StructureMap.group.rule";
2970
2971  }
2972
2973// added from java-adornments.txt:
2974
2975  public String toString() {
2976    return StructureMapUtilities.ruleToString(this);
2977  }
2978
2979
2980// end addition
2981  }
2982
2983    @Block()
2984    public static class StructureMapGroupRuleSourceComponent extends BackboneElement implements IBaseBackboneElement {
2985        /**
2986         * Type or variable this rule applies to.
2987         */
2988        @Child(name = "context", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2989        @Description(shortDefinition="Type or variable this rule applies to", formalDefinition="Type or variable this rule applies to." )
2990        protected IdType context;
2991
2992        /**
2993         * Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.
2994         */
2995        @Child(name = "min", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2996        @Description(shortDefinition="Specified minimum cardinality", formalDefinition="Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content." )
2997        protected IntegerType min;
2998
2999        /**
3000         * Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).
3001         */
3002        @Child(name = "max", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3003        @Description(shortDefinition="Specified maximum cardinality (number or *)", formalDefinition="Specified maximum cardinality for the element - a number or a \"*\". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value)." )
3004        protected StringType max;
3005
3006        /**
3007         * Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.
3008         */
3009        @Child(name = "type", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
3010        @Description(shortDefinition="Rule only applies if source has this type", formalDefinition="Specified type for the element. This works as a condition on the mapping - use for polymorphic elements." )
3011        protected StringType type;
3012
3013        /**
3014         * A value to use if there is no existing value in the source object.
3015         */
3016        @Child(name = "defaultValue", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
3017        @Description(shortDefinition="Default value if no value exists", formalDefinition="A value to use if there is no existing value in the source object." )
3018        protected org.hl7.fhir.dstu3.model.Type defaultValue;
3019
3020        /**
3021         * Optional field for this source.
3022         */
3023        @Child(name = "element", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
3024        @Description(shortDefinition="Optional field for this source", formalDefinition="Optional field for this source." )
3025        protected StringType element;
3026
3027        /**
3028         * How to handle the list mode for this element.
3029         */
3030        @Child(name = "listMode", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
3031        @Description(shortDefinition="first | not_first | last | not_last | only_one", formalDefinition="How to handle the list mode for this element." )
3032        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-source-list-mode")
3033        protected Enumeration<StructureMapSourceListMode> listMode;
3034
3035        /**
3036         * Named context for field, if a field is specified.
3037         */
3038        @Child(name = "variable", type = {IdType.class}, order=8, min=0, max=1, modifier=false, summary=true)
3039        @Description(shortDefinition="Named context for field, if a field is specified", formalDefinition="Named context for field, if a field is specified." )
3040        protected IdType variable;
3041
3042        /**
3043         * FHIRPath expression  - must be true or the rule does not apply.
3044         */
3045        @Child(name = "condition", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
3046        @Description(shortDefinition="FHIRPath expression  - must be true or the rule does not apply", formalDefinition="FHIRPath expression  - must be true or the rule does not apply." )
3047        protected StringType condition;
3048
3049        /**
3050         * FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.
3051         */
3052        @Child(name = "check", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true)
3053        @Description(shortDefinition="FHIRPath expression  - must be true or the mapping engine throws an error instead of completing", formalDefinition="FHIRPath expression  - must be true or the mapping engine throws an error instead of completing." )
3054        protected StringType check;
3055
3056        private static final long serialVersionUID = 1893118862L;
3057
3058    /**
3059     * Constructor
3060     */
3061      public StructureMapGroupRuleSourceComponent() {
3062        super();
3063      }
3064
3065    /**
3066     * Constructor
3067     */
3068      public StructureMapGroupRuleSourceComponent(IdType context) {
3069        super();
3070        this.context = context;
3071      }
3072
3073        /**
3074         * @return {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value
3075         */
3076        public IdType getContextElement() { 
3077          if (this.context == null)
3078            if (Configuration.errorOnAutoCreate())
3079              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.context");
3080            else if (Configuration.doAutoCreate())
3081              this.context = new IdType(); // bb
3082          return this.context;
3083        }
3084
3085        public boolean hasContextElement() { 
3086          return this.context != null && !this.context.isEmpty();
3087        }
3088
3089        public boolean hasContext() { 
3090          return this.context != null && !this.context.isEmpty();
3091        }
3092
3093        /**
3094         * @param value {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value
3095         */
3096        public StructureMapGroupRuleSourceComponent setContextElement(IdType value) { 
3097          this.context = value;
3098          return this;
3099        }
3100
3101        /**
3102         * @return Type or variable this rule applies to.
3103         */
3104        public String getContext() { 
3105          return this.context == null ? null : this.context.getValue();
3106        }
3107
3108        /**
3109         * @param value Type or variable this rule applies to.
3110         */
3111        public StructureMapGroupRuleSourceComponent setContext(String value) { 
3112            if (this.context == null)
3113              this.context = new IdType();
3114            this.context.setValue(value);
3115          return this;
3116        }
3117
3118        /**
3119         * @return {@link #min} (Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
3120         */
3121        public IntegerType getMinElement() { 
3122          if (this.min == null)
3123            if (Configuration.errorOnAutoCreate())
3124              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.min");
3125            else if (Configuration.doAutoCreate())
3126              this.min = new IntegerType(); // bb
3127          return this.min;
3128        }
3129
3130        public boolean hasMinElement() { 
3131          return this.min != null && !this.min.isEmpty();
3132        }
3133
3134        public boolean hasMin() { 
3135          return this.min != null && !this.min.isEmpty();
3136        }
3137
3138        /**
3139         * @param value {@link #min} (Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
3140         */
3141        public StructureMapGroupRuleSourceComponent setMinElement(IntegerType value) { 
3142          this.min = value;
3143          return this;
3144        }
3145
3146        /**
3147         * @return Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.
3148         */
3149        public int getMin() { 
3150          return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
3151        }
3152
3153        /**
3154         * @param value Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.
3155         */
3156        public StructureMapGroupRuleSourceComponent setMin(int value) { 
3157            if (this.min == null)
3158              this.min = new IntegerType();
3159            this.min.setValue(value);
3160          return this;
3161        }
3162
3163        /**
3164         * @return {@link #max} (Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
3165         */
3166        public StringType getMaxElement() { 
3167          if (this.max == null)
3168            if (Configuration.errorOnAutoCreate())
3169              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.max");
3170            else if (Configuration.doAutoCreate())
3171              this.max = new StringType(); // bb
3172          return this.max;
3173        }
3174
3175        public boolean hasMaxElement() { 
3176          return this.max != null && !this.max.isEmpty();
3177        }
3178
3179        public boolean hasMax() { 
3180          return this.max != null && !this.max.isEmpty();
3181        }
3182
3183        /**
3184         * @param value {@link #max} (Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
3185         */
3186        public StructureMapGroupRuleSourceComponent setMaxElement(StringType value) { 
3187          this.max = value;
3188          return this;
3189        }
3190
3191        /**
3192         * @return Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).
3193         */
3194        public String getMax() { 
3195          return this.max == null ? null : this.max.getValue();
3196        }
3197
3198        /**
3199         * @param value Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).
3200         */
3201        public StructureMapGroupRuleSourceComponent setMax(String value) { 
3202          if (Utilities.noString(value))
3203            this.max = null;
3204          else {
3205            if (this.max == null)
3206              this.max = new StringType();
3207            this.max.setValue(value);
3208          }
3209          return this;
3210        }
3211
3212        /**
3213         * @return {@link #type} (Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3214         */
3215        public StringType getTypeElement() { 
3216          if (this.type == null)
3217            if (Configuration.errorOnAutoCreate())
3218              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.type");
3219            else if (Configuration.doAutoCreate())
3220              this.type = new StringType(); // bb
3221          return this.type;
3222        }
3223
3224        public boolean hasTypeElement() { 
3225          return this.type != null && !this.type.isEmpty();
3226        }
3227
3228        public boolean hasType() { 
3229          return this.type != null && !this.type.isEmpty();
3230        }
3231
3232        /**
3233         * @param value {@link #type} (Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3234         */
3235        public StructureMapGroupRuleSourceComponent setTypeElement(StringType value) { 
3236          this.type = value;
3237          return this;
3238        }
3239
3240        /**
3241         * @return Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.
3242         */
3243        public String getType() { 
3244          return this.type == null ? null : this.type.getValue();
3245        }
3246
3247        /**
3248         * @param value Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.
3249         */
3250        public StructureMapGroupRuleSourceComponent setType(String value) { 
3251          if (Utilities.noString(value))
3252            this.type = null;
3253          else {
3254            if (this.type == null)
3255              this.type = new StringType();
3256            this.type.setValue(value);
3257          }
3258          return this;
3259        }
3260
3261        /**
3262         * @return {@link #defaultValue} (A value to use if there is no existing value in the source object.)
3263         */
3264        public org.hl7.fhir.dstu3.model.Type getDefaultValue() { 
3265          return this.defaultValue;
3266        }
3267
3268        public boolean hasDefaultValue() { 
3269          return this.defaultValue != null && !this.defaultValue.isEmpty();
3270        }
3271
3272        /**
3273         * @param value {@link #defaultValue} (A value to use if there is no existing value in the source object.)
3274         */
3275        public StructureMapGroupRuleSourceComponent setDefaultValue(org.hl7.fhir.dstu3.model.Type value)  { 
3276          this.defaultValue = value;
3277          return this;
3278        }
3279
3280        /**
3281         * @return {@link #element} (Optional field for this source.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value
3282         */
3283        public StringType getElementElement() { 
3284          if (this.element == null)
3285            if (Configuration.errorOnAutoCreate())
3286              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.element");
3287            else if (Configuration.doAutoCreate())
3288              this.element = new StringType(); // bb
3289          return this.element;
3290        }
3291
3292        public boolean hasElementElement() { 
3293          return this.element != null && !this.element.isEmpty();
3294        }
3295
3296        public boolean hasElement() { 
3297          return this.element != null && !this.element.isEmpty();
3298        }
3299
3300        /**
3301         * @param value {@link #element} (Optional field for this source.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value
3302         */
3303        public StructureMapGroupRuleSourceComponent setElementElement(StringType value) { 
3304          this.element = value;
3305          return this;
3306        }
3307
3308        /**
3309         * @return Optional field for this source.
3310         */
3311        public String getElement() { 
3312          return this.element == null ? null : this.element.getValue();
3313        }
3314
3315        /**
3316         * @param value Optional field for this source.
3317         */
3318        public StructureMapGroupRuleSourceComponent setElement(String value) { 
3319          if (Utilities.noString(value))
3320            this.element = null;
3321          else {
3322            if (this.element == null)
3323              this.element = new StringType();
3324            this.element.setValue(value);
3325          }
3326          return this;
3327        }
3328
3329        /**
3330         * @return {@link #listMode} (How to handle the list mode for this element.). This is the underlying object with id, value and extensions. The accessor "getListMode" gives direct access to the value
3331         */
3332        public Enumeration<StructureMapSourceListMode> getListModeElement() { 
3333          if (this.listMode == null)
3334            if (Configuration.errorOnAutoCreate())
3335              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.listMode");
3336            else if (Configuration.doAutoCreate())
3337              this.listMode = new Enumeration<StructureMapSourceListMode>(new StructureMapSourceListModeEnumFactory()); // bb
3338          return this.listMode;
3339        }
3340
3341        public boolean hasListModeElement() { 
3342          return this.listMode != null && !this.listMode.isEmpty();
3343        }
3344
3345        public boolean hasListMode() { 
3346          return this.listMode != null && !this.listMode.isEmpty();
3347        }
3348
3349        /**
3350         * @param value {@link #listMode} (How to handle the list mode for this element.). This is the underlying object with id, value and extensions. The accessor "getListMode" gives direct access to the value
3351         */
3352        public StructureMapGroupRuleSourceComponent setListModeElement(Enumeration<StructureMapSourceListMode> value) { 
3353          this.listMode = value;
3354          return this;
3355        }
3356
3357        /**
3358         * @return How to handle the list mode for this element.
3359         */
3360        public StructureMapSourceListMode getListMode() { 
3361          return this.listMode == null ? null : this.listMode.getValue();
3362        }
3363
3364        /**
3365         * @param value How to handle the list mode for this element.
3366         */
3367        public StructureMapGroupRuleSourceComponent setListMode(StructureMapSourceListMode value) { 
3368          if (value == null)
3369            this.listMode = null;
3370          else {
3371            if (this.listMode == null)
3372              this.listMode = new Enumeration<StructureMapSourceListMode>(new StructureMapSourceListModeEnumFactory());
3373            this.listMode.setValue(value);
3374          }
3375          return this;
3376        }
3377
3378        /**
3379         * @return {@link #variable} (Named context for field, if a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value
3380         */
3381        public IdType getVariableElement() { 
3382          if (this.variable == null)
3383            if (Configuration.errorOnAutoCreate())
3384              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.variable");
3385            else if (Configuration.doAutoCreate())
3386              this.variable = new IdType(); // bb
3387          return this.variable;
3388        }
3389
3390        public boolean hasVariableElement() { 
3391          return this.variable != null && !this.variable.isEmpty();
3392        }
3393
3394        public boolean hasVariable() { 
3395          return this.variable != null && !this.variable.isEmpty();
3396        }
3397
3398        /**
3399         * @param value {@link #variable} (Named context for field, if a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value
3400         */
3401        public StructureMapGroupRuleSourceComponent setVariableElement(IdType value) { 
3402          this.variable = value;
3403          return this;
3404        }
3405
3406        /**
3407         * @return Named context for field, if a field is specified.
3408         */
3409        public String getVariable() { 
3410          return this.variable == null ? null : this.variable.getValue();
3411        }
3412
3413        /**
3414         * @param value Named context for field, if a field is specified.
3415         */
3416        public StructureMapGroupRuleSourceComponent setVariable(String value) { 
3417          if (Utilities.noString(value))
3418            this.variable = null;
3419          else {
3420            if (this.variable == null)
3421              this.variable = new IdType();
3422            this.variable.setValue(value);
3423          }
3424          return this;
3425        }
3426
3427        /**
3428         * @return {@link #condition} (FHIRPath expression  - must be true or the rule does not apply.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value
3429         */
3430        public StringType getConditionElement() { 
3431          if (this.condition == null)
3432            if (Configuration.errorOnAutoCreate())
3433              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.condition");
3434            else if (Configuration.doAutoCreate())
3435              this.condition = new StringType(); // bb
3436          return this.condition;
3437        }
3438
3439        public boolean hasConditionElement() { 
3440          return this.condition != null && !this.condition.isEmpty();
3441        }
3442
3443        public boolean hasCondition() { 
3444          return this.condition != null && !this.condition.isEmpty();
3445        }
3446
3447        /**
3448         * @param value {@link #condition} (FHIRPath expression  - must be true or the rule does not apply.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value
3449         */
3450        public StructureMapGroupRuleSourceComponent setConditionElement(StringType value) { 
3451          this.condition = value;
3452          return this;
3453        }
3454
3455        /**
3456         * @return FHIRPath expression  - must be true or the rule does not apply.
3457         */
3458        public String getCondition() { 
3459          return this.condition == null ? null : this.condition.getValue();
3460        }
3461
3462        /**
3463         * @param value FHIRPath expression  - must be true or the rule does not apply.
3464         */
3465        public StructureMapGroupRuleSourceComponent setCondition(String value) { 
3466          if (Utilities.noString(value))
3467            this.condition = null;
3468          else {
3469            if (this.condition == null)
3470              this.condition = new StringType();
3471            this.condition.setValue(value);
3472          }
3473          return this;
3474        }
3475
3476        /**
3477         * @return {@link #check} (FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.). This is the underlying object with id, value and extensions. The accessor "getCheck" gives direct access to the value
3478         */
3479        public StringType getCheckElement() { 
3480          if (this.check == null)
3481            if (Configuration.errorOnAutoCreate())
3482              throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.check");
3483            else if (Configuration.doAutoCreate())
3484              this.check = new StringType(); // bb
3485          return this.check;
3486        }
3487
3488        public boolean hasCheckElement() { 
3489          return this.check != null && !this.check.isEmpty();
3490        }
3491
3492        public boolean hasCheck() { 
3493          return this.check != null && !this.check.isEmpty();
3494        }
3495
3496        /**
3497         * @param value {@link #check} (FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.). This is the underlying object with id, value and extensions. The accessor "getCheck" gives direct access to the value
3498         */
3499        public StructureMapGroupRuleSourceComponent setCheckElement(StringType value) { 
3500          this.check = value;
3501          return this;
3502        }
3503
3504        /**
3505         * @return FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.
3506         */
3507        public String getCheck() { 
3508          return this.check == null ? null : this.check.getValue();
3509        }
3510
3511        /**
3512         * @param value FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.
3513         */
3514        public StructureMapGroupRuleSourceComponent setCheck(String value) { 
3515          if (Utilities.noString(value))
3516            this.check = null;
3517          else {
3518            if (this.check == null)
3519              this.check = new StringType();
3520            this.check.setValue(value);
3521          }
3522          return this;
3523        }
3524
3525        protected void listChildren(List<Property> children) {
3526          super.listChildren(children);
3527          children.add(new Property("context", "id", "Type or variable this rule applies to.", 0, 1, context));
3528          children.add(new Property("min", "integer", "Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.", 0, 1, min));
3529          children.add(new Property("max", "string", "Specified maximum cardinality for the element - a number or a \"*\". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).", 0, 1, max));
3530          children.add(new Property("type", "string", "Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.", 0, 1, type));
3531          children.add(new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue));
3532          children.add(new Property("element", "string", "Optional field for this source.", 0, 1, element));
3533          children.add(new Property("listMode", "code", "How to handle the list mode for this element.", 0, 1, listMode));
3534          children.add(new Property("variable", "id", "Named context for field, if a field is specified.", 0, 1, variable));
3535          children.add(new Property("condition", "string", "FHIRPath expression  - must be true or the rule does not apply.", 0, 1, condition));
3536          children.add(new Property("check", "string", "FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.", 0, 1, check));
3537        }
3538
3539        @Override
3540        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3541          switch (_hash) {
3542          case 951530927: /*context*/  return new Property("context", "id", "Type or variable this rule applies to.", 0, 1, context);
3543          case 108114: /*min*/  return new Property("min", "integer", "Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.", 0, 1, min);
3544          case 107876: /*max*/  return new Property("max", "string", "Specified maximum cardinality for the element - a number or a \"*\". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).", 0, 1, max);
3545          case 3575610: /*type*/  return new Property("type", "string", "Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.", 0, 1, type);
3546          case 587922128: /*defaultValue[x]*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3547          case -659125328: /*defaultValue*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3548          case 1470297600: /*defaultValueBase64Binary*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3549          case 600437336: /*defaultValueBoolean*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3550          case 264593188: /*defaultValueCanonical*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3551          case 1044993469: /*defaultValueCode*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3552          case 1045010302: /*defaultValueDate*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3553          case 1220374379: /*defaultValueDateTime*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3554          case 2077989249: /*defaultValueDecimal*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3555          case -2059245333: /*defaultValueId*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3556          case -1801671663: /*defaultValueInstant*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3557          case -1801189522: /*defaultValueInteger*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3558          case -325436225: /*defaultValueMarkdown*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3559          case 587910138: /*defaultValueOid*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3560          case -737344154: /*defaultValuePositiveInt*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3561          case -320515103: /*defaultValueString*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3562          case 1045494429: /*defaultValueTime*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3563          case 539117290: /*defaultValueUnsignedInt*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3564          case 587916188: /*defaultValueUri*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3565          case 587916191: /*defaultValueUrl*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3566          case 1045535627: /*defaultValueUuid*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3567          case -611966428: /*defaultValueAddress*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3568          case -1851689217: /*defaultValueAnnotation*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3569          case 2034820339: /*defaultValueAttachment*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3570          case -410434095: /*defaultValueCodeableConcept*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3571          case -783616198: /*defaultValueCoding*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3572          case -344740576: /*defaultValueContactPoint*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3573          case -975393912: /*defaultValueHumanName*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3574          case -1915078535: /*defaultValueIdentifier*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3575          case -420255343: /*defaultValuePeriod*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3576          case -1857379237: /*defaultValueQuantity*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3577          case -1951495315: /*defaultValueRange*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3578          case -1951489477: /*defaultValueRatio*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3579          case -1488914053: /*defaultValueReference*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3580          case -449641228: /*defaultValueSampledData*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3581          case 509825768: /*defaultValueSignature*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3582          case -302193638: /*defaultValueTiming*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3583          case -754548089: /*defaultValueDosage*/  return new Property("defaultValue[x]", "*", "A value to use if there is no existing value in the source object.", 0, 1, defaultValue);
3584          case -1662836996: /*element*/  return new Property("element", "string", "Optional field for this source.", 0, 1, element);
3585          case 1345445729: /*listMode*/  return new Property("listMode", "code", "How to handle the list mode for this element.", 0, 1, listMode);
3586          case -1249586564: /*variable*/  return new Property("variable", "id", "Named context for field, if a field is specified.", 0, 1, variable);
3587          case -861311717: /*condition*/  return new Property("condition", "string", "FHIRPath expression  - must be true or the rule does not apply.", 0, 1, condition);
3588          case 94627080: /*check*/  return new Property("check", "string", "FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.", 0, 1, check);
3589          default: return super.getNamedProperty(_hash, _name, _checkValid);
3590          }
3591
3592        }
3593
3594      @Override
3595      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3596        switch (hash) {
3597        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // IdType
3598        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType
3599        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
3600        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType
3601        case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // org.hl7.fhir.dstu3.model.Type
3602        case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // StringType
3603        case 1345445729: /*listMode*/ return this.listMode == null ? new Base[0] : new Base[] {this.listMode}; // Enumeration<StructureMapSourceListMode>
3604        case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : new Base[] {this.variable}; // IdType
3605        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType
3606        case 94627080: /*check*/ return this.check == null ? new Base[0] : new Base[] {this.check}; // StringType
3607        default: return super.getProperty(hash, name, checkValid);
3608        }
3609
3610      }
3611
3612      @Override
3613      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3614        switch (hash) {
3615        case 951530927: // context
3616          this.context = castToId(value); // IdType
3617          return value;
3618        case 108114: // min
3619          this.min = castToInteger(value); // IntegerType
3620          return value;
3621        case 107876: // max
3622          this.max = castToString(value); // StringType
3623          return value;
3624        case 3575610: // type
3625          this.type = castToString(value); // StringType
3626          return value;
3627        case -659125328: // defaultValue
3628          this.defaultValue = castToType(value); // org.hl7.fhir.dstu3.model.Type
3629          return value;
3630        case -1662836996: // element
3631          this.element = castToString(value); // StringType
3632          return value;
3633        case 1345445729: // listMode
3634          value = new StructureMapSourceListModeEnumFactory().fromType(castToCode(value));
3635          this.listMode = (Enumeration) value; // Enumeration<StructureMapSourceListMode>
3636          return value;
3637        case -1249586564: // variable
3638          this.variable = castToId(value); // IdType
3639          return value;
3640        case -861311717: // condition
3641          this.condition = castToString(value); // StringType
3642          return value;
3643        case 94627080: // check
3644          this.check = castToString(value); // StringType
3645          return value;
3646        default: return super.setProperty(hash, name, value);
3647        }
3648
3649      }
3650
3651      @Override
3652      public Base setProperty(String name, Base value) throws FHIRException {
3653        if (name.equals("context")) {
3654          this.context = castToId(value); // IdType
3655        } else if (name.equals("min")) {
3656          this.min = castToInteger(value); // IntegerType
3657        } else if (name.equals("max")) {
3658          this.max = castToString(value); // StringType
3659        } else if (name.equals("type")) {
3660          this.type = castToString(value); // StringType
3661        } else if (name.equals("defaultValue[x]")) {
3662          this.defaultValue = castToType(value); // org.hl7.fhir.dstu3.model.Type
3663        } else if (name.equals("element")) {
3664          this.element = castToString(value); // StringType
3665        } else if (name.equals("listMode")) {
3666          value = new StructureMapSourceListModeEnumFactory().fromType(castToCode(value));
3667          this.listMode = (Enumeration) value; // Enumeration<StructureMapSourceListMode>
3668        } else if (name.equals("variable")) {
3669          this.variable = castToId(value); // IdType
3670        } else if (name.equals("condition")) {
3671          this.condition = castToString(value); // StringType
3672        } else if (name.equals("check")) {
3673          this.check = castToString(value); // StringType
3674        } else
3675          return super.setProperty(name, value);
3676        return value;
3677      }
3678
3679      @Override
3680      public Base makeProperty(int hash, String name) throws FHIRException {
3681        switch (hash) {
3682        case 951530927:  return getContextElement();
3683        case 108114:  return getMinElement();
3684        case 107876:  return getMaxElement();
3685        case 3575610:  return getTypeElement();
3686        case 587922128:  return getDefaultValue(); 
3687        case -659125328:  return getDefaultValue(); 
3688        case -1662836996:  return getElementElement();
3689        case 1345445729:  return getListModeElement();
3690        case -1249586564:  return getVariableElement();
3691        case -861311717:  return getConditionElement();
3692        case 94627080:  return getCheckElement();
3693        default: return super.makeProperty(hash, name);
3694        }
3695
3696      }
3697
3698      @Override
3699      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3700        switch (hash) {
3701        case 951530927: /*context*/ return new String[] {"id"};
3702        case 108114: /*min*/ return new String[] {"integer"};
3703        case 107876: /*max*/ return new String[] {"string"};
3704        case 3575610: /*type*/ return new String[] {"string"};
3705        case -659125328: /*defaultValue*/ return new String[] {"*"};
3706        case -1662836996: /*element*/ return new String[] {"string"};
3707        case 1345445729: /*listMode*/ return new String[] {"code"};
3708        case -1249586564: /*variable*/ return new String[] {"id"};
3709        case -861311717: /*condition*/ return new String[] {"string"};
3710        case 94627080: /*check*/ return new String[] {"string"};
3711        default: return super.getTypesForProperty(hash, name);
3712        }
3713
3714      }
3715
3716      @Override
3717      public Base addChild(String name) throws FHIRException {
3718        if (name.equals("context")) {
3719          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.context");
3720        }
3721        else if (name.equals("min")) {
3722          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.min");
3723        }
3724        else if (name.equals("max")) {
3725          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.max");
3726        }
3727        else if (name.equals("type")) {
3728          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.type");
3729        }
3730        else if (name.equals("defaultValueBoolean")) {
3731          this.defaultValue = new BooleanType();
3732          return this.defaultValue;
3733        }
3734        else if (name.equals("defaultValueInteger")) {
3735          this.defaultValue = new IntegerType();
3736          return this.defaultValue;
3737        }
3738        else if (name.equals("defaultValueDecimal")) {
3739          this.defaultValue = new DecimalType();
3740          return this.defaultValue;
3741        }
3742        else if (name.equals("defaultValueBase64Binary")) {
3743          this.defaultValue = new Base64BinaryType();
3744          return this.defaultValue;
3745        }
3746        else if (name.equals("defaultValueInstant")) {
3747          this.defaultValue = new InstantType();
3748          return this.defaultValue;
3749        }
3750        else if (name.equals("defaultValueString")) {
3751          this.defaultValue = new StringType();
3752          return this.defaultValue;
3753        }
3754        else if (name.equals("defaultValueUri")) {
3755          this.defaultValue = new UriType();
3756          return this.defaultValue;
3757        }
3758        else if (name.equals("defaultValueDate")) {
3759          this.defaultValue = new DateType();
3760          return this.defaultValue;
3761        }
3762        else if (name.equals("defaultValueDateTime")) {
3763          this.defaultValue = new DateTimeType();
3764          return this.defaultValue;
3765        }
3766        else if (name.equals("defaultValueTime")) {
3767          this.defaultValue = new TimeType();
3768          return this.defaultValue;
3769        }
3770        else if (name.equals("defaultValueCode")) {
3771          this.defaultValue = new CodeType();
3772          return this.defaultValue;
3773        }
3774        else if (name.equals("defaultValueOid")) {
3775          this.defaultValue = new OidType();
3776          return this.defaultValue;
3777        }
3778        else if (name.equals("defaultValueId")) {
3779          this.defaultValue = new IdType();
3780          return this.defaultValue;
3781        }
3782        else if (name.equals("defaultValueUnsignedInt")) {
3783          this.defaultValue = new UnsignedIntType();
3784          return this.defaultValue;
3785        }
3786        else if (name.equals("defaultValuePositiveInt")) {
3787          this.defaultValue = new PositiveIntType();
3788          return this.defaultValue;
3789        }
3790        else if (name.equals("defaultValueMarkdown")) {
3791          this.defaultValue = new MarkdownType();
3792          return this.defaultValue;
3793        }
3794        else if (name.equals("defaultValueAnnotation")) {
3795          this.defaultValue = new Annotation();
3796          return this.defaultValue;
3797        }
3798        else if (name.equals("defaultValueAttachment")) {
3799          this.defaultValue = new Attachment();
3800          return this.defaultValue;
3801        }
3802        else if (name.equals("defaultValueIdentifier")) {
3803          this.defaultValue = new Identifier();
3804          return this.defaultValue;
3805        }
3806        else if (name.equals("defaultValueCodeableConcept")) {
3807          this.defaultValue = new CodeableConcept();
3808          return this.defaultValue;
3809        }
3810        else if (name.equals("defaultValueCoding")) {
3811          this.defaultValue = new Coding();
3812          return this.defaultValue;
3813        }
3814        else if (name.equals("defaultValueQuantity")) {
3815          this.defaultValue = new Quantity();
3816          return this.defaultValue;
3817        }
3818        else if (name.equals("defaultValueRange")) {
3819          this.defaultValue = new Range();
3820          return this.defaultValue;
3821        }
3822        else if (name.equals("defaultValuePeriod")) {
3823          this.defaultValue = new Period();
3824          return this.defaultValue;
3825        }
3826        else if (name.equals("defaultValueRatio")) {
3827          this.defaultValue = new Ratio();
3828          return this.defaultValue;
3829        }
3830        else if (name.equals("defaultValueSampledData")) {
3831          this.defaultValue = new SampledData();
3832          return this.defaultValue;
3833        }
3834        else if (name.equals("defaultValueSignature")) {
3835          this.defaultValue = new Signature();
3836          return this.defaultValue;
3837        }
3838        else if (name.equals("defaultValueHumanName")) {
3839          this.defaultValue = new HumanName();
3840          return this.defaultValue;
3841        }
3842        else if (name.equals("defaultValueAddress")) {
3843          this.defaultValue = new Address();
3844          return this.defaultValue;
3845        }
3846        else if (name.equals("defaultValueContactPoint")) {
3847          this.defaultValue = new ContactPoint();
3848          return this.defaultValue;
3849        }
3850        else if (name.equals("defaultValueTiming")) {
3851          this.defaultValue = new Timing();
3852          return this.defaultValue;
3853        }
3854        else if (name.equals("defaultValueReference")) {
3855          this.defaultValue = new Reference();
3856          return this.defaultValue;
3857        }
3858        else if (name.equals("defaultValueMeta")) {
3859          this.defaultValue = new Meta();
3860          return this.defaultValue;
3861        }
3862        else if (name.equals("element")) {
3863          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.element");
3864        }
3865        else if (name.equals("listMode")) {
3866          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listMode");
3867        }
3868        else if (name.equals("variable")) {
3869          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable");
3870        }
3871        else if (name.equals("condition")) {
3872          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.condition");
3873        }
3874        else if (name.equals("check")) {
3875          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.check");
3876        }
3877        else
3878          return super.addChild(name);
3879      }
3880
3881      public StructureMapGroupRuleSourceComponent copy() {
3882        StructureMapGroupRuleSourceComponent dst = new StructureMapGroupRuleSourceComponent();
3883        copyValues(dst);
3884        dst.context = context == null ? null : context.copy();
3885        dst.min = min == null ? null : min.copy();
3886        dst.max = max == null ? null : max.copy();
3887        dst.type = type == null ? null : type.copy();
3888        dst.defaultValue = defaultValue == null ? null : defaultValue.copy();
3889        dst.element = element == null ? null : element.copy();
3890        dst.listMode = listMode == null ? null : listMode.copy();
3891        dst.variable = variable == null ? null : variable.copy();
3892        dst.condition = condition == null ? null : condition.copy();
3893        dst.check = check == null ? null : check.copy();
3894        return dst;
3895      }
3896
3897      @Override
3898      public boolean equalsDeep(Base other_) {
3899        if (!super.equalsDeep(other_))
3900          return false;
3901        if (!(other_ instanceof StructureMapGroupRuleSourceComponent))
3902          return false;
3903        StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other_;
3904        return compareDeep(context, o.context, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true)
3905           && compareDeep(type, o.type, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(element, o.element, true)
3906           && compareDeep(listMode, o.listMode, true) && compareDeep(variable, o.variable, true) && compareDeep(condition, o.condition, true)
3907           && compareDeep(check, o.check, true);
3908      }
3909
3910      @Override
3911      public boolean equalsShallow(Base other_) {
3912        if (!super.equalsShallow(other_))
3913          return false;
3914        if (!(other_ instanceof StructureMapGroupRuleSourceComponent))
3915          return false;
3916        StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other_;
3917        return compareValues(context, o.context, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true)
3918           && compareValues(type, o.type, true) && compareValues(element, o.element, true) && compareValues(listMode, o.listMode, true)
3919           && compareValues(variable, o.variable, true) && compareValues(condition, o.condition, true) && compareValues(check, o.check, true)
3920          ;
3921      }
3922
3923      public boolean isEmpty() {
3924        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(context, min, max, type
3925          , defaultValue, element, listMode, variable, condition, check);
3926      }
3927
3928  public String fhirType() {
3929    return "StructureMap.group.rule.source";
3930
3931  }
3932
3933// added from java-adornments.txt:
3934
3935  public String toString() {
3936    return StructureMapUtilities.sourceToString(this);
3937  }
3938
3939
3940// end addition
3941  }
3942
3943    @Block()
3944    public static class StructureMapGroupRuleTargetComponent extends BackboneElement implements IBaseBackboneElement {
3945        /**
3946         * Type or variable this rule applies to.
3947         */
3948        @Child(name = "context", type = {IdType.class}, order=1, min=0, max=1, modifier=false, summary=true)
3949        @Description(shortDefinition="Type or variable this rule applies to", formalDefinition="Type or variable this rule applies to." )
3950        protected IdType context;
3951
3952        /**
3953         * How to interpret the context.
3954         */
3955        @Child(name = "contextType", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3956        @Description(shortDefinition="type | variable", formalDefinition="How to interpret the context." )
3957        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-context-type")
3958        protected Enumeration<StructureMapContextType> contextType;
3959
3960        /**
3961         * Field to create in the context.
3962         */
3963        @Child(name = "element", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3964        @Description(shortDefinition="Field to create in the context", formalDefinition="Field to create in the context." )
3965        protected StringType element;
3966
3967        /**
3968         * Named context for field, if desired, and a field is specified.
3969         */
3970        @Child(name = "variable", type = {IdType.class}, order=4, min=0, max=1, modifier=false, summary=true)
3971        @Description(shortDefinition="Named context for field, if desired, and a field is specified", formalDefinition="Named context for field, if desired, and a field is specified." )
3972        protected IdType variable;
3973
3974        /**
3975         * If field is a list, how to manage the list.
3976         */
3977        @Child(name = "listMode", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3978        @Description(shortDefinition="first | share | last | collate", formalDefinition="If field is a list, how to manage the list." )
3979        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-target-list-mode")
3980        protected List<Enumeration<StructureMapTargetListMode>> listMode;
3981
3982        /**
3983         * Internal rule reference for shared list items.
3984         */
3985        @Child(name = "listRuleId", type = {IdType.class}, order=6, min=0, max=1, modifier=false, summary=true)
3986        @Description(shortDefinition="Internal rule reference for shared list items", formalDefinition="Internal rule reference for shared list items." )
3987        protected IdType listRuleId;
3988
3989        /**
3990         * How the data is copied / created.
3991         */
3992        @Child(name = "transform", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
3993        @Description(shortDefinition="create | copy +", formalDefinition="How the data is copied / created." )
3994        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/map-transform")
3995        protected Enumeration<StructureMapTransform> transform;
3996
3997        /**
3998         * Parameters to the transform.
3999         */
4000        @Child(name = "parameter", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4001        @Description(shortDefinition="Parameters to the transform", formalDefinition="Parameters to the transform." )
4002        protected List<StructureMapGroupRuleTargetParameterComponent> parameter;
4003
4004        private static final long serialVersionUID = -1441766429L;
4005
4006    /**
4007     * Constructor
4008     */
4009      public StructureMapGroupRuleTargetComponent() {
4010        super();
4011      }
4012
4013        /**
4014         * @return {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value
4015         */
4016        public IdType getContextElement() { 
4017          if (this.context == null)
4018            if (Configuration.errorOnAutoCreate())
4019              throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.context");
4020            else if (Configuration.doAutoCreate())
4021              this.context = new IdType(); // bb
4022          return this.context;
4023        }
4024
4025        public boolean hasContextElement() { 
4026          return this.context != null && !this.context.isEmpty();
4027        }
4028
4029        public boolean hasContext() { 
4030          return this.context != null && !this.context.isEmpty();
4031        }
4032
4033        /**
4034         * @param value {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value
4035         */
4036        public StructureMapGroupRuleTargetComponent setContextElement(IdType value) { 
4037          this.context = value;
4038          return this;
4039        }
4040
4041        /**
4042         * @return Type or variable this rule applies to.
4043         */
4044        public String getContext() { 
4045          return this.context == null ? null : this.context.getValue();
4046        }
4047
4048        /**
4049         * @param value Type or variable this rule applies to.
4050         */
4051        public StructureMapGroupRuleTargetComponent setContext(String value) { 
4052          if (Utilities.noString(value))
4053            this.context = null;
4054          else {
4055            if (this.context == null)
4056              this.context = new IdType();
4057            this.context.setValue(value);
4058          }
4059          return this;
4060        }
4061
4062        /**
4063         * @return {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value
4064         */
4065        public Enumeration<StructureMapContextType> getContextTypeElement() { 
4066          if (this.contextType == null)
4067            if (Configuration.errorOnAutoCreate())
4068              throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.contextType");
4069            else if (Configuration.doAutoCreate())
4070              this.contextType = new Enumeration<StructureMapContextType>(new StructureMapContextTypeEnumFactory()); // bb
4071          return this.contextType;
4072        }
4073
4074        public boolean hasContextTypeElement() { 
4075          return this.contextType != null && !this.contextType.isEmpty();
4076        }
4077
4078        public boolean hasContextType() { 
4079          return this.contextType != null && !this.contextType.isEmpty();
4080        }
4081
4082        /**
4083         * @param value {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value
4084         */
4085        public StructureMapGroupRuleTargetComponent setContextTypeElement(Enumeration<StructureMapContextType> value) { 
4086          this.contextType = value;
4087          return this;
4088        }
4089
4090        /**
4091         * @return How to interpret the context.
4092         */
4093        public StructureMapContextType getContextType() { 
4094          return this.contextType == null ? null : this.contextType.getValue();
4095        }
4096
4097        /**
4098         * @param value How to interpret the context.
4099         */
4100        public StructureMapGroupRuleTargetComponent setContextType(StructureMapContextType value) { 
4101          if (value == null)
4102            this.contextType = null;
4103          else {
4104            if (this.contextType == null)
4105              this.contextType = new Enumeration<StructureMapContextType>(new StructureMapContextTypeEnumFactory());
4106            this.contextType.setValue(value);
4107          }
4108          return this;
4109        }
4110
4111        /**
4112         * @return {@link #element} (Field to create in the context.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value
4113         */
4114        public StringType getElementElement() { 
4115          if (this.element == null)
4116            if (Configuration.errorOnAutoCreate())
4117              throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.element");
4118            else if (Configuration.doAutoCreate())
4119              this.element = new StringType(); // bb
4120          return this.element;
4121        }
4122
4123        public boolean hasElementElement() { 
4124          return this.element != null && !this.element.isEmpty();
4125        }
4126
4127        public boolean hasElement() { 
4128          return this.element != null && !this.element.isEmpty();
4129        }
4130
4131        /**
4132         * @param value {@link #element} (Field to create in the context.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value
4133         */
4134        public StructureMapGroupRuleTargetComponent setElementElement(StringType value) { 
4135          this.element = value;
4136          return this;
4137        }
4138
4139        /**
4140         * @return Field to create in the context.
4141         */
4142        public String getElement() { 
4143          return this.element == null ? null : this.element.getValue();
4144        }
4145
4146        /**
4147         * @param value Field to create in the context.
4148         */
4149        public StructureMapGroupRuleTargetComponent setElement(String value) { 
4150          if (Utilities.noString(value))
4151            this.element = null;
4152          else {
4153            if (this.element == null)
4154              this.element = new StringType();
4155            this.element.setValue(value);
4156          }
4157          return this;
4158        }
4159
4160        /**
4161         * @return {@link #variable} (Named context for field, if desired, and a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value
4162         */
4163        public IdType getVariableElement() { 
4164          if (this.variable == null)
4165            if (Configuration.errorOnAutoCreate())
4166              throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.variable");
4167            else if (Configuration.doAutoCreate())
4168              this.variable = new IdType(); // bb
4169          return this.variable;
4170        }
4171
4172        public boolean hasVariableElement() { 
4173          return this.variable != null && !this.variable.isEmpty();
4174        }
4175
4176        public boolean hasVariable() { 
4177          return this.variable != null && !this.variable.isEmpty();
4178        }
4179
4180        /**
4181         * @param value {@link #variable} (Named context for field, if desired, and a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value
4182         */
4183        public StructureMapGroupRuleTargetComponent setVariableElement(IdType value) { 
4184          this.variable = value;
4185          return this;
4186        }
4187
4188        /**
4189         * @return Named context for field, if desired, and a field is specified.
4190         */
4191        public String getVariable() { 
4192          return this.variable == null ? null : this.variable.getValue();
4193        }
4194
4195        /**
4196         * @param value Named context for field, if desired, and a field is specified.
4197         */
4198        public StructureMapGroupRuleTargetComponent setVariable(String value) { 
4199          if (Utilities.noString(value))
4200            this.variable = null;
4201          else {
4202            if (this.variable == null)
4203              this.variable = new IdType();
4204            this.variable.setValue(value);
4205          }
4206          return this;
4207        }
4208
4209        /**
4210         * @return {@link #listMode} (If field is a list, how to manage the list.)
4211         */
4212        public List<Enumeration<StructureMapTargetListMode>> getListMode() { 
4213          if (this.listMode == null)
4214            this.listMode = new ArrayList<Enumeration<StructureMapTargetListMode>>();
4215          return this.listMode;
4216        }
4217
4218        /**
4219         * @return Returns a reference to <code>this</code> for easy method chaining
4220         */
4221        public StructureMapGroupRuleTargetComponent setListMode(List<Enumeration<StructureMapTargetListMode>> theListMode) { 
4222          this.listMode = theListMode;
4223          return this;
4224        }
4225
4226        public boolean hasListMode() { 
4227          if (this.listMode == null)
4228            return false;
4229          for (Enumeration<StructureMapTargetListMode> item : this.listMode)
4230            if (!item.isEmpty())
4231              return true;
4232          return false;
4233        }
4234
4235        /**
4236         * @return {@link #listMode} (If field is a list, how to manage the list.)
4237         */
4238        public Enumeration<StructureMapTargetListMode> addListModeElement() {//2 
4239          Enumeration<StructureMapTargetListMode> t = new Enumeration<StructureMapTargetListMode>(new StructureMapTargetListModeEnumFactory());
4240          if (this.listMode == null)
4241            this.listMode = new ArrayList<Enumeration<StructureMapTargetListMode>>();
4242          this.listMode.add(t);
4243          return t;
4244        }
4245
4246        /**
4247         * @param value {@link #listMode} (If field is a list, how to manage the list.)
4248         */
4249        public StructureMapGroupRuleTargetComponent addListMode(StructureMapTargetListMode value) { //1
4250          Enumeration<StructureMapTargetListMode> t = new Enumeration<StructureMapTargetListMode>(new StructureMapTargetListModeEnumFactory());
4251          t.setValue(value);
4252          if (this.listMode == null)
4253            this.listMode = new ArrayList<Enumeration<StructureMapTargetListMode>>();
4254          this.listMode.add(t);
4255          return this;
4256        }
4257
4258        /**
4259         * @param value {@link #listMode} (If field is a list, how to manage the list.)
4260         */
4261        public boolean hasListMode(StructureMapTargetListMode value) { 
4262          if (this.listMode == null)
4263            return false;
4264          for (Enumeration<StructureMapTargetListMode> v : this.listMode)
4265            if (v.getValue().equals(value)) // code
4266              return true;
4267          return false;
4268        }
4269
4270        /**
4271         * @return {@link #listRuleId} (Internal rule reference for shared list items.). This is the underlying object with id, value and extensions. The accessor "getListRuleId" gives direct access to the value
4272         */
4273        public IdType getListRuleIdElement() { 
4274          if (this.listRuleId == null)
4275            if (Configuration.errorOnAutoCreate())
4276              throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.listRuleId");
4277            else if (Configuration.doAutoCreate())
4278              this.listRuleId = new IdType(); // bb
4279          return this.listRuleId;
4280        }
4281
4282        public boolean hasListRuleIdElement() { 
4283          return this.listRuleId != null && !this.listRuleId.isEmpty();
4284        }
4285
4286        public boolean hasListRuleId() { 
4287          return this.listRuleId != null && !this.listRuleId.isEmpty();
4288        }
4289
4290        /**
4291         * @param value {@link #listRuleId} (Internal rule reference for shared list items.). This is the underlying object with id, value and extensions. The accessor "getListRuleId" gives direct access to the value
4292         */
4293        public StructureMapGroupRuleTargetComponent setListRuleIdElement(IdType value) { 
4294          this.listRuleId = value;
4295          return this;
4296        }
4297
4298        /**
4299         * @return Internal rule reference for shared list items.
4300         */
4301        public String getListRuleId() { 
4302          return this.listRuleId == null ? null : this.listRuleId.getValue();
4303        }
4304
4305        /**
4306         * @param value Internal rule reference for shared list items.
4307         */
4308        public StructureMapGroupRuleTargetComponent setListRuleId(String value) { 
4309          if (Utilities.noString(value))
4310            this.listRuleId = null;
4311          else {
4312            if (this.listRuleId == null)
4313              this.listRuleId = new IdType();
4314            this.listRuleId.setValue(value);
4315          }
4316          return this;
4317        }
4318
4319        /**
4320         * @return {@link #transform} (How the data is copied / created.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value
4321         */
4322        public Enumeration<StructureMapTransform> getTransformElement() { 
4323          if (this.transform == null)
4324            if (Configuration.errorOnAutoCreate())
4325              throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.transform");
4326            else if (Configuration.doAutoCreate())
4327              this.transform = new Enumeration<StructureMapTransform>(new StructureMapTransformEnumFactory()); // bb
4328          return this.transform;
4329        }
4330
4331        public boolean hasTransformElement() { 
4332          return this.transform != null && !this.transform.isEmpty();
4333        }
4334
4335        public boolean hasTransform() { 
4336          return this.transform != null && !this.transform.isEmpty();
4337        }
4338
4339        /**
4340         * @param value {@link #transform} (How the data is copied / created.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value
4341         */
4342        public StructureMapGroupRuleTargetComponent setTransformElement(Enumeration<StructureMapTransform> value) { 
4343          this.transform = value;
4344          return this;
4345        }
4346
4347        /**
4348         * @return How the data is copied / created.
4349         */
4350        public StructureMapTransform getTransform() { 
4351          return this.transform == null ? null : this.transform.getValue();
4352        }
4353
4354        /**
4355         * @param value How the data is copied / created.
4356         */
4357        public StructureMapGroupRuleTargetComponent setTransform(StructureMapTransform value) { 
4358          if (value == null)
4359            this.transform = null;
4360          else {
4361            if (this.transform == null)
4362              this.transform = new Enumeration<StructureMapTransform>(new StructureMapTransformEnumFactory());
4363            this.transform.setValue(value);
4364          }
4365          return this;
4366        }
4367
4368        /**
4369         * @return {@link #parameter} (Parameters to the transform.)
4370         */
4371        public List<StructureMapGroupRuleTargetParameterComponent> getParameter() { 
4372          if (this.parameter == null)
4373            this.parameter = new ArrayList<StructureMapGroupRuleTargetParameterComponent>();
4374          return this.parameter;
4375        }
4376
4377        /**
4378         * @return Returns a reference to <code>this</code> for easy method chaining
4379         */
4380        public StructureMapGroupRuleTargetComponent setParameter(List<StructureMapGroupRuleTargetParameterComponent> theParameter) { 
4381          this.parameter = theParameter;
4382          return this;
4383        }
4384
4385        public boolean hasParameter() { 
4386          if (this.parameter == null)
4387            return false;
4388          for (StructureMapGroupRuleTargetParameterComponent item : this.parameter)
4389            if (!item.isEmpty())
4390              return true;
4391          return false;
4392        }
4393
4394        public StructureMapGroupRuleTargetParameterComponent addParameter() { //3
4395          StructureMapGroupRuleTargetParameterComponent t = new StructureMapGroupRuleTargetParameterComponent();
4396          if (this.parameter == null)
4397            this.parameter = new ArrayList<StructureMapGroupRuleTargetParameterComponent>();
4398          this.parameter.add(t);
4399          return t;
4400        }
4401
4402        public StructureMapGroupRuleTargetComponent addParameter(StructureMapGroupRuleTargetParameterComponent t) { //3
4403          if (t == null)
4404            return this;
4405          if (this.parameter == null)
4406            this.parameter = new ArrayList<StructureMapGroupRuleTargetParameterComponent>();
4407          this.parameter.add(t);
4408          return this;
4409        }
4410
4411        /**
4412         * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist
4413         */
4414        public StructureMapGroupRuleTargetParameterComponent getParameterFirstRep() { 
4415          if (getParameter().isEmpty()) {
4416            addParameter();
4417          }
4418          return getParameter().get(0);
4419        }
4420
4421        protected void listChildren(List<Property> children) {
4422          super.listChildren(children);
4423          children.add(new Property("context", "id", "Type or variable this rule applies to.", 0, 1, context));
4424          children.add(new Property("contextType", "code", "How to interpret the context.", 0, 1, contextType));
4425          children.add(new Property("element", "string", "Field to create in the context.", 0, 1, element));
4426          children.add(new Property("variable", "id", "Named context for field, if desired, and a field is specified.", 0, 1, variable));
4427          children.add(new Property("listMode", "code", "If field is a list, how to manage the list.", 0, java.lang.Integer.MAX_VALUE, listMode));
4428          children.add(new Property("listRuleId", "id", "Internal rule reference for shared list items.", 0, 1, listRuleId));
4429          children.add(new Property("transform", "code", "How the data is copied / created.", 0, 1, transform));
4430          children.add(new Property("parameter", "", "Parameters to the transform.", 0, java.lang.Integer.MAX_VALUE, parameter));
4431        }
4432
4433        @Override
4434        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4435          switch (_hash) {
4436          case 951530927: /*context*/  return new Property("context", "id", "Type or variable this rule applies to.", 0, 1, context);
4437          case -102839927: /*contextType*/  return new Property("contextType", "code", "How to interpret the context.", 0, 1, contextType);
4438          case -1662836996: /*element*/  return new Property("element", "string", "Field to create in the context.", 0, 1, element);
4439          case -1249586564: /*variable*/  return new Property("variable", "id", "Named context for field, if desired, and a field is specified.", 0, 1, variable);
4440          case 1345445729: /*listMode*/  return new Property("listMode", "code", "If field is a list, how to manage the list.", 0, java.lang.Integer.MAX_VALUE, listMode);
4441          case 337117045: /*listRuleId*/  return new Property("listRuleId", "id", "Internal rule reference for shared list items.", 0, 1, listRuleId);
4442          case 1052666732: /*transform*/  return new Property("transform", "code", "How the data is copied / created.", 0, 1, transform);
4443          case 1954460585: /*parameter*/  return new Property("parameter", "", "Parameters to the transform.", 0, java.lang.Integer.MAX_VALUE, parameter);
4444          default: return super.getNamedProperty(_hash, _name, _checkValid);
4445          }
4446
4447        }
4448
4449      @Override
4450      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4451        switch (hash) {
4452        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // IdType
4453        case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration<StructureMapContextType>
4454        case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // StringType
4455        case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : new Base[] {this.variable}; // IdType
4456        case 1345445729: /*listMode*/ return this.listMode == null ? new Base[0] : this.listMode.toArray(new Base[this.listMode.size()]); // Enumeration<StructureMapTargetListMode>
4457        case 337117045: /*listRuleId*/ return this.listRuleId == null ? new Base[0] : new Base[] {this.listRuleId}; // IdType
4458        case 1052666732: /*transform*/ return this.transform == null ? new Base[0] : new Base[] {this.transform}; // Enumeration<StructureMapTransform>
4459        case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // StructureMapGroupRuleTargetParameterComponent
4460        default: return super.getProperty(hash, name, checkValid);
4461        }
4462
4463      }
4464
4465      @Override
4466      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4467        switch (hash) {
4468        case 951530927: // context
4469          this.context = castToId(value); // IdType
4470          return value;
4471        case -102839927: // contextType
4472          value = new StructureMapContextTypeEnumFactory().fromType(castToCode(value));
4473          this.contextType = (Enumeration) value; // Enumeration<StructureMapContextType>
4474          return value;
4475        case -1662836996: // element
4476          this.element = castToString(value); // StringType
4477          return value;
4478        case -1249586564: // variable
4479          this.variable = castToId(value); // IdType
4480          return value;
4481        case 1345445729: // listMode
4482          value = new StructureMapTargetListModeEnumFactory().fromType(castToCode(value));
4483          this.getListMode().add((Enumeration) value); // Enumeration<StructureMapTargetListMode>
4484          return value;
4485        case 337117045: // listRuleId
4486          this.listRuleId = castToId(value); // IdType
4487          return value;
4488        case 1052666732: // transform
4489          value = new StructureMapTransformEnumFactory().fromType(castToCode(value));
4490          this.transform = (Enumeration) value; // Enumeration<StructureMapTransform>
4491          return value;
4492        case 1954460585: // parameter
4493          this.getParameter().add((StructureMapGroupRuleTargetParameterComponent) value); // StructureMapGroupRuleTargetParameterComponent
4494          return value;
4495        default: return super.setProperty(hash, name, value);
4496        }
4497
4498      }
4499
4500      @Override
4501      public Base setProperty(String name, Base value) throws FHIRException {
4502        if (name.equals("context")) {
4503          this.context = castToId(value); // IdType
4504        } else if (name.equals("contextType")) {
4505          value = new StructureMapContextTypeEnumFactory().fromType(castToCode(value));
4506          this.contextType = (Enumeration) value; // Enumeration<StructureMapContextType>
4507        } else if (name.equals("element")) {
4508          this.element = castToString(value); // StringType
4509        } else if (name.equals("variable")) {
4510          this.variable = castToId(value); // IdType
4511        } else if (name.equals("listMode")) {
4512          value = new StructureMapTargetListModeEnumFactory().fromType(castToCode(value));
4513          this.getListMode().add((Enumeration) value);
4514        } else if (name.equals("listRuleId")) {
4515          this.listRuleId = castToId(value); // IdType
4516        } else if (name.equals("transform")) {
4517          value = new StructureMapTransformEnumFactory().fromType(castToCode(value));
4518          this.transform = (Enumeration) value; // Enumeration<StructureMapTransform>
4519        } else if (name.equals("parameter")) {
4520          this.getParameter().add((StructureMapGroupRuleTargetParameterComponent) value);
4521        } else
4522          return super.setProperty(name, value);
4523        return value;
4524      }
4525
4526      @Override
4527      public Base makeProperty(int hash, String name) throws FHIRException {
4528        switch (hash) {
4529        case 951530927:  return getContextElement();
4530        case -102839927:  return getContextTypeElement();
4531        case -1662836996:  return getElementElement();
4532        case -1249586564:  return getVariableElement();
4533        case 1345445729:  return addListModeElement();
4534        case 337117045:  return getListRuleIdElement();
4535        case 1052666732:  return getTransformElement();
4536        case 1954460585:  return addParameter(); 
4537        default: return super.makeProperty(hash, name);
4538        }
4539
4540      }
4541
4542      @Override
4543      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4544        switch (hash) {
4545        case 951530927: /*context*/ return new String[] {"id"};
4546        case -102839927: /*contextType*/ return new String[] {"code"};
4547        case -1662836996: /*element*/ return new String[] {"string"};
4548        case -1249586564: /*variable*/ return new String[] {"id"};
4549        case 1345445729: /*listMode*/ return new String[] {"code"};
4550        case 337117045: /*listRuleId*/ return new String[] {"id"};
4551        case 1052666732: /*transform*/ return new String[] {"code"};
4552        case 1954460585: /*parameter*/ return new String[] {};
4553        default: return super.getTypesForProperty(hash, name);
4554        }
4555
4556      }
4557
4558      @Override
4559      public Base addChild(String name) throws FHIRException {
4560        if (name.equals("context")) {
4561          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.context");
4562        }
4563        else if (name.equals("contextType")) {
4564          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.contextType");
4565        }
4566        else if (name.equals("element")) {
4567          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.element");
4568        }
4569        else if (name.equals("variable")) {
4570          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable");
4571        }
4572        else if (name.equals("listMode")) {
4573          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listMode");
4574        }
4575        else if (name.equals("listRuleId")) {
4576          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listRuleId");
4577        }
4578        else if (name.equals("transform")) {
4579          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.transform");
4580        }
4581        else if (name.equals("parameter")) {
4582          return addParameter();
4583        }
4584        else
4585          return super.addChild(name);
4586      }
4587
4588      public StructureMapGroupRuleTargetComponent copy() {
4589        StructureMapGroupRuleTargetComponent dst = new StructureMapGroupRuleTargetComponent();
4590        copyValues(dst);
4591        dst.context = context == null ? null : context.copy();
4592        dst.contextType = contextType == null ? null : contextType.copy();
4593        dst.element = element == null ? null : element.copy();
4594        dst.variable = variable == null ? null : variable.copy();
4595        if (listMode != null) {
4596          dst.listMode = new ArrayList<Enumeration<StructureMapTargetListMode>>();
4597          for (Enumeration<StructureMapTargetListMode> i : listMode)
4598            dst.listMode.add(i.copy());
4599        };
4600        dst.listRuleId = listRuleId == null ? null : listRuleId.copy();
4601        dst.transform = transform == null ? null : transform.copy();
4602        if (parameter != null) {
4603          dst.parameter = new ArrayList<StructureMapGroupRuleTargetParameterComponent>();
4604          for (StructureMapGroupRuleTargetParameterComponent i : parameter)
4605            dst.parameter.add(i.copy());
4606        };
4607        return dst;
4608      }
4609
4610      @Override
4611      public boolean equalsDeep(Base other_) {
4612        if (!super.equalsDeep(other_))
4613          return false;
4614        if (!(other_ instanceof StructureMapGroupRuleTargetComponent))
4615          return false;
4616        StructureMapGroupRuleTargetComponent o = (StructureMapGroupRuleTargetComponent) other_;
4617        return compareDeep(context, o.context, true) && compareDeep(contextType, o.contextType, true) && compareDeep(element, o.element, true)
4618           && compareDeep(variable, o.variable, true) && compareDeep(listMode, o.listMode, true) && compareDeep(listRuleId, o.listRuleId, true)
4619           && compareDeep(transform, o.transform, true) && compareDeep(parameter, o.parameter, true);
4620      }
4621
4622      @Override
4623      public boolean equalsShallow(Base other_) {
4624        if (!super.equalsShallow(other_))
4625          return false;
4626        if (!(other_ instanceof StructureMapGroupRuleTargetComponent))
4627          return false;
4628        StructureMapGroupRuleTargetComponent o = (StructureMapGroupRuleTargetComponent) other_;
4629        return compareValues(context, o.context, true) && compareValues(contextType, o.contextType, true) && compareValues(element, o.element, true)
4630           && compareValues(variable, o.variable, true) && compareValues(listMode, o.listMode, true) && compareValues(listRuleId, o.listRuleId, true)
4631           && compareValues(transform, o.transform, true);
4632      }
4633
4634      public boolean isEmpty() {
4635        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(context, contextType, element
4636          , variable, listMode, listRuleId, transform, parameter);
4637      }
4638
4639  public String fhirType() {
4640    return "StructureMap.group.rule.target";
4641
4642  }
4643
4644// added from java-adornments.txt:
4645
4646  public String toString() {
4647    return StructureMapUtilities.targetToString(this);
4648  }
4649
4650
4651// end addition
4652  }
4653
4654    @Block()
4655    public static class StructureMapGroupRuleTargetParameterComponent extends BackboneElement implements IBaseBackboneElement {
4656        /**
4657         * Parameter value - variable or literal.
4658         */
4659        @Child(name = "value", type = {IdType.class, StringType.class, BooleanType.class, IntegerType.class, DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=true)
4660        @Description(shortDefinition="Parameter value - variable or literal", formalDefinition="Parameter value - variable or literal." )
4661        protected Type value;
4662
4663        private static final long serialVersionUID = -732981989L;
4664
4665    /**
4666     * Constructor
4667     */
4668      public StructureMapGroupRuleTargetParameterComponent() {
4669        super();
4670      }
4671
4672    /**
4673     * Constructor
4674     */
4675      public StructureMapGroupRuleTargetParameterComponent(Type value) {
4676        super();
4677        this.value = value;
4678      }
4679
4680        /**
4681         * @return {@link #value} (Parameter value - variable or literal.)
4682         */
4683        public Type getValue() { 
4684          return this.value;
4685        }
4686
4687        /**
4688         * @return {@link #value} (Parameter value - variable or literal.)
4689         */
4690        public IdType getValueIdType() throws FHIRException { 
4691          if (this.value == null)
4692            return null;
4693          if (!(this.value instanceof IdType))
4694            throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered");
4695          return (IdType) this.value;
4696        }
4697
4698        public boolean hasValueIdType() { 
4699          return this != null && this.value instanceof IdType;
4700        }
4701
4702        /**
4703         * @return {@link #value} (Parameter value - variable or literal.)
4704         */
4705        public StringType getValueStringType() throws FHIRException { 
4706          if (this.value == null)
4707            return null;
4708          if (!(this.value instanceof StringType))
4709            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
4710          return (StringType) this.value;
4711        }
4712
4713        public boolean hasValueStringType() { 
4714          return this != null && this.value instanceof StringType;
4715        }
4716
4717        /**
4718         * @return {@link #value} (Parameter value - variable or literal.)
4719         */
4720        public BooleanType getValueBooleanType() throws FHIRException { 
4721          if (this.value == null)
4722            return null;
4723          if (!(this.value instanceof BooleanType))
4724            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
4725          return (BooleanType) this.value;
4726        }
4727
4728        public boolean hasValueBooleanType() { 
4729          return this != null && this.value instanceof BooleanType;
4730        }
4731
4732        /**
4733         * @return {@link #value} (Parameter value - variable or literal.)
4734         */
4735        public IntegerType getValueIntegerType() throws FHIRException { 
4736          if (this.value == null)
4737            return null;
4738          if (!(this.value instanceof IntegerType))
4739            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
4740          return (IntegerType) this.value;
4741        }
4742
4743        public boolean hasValueIntegerType() { 
4744          return this != null && this.value instanceof IntegerType;
4745        }
4746
4747        /**
4748         * @return {@link #value} (Parameter value - variable or literal.)
4749         */
4750        public DecimalType getValueDecimalType() throws FHIRException { 
4751          if (this.value == null)
4752            return null;
4753          if (!(this.value instanceof DecimalType))
4754            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
4755          return (DecimalType) this.value;
4756        }
4757
4758        public boolean hasValueDecimalType() { 
4759          return this != null && this.value instanceof DecimalType;
4760        }
4761
4762        public boolean hasValue() { 
4763          return this.value != null && !this.value.isEmpty();
4764        }
4765
4766        /**
4767         * @param value {@link #value} (Parameter value - variable or literal.)
4768         */
4769        public StructureMapGroupRuleTargetParameterComponent setValue(Type value) throws FHIRFormatError { 
4770          if (value != null && !(value instanceof IdType || value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType || value instanceof DecimalType))
4771            throw new FHIRFormatError("Not the right type for StructureMap.group.rule.target.parameter.value[x]: "+value.fhirType());
4772          this.value = value;
4773          return this;
4774        }
4775
4776        protected void listChildren(List<Property> children) {
4777          super.listChildren(children);
4778          children.add(new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value));
4779        }
4780
4781        @Override
4782        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4783          switch (_hash) {
4784          case -1410166417: /*value[x]*/  return new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value);
4785          case 111972721: /*value*/  return new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value);
4786          case 231604844: /*valueId*/  return new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value);
4787          case -1424603934: /*valueString*/  return new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value);
4788          case 733421943: /*valueBoolean*/  return new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value);
4789          case -1668204915: /*valueInteger*/  return new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value);
4790          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, 1, value);
4791          default: return super.getNamedProperty(_hash, _name, _checkValid);
4792          }
4793
4794        }
4795
4796      @Override
4797      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4798        switch (hash) {
4799        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
4800        default: return super.getProperty(hash, name, checkValid);
4801        }
4802
4803      }
4804
4805      @Override
4806      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4807        switch (hash) {
4808        case 111972721: // value
4809          this.value = castToType(value); // Type
4810          return value;
4811        default: return super.setProperty(hash, name, value);
4812        }
4813
4814      }
4815
4816      @Override
4817      public Base setProperty(String name, Base value) throws FHIRException {
4818        if (name.equals("value[x]")) {
4819          this.value = castToType(value); // Type
4820        } else
4821          return super.setProperty(name, value);
4822        return value;
4823      }
4824
4825      @Override
4826      public Base makeProperty(int hash, String name) throws FHIRException {
4827        switch (hash) {
4828        case -1410166417:  return getValue(); 
4829        case 111972721:  return getValue(); 
4830        default: return super.makeProperty(hash, name);
4831        }
4832
4833      }
4834
4835      @Override
4836      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4837        switch (hash) {
4838        case 111972721: /*value*/ return new String[] {"id", "string", "boolean", "integer", "decimal"};
4839        default: return super.getTypesForProperty(hash, name);
4840        }
4841
4842      }
4843
4844      @Override
4845      public Base addChild(String name) throws FHIRException {
4846        if (name.equals("valueId")) {
4847          this.value = new IdType();
4848          return this.value;
4849        }
4850        else if (name.equals("valueString")) {
4851          this.value = new StringType();
4852          return this.value;
4853        }
4854        else if (name.equals("valueBoolean")) {
4855          this.value = new BooleanType();
4856          return this.value;
4857        }
4858        else if (name.equals("valueInteger")) {
4859          this.value = new IntegerType();
4860          return this.value;
4861        }
4862        else if (name.equals("valueDecimal")) {
4863          this.value = new DecimalType();
4864          return this.value;
4865        }
4866        else
4867          return super.addChild(name);
4868      }
4869
4870      public StructureMapGroupRuleTargetParameterComponent copy() {
4871        StructureMapGroupRuleTargetParameterComponent dst = new StructureMapGroupRuleTargetParameterComponent();
4872        copyValues(dst);
4873        dst.value = value == null ? null : value.copy();
4874        return dst;
4875      }
4876
4877      @Override
4878      public boolean equalsDeep(Base other_) {
4879        if (!super.equalsDeep(other_))
4880          return false;
4881        if (!(other_ instanceof StructureMapGroupRuleTargetParameterComponent))
4882          return false;
4883        StructureMapGroupRuleTargetParameterComponent o = (StructureMapGroupRuleTargetParameterComponent) other_;
4884        return compareDeep(value, o.value, true);
4885      }
4886
4887      @Override
4888      public boolean equalsShallow(Base other_) {
4889        if (!super.equalsShallow(other_))
4890          return false;
4891        if (!(other_ instanceof StructureMapGroupRuleTargetParameterComponent))
4892          return false;
4893        StructureMapGroupRuleTargetParameterComponent o = (StructureMapGroupRuleTargetParameterComponent) other_;
4894        return true;
4895      }
4896
4897      public boolean isEmpty() {
4898        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value);
4899      }
4900
4901  public String fhirType() {
4902    return "StructureMap.group.rule.target.parameter";
4903
4904  }
4905
4906// added from java-adornments.txt:
4907
4908      public String toString() {
4909        return value == null ? "null!" : value.toString();
4910      }
4911
4912
4913
4914// end addition
4915  }
4916
4917    @Block()
4918    public static class StructureMapGroupRuleDependentComponent extends BackboneElement implements IBaseBackboneElement {
4919        /**
4920         * Name of a rule or group to apply.
4921         */
4922        @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
4923        @Description(shortDefinition="Name of a rule or group to apply", formalDefinition="Name of a rule or group to apply." )
4924        protected IdType name;
4925
4926        /**
4927         * Variable to pass to the rule or group.
4928         */
4929        @Child(name = "variable", type = {StringType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4930        @Description(shortDefinition="Variable to pass to the rule or group", formalDefinition="Variable to pass to the rule or group." )
4931        protected List<StringType> variable;
4932
4933        private static final long serialVersionUID = 1021661591L;
4934
4935    /**
4936     * Constructor
4937     */
4938      public StructureMapGroupRuleDependentComponent() {
4939        super();
4940      }
4941
4942    /**
4943     * Constructor
4944     */
4945      public StructureMapGroupRuleDependentComponent(IdType name) {
4946        super();
4947        this.name = name;
4948      }
4949
4950        /**
4951         * @return {@link #name} (Name of a rule or group to apply.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4952         */
4953        public IdType getNameElement() { 
4954          if (this.name == null)
4955            if (Configuration.errorOnAutoCreate())
4956              throw new Error("Attempt to auto-create StructureMapGroupRuleDependentComponent.name");
4957            else if (Configuration.doAutoCreate())
4958              this.name = new IdType(); // bb
4959          return this.name;
4960        }
4961
4962        public boolean hasNameElement() { 
4963          return this.name != null && !this.name.isEmpty();
4964        }
4965
4966        public boolean hasName() { 
4967          return this.name != null && !this.name.isEmpty();
4968        }
4969
4970        /**
4971         * @param value {@link #name} (Name of a rule or group to apply.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4972         */
4973        public StructureMapGroupRuleDependentComponent setNameElement(IdType value) { 
4974          this.name = value;
4975          return this;
4976        }
4977
4978        /**
4979         * @return Name of a rule or group to apply.
4980         */
4981        public String getName() { 
4982          return this.name == null ? null : this.name.getValue();
4983        }
4984
4985        /**
4986         * @param value Name of a rule or group to apply.
4987         */
4988        public StructureMapGroupRuleDependentComponent setName(String value) { 
4989            if (this.name == null)
4990              this.name = new IdType();
4991            this.name.setValue(value);
4992          return this;
4993        }
4994
4995        /**
4996         * @return {@link #variable} (Variable to pass to the rule or group.)
4997         */
4998        public List<StringType> getVariable() { 
4999          if (this.variable == null)
5000            this.variable = new ArrayList<StringType>();
5001          return this.variable;
5002        }
5003
5004        /**
5005         * @return Returns a reference to <code>this</code> for easy method chaining
5006         */
5007        public StructureMapGroupRuleDependentComponent setVariable(List<StringType> theVariable) { 
5008          this.variable = theVariable;
5009          return this;
5010        }
5011
5012        public boolean hasVariable() { 
5013          if (this.variable == null)
5014            return false;
5015          for (StringType item : this.variable)
5016            if (!item.isEmpty())
5017              return true;
5018          return false;
5019        }
5020
5021        /**
5022         * @return {@link #variable} (Variable to pass to the rule or group.)
5023         */
5024        public StringType addVariableElement() {//2 
5025          StringType t = new StringType();
5026          if (this.variable == null)
5027            this.variable = new ArrayList<StringType>();
5028          this.variable.add(t);
5029          return t;
5030        }
5031
5032        /**
5033         * @param value {@link #variable} (Variable to pass to the rule or group.)
5034         */
5035        public StructureMapGroupRuleDependentComponent addVariable(String value) { //1
5036          StringType t = new StringType();
5037          t.setValue(value);
5038          if (this.variable == null)
5039            this.variable = new ArrayList<StringType>();
5040          this.variable.add(t);
5041          return this;
5042        }
5043
5044        /**
5045         * @param value {@link #variable} (Variable to pass to the rule or group.)
5046         */
5047        public boolean hasVariable(String value) { 
5048          if (this.variable == null)
5049            return false;
5050          for (StringType v : this.variable)
5051            if (v.getValue().equals(value)) // string
5052              return true;
5053          return false;
5054        }
5055
5056        protected void listChildren(List<Property> children) {
5057          super.listChildren(children);
5058          children.add(new Property("name", "id", "Name of a rule or group to apply.", 0, 1, name));
5059          children.add(new Property("variable", "string", "Variable to pass to the rule or group.", 0, java.lang.Integer.MAX_VALUE, variable));
5060        }
5061
5062        @Override
5063        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5064          switch (_hash) {
5065          case 3373707: /*name*/  return new Property("name", "id", "Name of a rule or group to apply.", 0, 1, name);
5066          case -1249586564: /*variable*/  return new Property("variable", "string", "Variable to pass to the rule or group.", 0, java.lang.Integer.MAX_VALUE, variable);
5067          default: return super.getNamedProperty(_hash, _name, _checkValid);
5068          }
5069
5070        }
5071
5072      @Override
5073      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5074        switch (hash) {
5075        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType
5076        case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : this.variable.toArray(new Base[this.variable.size()]); // StringType
5077        default: return super.getProperty(hash, name, checkValid);
5078        }
5079
5080      }
5081
5082      @Override
5083      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5084        switch (hash) {
5085        case 3373707: // name
5086          this.name = castToId(value); // IdType
5087          return value;
5088        case -1249586564: // variable
5089          this.getVariable().add(castToString(value)); // StringType
5090          return value;
5091        default: return super.setProperty(hash, name, value);
5092        }
5093
5094      }
5095
5096      @Override
5097      public Base setProperty(String name, Base value) throws FHIRException {
5098        if (name.equals("name")) {
5099          this.name = castToId(value); // IdType
5100        } else if (name.equals("variable")) {
5101          this.getVariable().add(castToString(value));
5102        } else
5103          return super.setProperty(name, value);
5104        return value;
5105      }
5106
5107      @Override
5108      public Base makeProperty(int hash, String name) throws FHIRException {
5109        switch (hash) {
5110        case 3373707:  return getNameElement();
5111        case -1249586564:  return addVariableElement();
5112        default: return super.makeProperty(hash, name);
5113        }
5114
5115      }
5116
5117      @Override
5118      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5119        switch (hash) {
5120        case 3373707: /*name*/ return new String[] {"id"};
5121        case -1249586564: /*variable*/ return new String[] {"string"};
5122        default: return super.getTypesForProperty(hash, name);
5123        }
5124
5125      }
5126
5127      @Override
5128      public Base addChild(String name) throws FHIRException {
5129        if (name.equals("name")) {
5130          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name");
5131        }
5132        else if (name.equals("variable")) {
5133          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable");
5134        }
5135        else
5136          return super.addChild(name);
5137      }
5138
5139      public StructureMapGroupRuleDependentComponent copy() {
5140        StructureMapGroupRuleDependentComponent dst = new StructureMapGroupRuleDependentComponent();
5141        copyValues(dst);
5142        dst.name = name == null ? null : name.copy();
5143        if (variable != null) {
5144          dst.variable = new ArrayList<StringType>();
5145          for (StringType i : variable)
5146            dst.variable.add(i.copy());
5147        };
5148        return dst;
5149      }
5150
5151      @Override
5152      public boolean equalsDeep(Base other_) {
5153        if (!super.equalsDeep(other_))
5154          return false;
5155        if (!(other_ instanceof StructureMapGroupRuleDependentComponent))
5156          return false;
5157        StructureMapGroupRuleDependentComponent o = (StructureMapGroupRuleDependentComponent) other_;
5158        return compareDeep(name, o.name, true) && compareDeep(variable, o.variable, true);
5159      }
5160
5161      @Override
5162      public boolean equalsShallow(Base other_) {
5163        if (!super.equalsShallow(other_))
5164          return false;
5165        if (!(other_ instanceof StructureMapGroupRuleDependentComponent))
5166          return false;
5167        StructureMapGroupRuleDependentComponent o = (StructureMapGroupRuleDependentComponent) other_;
5168        return compareValues(name, o.name, true) && compareValues(variable, o.variable, true);
5169      }
5170
5171      public boolean isEmpty() {
5172        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, variable);
5173      }
5174
5175  public String fhirType() {
5176    return "StructureMap.group.rule.dependent";
5177
5178  }
5179
5180  }
5181
5182    /**
5183     * A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance.
5184     */
5185    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5186    @Description(shortDefinition="Additional identifier for the structure map", formalDefinition="A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance." )
5187    protected List<Identifier> identifier;
5188
5189    /**
5190     * Explaination of why this structure map is needed and why it has been designed as it has.
5191     */
5192    @Child(name = "purpose", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
5193    @Description(shortDefinition="Why this structure map is defined", formalDefinition="Explaination of why this structure map is needed and why it has been designed as it has." )
5194    protected MarkdownType purpose;
5195
5196    /**
5197     * A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.
5198     */
5199    @Child(name = "copyright", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5200    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map." )
5201    protected MarkdownType copyright;
5202
5203    /**
5204     * A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.
5205     */
5206    @Child(name = "structure", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5207    @Description(shortDefinition="Structure Definition used by this map", formalDefinition="A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced." )
5208    protected List<StructureMapStructureComponent> structure;
5209
5210    /**
5211     * Other maps used by this map (canonical URLs).
5212     */
5213    @Child(name = "import", type = {UriType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5214    @Description(shortDefinition="Other maps used by this map (canonical URLs)", formalDefinition="Other maps used by this map (canonical URLs)." )
5215    protected List<UriType> import_;
5216
5217    /**
5218     * Organizes the mapping into managable chunks for human review/ease of maintenance.
5219     */
5220    @Child(name = "group", type = {}, order=5, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5221    @Description(shortDefinition="Named sections for reader convenience", formalDefinition="Organizes the mapping into managable chunks for human review/ease of maintenance." )
5222    protected List<StructureMapGroupComponent> group;
5223
5224    private static final long serialVersionUID = 952506557L;
5225
5226  /**
5227   * Constructor
5228   */
5229    public StructureMap() {
5230      super();
5231    }
5232
5233  /**
5234   * Constructor
5235   */
5236    public StructureMap(UriType url, StringType name, Enumeration<PublicationStatus> status) {
5237      super();
5238      this.url = url;
5239      this.name = name;
5240      this.status = status;
5241    }
5242
5243    /**
5244     * @return {@link #url} (An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. The URL SHOULD include the major version of the structure map. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5245     */
5246    public UriType getUrlElement() { 
5247      if (this.url == null)
5248        if (Configuration.errorOnAutoCreate())
5249          throw new Error("Attempt to auto-create StructureMap.url");
5250        else if (Configuration.doAutoCreate())
5251          this.url = new UriType(); // bb
5252      return this.url;
5253    }
5254
5255    public boolean hasUrlElement() { 
5256      return this.url != null && !this.url.isEmpty();
5257    }
5258
5259    public boolean hasUrl() { 
5260      return this.url != null && !this.url.isEmpty();
5261    }
5262
5263    /**
5264     * @param value {@link #url} (An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. The URL SHOULD include the major version of the structure map. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5265     */
5266    public StructureMap setUrlElement(UriType value) { 
5267      this.url = value;
5268      return this;
5269    }
5270
5271    /**
5272     * @return An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. The URL SHOULD include the major version of the structure map. For more information see [Technical and Business Versions](resource.html#versions).
5273     */
5274    public String getUrl() { 
5275      return this.url == null ? null : this.url.getValue();
5276    }
5277
5278    /**
5279     * @param value An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. The URL SHOULD include the major version of the structure map. For more information see [Technical and Business Versions](resource.html#versions).
5280     */
5281    public StructureMap setUrl(String value) { 
5282        if (this.url == null)
5283          this.url = new UriType();
5284        this.url.setValue(value);
5285      return this;
5286    }
5287
5288    /**
5289     * @return {@link #identifier} (A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance.)
5290     */
5291    public List<Identifier> getIdentifier() { 
5292      if (this.identifier == null)
5293        this.identifier = new ArrayList<Identifier>();
5294      return this.identifier;
5295    }
5296
5297    /**
5298     * @return Returns a reference to <code>this</code> for easy method chaining
5299     */
5300    public StructureMap setIdentifier(List<Identifier> theIdentifier) { 
5301      this.identifier = theIdentifier;
5302      return this;
5303    }
5304
5305    public boolean hasIdentifier() { 
5306      if (this.identifier == null)
5307        return false;
5308      for (Identifier item : this.identifier)
5309        if (!item.isEmpty())
5310          return true;
5311      return false;
5312    }
5313
5314    public Identifier addIdentifier() { //3
5315      Identifier t = new Identifier();
5316      if (this.identifier == null)
5317        this.identifier = new ArrayList<Identifier>();
5318      this.identifier.add(t);
5319      return t;
5320    }
5321
5322    public StructureMap addIdentifier(Identifier t) { //3
5323      if (t == null)
5324        return this;
5325      if (this.identifier == null)
5326        this.identifier = new ArrayList<Identifier>();
5327      this.identifier.add(t);
5328      return this;
5329    }
5330
5331    /**
5332     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
5333     */
5334    public Identifier getIdentifierFirstRep() { 
5335      if (getIdentifier().isEmpty()) {
5336        addIdentifier();
5337      }
5338      return getIdentifier().get(0);
5339    }
5340
5341    /**
5342     * @return {@link #version} (The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
5343     */
5344    public StringType getVersionElement() { 
5345      if (this.version == null)
5346        if (Configuration.errorOnAutoCreate())
5347          throw new Error("Attempt to auto-create StructureMap.version");
5348        else if (Configuration.doAutoCreate())
5349          this.version = new StringType(); // bb
5350      return this.version;
5351    }
5352
5353    public boolean hasVersionElement() { 
5354      return this.version != null && !this.version.isEmpty();
5355    }
5356
5357    public boolean hasVersion() { 
5358      return this.version != null && !this.version.isEmpty();
5359    }
5360
5361    /**
5362     * @param value {@link #version} (The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
5363     */
5364    public StructureMap setVersionElement(StringType value) { 
5365      this.version = value;
5366      return this;
5367    }
5368
5369    /**
5370     * @return The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
5371     */
5372    public String getVersion() { 
5373      return this.version == null ? null : this.version.getValue();
5374    }
5375
5376    /**
5377     * @param value The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
5378     */
5379    public StructureMap setVersion(String value) { 
5380      if (Utilities.noString(value))
5381        this.version = null;
5382      else {
5383        if (this.version == null)
5384          this.version = new StringType();
5385        this.version.setValue(value);
5386      }
5387      return this;
5388    }
5389
5390    /**
5391     * @return {@link #name} (A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5392     */
5393    public StringType getNameElement() { 
5394      if (this.name == null)
5395        if (Configuration.errorOnAutoCreate())
5396          throw new Error("Attempt to auto-create StructureMap.name");
5397        else if (Configuration.doAutoCreate())
5398          this.name = new StringType(); // bb
5399      return this.name;
5400    }
5401
5402    public boolean hasNameElement() { 
5403      return this.name != null && !this.name.isEmpty();
5404    }
5405
5406    public boolean hasName() { 
5407      return this.name != null && !this.name.isEmpty();
5408    }
5409
5410    /**
5411     * @param value {@link #name} (A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5412     */
5413    public StructureMap setNameElement(StringType value) { 
5414      this.name = value;
5415      return this;
5416    }
5417
5418    /**
5419     * @return A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.
5420     */
5421    public String getName() { 
5422      return this.name == null ? null : this.name.getValue();
5423    }
5424
5425    /**
5426     * @param value A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.
5427     */
5428    public StructureMap setName(String value) { 
5429        if (this.name == null)
5430          this.name = new StringType();
5431        this.name.setValue(value);
5432      return this;
5433    }
5434
5435    /**
5436     * @return {@link #title} (A short, descriptive, user-friendly title for the structure map.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
5437     */
5438    public StringType getTitleElement() { 
5439      if (this.title == null)
5440        if (Configuration.errorOnAutoCreate())
5441          throw new Error("Attempt to auto-create StructureMap.title");
5442        else if (Configuration.doAutoCreate())
5443          this.title = new StringType(); // bb
5444      return this.title;
5445    }
5446
5447    public boolean hasTitleElement() { 
5448      return this.title != null && !this.title.isEmpty();
5449    }
5450
5451    public boolean hasTitle() { 
5452      return this.title != null && !this.title.isEmpty();
5453    }
5454
5455    /**
5456     * @param value {@link #title} (A short, descriptive, user-friendly title for the structure map.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
5457     */
5458    public StructureMap setTitleElement(StringType value) { 
5459      this.title = value;
5460      return this;
5461    }
5462
5463    /**
5464     * @return A short, descriptive, user-friendly title for the structure map.
5465     */
5466    public String getTitle() { 
5467      return this.title == null ? null : this.title.getValue();
5468    }
5469
5470    /**
5471     * @param value A short, descriptive, user-friendly title for the structure map.
5472     */
5473    public StructureMap setTitle(String value) { 
5474      if (Utilities.noString(value))
5475        this.title = null;
5476      else {
5477        if (this.title == null)
5478          this.title = new StringType();
5479        this.title.setValue(value);
5480      }
5481      return this;
5482    }
5483
5484    /**
5485     * @return {@link #status} (The status of this structure map. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
5486     */
5487    public Enumeration<PublicationStatus> getStatusElement() { 
5488      if (this.status == null)
5489        if (Configuration.errorOnAutoCreate())
5490          throw new Error("Attempt to auto-create StructureMap.status");
5491        else if (Configuration.doAutoCreate())
5492          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
5493      return this.status;
5494    }
5495
5496    public boolean hasStatusElement() { 
5497      return this.status != null && !this.status.isEmpty();
5498    }
5499
5500    public boolean hasStatus() { 
5501      return this.status != null && !this.status.isEmpty();
5502    }
5503
5504    /**
5505     * @param value {@link #status} (The status of this structure map. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
5506     */
5507    public StructureMap setStatusElement(Enumeration<PublicationStatus> value) { 
5508      this.status = value;
5509      return this;
5510    }
5511
5512    /**
5513     * @return The status of this structure map. Enables tracking the life-cycle of the content.
5514     */
5515    public PublicationStatus getStatus() { 
5516      return this.status == null ? null : this.status.getValue();
5517    }
5518
5519    /**
5520     * @param value The status of this structure map. Enables tracking the life-cycle of the content.
5521     */
5522    public StructureMap setStatus(PublicationStatus value) { 
5523        if (this.status == null)
5524          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
5525        this.status.setValue(value);
5526      return this;
5527    }
5528
5529    /**
5530     * @return {@link #experimental} (A boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
5531     */
5532    public BooleanType getExperimentalElement() { 
5533      if (this.experimental == null)
5534        if (Configuration.errorOnAutoCreate())
5535          throw new Error("Attempt to auto-create StructureMap.experimental");
5536        else if (Configuration.doAutoCreate())
5537          this.experimental = new BooleanType(); // bb
5538      return this.experimental;
5539    }
5540
5541    public boolean hasExperimentalElement() { 
5542      return this.experimental != null && !this.experimental.isEmpty();
5543    }
5544
5545    public boolean hasExperimental() { 
5546      return this.experimental != null && !this.experimental.isEmpty();
5547    }
5548
5549    /**
5550     * @param value {@link #experimental} (A boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
5551     */
5552    public StructureMap setExperimentalElement(BooleanType value) { 
5553      this.experimental = value;
5554      return this;
5555    }
5556
5557    /**
5558     * @return A boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
5559     */
5560    public boolean getExperimental() { 
5561      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
5562    }
5563
5564    /**
5565     * @param value A boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
5566     */
5567    public StructureMap setExperimental(boolean value) { 
5568        if (this.experimental == null)
5569          this.experimental = new BooleanType();
5570        this.experimental.setValue(value);
5571      return this;
5572    }
5573
5574    /**
5575     * @return {@link #date} (The date  (and optionally time) when the structure map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5576     */
5577    public DateTimeType getDateElement() { 
5578      if (this.date == null)
5579        if (Configuration.errorOnAutoCreate())
5580          throw new Error("Attempt to auto-create StructureMap.date");
5581        else if (Configuration.doAutoCreate())
5582          this.date = new DateTimeType(); // bb
5583      return this.date;
5584    }
5585
5586    public boolean hasDateElement() { 
5587      return this.date != null && !this.date.isEmpty();
5588    }
5589
5590    public boolean hasDate() { 
5591      return this.date != null && !this.date.isEmpty();
5592    }
5593
5594    /**
5595     * @param value {@link #date} (The date  (and optionally time) when the structure map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5596     */
5597    public StructureMap setDateElement(DateTimeType value) { 
5598      this.date = value;
5599      return this;
5600    }
5601
5602    /**
5603     * @return The date  (and optionally time) when the structure map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.
5604     */
5605    public Date getDate() { 
5606      return this.date == null ? null : this.date.getValue();
5607    }
5608
5609    /**
5610     * @param value The date  (and optionally time) when the structure map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.
5611     */
5612    public StructureMap setDate(Date value) { 
5613      if (value == null)
5614        this.date = null;
5615      else {
5616        if (this.date == null)
5617          this.date = new DateTimeType();
5618        this.date.setValue(value);
5619      }
5620      return this;
5621    }
5622
5623    /**
5624     * @return {@link #publisher} (The name of the individual or organization that published the structure map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
5625     */
5626    public StringType getPublisherElement() { 
5627      if (this.publisher == null)
5628        if (Configuration.errorOnAutoCreate())
5629          throw new Error("Attempt to auto-create StructureMap.publisher");
5630        else if (Configuration.doAutoCreate())
5631          this.publisher = new StringType(); // bb
5632      return this.publisher;
5633    }
5634
5635    public boolean hasPublisherElement() { 
5636      return this.publisher != null && !this.publisher.isEmpty();
5637    }
5638
5639    public boolean hasPublisher() { 
5640      return this.publisher != null && !this.publisher.isEmpty();
5641    }
5642
5643    /**
5644     * @param value {@link #publisher} (The name of the individual or organization that published the structure map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
5645     */
5646    public StructureMap setPublisherElement(StringType value) { 
5647      this.publisher = value;
5648      return this;
5649    }
5650
5651    /**
5652     * @return The name of the individual or organization that published the structure map.
5653     */
5654    public String getPublisher() { 
5655      return this.publisher == null ? null : this.publisher.getValue();
5656    }
5657
5658    /**
5659     * @param value The name of the individual or organization that published the structure map.
5660     */
5661    public StructureMap setPublisher(String value) { 
5662      if (Utilities.noString(value))
5663        this.publisher = null;
5664      else {
5665        if (this.publisher == null)
5666          this.publisher = new StringType();
5667        this.publisher.setValue(value);
5668      }
5669      return this;
5670    }
5671
5672    /**
5673     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
5674     */
5675    public List<ContactDetail> getContact() { 
5676      if (this.contact == null)
5677        this.contact = new ArrayList<ContactDetail>();
5678      return this.contact;
5679    }
5680
5681    /**
5682     * @return Returns a reference to <code>this</code> for easy method chaining
5683     */
5684    public StructureMap setContact(List<ContactDetail> theContact) { 
5685      this.contact = theContact;
5686      return this;
5687    }
5688
5689    public boolean hasContact() { 
5690      if (this.contact == null)
5691        return false;
5692      for (ContactDetail item : this.contact)
5693        if (!item.isEmpty())
5694          return true;
5695      return false;
5696    }
5697
5698    public ContactDetail addContact() { //3
5699      ContactDetail t = new ContactDetail();
5700      if (this.contact == null)
5701        this.contact = new ArrayList<ContactDetail>();
5702      this.contact.add(t);
5703      return t;
5704    }
5705
5706    public StructureMap addContact(ContactDetail t) { //3
5707      if (t == null)
5708        return this;
5709      if (this.contact == null)
5710        this.contact = new ArrayList<ContactDetail>();
5711      this.contact.add(t);
5712      return this;
5713    }
5714
5715    /**
5716     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
5717     */
5718    public ContactDetail getContactFirstRep() { 
5719      if (getContact().isEmpty()) {
5720        addContact();
5721      }
5722      return getContact().get(0);
5723    }
5724
5725    /**
5726     * @return {@link #description} (A free text natural language description of the structure map from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
5727     */
5728    public MarkdownType getDescriptionElement() { 
5729      if (this.description == null)
5730        if (Configuration.errorOnAutoCreate())
5731          throw new Error("Attempt to auto-create StructureMap.description");
5732        else if (Configuration.doAutoCreate())
5733          this.description = new MarkdownType(); // bb
5734      return this.description;
5735    }
5736
5737    public boolean hasDescriptionElement() { 
5738      return this.description != null && !this.description.isEmpty();
5739    }
5740
5741    public boolean hasDescription() { 
5742      return this.description != null && !this.description.isEmpty();
5743    }
5744
5745    /**
5746     * @param value {@link #description} (A free text natural language description of the structure map from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
5747     */
5748    public StructureMap setDescriptionElement(MarkdownType value) { 
5749      this.description = value;
5750      return this;
5751    }
5752
5753    /**
5754     * @return A free text natural language description of the structure map from a consumer's perspective.
5755     */
5756    public String getDescription() { 
5757      return this.description == null ? null : this.description.getValue();
5758    }
5759
5760    /**
5761     * @param value A free text natural language description of the structure map from a consumer's perspective.
5762     */
5763    public StructureMap setDescription(String value) { 
5764      if (value == null)
5765        this.description = null;
5766      else {
5767        if (this.description == null)
5768          this.description = new MarkdownType();
5769        this.description.setValue(value);
5770      }
5771      return this;
5772    }
5773
5774    /**
5775     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure map instances.)
5776     */
5777    public List<UsageContext> getUseContext() { 
5778      if (this.useContext == null)
5779        this.useContext = new ArrayList<UsageContext>();
5780      return this.useContext;
5781    }
5782
5783    /**
5784     * @return Returns a reference to <code>this</code> for easy method chaining
5785     */
5786    public StructureMap setUseContext(List<UsageContext> theUseContext) { 
5787      this.useContext = theUseContext;
5788      return this;
5789    }
5790
5791    public boolean hasUseContext() { 
5792      if (this.useContext == null)
5793        return false;
5794      for (UsageContext item : this.useContext)
5795        if (!item.isEmpty())
5796          return true;
5797      return false;
5798    }
5799
5800    public UsageContext addUseContext() { //3
5801      UsageContext t = new UsageContext();
5802      if (this.useContext == null)
5803        this.useContext = new ArrayList<UsageContext>();
5804      this.useContext.add(t);
5805      return t;
5806    }
5807
5808    public StructureMap addUseContext(UsageContext t) { //3
5809      if (t == null)
5810        return this;
5811      if (this.useContext == null)
5812        this.useContext = new ArrayList<UsageContext>();
5813      this.useContext.add(t);
5814      return this;
5815    }
5816
5817    /**
5818     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
5819     */
5820    public UsageContext getUseContextFirstRep() { 
5821      if (getUseContext().isEmpty()) {
5822        addUseContext();
5823      }
5824      return getUseContext().get(0);
5825    }
5826
5827    /**
5828     * @return {@link #jurisdiction} (A legal or geographic region in which the structure map is intended to be used.)
5829     */
5830    public List<CodeableConcept> getJurisdiction() { 
5831      if (this.jurisdiction == null)
5832        this.jurisdiction = new ArrayList<CodeableConcept>();
5833      return this.jurisdiction;
5834    }
5835
5836    /**
5837     * @return Returns a reference to <code>this</code> for easy method chaining
5838     */
5839    public StructureMap setJurisdiction(List<CodeableConcept> theJurisdiction) { 
5840      this.jurisdiction = theJurisdiction;
5841      return this;
5842    }
5843
5844    public boolean hasJurisdiction() { 
5845      if (this.jurisdiction == null)
5846        return false;
5847      for (CodeableConcept item : this.jurisdiction)
5848        if (!item.isEmpty())
5849          return true;
5850      return false;
5851    }
5852
5853    public CodeableConcept addJurisdiction() { //3
5854      CodeableConcept t = new CodeableConcept();
5855      if (this.jurisdiction == null)
5856        this.jurisdiction = new ArrayList<CodeableConcept>();
5857      this.jurisdiction.add(t);
5858      return t;
5859    }
5860
5861    public StructureMap addJurisdiction(CodeableConcept t) { //3
5862      if (t == null)
5863        return this;
5864      if (this.jurisdiction == null)
5865        this.jurisdiction = new ArrayList<CodeableConcept>();
5866      this.jurisdiction.add(t);
5867      return this;
5868    }
5869
5870    /**
5871     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
5872     */
5873    public CodeableConcept getJurisdictionFirstRep() { 
5874      if (getJurisdiction().isEmpty()) {
5875        addJurisdiction();
5876      }
5877      return getJurisdiction().get(0);
5878    }
5879
5880    /**
5881     * @return {@link #purpose} (Explaination of why this structure map is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
5882     */
5883    public MarkdownType getPurposeElement() { 
5884      if (this.purpose == null)
5885        if (Configuration.errorOnAutoCreate())
5886          throw new Error("Attempt to auto-create StructureMap.purpose");
5887        else if (Configuration.doAutoCreate())
5888          this.purpose = new MarkdownType(); // bb
5889      return this.purpose;
5890    }
5891
5892    public boolean hasPurposeElement() { 
5893      return this.purpose != null && !this.purpose.isEmpty();
5894    }
5895
5896    public boolean hasPurpose() { 
5897      return this.purpose != null && !this.purpose.isEmpty();
5898    }
5899
5900    /**
5901     * @param value {@link #purpose} (Explaination of why this structure map is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
5902     */
5903    public StructureMap setPurposeElement(MarkdownType value) { 
5904      this.purpose = value;
5905      return this;
5906    }
5907
5908    /**
5909     * @return Explaination of why this structure map is needed and why it has been designed as it has.
5910     */
5911    public String getPurpose() { 
5912      return this.purpose == null ? null : this.purpose.getValue();
5913    }
5914
5915    /**
5916     * @param value Explaination of why this structure map is needed and why it has been designed as it has.
5917     */
5918    public StructureMap setPurpose(String value) { 
5919      if (value == null)
5920        this.purpose = null;
5921      else {
5922        if (this.purpose == null)
5923          this.purpose = new MarkdownType();
5924        this.purpose.setValue(value);
5925      }
5926      return this;
5927    }
5928
5929    /**
5930     * @return {@link #copyright} (A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
5931     */
5932    public MarkdownType getCopyrightElement() { 
5933      if (this.copyright == null)
5934        if (Configuration.errorOnAutoCreate())
5935          throw new Error("Attempt to auto-create StructureMap.copyright");
5936        else if (Configuration.doAutoCreate())
5937          this.copyright = new MarkdownType(); // bb
5938      return this.copyright;
5939    }
5940
5941    public boolean hasCopyrightElement() { 
5942      return this.copyright != null && !this.copyright.isEmpty();
5943    }
5944
5945    public boolean hasCopyright() { 
5946      return this.copyright != null && !this.copyright.isEmpty();
5947    }
5948
5949    /**
5950     * @param value {@link #copyright} (A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
5951     */
5952    public StructureMap setCopyrightElement(MarkdownType value) { 
5953      this.copyright = value;
5954      return this;
5955    }
5956
5957    /**
5958     * @return A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.
5959     */
5960    public String getCopyright() { 
5961      return this.copyright == null ? null : this.copyright.getValue();
5962    }
5963
5964    /**
5965     * @param value A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.
5966     */
5967    public StructureMap setCopyright(String value) { 
5968      if (value == null)
5969        this.copyright = null;
5970      else {
5971        if (this.copyright == null)
5972          this.copyright = new MarkdownType();
5973        this.copyright.setValue(value);
5974      }
5975      return this;
5976    }
5977
5978    /**
5979     * @return {@link #structure} (A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.)
5980     */
5981    public List<StructureMapStructureComponent> getStructure() { 
5982      if (this.structure == null)
5983        this.structure = new ArrayList<StructureMapStructureComponent>();
5984      return this.structure;
5985    }
5986
5987    /**
5988     * @return Returns a reference to <code>this</code> for easy method chaining
5989     */
5990    public StructureMap setStructure(List<StructureMapStructureComponent> theStructure) { 
5991      this.structure = theStructure;
5992      return this;
5993    }
5994
5995    public boolean hasStructure() { 
5996      if (this.structure == null)
5997        return false;
5998      for (StructureMapStructureComponent item : this.structure)
5999        if (!item.isEmpty())
6000          return true;
6001      return false;
6002    }
6003
6004    public StructureMapStructureComponent addStructure() { //3
6005      StructureMapStructureComponent t = new StructureMapStructureComponent();
6006      if (this.structure == null)
6007        this.structure = new ArrayList<StructureMapStructureComponent>();
6008      this.structure.add(t);
6009      return t;
6010    }
6011
6012    public StructureMap addStructure(StructureMapStructureComponent t) { //3
6013      if (t == null)
6014        return this;
6015      if (this.structure == null)
6016        this.structure = new ArrayList<StructureMapStructureComponent>();
6017      this.structure.add(t);
6018      return this;
6019    }
6020
6021    /**
6022     * @return The first repetition of repeating field {@link #structure}, creating it if it does not already exist
6023     */
6024    public StructureMapStructureComponent getStructureFirstRep() { 
6025      if (getStructure().isEmpty()) {
6026        addStructure();
6027      }
6028      return getStructure().get(0);
6029    }
6030
6031    /**
6032     * @return {@link #import_} (Other maps used by this map (canonical URLs).)
6033     */
6034    public List<UriType> getImport() { 
6035      if (this.import_ == null)
6036        this.import_ = new ArrayList<UriType>();
6037      return this.import_;
6038    }
6039
6040    /**
6041     * @return Returns a reference to <code>this</code> for easy method chaining
6042     */
6043    public StructureMap setImport(List<UriType> theImport) { 
6044      this.import_ = theImport;
6045      return this;
6046    }
6047
6048    public boolean hasImport() { 
6049      if (this.import_ == null)
6050        return false;
6051      for (UriType item : this.import_)
6052        if (!item.isEmpty())
6053          return true;
6054      return false;
6055    }
6056
6057    /**
6058     * @return {@link #import_} (Other maps used by this map (canonical URLs).)
6059     */
6060    public UriType addImportElement() {//2 
6061      UriType t = new UriType();
6062      if (this.import_ == null)
6063        this.import_ = new ArrayList<UriType>();
6064      this.import_.add(t);
6065      return t;
6066    }
6067
6068    /**
6069     * @param value {@link #import_} (Other maps used by this map (canonical URLs).)
6070     */
6071    public StructureMap addImport(String value) { //1
6072      UriType t = new UriType();
6073      t.setValue(value);
6074      if (this.import_ == null)
6075        this.import_ = new ArrayList<UriType>();
6076      this.import_.add(t);
6077      return this;
6078    }
6079
6080    /**
6081     * @param value {@link #import_} (Other maps used by this map (canonical URLs).)
6082     */
6083    public boolean hasImport(String value) { 
6084      if (this.import_ == null)
6085        return false;
6086      for (UriType v : this.import_)
6087        if (v.getValue().equals(value)) // uri
6088          return true;
6089      return false;
6090    }
6091
6092    /**
6093     * @return {@link #group} (Organizes the mapping into managable chunks for human review/ease of maintenance.)
6094     */
6095    public List<StructureMapGroupComponent> getGroup() { 
6096      if (this.group == null)
6097        this.group = new ArrayList<StructureMapGroupComponent>();
6098      return this.group;
6099    }
6100
6101    /**
6102     * @return Returns a reference to <code>this</code> for easy method chaining
6103     */
6104    public StructureMap setGroup(List<StructureMapGroupComponent> theGroup) { 
6105      this.group = theGroup;
6106      return this;
6107    }
6108
6109    public boolean hasGroup() { 
6110      if (this.group == null)
6111        return false;
6112      for (StructureMapGroupComponent item : this.group)
6113        if (!item.isEmpty())
6114          return true;
6115      return false;
6116    }
6117
6118    public StructureMapGroupComponent addGroup() { //3
6119      StructureMapGroupComponent t = new StructureMapGroupComponent();
6120      if (this.group == null)
6121        this.group = new ArrayList<StructureMapGroupComponent>();
6122      this.group.add(t);
6123      return t;
6124    }
6125
6126    public StructureMap addGroup(StructureMapGroupComponent t) { //3
6127      if (t == null)
6128        return this;
6129      if (this.group == null)
6130        this.group = new ArrayList<StructureMapGroupComponent>();
6131      this.group.add(t);
6132      return this;
6133    }
6134
6135    /**
6136     * @return The first repetition of repeating field {@link #group}, creating it if it does not already exist
6137     */
6138    public StructureMapGroupComponent getGroupFirstRep() { 
6139      if (getGroup().isEmpty()) {
6140        addGroup();
6141      }
6142      return getGroup().get(0);
6143    }
6144
6145      protected void listChildren(List<Property> children) {
6146        super.listChildren(children);
6147        children.add(new Property("url", "uri", "An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. The URL SHOULD include the major version of the structure map. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url));
6148        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
6149        children.add(new Property("version", "string", "The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
6150        children.add(new Property("name", "string", "A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
6151        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the structure map.", 0, 1, title));
6152        children.add(new Property("status", "code", "The status of this structure map. Enables tracking the life-cycle of the content.", 0, 1, status));
6153        children.add(new Property("experimental", "boolean", "A boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
6154        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the structure map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.", 0, 1, date));
6155        children.add(new Property("publisher", "string", "The name of the individual or organization that published the structure map.", 0, 1, publisher));
6156        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
6157        children.add(new Property("description", "markdown", "A free text natural language description of the structure map from a consumer's perspective.", 0, 1, description));
6158        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure map instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
6159        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the structure map is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
6160        children.add(new Property("purpose", "markdown", "Explaination of why this structure map is needed and why it has been designed as it has.", 0, 1, purpose));
6161        children.add(new Property("copyright", "markdown", "A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.", 0, 1, copyright));
6162        children.add(new Property("structure", "", "A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.", 0, java.lang.Integer.MAX_VALUE, structure));
6163        children.add(new Property("import", "uri", "Other maps used by this map (canonical URLs).", 0, java.lang.Integer.MAX_VALUE, import_));
6164        children.add(new Property("group", "", "Organizes the mapping into managable chunks for human review/ease of maintenance.", 0, java.lang.Integer.MAX_VALUE, group));
6165      }
6166
6167      @Override
6168      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6169        switch (_hash) {
6170        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. The URL SHOULD include the major version of the structure map. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url);
6171        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
6172        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
6173        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
6174        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the structure map.", 0, 1, title);
6175        case -892481550: /*status*/  return new Property("status", "code", "The status of this structure map. Enables tracking the life-cycle of the content.", 0, 1, status);
6176        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
6177        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the structure map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.", 0, 1, date);
6178        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the structure map.", 0, 1, publisher);
6179        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
6180        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the structure map from a consumer's perspective.", 0, 1, description);
6181        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure map instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
6182        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the structure map is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
6183        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explaination of why this structure map is needed and why it has been designed as it has.", 0, 1, purpose);
6184        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.", 0, 1, copyright);
6185        case 144518515: /*structure*/  return new Property("structure", "", "A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.", 0, java.lang.Integer.MAX_VALUE, structure);
6186        case -1184795739: /*import*/  return new Property("import", "uri", "Other maps used by this map (canonical URLs).", 0, java.lang.Integer.MAX_VALUE, import_);
6187        case 98629247: /*group*/  return new Property("group", "", "Organizes the mapping into managable chunks for human review/ease of maintenance.", 0, java.lang.Integer.MAX_VALUE, group);
6188        default: return super.getNamedProperty(_hash, _name, _checkValid);
6189        }
6190
6191      }
6192
6193      @Override
6194      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6195        switch (hash) {
6196        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
6197        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
6198        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
6199        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
6200        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
6201        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
6202        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
6203        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
6204        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
6205        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
6206        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
6207        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
6208        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
6209        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
6210        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
6211        case 144518515: /*structure*/ return this.structure == null ? new Base[0] : this.structure.toArray(new Base[this.structure.size()]); // StructureMapStructureComponent
6212        case -1184795739: /*import*/ return this.import_ == null ? new Base[0] : this.import_.toArray(new Base[this.import_.size()]); // UriType
6213        case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // StructureMapGroupComponent
6214        default: return super.getProperty(hash, name, checkValid);
6215        }
6216
6217      }
6218
6219      @Override
6220      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6221        switch (hash) {
6222        case 116079: // url
6223          this.url = castToUri(value); // UriType
6224          return value;
6225        case -1618432855: // identifier
6226          this.getIdentifier().add(castToIdentifier(value)); // Identifier
6227          return value;
6228        case 351608024: // version
6229          this.version = castToString(value); // StringType
6230          return value;
6231        case 3373707: // name
6232          this.name = castToString(value); // StringType
6233          return value;
6234        case 110371416: // title
6235          this.title = castToString(value); // StringType
6236          return value;
6237        case -892481550: // status
6238          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
6239          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
6240          return value;
6241        case -404562712: // experimental
6242          this.experimental = castToBoolean(value); // BooleanType
6243          return value;
6244        case 3076014: // date
6245          this.date = castToDateTime(value); // DateTimeType
6246          return value;
6247        case 1447404028: // publisher
6248          this.publisher = castToString(value); // StringType
6249          return value;
6250        case 951526432: // contact
6251          this.getContact().add(castToContactDetail(value)); // ContactDetail
6252          return value;
6253        case -1724546052: // description
6254          this.description = castToMarkdown(value); // MarkdownType
6255          return value;
6256        case -669707736: // useContext
6257          this.getUseContext().add(castToUsageContext(value)); // UsageContext
6258          return value;
6259        case -507075711: // jurisdiction
6260          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
6261          return value;
6262        case -220463842: // purpose
6263          this.purpose = castToMarkdown(value); // MarkdownType
6264          return value;
6265        case 1522889671: // copyright
6266          this.copyright = castToMarkdown(value); // MarkdownType
6267          return value;
6268        case 144518515: // structure
6269          this.getStructure().add((StructureMapStructureComponent) value); // StructureMapStructureComponent
6270          return value;
6271        case -1184795739: // import
6272          this.getImport().add(castToUri(value)); // UriType
6273          return value;
6274        case 98629247: // group
6275          this.getGroup().add((StructureMapGroupComponent) value); // StructureMapGroupComponent
6276          return value;
6277        default: return super.setProperty(hash, name, value);
6278        }
6279
6280      }
6281
6282      @Override
6283      public Base setProperty(String name, Base value) throws FHIRException {
6284        if (name.equals("url")) {
6285          this.url = castToUri(value); // UriType
6286        } else if (name.equals("identifier")) {
6287          this.getIdentifier().add(castToIdentifier(value));
6288        } else if (name.equals("version")) {
6289          this.version = castToString(value); // StringType
6290        } else if (name.equals("name")) {
6291          this.name = castToString(value); // StringType
6292        } else if (name.equals("title")) {
6293          this.title = castToString(value); // StringType
6294        } else if (name.equals("status")) {
6295          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
6296          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
6297        } else if (name.equals("experimental")) {
6298          this.experimental = castToBoolean(value); // BooleanType
6299        } else if (name.equals("date")) {
6300          this.date = castToDateTime(value); // DateTimeType
6301        } else if (name.equals("publisher")) {
6302          this.publisher = castToString(value); // StringType
6303        } else if (name.equals("contact")) {
6304          this.getContact().add(castToContactDetail(value));
6305        } else if (name.equals("description")) {
6306          this.description = castToMarkdown(value); // MarkdownType
6307        } else if (name.equals("useContext")) {
6308          this.getUseContext().add(castToUsageContext(value));
6309        } else if (name.equals("jurisdiction")) {
6310          this.getJurisdiction().add(castToCodeableConcept(value));
6311        } else if (name.equals("purpose")) {
6312          this.purpose = castToMarkdown(value); // MarkdownType
6313        } else if (name.equals("copyright")) {
6314          this.copyright = castToMarkdown(value); // MarkdownType
6315        } else if (name.equals("structure")) {
6316          this.getStructure().add((StructureMapStructureComponent) value);
6317        } else if (name.equals("import")) {
6318          this.getImport().add(castToUri(value));
6319        } else if (name.equals("group")) {
6320          this.getGroup().add((StructureMapGroupComponent) value);
6321        } else
6322          return super.setProperty(name, value);
6323        return value;
6324      }
6325
6326      @Override
6327      public Base makeProperty(int hash, String name) throws FHIRException {
6328        switch (hash) {
6329        case 116079:  return getUrlElement();
6330        case -1618432855:  return addIdentifier(); 
6331        case 351608024:  return getVersionElement();
6332        case 3373707:  return getNameElement();
6333        case 110371416:  return getTitleElement();
6334        case -892481550:  return getStatusElement();
6335        case -404562712:  return getExperimentalElement();
6336        case 3076014:  return getDateElement();
6337        case 1447404028:  return getPublisherElement();
6338        case 951526432:  return addContact(); 
6339        case -1724546052:  return getDescriptionElement();
6340        case -669707736:  return addUseContext(); 
6341        case -507075711:  return addJurisdiction(); 
6342        case -220463842:  return getPurposeElement();
6343        case 1522889671:  return getCopyrightElement();
6344        case 144518515:  return addStructure(); 
6345        case -1184795739:  return addImportElement();
6346        case 98629247:  return addGroup(); 
6347        default: return super.makeProperty(hash, name);
6348        }
6349
6350      }
6351
6352      @Override
6353      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6354        switch (hash) {
6355        case 116079: /*url*/ return new String[] {"uri"};
6356        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
6357        case 351608024: /*version*/ return new String[] {"string"};
6358        case 3373707: /*name*/ return new String[] {"string"};
6359        case 110371416: /*title*/ return new String[] {"string"};
6360        case -892481550: /*status*/ return new String[] {"code"};
6361        case -404562712: /*experimental*/ return new String[] {"boolean"};
6362        case 3076014: /*date*/ return new String[] {"dateTime"};
6363        case 1447404028: /*publisher*/ return new String[] {"string"};
6364        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
6365        case -1724546052: /*description*/ return new String[] {"markdown"};
6366        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
6367        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
6368        case -220463842: /*purpose*/ return new String[] {"markdown"};
6369        case 1522889671: /*copyright*/ return new String[] {"markdown"};
6370        case 144518515: /*structure*/ return new String[] {};
6371        case -1184795739: /*import*/ return new String[] {"uri"};
6372        case 98629247: /*group*/ return new String[] {};
6373        default: return super.getTypesForProperty(hash, name);
6374        }
6375
6376      }
6377
6378      @Override
6379      public Base addChild(String name) throws FHIRException {
6380        if (name.equals("url")) {
6381          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.url");
6382        }
6383        else if (name.equals("identifier")) {
6384          return addIdentifier();
6385        }
6386        else if (name.equals("version")) {
6387          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.version");
6388        }
6389        else if (name.equals("name")) {
6390          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name");
6391        }
6392        else if (name.equals("title")) {
6393          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.title");
6394        }
6395        else if (name.equals("status")) {
6396          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.status");
6397        }
6398        else if (name.equals("experimental")) {
6399          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.experimental");
6400        }
6401        else if (name.equals("date")) {
6402          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.date");
6403        }
6404        else if (name.equals("publisher")) {
6405          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.publisher");
6406        }
6407        else if (name.equals("contact")) {
6408          return addContact();
6409        }
6410        else if (name.equals("description")) {
6411          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.description");
6412        }
6413        else if (name.equals("useContext")) {
6414          return addUseContext();
6415        }
6416        else if (name.equals("jurisdiction")) {
6417          return addJurisdiction();
6418        }
6419        else if (name.equals("purpose")) {
6420          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.purpose");
6421        }
6422        else if (name.equals("copyright")) {
6423          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.copyright");
6424        }
6425        else if (name.equals("structure")) {
6426          return addStructure();
6427        }
6428        else if (name.equals("import")) {
6429          throw new FHIRException("Cannot call addChild on a primitive type StructureMap.import");
6430        }
6431        else if (name.equals("group")) {
6432          return addGroup();
6433        }
6434        else
6435          return super.addChild(name);
6436      }
6437
6438  public String fhirType() {
6439    return "StructureMap";
6440
6441  }
6442
6443      public StructureMap copy() {
6444        StructureMap dst = new StructureMap();
6445        copyValues(dst);
6446        dst.url = url == null ? null : url.copy();
6447        if (identifier != null) {
6448          dst.identifier = new ArrayList<Identifier>();
6449          for (Identifier i : identifier)
6450            dst.identifier.add(i.copy());
6451        };
6452        dst.version = version == null ? null : version.copy();
6453        dst.name = name == null ? null : name.copy();
6454        dst.title = title == null ? null : title.copy();
6455        dst.status = status == null ? null : status.copy();
6456        dst.experimental = experimental == null ? null : experimental.copy();
6457        dst.date = date == null ? null : date.copy();
6458        dst.publisher = publisher == null ? null : publisher.copy();
6459        if (contact != null) {
6460          dst.contact = new ArrayList<ContactDetail>();
6461          for (ContactDetail i : contact)
6462            dst.contact.add(i.copy());
6463        };
6464        dst.description = description == null ? null : description.copy();
6465        if (useContext != null) {
6466          dst.useContext = new ArrayList<UsageContext>();
6467          for (UsageContext i : useContext)
6468            dst.useContext.add(i.copy());
6469        };
6470        if (jurisdiction != null) {
6471          dst.jurisdiction = new ArrayList<CodeableConcept>();
6472          for (CodeableConcept i : jurisdiction)
6473            dst.jurisdiction.add(i.copy());
6474        };
6475        dst.purpose = purpose == null ? null : purpose.copy();
6476        dst.copyright = copyright == null ? null : copyright.copy();
6477        if (structure != null) {
6478          dst.structure = new ArrayList<StructureMapStructureComponent>();
6479          for (StructureMapStructureComponent i : structure)
6480            dst.structure.add(i.copy());
6481        };
6482        if (import_ != null) {
6483          dst.import_ = new ArrayList<UriType>();
6484          for (UriType i : import_)
6485            dst.import_.add(i.copy());
6486        };
6487        if (group != null) {
6488          dst.group = new ArrayList<StructureMapGroupComponent>();
6489          for (StructureMapGroupComponent i : group)
6490            dst.group.add(i.copy());
6491        };
6492        return dst;
6493      }
6494
6495      protected StructureMap typedCopy() {
6496        return copy();
6497      }
6498
6499      @Override
6500      public boolean equalsDeep(Base other_) {
6501        if (!super.equalsDeep(other_))
6502          return false;
6503        if (!(other_ instanceof StructureMap))
6504          return false;
6505        StructureMap o = (StructureMap) other_;
6506        return compareDeep(identifier, o.identifier, true) && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
6507           && compareDeep(structure, o.structure, true) && compareDeep(import_, o.import_, true) && compareDeep(group, o.group, true)
6508          ;
6509      }
6510
6511      @Override
6512      public boolean equalsShallow(Base other_) {
6513        if (!super.equalsShallow(other_))
6514          return false;
6515        if (!(other_ instanceof StructureMap))
6516          return false;
6517        StructureMap o = (StructureMap) other_;
6518        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(import_, o.import_, true)
6519          ;
6520      }
6521
6522      public boolean isEmpty() {
6523        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, copyright
6524          , structure, import_, group);
6525      }
6526
6527  @Override
6528  public ResourceType getResourceType() {
6529    return ResourceType.StructureMap;
6530   }
6531
6532 /**
6533   * Search parameter: <b>date</b>
6534   * <p>
6535   * Description: <b>The structure map publication date</b><br>
6536   * Type: <b>date</b><br>
6537   * Path: <b>StructureMap.date</b><br>
6538   * </p>
6539   */
6540  @SearchParamDefinition(name="date", path="StructureMap.date", description="The structure map publication date", type="date" )
6541  public static final String SP_DATE = "date";
6542 /**
6543   * <b>Fluent Client</b> search parameter constant for <b>date</b>
6544   * <p>
6545   * Description: <b>The structure map publication date</b><br>
6546   * Type: <b>date</b><br>
6547   * Path: <b>StructureMap.date</b><br>
6548   * </p>
6549   */
6550  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
6551
6552 /**
6553   * Search parameter: <b>identifier</b>
6554   * <p>
6555   * Description: <b>External identifier for the structure map</b><br>
6556   * Type: <b>token</b><br>
6557   * Path: <b>StructureMap.identifier</b><br>
6558   * </p>
6559   */
6560  @SearchParamDefinition(name="identifier", path="StructureMap.identifier", description="External identifier for the structure map", type="token" )
6561  public static final String SP_IDENTIFIER = "identifier";
6562 /**
6563   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
6564   * <p>
6565   * Description: <b>External identifier for the structure map</b><br>
6566   * Type: <b>token</b><br>
6567   * Path: <b>StructureMap.identifier</b><br>
6568   * </p>
6569   */
6570  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
6571
6572 /**
6573   * Search parameter: <b>jurisdiction</b>
6574   * <p>
6575   * Description: <b>Intended jurisdiction for the structure map</b><br>
6576   * Type: <b>token</b><br>
6577   * Path: <b>StructureMap.jurisdiction</b><br>
6578   * </p>
6579   */
6580  @SearchParamDefinition(name="jurisdiction", path="StructureMap.jurisdiction", description="Intended jurisdiction for the structure map", type="token" )
6581  public static final String SP_JURISDICTION = "jurisdiction";
6582 /**
6583   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
6584   * <p>
6585   * Description: <b>Intended jurisdiction for the structure map</b><br>
6586   * Type: <b>token</b><br>
6587   * Path: <b>StructureMap.jurisdiction</b><br>
6588   * </p>
6589   */
6590  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
6591
6592 /**
6593   * Search parameter: <b>name</b>
6594   * <p>
6595   * Description: <b>Computationally friendly name of the structure map</b><br>
6596   * Type: <b>string</b><br>
6597   * Path: <b>StructureMap.name</b><br>
6598   * </p>
6599   */
6600  @SearchParamDefinition(name="name", path="StructureMap.name", description="Computationally friendly name of the structure map", type="string" )
6601  public static final String SP_NAME = "name";
6602 /**
6603   * <b>Fluent Client</b> search parameter constant for <b>name</b>
6604   * <p>
6605   * Description: <b>Computationally friendly name of the structure map</b><br>
6606   * Type: <b>string</b><br>
6607   * Path: <b>StructureMap.name</b><br>
6608   * </p>
6609   */
6610  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
6611
6612 /**
6613   * Search parameter: <b>description</b>
6614   * <p>
6615   * Description: <b>The description of the structure map</b><br>
6616   * Type: <b>string</b><br>
6617   * Path: <b>StructureMap.description</b><br>
6618   * </p>
6619   */
6620  @SearchParamDefinition(name="description", path="StructureMap.description", description="The description of the structure map", type="string" )
6621  public static final String SP_DESCRIPTION = "description";
6622 /**
6623   * <b>Fluent Client</b> search parameter constant for <b>description</b>
6624   * <p>
6625   * Description: <b>The description of the structure map</b><br>
6626   * Type: <b>string</b><br>
6627   * Path: <b>StructureMap.description</b><br>
6628   * </p>
6629   */
6630  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
6631
6632 /**
6633   * Search parameter: <b>publisher</b>
6634   * <p>
6635   * Description: <b>Name of the publisher of the structure map</b><br>
6636   * Type: <b>string</b><br>
6637   * Path: <b>StructureMap.publisher</b><br>
6638   * </p>
6639   */
6640  @SearchParamDefinition(name="publisher", path="StructureMap.publisher", description="Name of the publisher of the structure map", type="string" )
6641  public static final String SP_PUBLISHER = "publisher";
6642 /**
6643   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
6644   * <p>
6645   * Description: <b>Name of the publisher of the structure map</b><br>
6646   * Type: <b>string</b><br>
6647   * Path: <b>StructureMap.publisher</b><br>
6648   * </p>
6649   */
6650  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
6651
6652 /**
6653   * Search parameter: <b>title</b>
6654   * <p>
6655   * Description: <b>The human-friendly name of the structure map</b><br>
6656   * Type: <b>string</b><br>
6657   * Path: <b>StructureMap.title</b><br>
6658   * </p>
6659   */
6660  @SearchParamDefinition(name="title", path="StructureMap.title", description="The human-friendly name of the structure map", type="string" )
6661  public static final String SP_TITLE = "title";
6662 /**
6663   * <b>Fluent Client</b> search parameter constant for <b>title</b>
6664   * <p>
6665   * Description: <b>The human-friendly name of the structure map</b><br>
6666   * Type: <b>string</b><br>
6667   * Path: <b>StructureMap.title</b><br>
6668   * </p>
6669   */
6670  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
6671
6672 /**
6673   * Search parameter: <b>version</b>
6674   * <p>
6675   * Description: <b>The business version of the structure map</b><br>
6676   * Type: <b>token</b><br>
6677   * Path: <b>StructureMap.version</b><br>
6678   * </p>
6679   */
6680  @SearchParamDefinition(name="version", path="StructureMap.version", description="The business version of the structure map", type="token" )
6681  public static final String SP_VERSION = "version";
6682 /**
6683   * <b>Fluent Client</b> search parameter constant for <b>version</b>
6684   * <p>
6685   * Description: <b>The business version of the structure map</b><br>
6686   * Type: <b>token</b><br>
6687   * Path: <b>StructureMap.version</b><br>
6688   * </p>
6689   */
6690  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
6691
6692 /**
6693   * Search parameter: <b>url</b>
6694   * <p>
6695   * Description: <b>The uri that identifies the structure map</b><br>
6696   * Type: <b>uri</b><br>
6697   * Path: <b>StructureMap.url</b><br>
6698   * </p>
6699   */
6700  @SearchParamDefinition(name="url", path="StructureMap.url", description="The uri that identifies the structure map", type="uri" )
6701  public static final String SP_URL = "url";
6702 /**
6703   * <b>Fluent Client</b> search parameter constant for <b>url</b>
6704   * <p>
6705   * Description: <b>The uri that identifies the structure map</b><br>
6706   * Type: <b>uri</b><br>
6707   * Path: <b>StructureMap.url</b><br>
6708   * </p>
6709   */
6710  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
6711
6712 /**
6713   * Search parameter: <b>status</b>
6714   * <p>
6715   * Description: <b>The current status of the structure map</b><br>
6716   * Type: <b>token</b><br>
6717   * Path: <b>StructureMap.status</b><br>
6718   * </p>
6719   */
6720  @SearchParamDefinition(name="status", path="StructureMap.status", description="The current status of the structure map", type="token" )
6721  public static final String SP_STATUS = "status";
6722 /**
6723   * <b>Fluent Client</b> search parameter constant for <b>status</b>
6724   * <p>
6725   * Description: <b>The current status of the structure map</b><br>
6726   * Type: <b>token</b><br>
6727   * Path: <b>StructureMap.status</b><br>
6728   * </p>
6729   */
6730  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
6731
6732// added from java-adornments.txt:
6733
6734  public String toString() {
6735    return StructureMapUtilities.render(this);
6736  }
6737
6738
6739// end addition
6740
6741}
6742