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