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