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