001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import ca.uhn.fhir.model.api.annotation.ResourceDef;
041import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.Block;
046import org.hl7.fhir.instance.model.api.*;
047import org.hl7.fhir.exceptions.FHIRException;
048/**
049 * A list is a curated collection of resources.
050 */
051@ResourceDef(name="List", profile="http://hl7.org/fhir/StructureDefinition/List")
052public class ListResource extends DomainResource {
053
054    public enum ListStatus {
055        /**
056         * The list is considered to be an active part of the patient's record.
057         */
058        CURRENT, 
059        /**
060         * The list is "old" and should no longer be considered accurate or relevant.
061         */
062        RETIRED, 
063        /**
064         * The list was never accurate.  It is retained for medico-legal purposes only.
065         */
066        ENTEREDINERROR, 
067        /**
068         * added to help the parsers with the generic types
069         */
070        NULL;
071        public static ListStatus fromCode(String codeString) throws FHIRException {
072            if (codeString == null || "".equals(codeString))
073                return null;
074        if ("current".equals(codeString))
075          return CURRENT;
076        if ("retired".equals(codeString))
077          return RETIRED;
078        if ("entered-in-error".equals(codeString))
079          return ENTEREDINERROR;
080        if (Configuration.isAcceptInvalidEnums())
081          return null;
082        else
083          throw new FHIRException("Unknown ListStatus code '"+codeString+"'");
084        }
085        public String toCode() {
086          switch (this) {
087            case CURRENT: return "current";
088            case RETIRED: return "retired";
089            case ENTEREDINERROR: return "entered-in-error";
090            case NULL: return null;
091            default: return "?";
092          }
093        }
094        public String getSystem() {
095          switch (this) {
096            case CURRENT: return "http://hl7.org/fhir/list-status";
097            case RETIRED: return "http://hl7.org/fhir/list-status";
098            case ENTEREDINERROR: return "http://hl7.org/fhir/list-status";
099            case NULL: return null;
100            default: return "?";
101          }
102        }
103        public String getDefinition() {
104          switch (this) {
105            case CURRENT: return "The list is considered to be an active part of the patient's record.";
106            case RETIRED: return "The list is \"old\" and should no longer be considered accurate or relevant.";
107            case ENTEREDINERROR: return "The list was never accurate.  It is retained for medico-legal purposes only.";
108            case NULL: return null;
109            default: return "?";
110          }
111        }
112        public String getDisplay() {
113          switch (this) {
114            case CURRENT: return "Current";
115            case RETIRED: return "Retired";
116            case ENTEREDINERROR: return "Entered In Error";
117            case NULL: return null;
118            default: return "?";
119          }
120        }
121    }
122
123  public static class ListStatusEnumFactory implements EnumFactory<ListStatus> {
124    public ListStatus fromCode(String codeString) throws IllegalArgumentException {
125      if (codeString == null || "".equals(codeString))
126            if (codeString == null || "".equals(codeString))
127                return null;
128        if ("current".equals(codeString))
129          return ListStatus.CURRENT;
130        if ("retired".equals(codeString))
131          return ListStatus.RETIRED;
132        if ("entered-in-error".equals(codeString))
133          return ListStatus.ENTEREDINERROR;
134        throw new IllegalArgumentException("Unknown ListStatus code '"+codeString+"'");
135        }
136        public Enumeration<ListStatus> fromType(Base code) throws FHIRException {
137          if (code == null)
138            return null;
139          if (code.isEmpty())
140            return new Enumeration<ListStatus>(this);
141          String codeString = ((PrimitiveType) code).asStringValue();
142          if (codeString == null || "".equals(codeString))
143            return null;
144        if ("current".equals(codeString))
145          return new Enumeration<ListStatus>(this, ListStatus.CURRENT);
146        if ("retired".equals(codeString))
147          return new Enumeration<ListStatus>(this, ListStatus.RETIRED);
148        if ("entered-in-error".equals(codeString))
149          return new Enumeration<ListStatus>(this, ListStatus.ENTEREDINERROR);
150        throw new FHIRException("Unknown ListStatus code '"+codeString+"'");
151        }
152    public String toCode(ListStatus code) {
153      if (code == ListStatus.CURRENT)
154        return "current";
155      if (code == ListStatus.RETIRED)
156        return "retired";
157      if (code == ListStatus.ENTEREDINERROR)
158        return "entered-in-error";
159      return "?";
160      }
161    public String toSystem(ListStatus code) {
162      return code.getSystem();
163      }
164    }
165
166    public enum ListMode {
167        /**
168         * This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes.
169         */
170        WORKING, 
171        /**
172         * This list was prepared as a snapshot. It should not be assumed to be current.
173         */
174        SNAPSHOT, 
175        /**
176         * A point-in-time list that shows what changes have been made or recommended.  E.g. a discharge medication list showing what was added and removed during an encounter.
177         */
178        CHANGES, 
179        /**
180         * added to help the parsers with the generic types
181         */
182        NULL;
183        public static ListMode fromCode(String codeString) throws FHIRException {
184            if (codeString == null || "".equals(codeString))
185                return null;
186        if ("working".equals(codeString))
187          return WORKING;
188        if ("snapshot".equals(codeString))
189          return SNAPSHOT;
190        if ("changes".equals(codeString))
191          return CHANGES;
192        if (Configuration.isAcceptInvalidEnums())
193          return null;
194        else
195          throw new FHIRException("Unknown ListMode code '"+codeString+"'");
196        }
197        public String toCode() {
198          switch (this) {
199            case WORKING: return "working";
200            case SNAPSHOT: return "snapshot";
201            case CHANGES: return "changes";
202            case NULL: return null;
203            default: return "?";
204          }
205        }
206        public String getSystem() {
207          switch (this) {
208            case WORKING: return "http://hl7.org/fhir/list-mode";
209            case SNAPSHOT: return "http://hl7.org/fhir/list-mode";
210            case CHANGES: return "http://hl7.org/fhir/list-mode";
211            case NULL: return null;
212            default: return "?";
213          }
214        }
215        public String getDefinition() {
216          switch (this) {
217            case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes.";
218            case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current.";
219            case CHANGES: return "A point-in-time list that shows what changes have been made or recommended.  E.g. a discharge medication list showing what was added and removed during an encounter.";
220            case NULL: return null;
221            default: return "?";
222          }
223        }
224        public String getDisplay() {
225          switch (this) {
226            case WORKING: return "Working List";
227            case SNAPSHOT: return "Snapshot List";
228            case CHANGES: return "Change List";
229            case NULL: return null;
230            default: return "?";
231          }
232        }
233    }
234
235  public static class ListModeEnumFactory implements EnumFactory<ListMode> {
236    public ListMode fromCode(String codeString) throws IllegalArgumentException {
237      if (codeString == null || "".equals(codeString))
238            if (codeString == null || "".equals(codeString))
239                return null;
240        if ("working".equals(codeString))
241          return ListMode.WORKING;
242        if ("snapshot".equals(codeString))
243          return ListMode.SNAPSHOT;
244        if ("changes".equals(codeString))
245          return ListMode.CHANGES;
246        throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'");
247        }
248        public Enumeration<ListMode> fromType(Base code) throws FHIRException {
249          if (code == null)
250            return null;
251          if (code.isEmpty())
252            return new Enumeration<ListMode>(this);
253          String codeString = ((PrimitiveType) code).asStringValue();
254          if (codeString == null || "".equals(codeString))
255            return null;
256        if ("working".equals(codeString))
257          return new Enumeration<ListMode>(this, ListMode.WORKING);
258        if ("snapshot".equals(codeString))
259          return new Enumeration<ListMode>(this, ListMode.SNAPSHOT);
260        if ("changes".equals(codeString))
261          return new Enumeration<ListMode>(this, ListMode.CHANGES);
262        throw new FHIRException("Unknown ListMode code '"+codeString+"'");
263        }
264    public String toCode(ListMode code) {
265      if (code == ListMode.WORKING)
266        return "working";
267      if (code == ListMode.SNAPSHOT)
268        return "snapshot";
269      if (code == ListMode.CHANGES)
270        return "changes";
271      return "?";
272      }
273    public String toSystem(ListMode code) {
274      return code.getSystem();
275      }
276    }
277
278    @Block()
279    public static class ListEntryComponent extends BackboneElement implements IBaseBackboneElement {
280        /**
281         * The flag allows the system constructing the list to indicate the role and significance of the item in the list.
282         */
283        @Child(name = "flag", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
284        @Description(shortDefinition="Status/Workflow information about this item", formalDefinition="The flag allows the system constructing the list to indicate the role and significance of the item in the list." )
285        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-item-flag")
286        protected CodeableConcept flag;
287
288        /**
289         * True if this item is marked as deleted in the list.
290         */
291        @Child(name = "deleted", type = {BooleanType.class}, order=2, min=0, max=1, modifier=true, summary=false)
292        @Description(shortDefinition="If this item is actually marked as deleted", formalDefinition="True if this item is marked as deleted in the list." )
293        protected BooleanType deleted;
294
295        /**
296         * When this item was added to the list.
297         */
298        @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
299        @Description(shortDefinition="When item added to list", formalDefinition="When this item was added to the list." )
300        protected DateTimeType date;
301
302        /**
303         * A reference to the actual resource from which data was derived.
304         */
305        @Child(name = "item", type = {Reference.class}, order=4, min=1, max=1, modifier=false, summary=false)
306        @Description(shortDefinition="Actual entry", formalDefinition="A reference to the actual resource from which data was derived." )
307        protected Reference item;
308
309        /**
310         * The actual object that is the target of the reference (A reference to the actual resource from which data was derived.)
311         */
312        protected Resource itemTarget;
313
314        private static final long serialVersionUID = -758164425L;
315
316    /**
317     * Constructor
318     */
319      public ListEntryComponent() {
320        super();
321      }
322
323    /**
324     * Constructor
325     */
326      public ListEntryComponent(Reference item) {
327        super();
328        this.item = item;
329      }
330
331        /**
332         * @return {@link #flag} (The flag allows the system constructing the list to indicate the role and significance of the item in the list.)
333         */
334        public CodeableConcept getFlag() { 
335          if (this.flag == null)
336            if (Configuration.errorOnAutoCreate())
337              throw new Error("Attempt to auto-create ListEntryComponent.flag");
338            else if (Configuration.doAutoCreate())
339              this.flag = new CodeableConcept(); // cc
340          return this.flag;
341        }
342
343        public boolean hasFlag() { 
344          return this.flag != null && !this.flag.isEmpty();
345        }
346
347        /**
348         * @param value {@link #flag} (The flag allows the system constructing the list to indicate the role and significance of the item in the list.)
349         */
350        public ListEntryComponent setFlag(CodeableConcept value) { 
351          this.flag = value;
352          return this;
353        }
354
355        /**
356         * @return {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value
357         */
358        public BooleanType getDeletedElement() { 
359          if (this.deleted == null)
360            if (Configuration.errorOnAutoCreate())
361              throw new Error("Attempt to auto-create ListEntryComponent.deleted");
362            else if (Configuration.doAutoCreate())
363              this.deleted = new BooleanType(); // bb
364          return this.deleted;
365        }
366
367        public boolean hasDeletedElement() { 
368          return this.deleted != null && !this.deleted.isEmpty();
369        }
370
371        public boolean hasDeleted() { 
372          return this.deleted != null && !this.deleted.isEmpty();
373        }
374
375        /**
376         * @param value {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value
377         */
378        public ListEntryComponent setDeletedElement(BooleanType value) { 
379          this.deleted = value;
380          return this;
381        }
382
383        /**
384         * @return True if this item is marked as deleted in the list.
385         */
386        public boolean getDeleted() { 
387          return this.deleted == null || this.deleted.isEmpty() ? false : this.deleted.getValue();
388        }
389
390        /**
391         * @param value True if this item is marked as deleted in the list.
392         */
393        public ListEntryComponent setDeleted(boolean value) { 
394            if (this.deleted == null)
395              this.deleted = new BooleanType();
396            this.deleted.setValue(value);
397          return this;
398        }
399
400        /**
401         * @return {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
402         */
403        public DateTimeType getDateElement() { 
404          if (this.date == null)
405            if (Configuration.errorOnAutoCreate())
406              throw new Error("Attempt to auto-create ListEntryComponent.date");
407            else if (Configuration.doAutoCreate())
408              this.date = new DateTimeType(); // bb
409          return this.date;
410        }
411
412        public boolean hasDateElement() { 
413          return this.date != null && !this.date.isEmpty();
414        }
415
416        public boolean hasDate() { 
417          return this.date != null && !this.date.isEmpty();
418        }
419
420        /**
421         * @param value {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
422         */
423        public ListEntryComponent setDateElement(DateTimeType value) { 
424          this.date = value;
425          return this;
426        }
427
428        /**
429         * @return When this item was added to the list.
430         */
431        public Date getDate() { 
432          return this.date == null ? null : this.date.getValue();
433        }
434
435        /**
436         * @param value When this item was added to the list.
437         */
438        public ListEntryComponent setDate(Date value) { 
439          if (value == null)
440            this.date = null;
441          else {
442            if (this.date == null)
443              this.date = new DateTimeType();
444            this.date.setValue(value);
445          }
446          return this;
447        }
448
449        /**
450         * @return {@link #item} (A reference to the actual resource from which data was derived.)
451         */
452        public Reference getItem() { 
453          if (this.item == null)
454            if (Configuration.errorOnAutoCreate())
455              throw new Error("Attempt to auto-create ListEntryComponent.item");
456            else if (Configuration.doAutoCreate())
457              this.item = new Reference(); // cc
458          return this.item;
459        }
460
461        public boolean hasItem() { 
462          return this.item != null && !this.item.isEmpty();
463        }
464
465        /**
466         * @param value {@link #item} (A reference to the actual resource from which data was derived.)
467         */
468        public ListEntryComponent setItem(Reference value) { 
469          this.item = value;
470          return this;
471        }
472
473        /**
474         * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.)
475         */
476        public Resource getItemTarget() { 
477          return this.itemTarget;
478        }
479
480        /**
481         * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.)
482         */
483        public ListEntryComponent setItemTarget(Resource value) { 
484          this.itemTarget = value;
485          return this;
486        }
487
488        protected void listChildren(List<Property> children) {
489          super.listChildren(children);
490          children.add(new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to indicate the role and significance of the item in the list.", 0, 1, flag));
491          children.add(new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, 1, deleted));
492          children.add(new Property("date", "dateTime", "When this item was added to the list.", 0, 1, date));
493          children.add(new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, 1, item));
494        }
495
496        @Override
497        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
498          switch (_hash) {
499          case 3145580: /*flag*/  return new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to indicate the role and significance of the item in the list.", 0, 1, flag);
500          case 1550463001: /*deleted*/  return new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, 1, deleted);
501          case 3076014: /*date*/  return new Property("date", "dateTime", "When this item was added to the list.", 0, 1, date);
502          case 3242771: /*item*/  return new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, 1, item);
503          default: return super.getNamedProperty(_hash, _name, _checkValid);
504          }
505
506        }
507
508      @Override
509      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
510        switch (hash) {
511        case 3145580: /*flag*/ return this.flag == null ? new Base[0] : new Base[] {this.flag}; // CodeableConcept
512        case 1550463001: /*deleted*/ return this.deleted == null ? new Base[0] : new Base[] {this.deleted}; // BooleanType
513        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
514        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Reference
515        default: return super.getProperty(hash, name, checkValid);
516        }
517
518      }
519
520      @Override
521      public Base setProperty(int hash, String name, Base value) throws FHIRException {
522        switch (hash) {
523        case 3145580: // flag
524          this.flag = castToCodeableConcept(value); // CodeableConcept
525          return value;
526        case 1550463001: // deleted
527          this.deleted = castToBoolean(value); // BooleanType
528          return value;
529        case 3076014: // date
530          this.date = castToDateTime(value); // DateTimeType
531          return value;
532        case 3242771: // item
533          this.item = castToReference(value); // Reference
534          return value;
535        default: return super.setProperty(hash, name, value);
536        }
537
538      }
539
540      @Override
541      public Base setProperty(String name, Base value) throws FHIRException {
542        if (name.equals("flag")) {
543          this.flag = castToCodeableConcept(value); // CodeableConcept
544        } else if (name.equals("deleted")) {
545          this.deleted = castToBoolean(value); // BooleanType
546        } else if (name.equals("date")) {
547          this.date = castToDateTime(value); // DateTimeType
548        } else if (name.equals("item")) {
549          this.item = castToReference(value); // Reference
550        } else
551          return super.setProperty(name, value);
552        return value;
553      }
554
555      @Override
556      public Base makeProperty(int hash, String name) throws FHIRException {
557        switch (hash) {
558        case 3145580:  return getFlag(); 
559        case 1550463001:  return getDeletedElement();
560        case 3076014:  return getDateElement();
561        case 3242771:  return getItem(); 
562        default: return super.makeProperty(hash, name);
563        }
564
565      }
566
567      @Override
568      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
569        switch (hash) {
570        case 3145580: /*flag*/ return new String[] {"CodeableConcept"};
571        case 1550463001: /*deleted*/ return new String[] {"boolean"};
572        case 3076014: /*date*/ return new String[] {"dateTime"};
573        case 3242771: /*item*/ return new String[] {"Reference"};
574        default: return super.getTypesForProperty(hash, name);
575        }
576
577      }
578
579      @Override
580      public Base addChild(String name) throws FHIRException {
581        if (name.equals("flag")) {
582          this.flag = new CodeableConcept();
583          return this.flag;
584        }
585        else if (name.equals("deleted")) {
586          throw new FHIRException("Cannot call addChild on a primitive type List.deleted");
587        }
588        else if (name.equals("date")) {
589          throw new FHIRException("Cannot call addChild on a primitive type List.date");
590        }
591        else if (name.equals("item")) {
592          this.item = new Reference();
593          return this.item;
594        }
595        else
596          return super.addChild(name);
597      }
598
599      public ListEntryComponent copy() {
600        ListEntryComponent dst = new ListEntryComponent();
601        copyValues(dst);
602        return dst;
603      }
604
605      public void copyValues(ListEntryComponent dst) {
606        super.copyValues(dst);
607        dst.flag = flag == null ? null : flag.copy();
608        dst.deleted = deleted == null ? null : deleted.copy();
609        dst.date = date == null ? null : date.copy();
610        dst.item = item == null ? null : item.copy();
611      }
612
613      @Override
614      public boolean equalsDeep(Base other_) {
615        if (!super.equalsDeep(other_))
616          return false;
617        if (!(other_ instanceof ListEntryComponent))
618          return false;
619        ListEntryComponent o = (ListEntryComponent) other_;
620        return compareDeep(flag, o.flag, true) && compareDeep(deleted, o.deleted, true) && compareDeep(date, o.date, true)
621           && compareDeep(item, o.item, true);
622      }
623
624      @Override
625      public boolean equalsShallow(Base other_) {
626        if (!super.equalsShallow(other_))
627          return false;
628        if (!(other_ instanceof ListEntryComponent))
629          return false;
630        ListEntryComponent o = (ListEntryComponent) other_;
631        return compareValues(deleted, o.deleted, true) && compareValues(date, o.date, true);
632      }
633
634      public boolean isEmpty() {
635        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(flag, deleted, date, item
636          );
637      }
638
639  public String fhirType() {
640    return "List.entry";
641
642  }
643
644  }
645
646    /**
647     * Identifier for the List assigned for business purposes outside the context of FHIR.
648     */
649    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
650    @Description(shortDefinition="Business identifier", formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." )
651    protected List<Identifier> identifier;
652
653    /**
654     * Indicates the current state of this list.
655     */
656    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
657    @Description(shortDefinition="current | retired | entered-in-error", formalDefinition="Indicates the current state of this list." )
658    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-status")
659    protected Enumeration<ListStatus> status;
660
661    /**
662     * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.
663     */
664    @Child(name = "mode", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
665    @Description(shortDefinition="working | snapshot | changes", formalDefinition="How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." )
666    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-mode")
667    protected Enumeration<ListMode> mode;
668
669    /**
670     * A label for the list assigned by the author.
671     */
672    @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
673    @Description(shortDefinition="Descriptive name for the list", formalDefinition="A label for the list assigned by the author." )
674    protected StringType title;
675
676    /**
677     * This code defines the purpose of the list - why it was created.
678     */
679    @Child(name = "code", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
680    @Description(shortDefinition="What the purpose of this list is", formalDefinition="This code defines the purpose of the list - why it was created." )
681    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-example-codes")
682    protected CodeableConcept code;
683
684    /**
685     * The common subject (or patient) of the resources that are in the list if there is one.
686     */
687    @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true)
688    @Description(shortDefinition="If all resources have the same subject", formalDefinition="The common subject (or patient) of the resources that are in the list if there is one." )
689    protected Reference subject;
690
691    /**
692     * The actual object that is the target of the reference (The common subject (or patient) of the resources that are in the list if there is one.)
693     */
694    protected Resource subjectTarget;
695
696    /**
697     * The encounter that is the context in which this list was created.
698     */
699    @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=false)
700    @Description(shortDefinition="Context in which list created", formalDefinition="The encounter that is the context in which this list was created." )
701    protected Reference encounter;
702
703    /**
704     * The actual object that is the target of the reference (The encounter that is the context in which this list was created.)
705     */
706    protected Encounter encounterTarget;
707
708    /**
709     * The date that the list was prepared.
710     */
711    @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
712    @Description(shortDefinition="When the list was prepared", formalDefinition="The date that the list was prepared." )
713    protected DateTimeType date;
714
715    /**
716     * The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.
717     */
718    @Child(name = "source", type = {Practitioner.class, PractitionerRole.class, Patient.class, Device.class}, order=8, min=0, max=1, modifier=false, summary=true)
719    @Description(shortDefinition="Who and/or what defined the list contents (aka Author)", formalDefinition="The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list." )
720    protected Reference source;
721
722    /**
723     * The actual object that is the target of the reference (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.)
724     */
725    protected Resource sourceTarget;
726
727    /**
728     * What order applies to the items in the list.
729     */
730    @Child(name = "orderedBy", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
731    @Description(shortDefinition="What order the list has", formalDefinition="What order applies to the items in the list." )
732    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-order")
733    protected CodeableConcept orderedBy;
734
735    /**
736     * Comments that apply to the overall list.
737     */
738    @Child(name = "note", type = {Annotation.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
739    @Description(shortDefinition="Comments about the list", formalDefinition="Comments that apply to the overall list." )
740    protected List<Annotation> note;
741
742    /**
743     * Entries in this list.
744     */
745    @Child(name = "entry", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
746    @Description(shortDefinition="Entries in the list", formalDefinition="Entries in this list." )
747    protected List<ListEntryComponent> entry;
748
749    /**
750     * If the list is empty, why the list is empty.
751     */
752    @Child(name = "emptyReason", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false)
753    @Description(shortDefinition="Why list is empty", formalDefinition="If the list is empty, why the list is empty." )
754    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-empty-reason")
755    protected CodeableConcept emptyReason;
756
757    private static final long serialVersionUID = 2071342704L;
758
759  /**
760   * Constructor
761   */
762    public ListResource() {
763      super();
764    }
765
766  /**
767   * Constructor
768   */
769    public ListResource(Enumeration<ListStatus> status, Enumeration<ListMode> mode) {
770      super();
771      this.status = status;
772      this.mode = mode;
773    }
774
775    /**
776     * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.)
777     */
778    public List<Identifier> getIdentifier() { 
779      if (this.identifier == null)
780        this.identifier = new ArrayList<Identifier>();
781      return this.identifier;
782    }
783
784    /**
785     * @return Returns a reference to <code>this</code> for easy method chaining
786     */
787    public ListResource setIdentifier(List<Identifier> theIdentifier) { 
788      this.identifier = theIdentifier;
789      return this;
790    }
791
792    public boolean hasIdentifier() { 
793      if (this.identifier == null)
794        return false;
795      for (Identifier item : this.identifier)
796        if (!item.isEmpty())
797          return true;
798      return false;
799    }
800
801    public Identifier addIdentifier() { //3
802      Identifier t = new Identifier();
803      if (this.identifier == null)
804        this.identifier = new ArrayList<Identifier>();
805      this.identifier.add(t);
806      return t;
807    }
808
809    public ListResource addIdentifier(Identifier t) { //3
810      if (t == null)
811        return this;
812      if (this.identifier == null)
813        this.identifier = new ArrayList<Identifier>();
814      this.identifier.add(t);
815      return this;
816    }
817
818    /**
819     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
820     */
821    public Identifier getIdentifierFirstRep() { 
822      if (getIdentifier().isEmpty()) {
823        addIdentifier();
824      }
825      return getIdentifier().get(0);
826    }
827
828    /**
829     * @return {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
830     */
831    public Enumeration<ListStatus> getStatusElement() { 
832      if (this.status == null)
833        if (Configuration.errorOnAutoCreate())
834          throw new Error("Attempt to auto-create List.status");
835        else if (Configuration.doAutoCreate())
836          this.status = new Enumeration<ListStatus>(new ListStatusEnumFactory()); // bb
837      return this.status;
838    }
839
840    public boolean hasStatusElement() { 
841      return this.status != null && !this.status.isEmpty();
842    }
843
844    public boolean hasStatus() { 
845      return this.status != null && !this.status.isEmpty();
846    }
847
848    /**
849     * @param value {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
850     */
851    public ListResource setStatusElement(Enumeration<ListStatus> value) { 
852      this.status = value;
853      return this;
854    }
855
856    /**
857     * @return Indicates the current state of this list.
858     */
859    public ListStatus getStatus() { 
860      return this.status == null ? null : this.status.getValue();
861    }
862
863    /**
864     * @param value Indicates the current state of this list.
865     */
866    public ListResource setStatus(ListStatus value) { 
867        if (this.status == null)
868          this.status = new Enumeration<ListStatus>(new ListStatusEnumFactory());
869        this.status.setValue(value);
870      return this;
871    }
872
873    /**
874     * @return {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
875     */
876    public Enumeration<ListMode> getModeElement() { 
877      if (this.mode == null)
878        if (Configuration.errorOnAutoCreate())
879          throw new Error("Attempt to auto-create List.mode");
880        else if (Configuration.doAutoCreate())
881          this.mode = new Enumeration<ListMode>(new ListModeEnumFactory()); // bb
882      return this.mode;
883    }
884
885    public boolean hasModeElement() { 
886      return this.mode != null && !this.mode.isEmpty();
887    }
888
889    public boolean hasMode() { 
890      return this.mode != null && !this.mode.isEmpty();
891    }
892
893    /**
894     * @param value {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
895     */
896    public ListResource setModeElement(Enumeration<ListMode> value) { 
897      this.mode = value;
898      return this;
899    }
900
901    /**
902     * @return How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.
903     */
904    public ListMode getMode() { 
905      return this.mode == null ? null : this.mode.getValue();
906    }
907
908    /**
909     * @param value How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.
910     */
911    public ListResource setMode(ListMode value) { 
912        if (this.mode == null)
913          this.mode = new Enumeration<ListMode>(new ListModeEnumFactory());
914        this.mode.setValue(value);
915      return this;
916    }
917
918    /**
919     * @return {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
920     */
921    public StringType getTitleElement() { 
922      if (this.title == null)
923        if (Configuration.errorOnAutoCreate())
924          throw new Error("Attempt to auto-create List.title");
925        else if (Configuration.doAutoCreate())
926          this.title = new StringType(); // bb
927      return this.title;
928    }
929
930    public boolean hasTitleElement() { 
931      return this.title != null && !this.title.isEmpty();
932    }
933
934    public boolean hasTitle() { 
935      return this.title != null && !this.title.isEmpty();
936    }
937
938    /**
939     * @param value {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
940     */
941    public ListResource setTitleElement(StringType value) { 
942      this.title = value;
943      return this;
944    }
945
946    /**
947     * @return A label for the list assigned by the author.
948     */
949    public String getTitle() { 
950      return this.title == null ? null : this.title.getValue();
951    }
952
953    /**
954     * @param value A label for the list assigned by the author.
955     */
956    public ListResource setTitle(String value) { 
957      if (Utilities.noString(value))
958        this.title = null;
959      else {
960        if (this.title == null)
961          this.title = new StringType();
962        this.title.setValue(value);
963      }
964      return this;
965    }
966
967    /**
968     * @return {@link #code} (This code defines the purpose of the list - why it was created.)
969     */
970    public CodeableConcept getCode() { 
971      if (this.code == null)
972        if (Configuration.errorOnAutoCreate())
973          throw new Error("Attempt to auto-create List.code");
974        else if (Configuration.doAutoCreate())
975          this.code = new CodeableConcept(); // cc
976      return this.code;
977    }
978
979    public boolean hasCode() { 
980      return this.code != null && !this.code.isEmpty();
981    }
982
983    /**
984     * @param value {@link #code} (This code defines the purpose of the list - why it was created.)
985     */
986    public ListResource setCode(CodeableConcept value) { 
987      this.code = value;
988      return this;
989    }
990
991    /**
992     * @return {@link #subject} (The common subject (or patient) of the resources that are in the list if there is one.)
993     */
994    public Reference getSubject() { 
995      if (this.subject == null)
996        if (Configuration.errorOnAutoCreate())
997          throw new Error("Attempt to auto-create List.subject");
998        else if (Configuration.doAutoCreate())
999          this.subject = new Reference(); // cc
1000      return this.subject;
1001    }
1002
1003    public boolean hasSubject() { 
1004      return this.subject != null && !this.subject.isEmpty();
1005    }
1006
1007    /**
1008     * @param value {@link #subject} (The common subject (or patient) of the resources that are in the list if there is one.)
1009     */
1010    public ListResource setSubject(Reference value) { 
1011      this.subject = value;
1012      return this;
1013    }
1014
1015    /**
1016     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list if there is one.)
1017     */
1018    public Resource getSubjectTarget() { 
1019      return this.subjectTarget;
1020    }
1021
1022    /**
1023     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list if there is one.)
1024     */
1025    public ListResource setSubjectTarget(Resource value) { 
1026      this.subjectTarget = value;
1027      return this;
1028    }
1029
1030    /**
1031     * @return {@link #encounter} (The encounter that is the context in which this list was created.)
1032     */
1033    public Reference getEncounter() { 
1034      if (this.encounter == null)
1035        if (Configuration.errorOnAutoCreate())
1036          throw new Error("Attempt to auto-create List.encounter");
1037        else if (Configuration.doAutoCreate())
1038          this.encounter = new Reference(); // cc
1039      return this.encounter;
1040    }
1041
1042    public boolean hasEncounter() { 
1043      return this.encounter != null && !this.encounter.isEmpty();
1044    }
1045
1046    /**
1047     * @param value {@link #encounter} (The encounter that is the context in which this list was created.)
1048     */
1049    public ListResource setEncounter(Reference value) { 
1050      this.encounter = value;
1051      return this;
1052    }
1053
1054    /**
1055     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter that is the context in which this list was created.)
1056     */
1057    public Encounter getEncounterTarget() { 
1058      if (this.encounterTarget == null)
1059        if (Configuration.errorOnAutoCreate())
1060          throw new Error("Attempt to auto-create List.encounter");
1061        else if (Configuration.doAutoCreate())
1062          this.encounterTarget = new Encounter(); // aa
1063      return this.encounterTarget;
1064    }
1065
1066    /**
1067     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter that is the context in which this list was created.)
1068     */
1069    public ListResource setEncounterTarget(Encounter value) { 
1070      this.encounterTarget = value;
1071      return this;
1072    }
1073
1074    /**
1075     * @return {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1076     */
1077    public DateTimeType getDateElement() { 
1078      if (this.date == null)
1079        if (Configuration.errorOnAutoCreate())
1080          throw new Error("Attempt to auto-create List.date");
1081        else if (Configuration.doAutoCreate())
1082          this.date = new DateTimeType(); // bb
1083      return this.date;
1084    }
1085
1086    public boolean hasDateElement() { 
1087      return this.date != null && !this.date.isEmpty();
1088    }
1089
1090    public boolean hasDate() { 
1091      return this.date != null && !this.date.isEmpty();
1092    }
1093
1094    /**
1095     * @param value {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1096     */
1097    public ListResource setDateElement(DateTimeType value) { 
1098      this.date = value;
1099      return this;
1100    }
1101
1102    /**
1103     * @return The date that the list was prepared.
1104     */
1105    public Date getDate() { 
1106      return this.date == null ? null : this.date.getValue();
1107    }
1108
1109    /**
1110     * @param value The date that the list was prepared.
1111     */
1112    public ListResource setDate(Date value) { 
1113      if (value == null)
1114        this.date = null;
1115      else {
1116        if (this.date == null)
1117          this.date = new DateTimeType();
1118        this.date.setValue(value);
1119      }
1120      return this;
1121    }
1122
1123    /**
1124     * @return {@link #source} (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.)
1125     */
1126    public Reference getSource() { 
1127      if (this.source == null)
1128        if (Configuration.errorOnAutoCreate())
1129          throw new Error("Attempt to auto-create List.source");
1130        else if (Configuration.doAutoCreate())
1131          this.source = new Reference(); // cc
1132      return this.source;
1133    }
1134
1135    public boolean hasSource() { 
1136      return this.source != null && !this.source.isEmpty();
1137    }
1138
1139    /**
1140     * @param value {@link #source} (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.)
1141     */
1142    public ListResource setSource(Reference value) { 
1143      this.source = value;
1144      return this;
1145    }
1146
1147    /**
1148     * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.)
1149     */
1150    public Resource getSourceTarget() { 
1151      return this.sourceTarget;
1152    }
1153
1154    /**
1155     * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.)
1156     */
1157    public ListResource setSourceTarget(Resource value) { 
1158      this.sourceTarget = value;
1159      return this;
1160    }
1161
1162    /**
1163     * @return {@link #orderedBy} (What order applies to the items in the list.)
1164     */
1165    public CodeableConcept getOrderedBy() { 
1166      if (this.orderedBy == null)
1167        if (Configuration.errorOnAutoCreate())
1168          throw new Error("Attempt to auto-create List.orderedBy");
1169        else if (Configuration.doAutoCreate())
1170          this.orderedBy = new CodeableConcept(); // cc
1171      return this.orderedBy;
1172    }
1173
1174    public boolean hasOrderedBy() { 
1175      return this.orderedBy != null && !this.orderedBy.isEmpty();
1176    }
1177
1178    /**
1179     * @param value {@link #orderedBy} (What order applies to the items in the list.)
1180     */
1181    public ListResource setOrderedBy(CodeableConcept value) { 
1182      this.orderedBy = value;
1183      return this;
1184    }
1185
1186    /**
1187     * @return {@link #note} (Comments that apply to the overall list.)
1188     */
1189    public List<Annotation> getNote() { 
1190      if (this.note == null)
1191        this.note = new ArrayList<Annotation>();
1192      return this.note;
1193    }
1194
1195    /**
1196     * @return Returns a reference to <code>this</code> for easy method chaining
1197     */
1198    public ListResource setNote(List<Annotation> theNote) { 
1199      this.note = theNote;
1200      return this;
1201    }
1202
1203    public boolean hasNote() { 
1204      if (this.note == null)
1205        return false;
1206      for (Annotation item : this.note)
1207        if (!item.isEmpty())
1208          return true;
1209      return false;
1210    }
1211
1212    public Annotation addNote() { //3
1213      Annotation t = new Annotation();
1214      if (this.note == null)
1215        this.note = new ArrayList<Annotation>();
1216      this.note.add(t);
1217      return t;
1218    }
1219
1220    public ListResource addNote(Annotation t) { //3
1221      if (t == null)
1222        return this;
1223      if (this.note == null)
1224        this.note = new ArrayList<Annotation>();
1225      this.note.add(t);
1226      return this;
1227    }
1228
1229    /**
1230     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1231     */
1232    public Annotation getNoteFirstRep() { 
1233      if (getNote().isEmpty()) {
1234        addNote();
1235      }
1236      return getNote().get(0);
1237    }
1238
1239    /**
1240     * @return {@link #entry} (Entries in this list.)
1241     */
1242    public List<ListEntryComponent> getEntry() { 
1243      if (this.entry == null)
1244        this.entry = new ArrayList<ListEntryComponent>();
1245      return this.entry;
1246    }
1247
1248    /**
1249     * @return Returns a reference to <code>this</code> for easy method chaining
1250     */
1251    public ListResource setEntry(List<ListEntryComponent> theEntry) { 
1252      this.entry = theEntry;
1253      return this;
1254    }
1255
1256    public boolean hasEntry() { 
1257      if (this.entry == null)
1258        return false;
1259      for (ListEntryComponent item : this.entry)
1260        if (!item.isEmpty())
1261          return true;
1262      return false;
1263    }
1264
1265    public ListEntryComponent addEntry() { //3
1266      ListEntryComponent t = new ListEntryComponent();
1267      if (this.entry == null)
1268        this.entry = new ArrayList<ListEntryComponent>();
1269      this.entry.add(t);
1270      return t;
1271    }
1272
1273    public ListResource addEntry(ListEntryComponent t) { //3
1274      if (t == null)
1275        return this;
1276      if (this.entry == null)
1277        this.entry = new ArrayList<ListEntryComponent>();
1278      this.entry.add(t);
1279      return this;
1280    }
1281
1282    /**
1283     * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist
1284     */
1285    public ListEntryComponent getEntryFirstRep() { 
1286      if (getEntry().isEmpty()) {
1287        addEntry();
1288      }
1289      return getEntry().get(0);
1290    }
1291
1292    /**
1293     * @return {@link #emptyReason} (If the list is empty, why the list is empty.)
1294     */
1295    public CodeableConcept getEmptyReason() { 
1296      if (this.emptyReason == null)
1297        if (Configuration.errorOnAutoCreate())
1298          throw new Error("Attempt to auto-create List.emptyReason");
1299        else if (Configuration.doAutoCreate())
1300          this.emptyReason = new CodeableConcept(); // cc
1301      return this.emptyReason;
1302    }
1303
1304    public boolean hasEmptyReason() { 
1305      return this.emptyReason != null && !this.emptyReason.isEmpty();
1306    }
1307
1308    /**
1309     * @param value {@link #emptyReason} (If the list is empty, why the list is empty.)
1310     */
1311    public ListResource setEmptyReason(CodeableConcept value) { 
1312      this.emptyReason = value;
1313      return this;
1314    }
1315
1316      protected void listChildren(List<Property> children) {
1317        super.listChildren(children);
1318        children.add(new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier));
1319        children.add(new Property("status", "code", "Indicates the current state of this list.", 0, 1, status));
1320        children.add(new Property("mode", "code", "How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, 1, mode));
1321        children.add(new Property("title", "string", "A label for the list assigned by the author.", 0, 1, title));
1322        children.add(new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, 1, code));
1323        children.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list if there is one.", 0, 1, subject));
1324        children.add(new Property("encounter", "Reference(Encounter)", "The encounter that is the context in which this list was created.", 0, 1, encounter));
1325        children.add(new Property("date", "dateTime", "The date that the list was prepared.", 0, 1, date));
1326        children.add(new Property("source", "Reference(Practitioner|PractitionerRole|Patient|Device)", "The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.", 0, 1, source));
1327        children.add(new Property("orderedBy", "CodeableConcept", "What order applies to the items in the list.", 0, 1, orderedBy));
1328        children.add(new Property("note", "Annotation", "Comments that apply to the overall list.", 0, java.lang.Integer.MAX_VALUE, note));
1329        children.add(new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry));
1330        children.add(new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, 1, emptyReason));
1331      }
1332
1333      @Override
1334      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1335        switch (_hash) {
1336        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier);
1337        case -892481550: /*status*/  return new Property("status", "code", "Indicates the current state of this list.", 0, 1, status);
1338        case 3357091: /*mode*/  return new Property("mode", "code", "How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, 1, mode);
1339        case 110371416: /*title*/  return new Property("title", "string", "A label for the list assigned by the author.", 0, 1, title);
1340        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, 1, code);
1341        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list if there is one.", 0, 1, subject);
1342        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The encounter that is the context in which this list was created.", 0, 1, encounter);
1343        case 3076014: /*date*/  return new Property("date", "dateTime", "The date that the list was prepared.", 0, 1, date);
1344        case -896505829: /*source*/  return new Property("source", "Reference(Practitioner|PractitionerRole|Patient|Device)", "The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.", 0, 1, source);
1345        case -391079516: /*orderedBy*/  return new Property("orderedBy", "CodeableConcept", "What order applies to the items in the list.", 0, 1, orderedBy);
1346        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments that apply to the overall list.", 0, java.lang.Integer.MAX_VALUE, note);
1347        case 96667762: /*entry*/  return new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry);
1348        case 1140135409: /*emptyReason*/  return new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, 1, emptyReason);
1349        default: return super.getNamedProperty(_hash, _name, _checkValid);
1350        }
1351
1352      }
1353
1354      @Override
1355      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1356        switch (hash) {
1357        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1358        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ListStatus>
1359        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<ListMode>
1360        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
1361        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1362        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1363        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1364        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1365        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference
1366        case -391079516: /*orderedBy*/ return this.orderedBy == null ? new Base[0] : new Base[] {this.orderedBy}; // CodeableConcept
1367        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1368        case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // ListEntryComponent
1369        case 1140135409: /*emptyReason*/ return this.emptyReason == null ? new Base[0] : new Base[] {this.emptyReason}; // CodeableConcept
1370        default: return super.getProperty(hash, name, checkValid);
1371        }
1372
1373      }
1374
1375      @Override
1376      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1377        switch (hash) {
1378        case -1618432855: // identifier
1379          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1380          return value;
1381        case -892481550: // status
1382          value = new ListStatusEnumFactory().fromType(castToCode(value));
1383          this.status = (Enumeration) value; // Enumeration<ListStatus>
1384          return value;
1385        case 3357091: // mode
1386          value = new ListModeEnumFactory().fromType(castToCode(value));
1387          this.mode = (Enumeration) value; // Enumeration<ListMode>
1388          return value;
1389        case 110371416: // title
1390          this.title = castToString(value); // StringType
1391          return value;
1392        case 3059181: // code
1393          this.code = castToCodeableConcept(value); // CodeableConcept
1394          return value;
1395        case -1867885268: // subject
1396          this.subject = castToReference(value); // Reference
1397          return value;
1398        case 1524132147: // encounter
1399          this.encounter = castToReference(value); // Reference
1400          return value;
1401        case 3076014: // date
1402          this.date = castToDateTime(value); // DateTimeType
1403          return value;
1404        case -896505829: // source
1405          this.source = castToReference(value); // Reference
1406          return value;
1407        case -391079516: // orderedBy
1408          this.orderedBy = castToCodeableConcept(value); // CodeableConcept
1409          return value;
1410        case 3387378: // note
1411          this.getNote().add(castToAnnotation(value)); // Annotation
1412          return value;
1413        case 96667762: // entry
1414          this.getEntry().add((ListEntryComponent) value); // ListEntryComponent
1415          return value;
1416        case 1140135409: // emptyReason
1417          this.emptyReason = castToCodeableConcept(value); // CodeableConcept
1418          return value;
1419        default: return super.setProperty(hash, name, value);
1420        }
1421
1422      }
1423
1424      @Override
1425      public Base setProperty(String name, Base value) throws FHIRException {
1426        if (name.equals("identifier")) {
1427          this.getIdentifier().add(castToIdentifier(value));
1428        } else if (name.equals("status")) {
1429          value = new ListStatusEnumFactory().fromType(castToCode(value));
1430          this.status = (Enumeration) value; // Enumeration<ListStatus>
1431        } else if (name.equals("mode")) {
1432          value = new ListModeEnumFactory().fromType(castToCode(value));
1433          this.mode = (Enumeration) value; // Enumeration<ListMode>
1434        } else if (name.equals("title")) {
1435          this.title = castToString(value); // StringType
1436        } else if (name.equals("code")) {
1437          this.code = castToCodeableConcept(value); // CodeableConcept
1438        } else if (name.equals("subject")) {
1439          this.subject = castToReference(value); // Reference
1440        } else if (name.equals("encounter")) {
1441          this.encounter = castToReference(value); // Reference
1442        } else if (name.equals("date")) {
1443          this.date = castToDateTime(value); // DateTimeType
1444        } else if (name.equals("source")) {
1445          this.source = castToReference(value); // Reference
1446        } else if (name.equals("orderedBy")) {
1447          this.orderedBy = castToCodeableConcept(value); // CodeableConcept
1448        } else if (name.equals("note")) {
1449          this.getNote().add(castToAnnotation(value));
1450        } else if (name.equals("entry")) {
1451          this.getEntry().add((ListEntryComponent) value);
1452        } else if (name.equals("emptyReason")) {
1453          this.emptyReason = castToCodeableConcept(value); // CodeableConcept
1454        } else
1455          return super.setProperty(name, value);
1456        return value;
1457      }
1458
1459      @Override
1460      public Base makeProperty(int hash, String name) throws FHIRException {
1461        switch (hash) {
1462        case -1618432855:  return addIdentifier(); 
1463        case -892481550:  return getStatusElement();
1464        case 3357091:  return getModeElement();
1465        case 110371416:  return getTitleElement();
1466        case 3059181:  return getCode(); 
1467        case -1867885268:  return getSubject(); 
1468        case 1524132147:  return getEncounter(); 
1469        case 3076014:  return getDateElement();
1470        case -896505829:  return getSource(); 
1471        case -391079516:  return getOrderedBy(); 
1472        case 3387378:  return addNote(); 
1473        case 96667762:  return addEntry(); 
1474        case 1140135409:  return getEmptyReason(); 
1475        default: return super.makeProperty(hash, name);
1476        }
1477
1478      }
1479
1480      @Override
1481      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1482        switch (hash) {
1483        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1484        case -892481550: /*status*/ return new String[] {"code"};
1485        case 3357091: /*mode*/ return new String[] {"code"};
1486        case 110371416: /*title*/ return new String[] {"string"};
1487        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1488        case -1867885268: /*subject*/ return new String[] {"Reference"};
1489        case 1524132147: /*encounter*/ return new String[] {"Reference"};
1490        case 3076014: /*date*/ return new String[] {"dateTime"};
1491        case -896505829: /*source*/ return new String[] {"Reference"};
1492        case -391079516: /*orderedBy*/ return new String[] {"CodeableConcept"};
1493        case 3387378: /*note*/ return new String[] {"Annotation"};
1494        case 96667762: /*entry*/ return new String[] {};
1495        case 1140135409: /*emptyReason*/ return new String[] {"CodeableConcept"};
1496        default: return super.getTypesForProperty(hash, name);
1497        }
1498
1499      }
1500
1501      @Override
1502      public Base addChild(String name) throws FHIRException {
1503        if (name.equals("identifier")) {
1504          return addIdentifier();
1505        }
1506        else if (name.equals("status")) {
1507          throw new FHIRException("Cannot call addChild on a primitive type List.status");
1508        }
1509        else if (name.equals("mode")) {
1510          throw new FHIRException("Cannot call addChild on a primitive type List.mode");
1511        }
1512        else if (name.equals("title")) {
1513          throw new FHIRException("Cannot call addChild on a primitive type List.title");
1514        }
1515        else if (name.equals("code")) {
1516          this.code = new CodeableConcept();
1517          return this.code;
1518        }
1519        else if (name.equals("subject")) {
1520          this.subject = new Reference();
1521          return this.subject;
1522        }
1523        else if (name.equals("encounter")) {
1524          this.encounter = new Reference();
1525          return this.encounter;
1526        }
1527        else if (name.equals("date")) {
1528          throw new FHIRException("Cannot call addChild on a primitive type List.date");
1529        }
1530        else if (name.equals("source")) {
1531          this.source = new Reference();
1532          return this.source;
1533        }
1534        else if (name.equals("orderedBy")) {
1535          this.orderedBy = new CodeableConcept();
1536          return this.orderedBy;
1537        }
1538        else if (name.equals("note")) {
1539          return addNote();
1540        }
1541        else if (name.equals("entry")) {
1542          return addEntry();
1543        }
1544        else if (name.equals("emptyReason")) {
1545          this.emptyReason = new CodeableConcept();
1546          return this.emptyReason;
1547        }
1548        else
1549          return super.addChild(name);
1550      }
1551
1552  public String fhirType() {
1553    return "List";
1554
1555  }
1556
1557      public ListResource copy() {
1558        ListResource dst = new ListResource();
1559        copyValues(dst);
1560        return dst;
1561      }
1562
1563      public void copyValues(ListResource dst) {
1564        super.copyValues(dst);
1565        if (identifier != null) {
1566          dst.identifier = new ArrayList<Identifier>();
1567          for (Identifier i : identifier)
1568            dst.identifier.add(i.copy());
1569        };
1570        dst.status = status == null ? null : status.copy();
1571        dst.mode = mode == null ? null : mode.copy();
1572        dst.title = title == null ? null : title.copy();
1573        dst.code = code == null ? null : code.copy();
1574        dst.subject = subject == null ? null : subject.copy();
1575        dst.encounter = encounter == null ? null : encounter.copy();
1576        dst.date = date == null ? null : date.copy();
1577        dst.source = source == null ? null : source.copy();
1578        dst.orderedBy = orderedBy == null ? null : orderedBy.copy();
1579        if (note != null) {
1580          dst.note = new ArrayList<Annotation>();
1581          for (Annotation i : note)
1582            dst.note.add(i.copy());
1583        };
1584        if (entry != null) {
1585          dst.entry = new ArrayList<ListEntryComponent>();
1586          for (ListEntryComponent i : entry)
1587            dst.entry.add(i.copy());
1588        };
1589        dst.emptyReason = emptyReason == null ? null : emptyReason.copy();
1590      }
1591
1592      protected ListResource typedCopy() {
1593        return copy();
1594      }
1595
1596      @Override
1597      public boolean equalsDeep(Base other_) {
1598        if (!super.equalsDeep(other_))
1599          return false;
1600        if (!(other_ instanceof ListResource))
1601          return false;
1602        ListResource o = (ListResource) other_;
1603        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(mode, o.mode, true)
1604           && compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true)
1605           && compareDeep(encounter, o.encounter, true) && compareDeep(date, o.date, true) && compareDeep(source, o.source, true)
1606           && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(note, o.note, true) && compareDeep(entry, o.entry, true)
1607           && compareDeep(emptyReason, o.emptyReason, true);
1608      }
1609
1610      @Override
1611      public boolean equalsShallow(Base other_) {
1612        if (!super.equalsShallow(other_))
1613          return false;
1614        if (!(other_ instanceof ListResource))
1615          return false;
1616        ListResource o = (ListResource) other_;
1617        return compareValues(status, o.status, true) && compareValues(mode, o.mode, true) && compareValues(title, o.title, true)
1618           && compareValues(date, o.date, true);
1619      }
1620
1621      public boolean isEmpty() {
1622        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, mode
1623          , title, code, subject, encounter, date, source, orderedBy, note, entry, emptyReason
1624          );
1625      }
1626
1627  @Override
1628  public ResourceType getResourceType() {
1629    return ResourceType.List;
1630   }
1631
1632 /**
1633   * Search parameter: <b>date</b>
1634   * <p>
1635   * Description: <b>When the list was prepared</b><br>
1636   * Type: <b>date</b><br>
1637   * Path: <b>List.date</b><br>
1638   * </p>
1639   */
1640  @SearchParamDefinition(name="date", path="List.date", description="When the list was prepared", type="date" )
1641  public static final String SP_DATE = "date";
1642 /**
1643   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1644   * <p>
1645   * Description: <b>When the list was prepared</b><br>
1646   * Type: <b>date</b><br>
1647   * Path: <b>List.date</b><br>
1648   * </p>
1649   */
1650  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1651
1652 /**
1653   * Search parameter: <b>identifier</b>
1654   * <p>
1655   * Description: <b>Business identifier</b><br>
1656   * Type: <b>token</b><br>
1657   * Path: <b>List.identifier</b><br>
1658   * </p>
1659   */
1660  @SearchParamDefinition(name="identifier", path="List.identifier", description="Business identifier", type="token" )
1661  public static final String SP_IDENTIFIER = "identifier";
1662 /**
1663   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1664   * <p>
1665   * Description: <b>Business identifier</b><br>
1666   * Type: <b>token</b><br>
1667   * Path: <b>List.identifier</b><br>
1668   * </p>
1669   */
1670  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1671
1672 /**
1673   * Search parameter: <b>item</b>
1674   * <p>
1675   * Description: <b>Actual entry</b><br>
1676   * Type: <b>reference</b><br>
1677   * Path: <b>List.entry.item</b><br>
1678   * </p>
1679   */
1680  @SearchParamDefinition(name="item", path="List.entry.item", description="Actual entry", type="reference" )
1681  public static final String SP_ITEM = "item";
1682 /**
1683   * <b>Fluent Client</b> search parameter constant for <b>item</b>
1684   * <p>
1685   * Description: <b>Actual entry</b><br>
1686   * Type: <b>reference</b><br>
1687   * Path: <b>List.entry.item</b><br>
1688   * </p>
1689   */
1690  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ITEM);
1691
1692/**
1693   * Constant for fluent queries to be used to add include statements. Specifies
1694   * the path value of "<b>List:item</b>".
1695   */
1696  public static final ca.uhn.fhir.model.api.Include INCLUDE_ITEM = new ca.uhn.fhir.model.api.Include("List:item").toLocked();
1697
1698 /**
1699   * Search parameter: <b>empty-reason</b>
1700   * <p>
1701   * Description: <b>Why list is empty</b><br>
1702   * Type: <b>token</b><br>
1703   * Path: <b>List.emptyReason</b><br>
1704   * </p>
1705   */
1706  @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="Why list is empty", type="token" )
1707  public static final String SP_EMPTY_REASON = "empty-reason";
1708 /**
1709   * <b>Fluent Client</b> search parameter constant for <b>empty-reason</b>
1710   * <p>
1711   * Description: <b>Why list is empty</b><br>
1712   * Type: <b>token</b><br>
1713   * Path: <b>List.emptyReason</b><br>
1714   * </p>
1715   */
1716  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMPTY_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMPTY_REASON);
1717
1718 /**
1719   * Search parameter: <b>code</b>
1720   * <p>
1721   * Description: <b>What the purpose of this list is</b><br>
1722   * Type: <b>token</b><br>
1723   * Path: <b>List.code</b><br>
1724   * </p>
1725   */
1726  @SearchParamDefinition(name="code", path="List.code", description="What the purpose of this list is", type="token" )
1727  public static final String SP_CODE = "code";
1728 /**
1729   * <b>Fluent Client</b> search parameter constant for <b>code</b>
1730   * <p>
1731   * Description: <b>What the purpose of this list is</b><br>
1732   * Type: <b>token</b><br>
1733   * Path: <b>List.code</b><br>
1734   * </p>
1735   */
1736  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
1737
1738 /**
1739   * Search parameter: <b>notes</b>
1740   * <p>
1741   * Description: <b>The annotation  - text content (as markdown)</b><br>
1742   * Type: <b>string</b><br>
1743   * Path: <b>List.note.text</b><br>
1744   * </p>
1745   */
1746  @SearchParamDefinition(name="notes", path="List.note.text", description="The annotation  - text content (as markdown)", type="string" )
1747  public static final String SP_NOTES = "notes";
1748 /**
1749   * <b>Fluent Client</b> search parameter constant for <b>notes</b>
1750   * <p>
1751   * Description: <b>The annotation  - text content (as markdown)</b><br>
1752   * Type: <b>string</b><br>
1753   * Path: <b>List.note.text</b><br>
1754   * </p>
1755   */
1756  public static final ca.uhn.fhir.rest.gclient.StringClientParam NOTES = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NOTES);
1757
1758 /**
1759   * Search parameter: <b>subject</b>
1760   * <p>
1761   * Description: <b>If all resources have the same subject</b><br>
1762   * Type: <b>reference</b><br>
1763   * Path: <b>List.subject</b><br>
1764   * </p>
1765   */
1766  @SearchParamDefinition(name="subject", path="List.subject", description="If all resources have the same subject", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Device.class, Group.class, Location.class, Patient.class } )
1767  public static final String SP_SUBJECT = "subject";
1768 /**
1769   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1770   * <p>
1771   * Description: <b>If all resources have the same subject</b><br>
1772   * Type: <b>reference</b><br>
1773   * Path: <b>List.subject</b><br>
1774   * </p>
1775   */
1776  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1777
1778/**
1779   * Constant for fluent queries to be used to add include statements. Specifies
1780   * the path value of "<b>List:subject</b>".
1781   */
1782  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("List:subject").toLocked();
1783
1784 /**
1785   * Search parameter: <b>patient</b>
1786   * <p>
1787   * Description: <b>If all resources have the same subject</b><br>
1788   * Type: <b>reference</b><br>
1789   * Path: <b>List.subject</b><br>
1790   * </p>
1791   */
1792  @SearchParamDefinition(name="patient", path="List.subject.where(resolve() is Patient)", description="If all resources have the same subject", type="reference", target={Patient.class } )
1793  public static final String SP_PATIENT = "patient";
1794 /**
1795   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1796   * <p>
1797   * Description: <b>If all resources have the same subject</b><br>
1798   * Type: <b>reference</b><br>
1799   * Path: <b>List.subject</b><br>
1800   * </p>
1801   */
1802  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1803
1804/**
1805   * Constant for fluent queries to be used to add include statements. Specifies
1806   * the path value of "<b>List:patient</b>".
1807   */
1808  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("List:patient").toLocked();
1809
1810 /**
1811   * Search parameter: <b>source</b>
1812   * <p>
1813   * Description: <b>Who and/or what defined the list contents (aka Author)</b><br>
1814   * Type: <b>reference</b><br>
1815   * Path: <b>List.source</b><br>
1816   * </p>
1817   */
1818  @SearchParamDefinition(name="source", path="List.source", description="Who and/or what defined the list contents (aka Author)", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Device.class, Patient.class, Practitioner.class, PractitionerRole.class } )
1819  public static final String SP_SOURCE = "source";
1820 /**
1821   * <b>Fluent Client</b> search parameter constant for <b>source</b>
1822   * <p>
1823   * Description: <b>Who and/or what defined the list contents (aka Author)</b><br>
1824   * Type: <b>reference</b><br>
1825   * Path: <b>List.source</b><br>
1826   * </p>
1827   */
1828  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE);
1829
1830/**
1831   * Constant for fluent queries to be used to add include statements. Specifies
1832   * the path value of "<b>List:source</b>".
1833   */
1834  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("List:source").toLocked();
1835
1836 /**
1837   * Search parameter: <b>encounter</b>
1838   * <p>
1839   * Description: <b>Context in which list created</b><br>
1840   * Type: <b>reference</b><br>
1841   * Path: <b>List.encounter</b><br>
1842   * </p>
1843   */
1844  @SearchParamDefinition(name="encounter", path="List.encounter", description="Context in which list created", type="reference", target={Encounter.class } )
1845  public static final String SP_ENCOUNTER = "encounter";
1846 /**
1847   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
1848   * <p>
1849   * Description: <b>Context in which list created</b><br>
1850   * Type: <b>reference</b><br>
1851   * Path: <b>List.encounter</b><br>
1852   * </p>
1853   */
1854  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
1855
1856/**
1857   * Constant for fluent queries to be used to add include statements. Specifies
1858   * the path value of "<b>List:encounter</b>".
1859   */
1860  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("List:encounter").toLocked();
1861
1862 /**
1863   * Search parameter: <b>title</b>
1864   * <p>
1865   * Description: <b>Descriptive name for the list</b><br>
1866   * Type: <b>string</b><br>
1867   * Path: <b>List.title</b><br>
1868   * </p>
1869   */
1870  @SearchParamDefinition(name="title", path="List.title", description="Descriptive name for the list", type="string" )
1871  public static final String SP_TITLE = "title";
1872 /**
1873   * <b>Fluent Client</b> search parameter constant for <b>title</b>
1874   * <p>
1875   * Description: <b>Descriptive name for the list</b><br>
1876   * Type: <b>string</b><br>
1877   * Path: <b>List.title</b><br>
1878   * </p>
1879   */
1880  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
1881
1882 /**
1883   * Search parameter: <b>status</b>
1884   * <p>
1885   * Description: <b>current | retired | entered-in-error</b><br>
1886   * Type: <b>token</b><br>
1887   * Path: <b>List.status</b><br>
1888   * </p>
1889   */
1890  @SearchParamDefinition(name="status", path="List.status", description="current | retired | entered-in-error", type="token" )
1891  public static final String SP_STATUS = "status";
1892 /**
1893   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1894   * <p>
1895   * Description: <b>current | retired | entered-in-error</b><br>
1896   * Type: <b>token</b><br>
1897   * Path: <b>List.status</b><br>
1898   * </p>
1899   */
1900  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1901
1902
1903}