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