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