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