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