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