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 * The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.
050 */
051@ResourceDef(name="MeasureReport", profile="http://hl7.org/fhir/StructureDefinition/MeasureReport")
052public class MeasureReport extends DomainResource {
053
054    public enum MeasureReportStatus {
055        /**
056         * The report is complete and ready for use.
057         */
058        COMPLETE, 
059        /**
060         * The report is currently being generated.
061         */
062        PENDING, 
063        /**
064         * An error occurred attempting to generate the report.
065         */
066        ERROR, 
067        /**
068         * added to help the parsers with the generic types
069         */
070        NULL;
071        public static MeasureReportStatus fromCode(String codeString) throws FHIRException {
072            if (codeString == null || "".equals(codeString))
073                return null;
074        if ("complete".equals(codeString))
075          return COMPLETE;
076        if ("pending".equals(codeString))
077          return PENDING;
078        if ("error".equals(codeString))
079          return ERROR;
080        if (Configuration.isAcceptInvalidEnums())
081          return null;
082        else
083          throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'");
084        }
085        public String toCode() {
086          switch (this) {
087            case COMPLETE: return "complete";
088            case PENDING: return "pending";
089            case ERROR: return "error";
090            default: return "?";
091          }
092        }
093        public String getSystem() {
094          switch (this) {
095            case COMPLETE: return "http://hl7.org/fhir/measure-report-status";
096            case PENDING: return "http://hl7.org/fhir/measure-report-status";
097            case ERROR: return "http://hl7.org/fhir/measure-report-status";
098            default: return "?";
099          }
100        }
101        public String getDefinition() {
102          switch (this) {
103            case COMPLETE: return "The report is complete and ready for use.";
104            case PENDING: return "The report is currently being generated.";
105            case ERROR: return "An error occurred attempting to generate the report.";
106            default: return "?";
107          }
108        }
109        public String getDisplay() {
110          switch (this) {
111            case COMPLETE: return "Complete";
112            case PENDING: return "Pending";
113            case ERROR: return "Error";
114            default: return "?";
115          }
116        }
117    }
118
119  public static class MeasureReportStatusEnumFactory implements EnumFactory<MeasureReportStatus> {
120    public MeasureReportStatus fromCode(String codeString) throws IllegalArgumentException {
121      if (codeString == null || "".equals(codeString))
122            if (codeString == null || "".equals(codeString))
123                return null;
124        if ("complete".equals(codeString))
125          return MeasureReportStatus.COMPLETE;
126        if ("pending".equals(codeString))
127          return MeasureReportStatus.PENDING;
128        if ("error".equals(codeString))
129          return MeasureReportStatus.ERROR;
130        throw new IllegalArgumentException("Unknown MeasureReportStatus code '"+codeString+"'");
131        }
132        public Enumeration<MeasureReportStatus> fromType(Base code) throws FHIRException {
133          if (code == null)
134            return null;
135          if (code.isEmpty())
136            return new Enumeration<MeasureReportStatus>(this);
137          String codeString = ((PrimitiveType) code).asStringValue();
138          if (codeString == null || "".equals(codeString))
139            return null;
140        if ("complete".equals(codeString))
141          return new Enumeration<MeasureReportStatus>(this, MeasureReportStatus.COMPLETE);
142        if ("pending".equals(codeString))
143          return new Enumeration<MeasureReportStatus>(this, MeasureReportStatus.PENDING);
144        if ("error".equals(codeString))
145          return new Enumeration<MeasureReportStatus>(this, MeasureReportStatus.ERROR);
146        throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'");
147        }
148    public String toCode(MeasureReportStatus code) {
149      if (code == MeasureReportStatus.COMPLETE)
150        return "complete";
151      if (code == MeasureReportStatus.PENDING)
152        return "pending";
153      if (code == MeasureReportStatus.ERROR)
154        return "error";
155      return "?";
156      }
157    public String toSystem(MeasureReportStatus code) {
158      return code.getSystem();
159      }
160    }
161
162    public enum MeasureReportType {
163        /**
164         * An individual report that provides information on the performance for a given measure with respect to a single subject.
165         */
166        INDIVIDUAL, 
167        /**
168         * A subject list report that includes a listing of subjects that satisfied each population criteria in the measure.
169         */
170        SUBJECTLIST, 
171        /**
172         * A summary report that returns the number of members in each population criteria for the measure.
173         */
174        SUMMARY, 
175        /**
176         * A data collection report that contains data-of-interest for the measure.
177         */
178        DATACOLLECTION, 
179        /**
180         * added to help the parsers with the generic types
181         */
182        NULL;
183        public static MeasureReportType fromCode(String codeString) throws FHIRException {
184            if (codeString == null || "".equals(codeString))
185                return null;
186        if ("individual".equals(codeString))
187          return INDIVIDUAL;
188        if ("subject-list".equals(codeString))
189          return SUBJECTLIST;
190        if ("summary".equals(codeString))
191          return SUMMARY;
192        if ("data-collection".equals(codeString))
193          return DATACOLLECTION;
194        if (Configuration.isAcceptInvalidEnums())
195          return null;
196        else
197          throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'");
198        }
199        public String toCode() {
200          switch (this) {
201            case INDIVIDUAL: return "individual";
202            case SUBJECTLIST: return "subject-list";
203            case SUMMARY: return "summary";
204            case DATACOLLECTION: return "data-collection";
205            default: return "?";
206          }
207        }
208        public String getSystem() {
209          switch (this) {
210            case INDIVIDUAL: return "http://hl7.org/fhir/measure-report-type";
211            case SUBJECTLIST: return "http://hl7.org/fhir/measure-report-type";
212            case SUMMARY: return "http://hl7.org/fhir/measure-report-type";
213            case DATACOLLECTION: return "http://hl7.org/fhir/measure-report-type";
214            default: return "?";
215          }
216        }
217        public String getDefinition() {
218          switch (this) {
219            case INDIVIDUAL: return "An individual report that provides information on the performance for a given measure with respect to a single subject.";
220            case SUBJECTLIST: return "A subject list report that includes a listing of subjects that satisfied each population criteria in the measure.";
221            case SUMMARY: return "A summary report that returns the number of members in each population criteria for the measure.";
222            case DATACOLLECTION: return "A data collection report that contains data-of-interest for the measure.";
223            default: return "?";
224          }
225        }
226        public String getDisplay() {
227          switch (this) {
228            case INDIVIDUAL: return "Individual";
229            case SUBJECTLIST: return "Subject List";
230            case SUMMARY: return "Summary";
231            case DATACOLLECTION: return "Data Collection";
232            default: return "?";
233          }
234        }
235    }
236
237  public static class MeasureReportTypeEnumFactory implements EnumFactory<MeasureReportType> {
238    public MeasureReportType fromCode(String codeString) throws IllegalArgumentException {
239      if (codeString == null || "".equals(codeString))
240            if (codeString == null || "".equals(codeString))
241                return null;
242        if ("individual".equals(codeString))
243          return MeasureReportType.INDIVIDUAL;
244        if ("subject-list".equals(codeString))
245          return MeasureReportType.SUBJECTLIST;
246        if ("summary".equals(codeString))
247          return MeasureReportType.SUMMARY;
248        if ("data-collection".equals(codeString))
249          return MeasureReportType.DATACOLLECTION;
250        throw new IllegalArgumentException("Unknown MeasureReportType code '"+codeString+"'");
251        }
252        public Enumeration<MeasureReportType> fromType(Base code) throws FHIRException {
253          if (code == null)
254            return null;
255          if (code.isEmpty())
256            return new Enumeration<MeasureReportType>(this);
257          String codeString = ((PrimitiveType) code).asStringValue();
258          if (codeString == null || "".equals(codeString))
259            return null;
260        if ("individual".equals(codeString))
261          return new Enumeration<MeasureReportType>(this, MeasureReportType.INDIVIDUAL);
262        if ("subject-list".equals(codeString))
263          return new Enumeration<MeasureReportType>(this, MeasureReportType.SUBJECTLIST);
264        if ("summary".equals(codeString))
265          return new Enumeration<MeasureReportType>(this, MeasureReportType.SUMMARY);
266        if ("data-collection".equals(codeString))
267          return new Enumeration<MeasureReportType>(this, MeasureReportType.DATACOLLECTION);
268        throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'");
269        }
270    public String toCode(MeasureReportType code) {
271      if (code == MeasureReportType.INDIVIDUAL)
272        return "individual";
273      if (code == MeasureReportType.SUBJECTLIST)
274        return "subject-list";
275      if (code == MeasureReportType.SUMMARY)
276        return "summary";
277      if (code == MeasureReportType.DATACOLLECTION)
278        return "data-collection";
279      return "?";
280      }
281    public String toSystem(MeasureReportType code) {
282      return code.getSystem();
283      }
284    }
285
286    @Block()
287    public static class MeasureReportGroupComponent extends BackboneElement implements IBaseBackboneElement {
288        /**
289         * The meaning of the population group as defined in the measure definition.
290         */
291        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
292        @Description(shortDefinition="Meaning of the group", formalDefinition="The meaning of the population group as defined in the measure definition." )
293        protected CodeableConcept code;
294
295        /**
296         * The populations that make up the population group, one for each type of population appropriate for the measure.
297         */
298        @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
299        @Description(shortDefinition="The populations in the group", formalDefinition="The populations that make up the population group, one for each type of population appropriate for the measure." )
300        protected List<MeasureReportGroupPopulationComponent> population;
301
302        /**
303         * The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.
304         */
305        @Child(name = "measureScore", type = {Quantity.class}, order=3, min=0, max=1, modifier=false, summary=true)
306        @Description(shortDefinition="What score this group achieved", formalDefinition="The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group." )
307        protected Quantity measureScore;
308
309        /**
310         * When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.
311         */
312        @Child(name = "stratifier", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
313        @Description(shortDefinition="Stratification results", formalDefinition="When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure." )
314        protected List<MeasureReportGroupStratifierComponent> stratifier;
315
316        private static final long serialVersionUID = 1744426009L;
317
318    /**
319     * Constructor
320     */
321      public MeasureReportGroupComponent() {
322        super();
323      }
324
325        /**
326         * @return {@link #code} (The meaning of the population group as defined in the measure definition.)
327         */
328        public CodeableConcept getCode() { 
329          if (this.code == null)
330            if (Configuration.errorOnAutoCreate())
331              throw new Error("Attempt to auto-create MeasureReportGroupComponent.code");
332            else if (Configuration.doAutoCreate())
333              this.code = new CodeableConcept(); // cc
334          return this.code;
335        }
336
337        public boolean hasCode() { 
338          return this.code != null && !this.code.isEmpty();
339        }
340
341        /**
342         * @param value {@link #code} (The meaning of the population group as defined in the measure definition.)
343         */
344        public MeasureReportGroupComponent setCode(CodeableConcept value) { 
345          this.code = value;
346          return this;
347        }
348
349        /**
350         * @return {@link #population} (The populations that make up the population group, one for each type of population appropriate for the measure.)
351         */
352        public List<MeasureReportGroupPopulationComponent> getPopulation() { 
353          if (this.population == null)
354            this.population = new ArrayList<MeasureReportGroupPopulationComponent>();
355          return this.population;
356        }
357
358        /**
359         * @return Returns a reference to <code>this</code> for easy method chaining
360         */
361        public MeasureReportGroupComponent setPopulation(List<MeasureReportGroupPopulationComponent> thePopulation) { 
362          this.population = thePopulation;
363          return this;
364        }
365
366        public boolean hasPopulation() { 
367          if (this.population == null)
368            return false;
369          for (MeasureReportGroupPopulationComponent item : this.population)
370            if (!item.isEmpty())
371              return true;
372          return false;
373        }
374
375        public MeasureReportGroupPopulationComponent addPopulation() { //3
376          MeasureReportGroupPopulationComponent t = new MeasureReportGroupPopulationComponent();
377          if (this.population == null)
378            this.population = new ArrayList<MeasureReportGroupPopulationComponent>();
379          this.population.add(t);
380          return t;
381        }
382
383        public MeasureReportGroupComponent addPopulation(MeasureReportGroupPopulationComponent t) { //3
384          if (t == null)
385            return this;
386          if (this.population == null)
387            this.population = new ArrayList<MeasureReportGroupPopulationComponent>();
388          this.population.add(t);
389          return this;
390        }
391
392        /**
393         * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist
394         */
395        public MeasureReportGroupPopulationComponent getPopulationFirstRep() { 
396          if (getPopulation().isEmpty()) {
397            addPopulation();
398          }
399          return getPopulation().get(0);
400        }
401
402        /**
403         * @return {@link #measureScore} (The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.)
404         */
405        public Quantity getMeasureScore() { 
406          if (this.measureScore == null)
407            if (Configuration.errorOnAutoCreate())
408              throw new Error("Attempt to auto-create MeasureReportGroupComponent.measureScore");
409            else if (Configuration.doAutoCreate())
410              this.measureScore = new Quantity(); // cc
411          return this.measureScore;
412        }
413
414        public boolean hasMeasureScore() { 
415          return this.measureScore != null && !this.measureScore.isEmpty();
416        }
417
418        /**
419         * @param value {@link #measureScore} (The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.)
420         */
421        public MeasureReportGroupComponent setMeasureScore(Quantity value) { 
422          this.measureScore = value;
423          return this;
424        }
425
426        /**
427         * @return {@link #stratifier} (When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.)
428         */
429        public List<MeasureReportGroupStratifierComponent> getStratifier() { 
430          if (this.stratifier == null)
431            this.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
432          return this.stratifier;
433        }
434
435        /**
436         * @return Returns a reference to <code>this</code> for easy method chaining
437         */
438        public MeasureReportGroupComponent setStratifier(List<MeasureReportGroupStratifierComponent> theStratifier) { 
439          this.stratifier = theStratifier;
440          return this;
441        }
442
443        public boolean hasStratifier() { 
444          if (this.stratifier == null)
445            return false;
446          for (MeasureReportGroupStratifierComponent item : this.stratifier)
447            if (!item.isEmpty())
448              return true;
449          return false;
450        }
451
452        public MeasureReportGroupStratifierComponent addStratifier() { //3
453          MeasureReportGroupStratifierComponent t = new MeasureReportGroupStratifierComponent();
454          if (this.stratifier == null)
455            this.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
456          this.stratifier.add(t);
457          return t;
458        }
459
460        public MeasureReportGroupComponent addStratifier(MeasureReportGroupStratifierComponent t) { //3
461          if (t == null)
462            return this;
463          if (this.stratifier == null)
464            this.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
465          this.stratifier.add(t);
466          return this;
467        }
468
469        /**
470         * @return The first repetition of repeating field {@link #stratifier}, creating it if it does not already exist
471         */
472        public MeasureReportGroupStratifierComponent getStratifierFirstRep() { 
473          if (getStratifier().isEmpty()) {
474            addStratifier();
475          }
476          return getStratifier().get(0);
477        }
478
479        protected void listChildren(List<Property> children) {
480          super.listChildren(children);
481          children.add(new Property("code", "CodeableConcept", "The meaning of the population group as defined in the measure definition.", 0, 1, code));
482          children.add(new Property("population", "", "The populations that make up the population group, one for each type of population appropriate for the measure.", 0, java.lang.Integer.MAX_VALUE, population));
483          children.add(new Property("measureScore", "Quantity", "The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.", 0, 1, measureScore));
484          children.add(new Property("stratifier", "", "When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.", 0, java.lang.Integer.MAX_VALUE, stratifier));
485        }
486
487        @Override
488        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
489          switch (_hash) {
490          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The meaning of the population group as defined in the measure definition.", 0, 1, code);
491          case -2023558323: /*population*/  return new Property("population", "", "The populations that make up the population group, one for each type of population appropriate for the measure.", 0, java.lang.Integer.MAX_VALUE, population);
492          case -386313260: /*measureScore*/  return new Property("measureScore", "Quantity", "The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.", 0, 1, measureScore);
493          case 90983669: /*stratifier*/  return new Property("stratifier", "", "When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.", 0, java.lang.Integer.MAX_VALUE, stratifier);
494          default: return super.getNamedProperty(_hash, _name, _checkValid);
495          }
496
497        }
498
499      @Override
500      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
501        switch (hash) {
502        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
503        case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureReportGroupPopulationComponent
504        case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // Quantity
505        case 90983669: /*stratifier*/ return this.stratifier == null ? new Base[0] : this.stratifier.toArray(new Base[this.stratifier.size()]); // MeasureReportGroupStratifierComponent
506        default: return super.getProperty(hash, name, checkValid);
507        }
508
509      }
510
511      @Override
512      public Base setProperty(int hash, String name, Base value) throws FHIRException {
513        switch (hash) {
514        case 3059181: // code
515          this.code = castToCodeableConcept(value); // CodeableConcept
516          return value;
517        case -2023558323: // population
518          this.getPopulation().add((MeasureReportGroupPopulationComponent) value); // MeasureReportGroupPopulationComponent
519          return value;
520        case -386313260: // measureScore
521          this.measureScore = castToQuantity(value); // Quantity
522          return value;
523        case 90983669: // stratifier
524          this.getStratifier().add((MeasureReportGroupStratifierComponent) value); // MeasureReportGroupStratifierComponent
525          return value;
526        default: return super.setProperty(hash, name, value);
527        }
528
529      }
530
531      @Override
532      public Base setProperty(String name, Base value) throws FHIRException {
533        if (name.equals("code")) {
534          this.code = castToCodeableConcept(value); // CodeableConcept
535        } else if (name.equals("population")) {
536          this.getPopulation().add((MeasureReportGroupPopulationComponent) value);
537        } else if (name.equals("measureScore")) {
538          this.measureScore = castToQuantity(value); // Quantity
539        } else if (name.equals("stratifier")) {
540          this.getStratifier().add((MeasureReportGroupStratifierComponent) value);
541        } else
542          return super.setProperty(name, value);
543        return value;
544      }
545
546      @Override
547      public Base makeProperty(int hash, String name) throws FHIRException {
548        switch (hash) {
549        case 3059181:  return getCode(); 
550        case -2023558323:  return addPopulation(); 
551        case -386313260:  return getMeasureScore(); 
552        case 90983669:  return addStratifier(); 
553        default: return super.makeProperty(hash, name);
554        }
555
556      }
557
558      @Override
559      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
560        switch (hash) {
561        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
562        case -2023558323: /*population*/ return new String[] {};
563        case -386313260: /*measureScore*/ return new String[] {"Quantity"};
564        case 90983669: /*stratifier*/ return new String[] {};
565        default: return super.getTypesForProperty(hash, name);
566        }
567
568      }
569
570      @Override
571      public Base addChild(String name) throws FHIRException {
572        if (name.equals("code")) {
573          this.code = new CodeableConcept();
574          return this.code;
575        }
576        else if (name.equals("population")) {
577          return addPopulation();
578        }
579        else if (name.equals("measureScore")) {
580          this.measureScore = new Quantity();
581          return this.measureScore;
582        }
583        else if (name.equals("stratifier")) {
584          return addStratifier();
585        }
586        else
587          return super.addChild(name);
588      }
589
590      public MeasureReportGroupComponent copy() {
591        MeasureReportGroupComponent dst = new MeasureReportGroupComponent();
592        copyValues(dst);
593        return dst;
594      }
595
596      public void copyValues(MeasureReportGroupComponent dst) {
597        super.copyValues(dst);
598        dst.code = code == null ? null : code.copy();
599        if (population != null) {
600          dst.population = new ArrayList<MeasureReportGroupPopulationComponent>();
601          for (MeasureReportGroupPopulationComponent i : population)
602            dst.population.add(i.copy());
603        };
604        dst.measureScore = measureScore == null ? null : measureScore.copy();
605        if (stratifier != null) {
606          dst.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
607          for (MeasureReportGroupStratifierComponent i : stratifier)
608            dst.stratifier.add(i.copy());
609        };
610      }
611
612      @Override
613      public boolean equalsDeep(Base other_) {
614        if (!super.equalsDeep(other_))
615          return false;
616        if (!(other_ instanceof MeasureReportGroupComponent))
617          return false;
618        MeasureReportGroupComponent o = (MeasureReportGroupComponent) other_;
619        return compareDeep(code, o.code, true) && compareDeep(population, o.population, true) && compareDeep(measureScore, o.measureScore, true)
620           && compareDeep(stratifier, o.stratifier, true);
621      }
622
623      @Override
624      public boolean equalsShallow(Base other_) {
625        if (!super.equalsShallow(other_))
626          return false;
627        if (!(other_ instanceof MeasureReportGroupComponent))
628          return false;
629        MeasureReportGroupComponent o = (MeasureReportGroupComponent) other_;
630        return true;
631      }
632
633      public boolean isEmpty() {
634        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, population, measureScore
635          , stratifier);
636      }
637
638  public String fhirType() {
639    return "MeasureReport.group";
640
641  }
642
643  }
644
645    @Block()
646    public static class MeasureReportGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement {
647        /**
648         * The type of the population.
649         */
650        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
651        @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-observation", formalDefinition="The type of the population." )
652        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-population")
653        protected CodeableConcept code;
654
655        /**
656         * The number of members of the population.
657         */
658        @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false)
659        @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population." )
660        protected IntegerType count;
661
662        /**
663         * This element refers to a List of subject level MeasureReport resources, one for each subject in this population.
664         */
665        @Child(name = "subjectResults", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=false)
666        @Description(shortDefinition="For subject-list reports, the subject results in this population", formalDefinition="This element refers to a List of subject level MeasureReport resources, one for each subject in this population." )
667        protected Reference subjectResults;
668
669        /**
670         * The actual object that is the target of the reference (This element refers to a List of subject level MeasureReport resources, one for each subject in this population.)
671         */
672        protected ListResource subjectResultsTarget;
673
674        private static final long serialVersionUID = 210461445L;
675
676    /**
677     * Constructor
678     */
679      public MeasureReportGroupPopulationComponent() {
680        super();
681      }
682
683        /**
684         * @return {@link #code} (The type of the population.)
685         */
686        public CodeableConcept getCode() { 
687          if (this.code == null)
688            if (Configuration.errorOnAutoCreate())
689              throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.code");
690            else if (Configuration.doAutoCreate())
691              this.code = new CodeableConcept(); // cc
692          return this.code;
693        }
694
695        public boolean hasCode() { 
696          return this.code != null && !this.code.isEmpty();
697        }
698
699        /**
700         * @param value {@link #code} (The type of the population.)
701         */
702        public MeasureReportGroupPopulationComponent setCode(CodeableConcept value) { 
703          this.code = value;
704          return this;
705        }
706
707        /**
708         * @return {@link #count} (The number of members of the population.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value
709         */
710        public IntegerType getCountElement() { 
711          if (this.count == null)
712            if (Configuration.errorOnAutoCreate())
713              throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.count");
714            else if (Configuration.doAutoCreate())
715              this.count = new IntegerType(); // bb
716          return this.count;
717        }
718
719        public boolean hasCountElement() { 
720          return this.count != null && !this.count.isEmpty();
721        }
722
723        public boolean hasCount() { 
724          return this.count != null && !this.count.isEmpty();
725        }
726
727        /**
728         * @param value {@link #count} (The number of members of the population.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value
729         */
730        public MeasureReportGroupPopulationComponent setCountElement(IntegerType value) { 
731          this.count = value;
732          return this;
733        }
734
735        /**
736         * @return The number of members of the population.
737         */
738        public int getCount() { 
739          return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue();
740        }
741
742        /**
743         * @param value The number of members of the population.
744         */
745        public MeasureReportGroupPopulationComponent setCount(int value) { 
746            if (this.count == null)
747              this.count = new IntegerType();
748            this.count.setValue(value);
749          return this;
750        }
751
752        /**
753         * @return {@link #subjectResults} (This element refers to a List of subject level MeasureReport resources, one for each subject in this population.)
754         */
755        public Reference getSubjectResults() { 
756          if (this.subjectResults == null)
757            if (Configuration.errorOnAutoCreate())
758              throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.subjectResults");
759            else if (Configuration.doAutoCreate())
760              this.subjectResults = new Reference(); // cc
761          return this.subjectResults;
762        }
763
764        public boolean hasSubjectResults() { 
765          return this.subjectResults != null && !this.subjectResults.isEmpty();
766        }
767
768        /**
769         * @param value {@link #subjectResults} (This element refers to a List of subject level MeasureReport resources, one for each subject in this population.)
770         */
771        public MeasureReportGroupPopulationComponent setSubjectResults(Reference value) { 
772          this.subjectResults = value;
773          return this;
774        }
775
776        /**
777         * @return {@link #subjectResults} 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. (This element refers to a List of subject level MeasureReport resources, one for each subject in this population.)
778         */
779        public ListResource getSubjectResultsTarget() { 
780          if (this.subjectResultsTarget == null)
781            if (Configuration.errorOnAutoCreate())
782              throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.subjectResults");
783            else if (Configuration.doAutoCreate())
784              this.subjectResultsTarget = new ListResource(); // aa
785          return this.subjectResultsTarget;
786        }
787
788        /**
789         * @param value {@link #subjectResults} 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. (This element refers to a List of subject level MeasureReport resources, one for each subject in this population.)
790         */
791        public MeasureReportGroupPopulationComponent setSubjectResultsTarget(ListResource value) { 
792          this.subjectResultsTarget = value;
793          return this;
794        }
795
796        protected void listChildren(List<Property> children) {
797          super.listChildren(children);
798          children.add(new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code));
799          children.add(new Property("count", "integer", "The number of members of the population.", 0, 1, count));
800          children.add(new Property("subjectResults", "Reference(List)", "This element refers to a List of subject level MeasureReport resources, one for each subject in this population.", 0, 1, subjectResults));
801        }
802
803        @Override
804        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
805          switch (_hash) {
806          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code);
807          case 94851343: /*count*/  return new Property("count", "integer", "The number of members of the population.", 0, 1, count);
808          case 2136184106: /*subjectResults*/  return new Property("subjectResults", "Reference(List)", "This element refers to a List of subject level MeasureReport resources, one for each subject in this population.", 0, 1, subjectResults);
809          default: return super.getNamedProperty(_hash, _name, _checkValid);
810          }
811
812        }
813
814      @Override
815      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
816        switch (hash) {
817        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
818        case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType
819        case 2136184106: /*subjectResults*/ return this.subjectResults == null ? new Base[0] : new Base[] {this.subjectResults}; // Reference
820        default: return super.getProperty(hash, name, checkValid);
821        }
822
823      }
824
825      @Override
826      public Base setProperty(int hash, String name, Base value) throws FHIRException {
827        switch (hash) {
828        case 3059181: // code
829          this.code = castToCodeableConcept(value); // CodeableConcept
830          return value;
831        case 94851343: // count
832          this.count = castToInteger(value); // IntegerType
833          return value;
834        case 2136184106: // subjectResults
835          this.subjectResults = castToReference(value); // Reference
836          return value;
837        default: return super.setProperty(hash, name, value);
838        }
839
840      }
841
842      @Override
843      public Base setProperty(String name, Base value) throws FHIRException {
844        if (name.equals("code")) {
845          this.code = castToCodeableConcept(value); // CodeableConcept
846        } else if (name.equals("count")) {
847          this.count = castToInteger(value); // IntegerType
848        } else if (name.equals("subjectResults")) {
849          this.subjectResults = castToReference(value); // Reference
850        } else
851          return super.setProperty(name, value);
852        return value;
853      }
854
855      @Override
856      public Base makeProperty(int hash, String name) throws FHIRException {
857        switch (hash) {
858        case 3059181:  return getCode(); 
859        case 94851343:  return getCountElement();
860        case 2136184106:  return getSubjectResults(); 
861        default: return super.makeProperty(hash, name);
862        }
863
864      }
865
866      @Override
867      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
868        switch (hash) {
869        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
870        case 94851343: /*count*/ return new String[] {"integer"};
871        case 2136184106: /*subjectResults*/ return new String[] {"Reference"};
872        default: return super.getTypesForProperty(hash, name);
873        }
874
875      }
876
877      @Override
878      public Base addChild(String name) throws FHIRException {
879        if (name.equals("code")) {
880          this.code = new CodeableConcept();
881          return this.code;
882        }
883        else if (name.equals("count")) {
884          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count");
885        }
886        else if (name.equals("subjectResults")) {
887          this.subjectResults = new Reference();
888          return this.subjectResults;
889        }
890        else
891          return super.addChild(name);
892      }
893
894      public MeasureReportGroupPopulationComponent copy() {
895        MeasureReportGroupPopulationComponent dst = new MeasureReportGroupPopulationComponent();
896        copyValues(dst);
897        return dst;
898      }
899
900      public void copyValues(MeasureReportGroupPopulationComponent dst) {
901        super.copyValues(dst);
902        dst.code = code == null ? null : code.copy();
903        dst.count = count == null ? null : count.copy();
904        dst.subjectResults = subjectResults == null ? null : subjectResults.copy();
905      }
906
907      @Override
908      public boolean equalsDeep(Base other_) {
909        if (!super.equalsDeep(other_))
910          return false;
911        if (!(other_ instanceof MeasureReportGroupPopulationComponent))
912          return false;
913        MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other_;
914        return compareDeep(code, o.code, true) && compareDeep(count, o.count, true) && compareDeep(subjectResults, o.subjectResults, true)
915          ;
916      }
917
918      @Override
919      public boolean equalsShallow(Base other_) {
920        if (!super.equalsShallow(other_))
921          return false;
922        if (!(other_ instanceof MeasureReportGroupPopulationComponent))
923          return false;
924        MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other_;
925        return compareValues(count, o.count, true);
926      }
927
928      public boolean isEmpty() {
929        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, count, subjectResults
930          );
931      }
932
933  public String fhirType() {
934    return "MeasureReport.group.population";
935
936  }
937
938  }
939
940    @Block()
941    public static class MeasureReportGroupStratifierComponent extends BackboneElement implements IBaseBackboneElement {
942        /**
943         * The meaning of this stratifier, as defined in the measure definition.
944         */
945        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
946        @Description(shortDefinition="What stratifier of the group", formalDefinition="The meaning of this stratifier, as defined in the measure definition." )
947        protected List<CodeableConcept> code;
948
949        /**
950         * This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.
951         */
952        @Child(name = "stratum", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
953        @Description(shortDefinition="Stratum results, one for each unique value, or set of values, in the stratifier, or stratifier components", formalDefinition="This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value." )
954        protected List<StratifierGroupComponent> stratum;
955
956        private static final long serialVersionUID = 259550185L;
957
958    /**
959     * Constructor
960     */
961      public MeasureReportGroupStratifierComponent() {
962        super();
963      }
964
965        /**
966         * @return {@link #code} (The meaning of this stratifier, as defined in the measure definition.)
967         */
968        public List<CodeableConcept> getCode() { 
969          if (this.code == null)
970            this.code = new ArrayList<CodeableConcept>();
971          return this.code;
972        }
973
974        /**
975         * @return Returns a reference to <code>this</code> for easy method chaining
976         */
977        public MeasureReportGroupStratifierComponent setCode(List<CodeableConcept> theCode) { 
978          this.code = theCode;
979          return this;
980        }
981
982        public boolean hasCode() { 
983          if (this.code == null)
984            return false;
985          for (CodeableConcept item : this.code)
986            if (!item.isEmpty())
987              return true;
988          return false;
989        }
990
991        public CodeableConcept addCode() { //3
992          CodeableConcept t = new CodeableConcept();
993          if (this.code == null)
994            this.code = new ArrayList<CodeableConcept>();
995          this.code.add(t);
996          return t;
997        }
998
999        public MeasureReportGroupStratifierComponent addCode(CodeableConcept t) { //3
1000          if (t == null)
1001            return this;
1002          if (this.code == null)
1003            this.code = new ArrayList<CodeableConcept>();
1004          this.code.add(t);
1005          return this;
1006        }
1007
1008        /**
1009         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
1010         */
1011        public CodeableConcept getCodeFirstRep() { 
1012          if (getCode().isEmpty()) {
1013            addCode();
1014          }
1015          return getCode().get(0);
1016        }
1017
1018        /**
1019         * @return {@link #stratum} (This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.)
1020         */
1021        public List<StratifierGroupComponent> getStratum() { 
1022          if (this.stratum == null)
1023            this.stratum = new ArrayList<StratifierGroupComponent>();
1024          return this.stratum;
1025        }
1026
1027        /**
1028         * @return Returns a reference to <code>this</code> for easy method chaining
1029         */
1030        public MeasureReportGroupStratifierComponent setStratum(List<StratifierGroupComponent> theStratum) { 
1031          this.stratum = theStratum;
1032          return this;
1033        }
1034
1035        public boolean hasStratum() { 
1036          if (this.stratum == null)
1037            return false;
1038          for (StratifierGroupComponent item : this.stratum)
1039            if (!item.isEmpty())
1040              return true;
1041          return false;
1042        }
1043
1044        public StratifierGroupComponent addStratum() { //3
1045          StratifierGroupComponent t = new StratifierGroupComponent();
1046          if (this.stratum == null)
1047            this.stratum = new ArrayList<StratifierGroupComponent>();
1048          this.stratum.add(t);
1049          return t;
1050        }
1051
1052        public MeasureReportGroupStratifierComponent addStratum(StratifierGroupComponent t) { //3
1053          if (t == null)
1054            return this;
1055          if (this.stratum == null)
1056            this.stratum = new ArrayList<StratifierGroupComponent>();
1057          this.stratum.add(t);
1058          return this;
1059        }
1060
1061        /**
1062         * @return The first repetition of repeating field {@link #stratum}, creating it if it does not already exist
1063         */
1064        public StratifierGroupComponent getStratumFirstRep() { 
1065          if (getStratum().isEmpty()) {
1066            addStratum();
1067          }
1068          return getStratum().get(0);
1069        }
1070
1071        protected void listChildren(List<Property> children) {
1072          super.listChildren(children);
1073          children.add(new Property("code", "CodeableConcept", "The meaning of this stratifier, as defined in the measure definition.", 0, java.lang.Integer.MAX_VALUE, code));
1074          children.add(new Property("stratum", "", "This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.", 0, java.lang.Integer.MAX_VALUE, stratum));
1075        }
1076
1077        @Override
1078        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1079          switch (_hash) {
1080          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The meaning of this stratifier, as defined in the measure definition.", 0, java.lang.Integer.MAX_VALUE, code);
1081          case -1881991236: /*stratum*/  return new Property("stratum", "", "This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.", 0, java.lang.Integer.MAX_VALUE, stratum);
1082          default: return super.getNamedProperty(_hash, _name, _checkValid);
1083          }
1084
1085        }
1086
1087      @Override
1088      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1089        switch (hash) {
1090        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
1091        case -1881991236: /*stratum*/ return this.stratum == null ? new Base[0] : this.stratum.toArray(new Base[this.stratum.size()]); // StratifierGroupComponent
1092        default: return super.getProperty(hash, name, checkValid);
1093        }
1094
1095      }
1096
1097      @Override
1098      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1099        switch (hash) {
1100        case 3059181: // code
1101          this.getCode().add(castToCodeableConcept(value)); // CodeableConcept
1102          return value;
1103        case -1881991236: // stratum
1104          this.getStratum().add((StratifierGroupComponent) value); // StratifierGroupComponent
1105          return value;
1106        default: return super.setProperty(hash, name, value);
1107        }
1108
1109      }
1110
1111      @Override
1112      public Base setProperty(String name, Base value) throws FHIRException {
1113        if (name.equals("code")) {
1114          this.getCode().add(castToCodeableConcept(value));
1115        } else if (name.equals("stratum")) {
1116          this.getStratum().add((StratifierGroupComponent) value);
1117        } else
1118          return super.setProperty(name, value);
1119        return value;
1120      }
1121
1122      @Override
1123      public Base makeProperty(int hash, String name) throws FHIRException {
1124        switch (hash) {
1125        case 3059181:  return addCode(); 
1126        case -1881991236:  return addStratum(); 
1127        default: return super.makeProperty(hash, name);
1128        }
1129
1130      }
1131
1132      @Override
1133      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1134        switch (hash) {
1135        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1136        case -1881991236: /*stratum*/ return new String[] {};
1137        default: return super.getTypesForProperty(hash, name);
1138        }
1139
1140      }
1141
1142      @Override
1143      public Base addChild(String name) throws FHIRException {
1144        if (name.equals("code")) {
1145          return addCode();
1146        }
1147        else if (name.equals("stratum")) {
1148          return addStratum();
1149        }
1150        else
1151          return super.addChild(name);
1152      }
1153
1154      public MeasureReportGroupStratifierComponent copy() {
1155        MeasureReportGroupStratifierComponent dst = new MeasureReportGroupStratifierComponent();
1156        copyValues(dst);
1157        return dst;
1158      }
1159
1160      public void copyValues(MeasureReportGroupStratifierComponent dst) {
1161        super.copyValues(dst);
1162        if (code != null) {
1163          dst.code = new ArrayList<CodeableConcept>();
1164          for (CodeableConcept i : code)
1165            dst.code.add(i.copy());
1166        };
1167        if (stratum != null) {
1168          dst.stratum = new ArrayList<StratifierGroupComponent>();
1169          for (StratifierGroupComponent i : stratum)
1170            dst.stratum.add(i.copy());
1171        };
1172      }
1173
1174      @Override
1175      public boolean equalsDeep(Base other_) {
1176        if (!super.equalsDeep(other_))
1177          return false;
1178        if (!(other_ instanceof MeasureReportGroupStratifierComponent))
1179          return false;
1180        MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other_;
1181        return compareDeep(code, o.code, true) && compareDeep(stratum, o.stratum, true);
1182      }
1183
1184      @Override
1185      public boolean equalsShallow(Base other_) {
1186        if (!super.equalsShallow(other_))
1187          return false;
1188        if (!(other_ instanceof MeasureReportGroupStratifierComponent))
1189          return false;
1190        MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other_;
1191        return true;
1192      }
1193
1194      public boolean isEmpty() {
1195        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, stratum);
1196      }
1197
1198  public String fhirType() {
1199    return "MeasureReport.group.stratifier";
1200
1201  }
1202
1203  }
1204
1205    @Block()
1206    public static class StratifierGroupComponent extends BackboneElement implements IBaseBackboneElement {
1207        /**
1208         * The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.
1209         */
1210        @Child(name = "value", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1211        @Description(shortDefinition="The stratum value, e.g. male", formalDefinition="The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique." )
1212        protected CodeableConcept value;
1213
1214        /**
1215         * A stratifier component value.
1216         */
1217        @Child(name = "component", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1218        @Description(shortDefinition="Stratifier component values", formalDefinition="A stratifier component value." )
1219        protected List<StratifierGroupComponentComponent> component;
1220
1221        /**
1222         * The populations that make up the stratum, one for each type of population appropriate to the measure.
1223         */
1224        @Child(name = "population", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1225        @Description(shortDefinition="Population results in this stratum", formalDefinition="The populations that make up the stratum, one for each type of population appropriate to the measure." )
1226        protected List<StratifierGroupPopulationComponent> population;
1227
1228        /**
1229         * The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.
1230         */
1231        @Child(name = "measureScore", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=false)
1232        @Description(shortDefinition="What score this stratum achieved", formalDefinition="The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum." )
1233        protected Quantity measureScore;
1234
1235        private static final long serialVersionUID = 892251179L;
1236
1237    /**
1238     * Constructor
1239     */
1240      public StratifierGroupComponent() {
1241        super();
1242      }
1243
1244        /**
1245         * @return {@link #value} (The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.)
1246         */
1247        public CodeableConcept getValue() { 
1248          if (this.value == null)
1249            if (Configuration.errorOnAutoCreate())
1250              throw new Error("Attempt to auto-create StratifierGroupComponent.value");
1251            else if (Configuration.doAutoCreate())
1252              this.value = new CodeableConcept(); // cc
1253          return this.value;
1254        }
1255
1256        public boolean hasValue() { 
1257          return this.value != null && !this.value.isEmpty();
1258        }
1259
1260        /**
1261         * @param value {@link #value} (The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.)
1262         */
1263        public StratifierGroupComponent setValue(CodeableConcept value) { 
1264          this.value = value;
1265          return this;
1266        }
1267
1268        /**
1269         * @return {@link #component} (A stratifier component value.)
1270         */
1271        public List<StratifierGroupComponentComponent> getComponent() { 
1272          if (this.component == null)
1273            this.component = new ArrayList<StratifierGroupComponentComponent>();
1274          return this.component;
1275        }
1276
1277        /**
1278         * @return Returns a reference to <code>this</code> for easy method chaining
1279         */
1280        public StratifierGroupComponent setComponent(List<StratifierGroupComponentComponent> theComponent) { 
1281          this.component = theComponent;
1282          return this;
1283        }
1284
1285        public boolean hasComponent() { 
1286          if (this.component == null)
1287            return false;
1288          for (StratifierGroupComponentComponent item : this.component)
1289            if (!item.isEmpty())
1290              return true;
1291          return false;
1292        }
1293
1294        public StratifierGroupComponentComponent addComponent() { //3
1295          StratifierGroupComponentComponent t = new StratifierGroupComponentComponent();
1296          if (this.component == null)
1297            this.component = new ArrayList<StratifierGroupComponentComponent>();
1298          this.component.add(t);
1299          return t;
1300        }
1301
1302        public StratifierGroupComponent addComponent(StratifierGroupComponentComponent t) { //3
1303          if (t == null)
1304            return this;
1305          if (this.component == null)
1306            this.component = new ArrayList<StratifierGroupComponentComponent>();
1307          this.component.add(t);
1308          return this;
1309        }
1310
1311        /**
1312         * @return The first repetition of repeating field {@link #component}, creating it if it does not already exist
1313         */
1314        public StratifierGroupComponentComponent getComponentFirstRep() { 
1315          if (getComponent().isEmpty()) {
1316            addComponent();
1317          }
1318          return getComponent().get(0);
1319        }
1320
1321        /**
1322         * @return {@link #population} (The populations that make up the stratum, one for each type of population appropriate to the measure.)
1323         */
1324        public List<StratifierGroupPopulationComponent> getPopulation() { 
1325          if (this.population == null)
1326            this.population = new ArrayList<StratifierGroupPopulationComponent>();
1327          return this.population;
1328        }
1329
1330        /**
1331         * @return Returns a reference to <code>this</code> for easy method chaining
1332         */
1333        public StratifierGroupComponent setPopulation(List<StratifierGroupPopulationComponent> thePopulation) { 
1334          this.population = thePopulation;
1335          return this;
1336        }
1337
1338        public boolean hasPopulation() { 
1339          if (this.population == null)
1340            return false;
1341          for (StratifierGroupPopulationComponent item : this.population)
1342            if (!item.isEmpty())
1343              return true;
1344          return false;
1345        }
1346
1347        public StratifierGroupPopulationComponent addPopulation() { //3
1348          StratifierGroupPopulationComponent t = new StratifierGroupPopulationComponent();
1349          if (this.population == null)
1350            this.population = new ArrayList<StratifierGroupPopulationComponent>();
1351          this.population.add(t);
1352          return t;
1353        }
1354
1355        public StratifierGroupComponent addPopulation(StratifierGroupPopulationComponent t) { //3
1356          if (t == null)
1357            return this;
1358          if (this.population == null)
1359            this.population = new ArrayList<StratifierGroupPopulationComponent>();
1360          this.population.add(t);
1361          return this;
1362        }
1363
1364        /**
1365         * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist
1366         */
1367        public StratifierGroupPopulationComponent getPopulationFirstRep() { 
1368          if (getPopulation().isEmpty()) {
1369            addPopulation();
1370          }
1371          return getPopulation().get(0);
1372        }
1373
1374        /**
1375         * @return {@link #measureScore} (The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.)
1376         */
1377        public Quantity getMeasureScore() { 
1378          if (this.measureScore == null)
1379            if (Configuration.errorOnAutoCreate())
1380              throw new Error("Attempt to auto-create StratifierGroupComponent.measureScore");
1381            else if (Configuration.doAutoCreate())
1382              this.measureScore = new Quantity(); // cc
1383          return this.measureScore;
1384        }
1385
1386        public boolean hasMeasureScore() { 
1387          return this.measureScore != null && !this.measureScore.isEmpty();
1388        }
1389
1390        /**
1391         * @param value {@link #measureScore} (The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.)
1392         */
1393        public StratifierGroupComponent setMeasureScore(Quantity value) { 
1394          this.measureScore = value;
1395          return this;
1396        }
1397
1398        protected void listChildren(List<Property> children) {
1399          super.listChildren(children);
1400          children.add(new Property("value", "CodeableConcept", "The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.", 0, 1, value));
1401          children.add(new Property("component", "", "A stratifier component value.", 0, java.lang.Integer.MAX_VALUE, component));
1402          children.add(new Property("population", "", "The populations that make up the stratum, one for each type of population appropriate to the measure.", 0, java.lang.Integer.MAX_VALUE, population));
1403          children.add(new Property("measureScore", "Quantity", "The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.", 0, 1, measureScore));
1404        }
1405
1406        @Override
1407        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1408          switch (_hash) {
1409          case 111972721: /*value*/  return new Property("value", "CodeableConcept", "The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.", 0, 1, value);
1410          case -1399907075: /*component*/  return new Property("component", "", "A stratifier component value.", 0, java.lang.Integer.MAX_VALUE, component);
1411          case -2023558323: /*population*/  return new Property("population", "", "The populations that make up the stratum, one for each type of population appropriate to the measure.", 0, java.lang.Integer.MAX_VALUE, population);
1412          case -386313260: /*measureScore*/  return new Property("measureScore", "Quantity", "The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.", 0, 1, measureScore);
1413          default: return super.getNamedProperty(_hash, _name, _checkValid);
1414          }
1415
1416        }
1417
1418      @Override
1419      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1420        switch (hash) {
1421        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeableConcept
1422        case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // StratifierGroupComponentComponent
1423        case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // StratifierGroupPopulationComponent
1424        case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // Quantity
1425        default: return super.getProperty(hash, name, checkValid);
1426        }
1427
1428      }
1429
1430      @Override
1431      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1432        switch (hash) {
1433        case 111972721: // value
1434          this.value = castToCodeableConcept(value); // CodeableConcept
1435          return value;
1436        case -1399907075: // component
1437          this.getComponent().add((StratifierGroupComponentComponent) value); // StratifierGroupComponentComponent
1438          return value;
1439        case -2023558323: // population
1440          this.getPopulation().add((StratifierGroupPopulationComponent) value); // StratifierGroupPopulationComponent
1441          return value;
1442        case -386313260: // measureScore
1443          this.measureScore = castToQuantity(value); // Quantity
1444          return value;
1445        default: return super.setProperty(hash, name, value);
1446        }
1447
1448      }
1449
1450      @Override
1451      public Base setProperty(String name, Base value) throws FHIRException {
1452        if (name.equals("value")) {
1453          this.value = castToCodeableConcept(value); // CodeableConcept
1454        } else if (name.equals("component")) {
1455          this.getComponent().add((StratifierGroupComponentComponent) value);
1456        } else if (name.equals("population")) {
1457          this.getPopulation().add((StratifierGroupPopulationComponent) value);
1458        } else if (name.equals("measureScore")) {
1459          this.measureScore = castToQuantity(value); // Quantity
1460        } else
1461          return super.setProperty(name, value);
1462        return value;
1463      }
1464
1465      @Override
1466      public Base makeProperty(int hash, String name) throws FHIRException {
1467        switch (hash) {
1468        case 111972721:  return getValue(); 
1469        case -1399907075:  return addComponent(); 
1470        case -2023558323:  return addPopulation(); 
1471        case -386313260:  return getMeasureScore(); 
1472        default: return super.makeProperty(hash, name);
1473        }
1474
1475      }
1476
1477      @Override
1478      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1479        switch (hash) {
1480        case 111972721: /*value*/ return new String[] {"CodeableConcept"};
1481        case -1399907075: /*component*/ return new String[] {};
1482        case -2023558323: /*population*/ return new String[] {};
1483        case -386313260: /*measureScore*/ return new String[] {"Quantity"};
1484        default: return super.getTypesForProperty(hash, name);
1485        }
1486
1487      }
1488
1489      @Override
1490      public Base addChild(String name) throws FHIRException {
1491        if (name.equals("value")) {
1492          this.value = new CodeableConcept();
1493          return this.value;
1494        }
1495        else if (name.equals("component")) {
1496          return addComponent();
1497        }
1498        else if (name.equals("population")) {
1499          return addPopulation();
1500        }
1501        else if (name.equals("measureScore")) {
1502          this.measureScore = new Quantity();
1503          return this.measureScore;
1504        }
1505        else
1506          return super.addChild(name);
1507      }
1508
1509      public StratifierGroupComponent copy() {
1510        StratifierGroupComponent dst = new StratifierGroupComponent();
1511        copyValues(dst);
1512        return dst;
1513      }
1514
1515      public void copyValues(StratifierGroupComponent dst) {
1516        super.copyValues(dst);
1517        dst.value = value == null ? null : value.copy();
1518        if (component != null) {
1519          dst.component = new ArrayList<StratifierGroupComponentComponent>();
1520          for (StratifierGroupComponentComponent i : component)
1521            dst.component.add(i.copy());
1522        };
1523        if (population != null) {
1524          dst.population = new ArrayList<StratifierGroupPopulationComponent>();
1525          for (StratifierGroupPopulationComponent i : population)
1526            dst.population.add(i.copy());
1527        };
1528        dst.measureScore = measureScore == null ? null : measureScore.copy();
1529      }
1530
1531      @Override
1532      public boolean equalsDeep(Base other_) {
1533        if (!super.equalsDeep(other_))
1534          return false;
1535        if (!(other_ instanceof StratifierGroupComponent))
1536          return false;
1537        StratifierGroupComponent o = (StratifierGroupComponent) other_;
1538        return compareDeep(value, o.value, true) && compareDeep(component, o.component, true) && compareDeep(population, o.population, true)
1539           && compareDeep(measureScore, o.measureScore, true);
1540      }
1541
1542      @Override
1543      public boolean equalsShallow(Base other_) {
1544        if (!super.equalsShallow(other_))
1545          return false;
1546        if (!(other_ instanceof StratifierGroupComponent))
1547          return false;
1548        StratifierGroupComponent o = (StratifierGroupComponent) other_;
1549        return true;
1550      }
1551
1552      public boolean isEmpty() {
1553        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, component, population
1554          , measureScore);
1555      }
1556
1557  public String fhirType() {
1558    return "MeasureReport.group.stratifier.stratum";
1559
1560  }
1561
1562  }
1563
1564    @Block()
1565    public static class StratifierGroupComponentComponent extends BackboneElement implements IBaseBackboneElement {
1566        /**
1567         * The code for the stratum component value.
1568         */
1569        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1570        @Description(shortDefinition="What stratifier component of the group", formalDefinition="The code for the stratum component value." )
1571        protected CodeableConcept code;
1572
1573        /**
1574         * The stratum component value.
1575         */
1576        @Child(name = "value", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
1577        @Description(shortDefinition="The stratum component value, e.g. male", formalDefinition="The stratum component value." )
1578        protected CodeableConcept value;
1579
1580        private static final long serialVersionUID = 1750253426L;
1581
1582    /**
1583     * Constructor
1584     */
1585      public StratifierGroupComponentComponent() {
1586        super();
1587      }
1588
1589    /**
1590     * Constructor
1591     */
1592      public StratifierGroupComponentComponent(CodeableConcept code, CodeableConcept value) {
1593        super();
1594        this.code = code;
1595        this.value = value;
1596      }
1597
1598        /**
1599         * @return {@link #code} (The code for the stratum component value.)
1600         */
1601        public CodeableConcept getCode() { 
1602          if (this.code == null)
1603            if (Configuration.errorOnAutoCreate())
1604              throw new Error("Attempt to auto-create StratifierGroupComponentComponent.code");
1605            else if (Configuration.doAutoCreate())
1606              this.code = new CodeableConcept(); // cc
1607          return this.code;
1608        }
1609
1610        public boolean hasCode() { 
1611          return this.code != null && !this.code.isEmpty();
1612        }
1613
1614        /**
1615         * @param value {@link #code} (The code for the stratum component value.)
1616         */
1617        public StratifierGroupComponentComponent setCode(CodeableConcept value) { 
1618          this.code = value;
1619          return this;
1620        }
1621
1622        /**
1623         * @return {@link #value} (The stratum component value.)
1624         */
1625        public CodeableConcept getValue() { 
1626          if (this.value == null)
1627            if (Configuration.errorOnAutoCreate())
1628              throw new Error("Attempt to auto-create StratifierGroupComponentComponent.value");
1629            else if (Configuration.doAutoCreate())
1630              this.value = new CodeableConcept(); // cc
1631          return this.value;
1632        }
1633
1634        public boolean hasValue() { 
1635          return this.value != null && !this.value.isEmpty();
1636        }
1637
1638        /**
1639         * @param value {@link #value} (The stratum component value.)
1640         */
1641        public StratifierGroupComponentComponent setValue(CodeableConcept value) { 
1642          this.value = value;
1643          return this;
1644        }
1645
1646        protected void listChildren(List<Property> children) {
1647          super.listChildren(children);
1648          children.add(new Property("code", "CodeableConcept", "The code for the stratum component value.", 0, 1, code));
1649          children.add(new Property("value", "CodeableConcept", "The stratum component value.", 0, 1, value));
1650        }
1651
1652        @Override
1653        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1654          switch (_hash) {
1655          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The code for the stratum component value.", 0, 1, code);
1656          case 111972721: /*value*/  return new Property("value", "CodeableConcept", "The stratum component value.", 0, 1, value);
1657          default: return super.getNamedProperty(_hash, _name, _checkValid);
1658          }
1659
1660        }
1661
1662      @Override
1663      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1664        switch (hash) {
1665        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1666        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeableConcept
1667        default: return super.getProperty(hash, name, checkValid);
1668        }
1669
1670      }
1671
1672      @Override
1673      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1674        switch (hash) {
1675        case 3059181: // code
1676          this.code = castToCodeableConcept(value); // CodeableConcept
1677          return value;
1678        case 111972721: // value
1679          this.value = castToCodeableConcept(value); // CodeableConcept
1680          return value;
1681        default: return super.setProperty(hash, name, value);
1682        }
1683
1684      }
1685
1686      @Override
1687      public Base setProperty(String name, Base value) throws FHIRException {
1688        if (name.equals("code")) {
1689          this.code = castToCodeableConcept(value); // CodeableConcept
1690        } else if (name.equals("value")) {
1691          this.value = castToCodeableConcept(value); // CodeableConcept
1692        } else
1693          return super.setProperty(name, value);
1694        return value;
1695      }
1696
1697      @Override
1698      public Base makeProperty(int hash, String name) throws FHIRException {
1699        switch (hash) {
1700        case 3059181:  return getCode(); 
1701        case 111972721:  return getValue(); 
1702        default: return super.makeProperty(hash, name);
1703        }
1704
1705      }
1706
1707      @Override
1708      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1709        switch (hash) {
1710        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1711        case 111972721: /*value*/ return new String[] {"CodeableConcept"};
1712        default: return super.getTypesForProperty(hash, name);
1713        }
1714
1715      }
1716
1717      @Override
1718      public Base addChild(String name) throws FHIRException {
1719        if (name.equals("code")) {
1720          this.code = new CodeableConcept();
1721          return this.code;
1722        }
1723        else if (name.equals("value")) {
1724          this.value = new CodeableConcept();
1725          return this.value;
1726        }
1727        else
1728          return super.addChild(name);
1729      }
1730
1731      public StratifierGroupComponentComponent copy() {
1732        StratifierGroupComponentComponent dst = new StratifierGroupComponentComponent();
1733        copyValues(dst);
1734        return dst;
1735      }
1736
1737      public void copyValues(StratifierGroupComponentComponent dst) {
1738        super.copyValues(dst);
1739        dst.code = code == null ? null : code.copy();
1740        dst.value = value == null ? null : value.copy();
1741      }
1742
1743      @Override
1744      public boolean equalsDeep(Base other_) {
1745        if (!super.equalsDeep(other_))
1746          return false;
1747        if (!(other_ instanceof StratifierGroupComponentComponent))
1748          return false;
1749        StratifierGroupComponentComponent o = (StratifierGroupComponentComponent) other_;
1750        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
1751      }
1752
1753      @Override
1754      public boolean equalsShallow(Base other_) {
1755        if (!super.equalsShallow(other_))
1756          return false;
1757        if (!(other_ instanceof StratifierGroupComponentComponent))
1758          return false;
1759        StratifierGroupComponentComponent o = (StratifierGroupComponentComponent) other_;
1760        return true;
1761      }
1762
1763      public boolean isEmpty() {
1764        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
1765      }
1766
1767  public String fhirType() {
1768    return "MeasureReport.group.stratifier.stratum.component";
1769
1770  }
1771
1772  }
1773
1774    @Block()
1775    public static class StratifierGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement {
1776        /**
1777         * The type of the population.
1778         */
1779        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1780        @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-observation", formalDefinition="The type of the population." )
1781        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-population")
1782        protected CodeableConcept code;
1783
1784        /**
1785         * The number of members of the population in this stratum.
1786         */
1787        @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1788        @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population in this stratum." )
1789        protected IntegerType count;
1790
1791        /**
1792         * This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.
1793         */
1794        @Child(name = "subjectResults", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=false)
1795        @Description(shortDefinition="For subject-list reports, the subject results in this population", formalDefinition="This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum." )
1796        protected Reference subjectResults;
1797
1798        /**
1799         * The actual object that is the target of the reference (This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.)
1800         */
1801        protected ListResource subjectResultsTarget;
1802
1803        private static final long serialVersionUID = 210461445L;
1804
1805    /**
1806     * Constructor
1807     */
1808      public StratifierGroupPopulationComponent() {
1809        super();
1810      }
1811
1812        /**
1813         * @return {@link #code} (The type of the population.)
1814         */
1815        public CodeableConcept getCode() { 
1816          if (this.code == null)
1817            if (Configuration.errorOnAutoCreate())
1818              throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.code");
1819            else if (Configuration.doAutoCreate())
1820              this.code = new CodeableConcept(); // cc
1821          return this.code;
1822        }
1823
1824        public boolean hasCode() { 
1825          return this.code != null && !this.code.isEmpty();
1826        }
1827
1828        /**
1829         * @param value {@link #code} (The type of the population.)
1830         */
1831        public StratifierGroupPopulationComponent setCode(CodeableConcept value) { 
1832          this.code = value;
1833          return this;
1834        }
1835
1836        /**
1837         * @return {@link #count} (The number of members of the population in this stratum.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value
1838         */
1839        public IntegerType getCountElement() { 
1840          if (this.count == null)
1841            if (Configuration.errorOnAutoCreate())
1842              throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.count");
1843            else if (Configuration.doAutoCreate())
1844              this.count = new IntegerType(); // bb
1845          return this.count;
1846        }
1847
1848        public boolean hasCountElement() { 
1849          return this.count != null && !this.count.isEmpty();
1850        }
1851
1852        public boolean hasCount() { 
1853          return this.count != null && !this.count.isEmpty();
1854        }
1855
1856        /**
1857         * @param value {@link #count} (The number of members of the population in this stratum.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value
1858         */
1859        public StratifierGroupPopulationComponent setCountElement(IntegerType value) { 
1860          this.count = value;
1861          return this;
1862        }
1863
1864        /**
1865         * @return The number of members of the population in this stratum.
1866         */
1867        public int getCount() { 
1868          return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue();
1869        }
1870
1871        /**
1872         * @param value The number of members of the population in this stratum.
1873         */
1874        public StratifierGroupPopulationComponent setCount(int value) { 
1875            if (this.count == null)
1876              this.count = new IntegerType();
1877            this.count.setValue(value);
1878          return this;
1879        }
1880
1881        /**
1882         * @return {@link #subjectResults} (This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.)
1883         */
1884        public Reference getSubjectResults() { 
1885          if (this.subjectResults == null)
1886            if (Configuration.errorOnAutoCreate())
1887              throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.subjectResults");
1888            else if (Configuration.doAutoCreate())
1889              this.subjectResults = new Reference(); // cc
1890          return this.subjectResults;
1891        }
1892
1893        public boolean hasSubjectResults() { 
1894          return this.subjectResults != null && !this.subjectResults.isEmpty();
1895        }
1896
1897        /**
1898         * @param value {@link #subjectResults} (This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.)
1899         */
1900        public StratifierGroupPopulationComponent setSubjectResults(Reference value) { 
1901          this.subjectResults = value;
1902          return this;
1903        }
1904
1905        /**
1906         * @return {@link #subjectResults} 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. (This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.)
1907         */
1908        public ListResource getSubjectResultsTarget() { 
1909          if (this.subjectResultsTarget == null)
1910            if (Configuration.errorOnAutoCreate())
1911              throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.subjectResults");
1912            else if (Configuration.doAutoCreate())
1913              this.subjectResultsTarget = new ListResource(); // aa
1914          return this.subjectResultsTarget;
1915        }
1916
1917        /**
1918         * @param value {@link #subjectResults} 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. (This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.)
1919         */
1920        public StratifierGroupPopulationComponent setSubjectResultsTarget(ListResource value) { 
1921          this.subjectResultsTarget = value;
1922          return this;
1923        }
1924
1925        protected void listChildren(List<Property> children) {
1926          super.listChildren(children);
1927          children.add(new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code));
1928          children.add(new Property("count", "integer", "The number of members of the population in this stratum.", 0, 1, count));
1929          children.add(new Property("subjectResults", "Reference(List)", "This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.", 0, 1, subjectResults));
1930        }
1931
1932        @Override
1933        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1934          switch (_hash) {
1935          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code);
1936          case 94851343: /*count*/  return new Property("count", "integer", "The number of members of the population in this stratum.", 0, 1, count);
1937          case 2136184106: /*subjectResults*/  return new Property("subjectResults", "Reference(List)", "This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.", 0, 1, subjectResults);
1938          default: return super.getNamedProperty(_hash, _name, _checkValid);
1939          }
1940
1941        }
1942
1943      @Override
1944      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1945        switch (hash) {
1946        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1947        case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType
1948        case 2136184106: /*subjectResults*/ return this.subjectResults == null ? new Base[0] : new Base[] {this.subjectResults}; // Reference
1949        default: return super.getProperty(hash, name, checkValid);
1950        }
1951
1952      }
1953
1954      @Override
1955      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1956        switch (hash) {
1957        case 3059181: // code
1958          this.code = castToCodeableConcept(value); // CodeableConcept
1959          return value;
1960        case 94851343: // count
1961          this.count = castToInteger(value); // IntegerType
1962          return value;
1963        case 2136184106: // subjectResults
1964          this.subjectResults = castToReference(value); // Reference
1965          return value;
1966        default: return super.setProperty(hash, name, value);
1967        }
1968
1969      }
1970
1971      @Override
1972      public Base setProperty(String name, Base value) throws FHIRException {
1973        if (name.equals("code")) {
1974          this.code = castToCodeableConcept(value); // CodeableConcept
1975        } else if (name.equals("count")) {
1976          this.count = castToInteger(value); // IntegerType
1977        } else if (name.equals("subjectResults")) {
1978          this.subjectResults = castToReference(value); // Reference
1979        } else
1980          return super.setProperty(name, value);
1981        return value;
1982      }
1983
1984      @Override
1985      public Base makeProperty(int hash, String name) throws FHIRException {
1986        switch (hash) {
1987        case 3059181:  return getCode(); 
1988        case 94851343:  return getCountElement();
1989        case 2136184106:  return getSubjectResults(); 
1990        default: return super.makeProperty(hash, name);
1991        }
1992
1993      }
1994
1995      @Override
1996      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1997        switch (hash) {
1998        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1999        case 94851343: /*count*/ return new String[] {"integer"};
2000        case 2136184106: /*subjectResults*/ return new String[] {"Reference"};
2001        default: return super.getTypesForProperty(hash, name);
2002        }
2003
2004      }
2005
2006      @Override
2007      public Base addChild(String name) throws FHIRException {
2008        if (name.equals("code")) {
2009          this.code = new CodeableConcept();
2010          return this.code;
2011        }
2012        else if (name.equals("count")) {
2013          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count");
2014        }
2015        else if (name.equals("subjectResults")) {
2016          this.subjectResults = new Reference();
2017          return this.subjectResults;
2018        }
2019        else
2020          return super.addChild(name);
2021      }
2022
2023      public StratifierGroupPopulationComponent copy() {
2024        StratifierGroupPopulationComponent dst = new StratifierGroupPopulationComponent();
2025        copyValues(dst);
2026        return dst;
2027      }
2028
2029      public void copyValues(StratifierGroupPopulationComponent dst) {
2030        super.copyValues(dst);
2031        dst.code = code == null ? null : code.copy();
2032        dst.count = count == null ? null : count.copy();
2033        dst.subjectResults = subjectResults == null ? null : subjectResults.copy();
2034      }
2035
2036      @Override
2037      public boolean equalsDeep(Base other_) {
2038        if (!super.equalsDeep(other_))
2039          return false;
2040        if (!(other_ instanceof StratifierGroupPopulationComponent))
2041          return false;
2042        StratifierGroupPopulationComponent o = (StratifierGroupPopulationComponent) other_;
2043        return compareDeep(code, o.code, true) && compareDeep(count, o.count, true) && compareDeep(subjectResults, o.subjectResults, true)
2044          ;
2045      }
2046
2047      @Override
2048      public boolean equalsShallow(Base other_) {
2049        if (!super.equalsShallow(other_))
2050          return false;
2051        if (!(other_ instanceof StratifierGroupPopulationComponent))
2052          return false;
2053        StratifierGroupPopulationComponent o = (StratifierGroupPopulationComponent) other_;
2054        return compareValues(count, o.count, true);
2055      }
2056
2057      public boolean isEmpty() {
2058        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, count, subjectResults
2059          );
2060      }
2061
2062  public String fhirType() {
2063    return "MeasureReport.group.stratifier.stratum.population";
2064
2065  }
2066
2067  }
2068
2069    /**
2070     * A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance.
2071     */
2072    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2073    @Description(shortDefinition="Additional identifier for the MeasureReport", formalDefinition="A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance." )
2074    protected List<Identifier> identifier;
2075
2076    /**
2077     * The MeasureReport status. No data will be available until the MeasureReport status is complete.
2078     */
2079    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2080    @Description(shortDefinition="complete | pending | error", formalDefinition="The MeasureReport status. No data will be available until the MeasureReport status is complete." )
2081    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-report-status")
2082    protected Enumeration<MeasureReportStatus> status;
2083
2084    /**
2085     * The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.
2086     */
2087    @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
2088    @Description(shortDefinition="individual | subject-list | summary | data-collection", formalDefinition="The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure." )
2089    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-report-type")
2090    protected Enumeration<MeasureReportType> type;
2091
2092    /**
2093     * A reference to the Measure that was calculated to produce this report.
2094     */
2095    @Child(name = "measure", type = {CanonicalType.class}, order=3, min=1, max=1, modifier=false, summary=true)
2096    @Description(shortDefinition="What measure was calculated", formalDefinition="A reference to the Measure that was calculated to produce this report." )
2097    protected CanonicalType measure;
2098
2099    /**
2100     * Optional subject identifying the individual or individuals the report is for.
2101     */
2102    @Child(name = "subject", type = {Patient.class, Practitioner.class, PractitionerRole.class, Location.class, Device.class, RelatedPerson.class, Group.class}, order=4, min=0, max=1, modifier=false, summary=true)
2103    @Description(shortDefinition="What individual(s) the report is for", formalDefinition="Optional subject identifying the individual or individuals the report is for." )
2104    protected Reference subject;
2105
2106    /**
2107     * The actual object that is the target of the reference (Optional subject identifying the individual or individuals the report is for.)
2108     */
2109    protected Resource subjectTarget;
2110
2111    /**
2112     * The date this measure report was generated.
2113     */
2114    @Child(name = "date", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2115    @Description(shortDefinition="When the report was generated", formalDefinition="The date this measure report was generated." )
2116    protected DateTimeType date;
2117
2118    /**
2119     * The individual, location, or organization that is reporting the data.
2120     */
2121    @Child(name = "reporter", type = {Practitioner.class, PractitionerRole.class, Location.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
2122    @Description(shortDefinition="Who is reporting the data", formalDefinition="The individual, location, or organization that is reporting the data." )
2123    protected Reference reporter;
2124
2125    /**
2126     * The actual object that is the target of the reference (The individual, location, or organization that is reporting the data.)
2127     */
2128    protected Resource reporterTarget;
2129
2130    /**
2131     * The reporting period for which the report was calculated.
2132     */
2133    @Child(name = "period", type = {Period.class}, order=7, min=1, max=1, modifier=false, summary=true)
2134    @Description(shortDefinition="What period the report covers", formalDefinition="The reporting period for which the report was calculated." )
2135    protected Period period;
2136
2137    /**
2138     * Whether improvement in the measure is noted by an increase or decrease in the measure score.
2139     */
2140    @Child(name = "improvementNotation", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=true, summary=true)
2141    @Description(shortDefinition="increase | decrease", formalDefinition="Whether improvement in the measure is noted by an increase or decrease in the measure score." )
2142    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-improvement-notation")
2143    protected CodeableConcept improvementNotation;
2144
2145    /**
2146     * The results of the calculation, one for each population group in the measure.
2147     */
2148    @Child(name = "group", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2149    @Description(shortDefinition="Measure results for each group", formalDefinition="The results of the calculation, one for each population group in the measure." )
2150    protected List<MeasureReportGroupComponent> group;
2151
2152    /**
2153     * A reference to a Bundle containing the Resources that were used in the calculation of this measure.
2154     */
2155    @Child(name = "evaluatedResource", type = {Reference.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2156    @Description(shortDefinition="What data was used to calculate the measure score", formalDefinition="A reference to a Bundle containing the Resources that were used in the calculation of this measure." )
2157    protected List<Reference> evaluatedResource;
2158    /**
2159     * The actual objects that are the target of the reference (A reference to a Bundle containing the Resources that were used in the calculation of this measure.)
2160     */
2161    protected List<Resource> evaluatedResourceTarget;
2162
2163
2164    private static final long serialVersionUID = 355307999L;
2165
2166  /**
2167   * Constructor
2168   */
2169    public MeasureReport() {
2170      super();
2171    }
2172
2173  /**
2174   * Constructor
2175   */
2176    public MeasureReport(Enumeration<MeasureReportStatus> status, Enumeration<MeasureReportType> type, CanonicalType measure, Period period) {
2177      super();
2178      this.status = status;
2179      this.type = type;
2180      this.measure = measure;
2181      this.period = period;
2182    }
2183
2184    /**
2185     * @return {@link #identifier} (A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance.)
2186     */
2187    public List<Identifier> getIdentifier() { 
2188      if (this.identifier == null)
2189        this.identifier = new ArrayList<Identifier>();
2190      return this.identifier;
2191    }
2192
2193    /**
2194     * @return Returns a reference to <code>this</code> for easy method chaining
2195     */
2196    public MeasureReport setIdentifier(List<Identifier> theIdentifier) { 
2197      this.identifier = theIdentifier;
2198      return this;
2199    }
2200
2201    public boolean hasIdentifier() { 
2202      if (this.identifier == null)
2203        return false;
2204      for (Identifier item : this.identifier)
2205        if (!item.isEmpty())
2206          return true;
2207      return false;
2208    }
2209
2210    public Identifier addIdentifier() { //3
2211      Identifier t = new Identifier();
2212      if (this.identifier == null)
2213        this.identifier = new ArrayList<Identifier>();
2214      this.identifier.add(t);
2215      return t;
2216    }
2217
2218    public MeasureReport addIdentifier(Identifier t) { //3
2219      if (t == null)
2220        return this;
2221      if (this.identifier == null)
2222        this.identifier = new ArrayList<Identifier>();
2223      this.identifier.add(t);
2224      return this;
2225    }
2226
2227    /**
2228     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2229     */
2230    public Identifier getIdentifierFirstRep() { 
2231      if (getIdentifier().isEmpty()) {
2232        addIdentifier();
2233      }
2234      return getIdentifier().get(0);
2235    }
2236
2237    /**
2238     * @return {@link #status} (The MeasureReport status. No data will be available until the MeasureReport status is complete.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2239     */
2240    public Enumeration<MeasureReportStatus> getStatusElement() { 
2241      if (this.status == null)
2242        if (Configuration.errorOnAutoCreate())
2243          throw new Error("Attempt to auto-create MeasureReport.status");
2244        else if (Configuration.doAutoCreate())
2245          this.status = new Enumeration<MeasureReportStatus>(new MeasureReportStatusEnumFactory()); // bb
2246      return this.status;
2247    }
2248
2249    public boolean hasStatusElement() { 
2250      return this.status != null && !this.status.isEmpty();
2251    }
2252
2253    public boolean hasStatus() { 
2254      return this.status != null && !this.status.isEmpty();
2255    }
2256
2257    /**
2258     * @param value {@link #status} (The MeasureReport status. No data will be available until the MeasureReport status is complete.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2259     */
2260    public MeasureReport setStatusElement(Enumeration<MeasureReportStatus> value) { 
2261      this.status = value;
2262      return this;
2263    }
2264
2265    /**
2266     * @return The MeasureReport status. No data will be available until the MeasureReport status is complete.
2267     */
2268    public MeasureReportStatus getStatus() { 
2269      return this.status == null ? null : this.status.getValue();
2270    }
2271
2272    /**
2273     * @param value The MeasureReport status. No data will be available until the MeasureReport status is complete.
2274     */
2275    public MeasureReport setStatus(MeasureReportStatus value) { 
2276        if (this.status == null)
2277          this.status = new Enumeration<MeasureReportStatus>(new MeasureReportStatusEnumFactory());
2278        this.status.setValue(value);
2279      return this;
2280    }
2281
2282    /**
2283     * @return {@link #type} (The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2284     */
2285    public Enumeration<MeasureReportType> getTypeElement() { 
2286      if (this.type == null)
2287        if (Configuration.errorOnAutoCreate())
2288          throw new Error("Attempt to auto-create MeasureReport.type");
2289        else if (Configuration.doAutoCreate())
2290          this.type = new Enumeration<MeasureReportType>(new MeasureReportTypeEnumFactory()); // bb
2291      return this.type;
2292    }
2293
2294    public boolean hasTypeElement() { 
2295      return this.type != null && !this.type.isEmpty();
2296    }
2297
2298    public boolean hasType() { 
2299      return this.type != null && !this.type.isEmpty();
2300    }
2301
2302    /**
2303     * @param value {@link #type} (The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2304     */
2305    public MeasureReport setTypeElement(Enumeration<MeasureReportType> value) { 
2306      this.type = value;
2307      return this;
2308    }
2309
2310    /**
2311     * @return The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.
2312     */
2313    public MeasureReportType getType() { 
2314      return this.type == null ? null : this.type.getValue();
2315    }
2316
2317    /**
2318     * @param value The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.
2319     */
2320    public MeasureReport setType(MeasureReportType value) { 
2321        if (this.type == null)
2322          this.type = new Enumeration<MeasureReportType>(new MeasureReportTypeEnumFactory());
2323        this.type.setValue(value);
2324      return this;
2325    }
2326
2327    /**
2328     * @return {@link #measure} (A reference to the Measure that was calculated to produce this report.). This is the underlying object with id, value and extensions. The accessor "getMeasure" gives direct access to the value
2329     */
2330    public CanonicalType getMeasureElement() { 
2331      if (this.measure == null)
2332        if (Configuration.errorOnAutoCreate())
2333          throw new Error("Attempt to auto-create MeasureReport.measure");
2334        else if (Configuration.doAutoCreate())
2335          this.measure = new CanonicalType(); // bb
2336      return this.measure;
2337    }
2338
2339    public boolean hasMeasureElement() { 
2340      return this.measure != null && !this.measure.isEmpty();
2341    }
2342
2343    public boolean hasMeasure() { 
2344      return this.measure != null && !this.measure.isEmpty();
2345    }
2346
2347    /**
2348     * @param value {@link #measure} (A reference to the Measure that was calculated to produce this report.). This is the underlying object with id, value and extensions. The accessor "getMeasure" gives direct access to the value
2349     */
2350    public MeasureReport setMeasureElement(CanonicalType value) { 
2351      this.measure = value;
2352      return this;
2353    }
2354
2355    /**
2356     * @return A reference to the Measure that was calculated to produce this report.
2357     */
2358    public String getMeasure() { 
2359      return this.measure == null ? null : this.measure.getValue();
2360    }
2361
2362    /**
2363     * @param value A reference to the Measure that was calculated to produce this report.
2364     */
2365    public MeasureReport setMeasure(String value) { 
2366        if (this.measure == null)
2367          this.measure = new CanonicalType();
2368        this.measure.setValue(value);
2369      return this;
2370    }
2371
2372    /**
2373     * @return {@link #subject} (Optional subject identifying the individual or individuals the report is for.)
2374     */
2375    public Reference getSubject() { 
2376      if (this.subject == null)
2377        if (Configuration.errorOnAutoCreate())
2378          throw new Error("Attempt to auto-create MeasureReport.subject");
2379        else if (Configuration.doAutoCreate())
2380          this.subject = new Reference(); // cc
2381      return this.subject;
2382    }
2383
2384    public boolean hasSubject() { 
2385      return this.subject != null && !this.subject.isEmpty();
2386    }
2387
2388    /**
2389     * @param value {@link #subject} (Optional subject identifying the individual or individuals the report is for.)
2390     */
2391    public MeasureReport setSubject(Reference value) { 
2392      this.subject = value;
2393      return this;
2394    }
2395
2396    /**
2397     * @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. (Optional subject identifying the individual or individuals the report is for.)
2398     */
2399    public Resource getSubjectTarget() { 
2400      return this.subjectTarget;
2401    }
2402
2403    /**
2404     * @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. (Optional subject identifying the individual or individuals the report is for.)
2405     */
2406    public MeasureReport setSubjectTarget(Resource value) { 
2407      this.subjectTarget = value;
2408      return this;
2409    }
2410
2411    /**
2412     * @return {@link #date} (The date this measure report was generated.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2413     */
2414    public DateTimeType getDateElement() { 
2415      if (this.date == null)
2416        if (Configuration.errorOnAutoCreate())
2417          throw new Error("Attempt to auto-create MeasureReport.date");
2418        else if (Configuration.doAutoCreate())
2419          this.date = new DateTimeType(); // bb
2420      return this.date;
2421    }
2422
2423    public boolean hasDateElement() { 
2424      return this.date != null && !this.date.isEmpty();
2425    }
2426
2427    public boolean hasDate() { 
2428      return this.date != null && !this.date.isEmpty();
2429    }
2430
2431    /**
2432     * @param value {@link #date} (The date this measure report was generated.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2433     */
2434    public MeasureReport setDateElement(DateTimeType value) { 
2435      this.date = value;
2436      return this;
2437    }
2438
2439    /**
2440     * @return The date this measure report was generated.
2441     */
2442    public Date getDate() { 
2443      return this.date == null ? null : this.date.getValue();
2444    }
2445
2446    /**
2447     * @param value The date this measure report was generated.
2448     */
2449    public MeasureReport setDate(Date value) { 
2450      if (value == null)
2451        this.date = null;
2452      else {
2453        if (this.date == null)
2454          this.date = new DateTimeType();
2455        this.date.setValue(value);
2456      }
2457      return this;
2458    }
2459
2460    /**
2461     * @return {@link #reporter} (The individual, location, or organization that is reporting the data.)
2462     */
2463    public Reference getReporter() { 
2464      if (this.reporter == null)
2465        if (Configuration.errorOnAutoCreate())
2466          throw new Error("Attempt to auto-create MeasureReport.reporter");
2467        else if (Configuration.doAutoCreate())
2468          this.reporter = new Reference(); // cc
2469      return this.reporter;
2470    }
2471
2472    public boolean hasReporter() { 
2473      return this.reporter != null && !this.reporter.isEmpty();
2474    }
2475
2476    /**
2477     * @param value {@link #reporter} (The individual, location, or organization that is reporting the data.)
2478     */
2479    public MeasureReport setReporter(Reference value) { 
2480      this.reporter = value;
2481      return this;
2482    }
2483
2484    /**
2485     * @return {@link #reporter} 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 individual, location, or organization that is reporting the data.)
2486     */
2487    public Resource getReporterTarget() { 
2488      return this.reporterTarget;
2489    }
2490
2491    /**
2492     * @param value {@link #reporter} 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 individual, location, or organization that is reporting the data.)
2493     */
2494    public MeasureReport setReporterTarget(Resource value) { 
2495      this.reporterTarget = value;
2496      return this;
2497    }
2498
2499    /**
2500     * @return {@link #period} (The reporting period for which the report was calculated.)
2501     */
2502    public Period getPeriod() { 
2503      if (this.period == null)
2504        if (Configuration.errorOnAutoCreate())
2505          throw new Error("Attempt to auto-create MeasureReport.period");
2506        else if (Configuration.doAutoCreate())
2507          this.period = new Period(); // cc
2508      return this.period;
2509    }
2510
2511    public boolean hasPeriod() { 
2512      return this.period != null && !this.period.isEmpty();
2513    }
2514
2515    /**
2516     * @param value {@link #period} (The reporting period for which the report was calculated.)
2517     */
2518    public MeasureReport setPeriod(Period value) { 
2519      this.period = value;
2520      return this;
2521    }
2522
2523    /**
2524     * @return {@link #improvementNotation} (Whether improvement in the measure is noted by an increase or decrease in the measure score.)
2525     */
2526    public CodeableConcept getImprovementNotation() { 
2527      if (this.improvementNotation == null)
2528        if (Configuration.errorOnAutoCreate())
2529          throw new Error("Attempt to auto-create MeasureReport.improvementNotation");
2530        else if (Configuration.doAutoCreate())
2531          this.improvementNotation = new CodeableConcept(); // cc
2532      return this.improvementNotation;
2533    }
2534
2535    public boolean hasImprovementNotation() { 
2536      return this.improvementNotation != null && !this.improvementNotation.isEmpty();
2537    }
2538
2539    /**
2540     * @param value {@link #improvementNotation} (Whether improvement in the measure is noted by an increase or decrease in the measure score.)
2541     */
2542    public MeasureReport setImprovementNotation(CodeableConcept value) { 
2543      this.improvementNotation = value;
2544      return this;
2545    }
2546
2547    /**
2548     * @return {@link #group} (The results of the calculation, one for each population group in the measure.)
2549     */
2550    public List<MeasureReportGroupComponent> getGroup() { 
2551      if (this.group == null)
2552        this.group = new ArrayList<MeasureReportGroupComponent>();
2553      return this.group;
2554    }
2555
2556    /**
2557     * @return Returns a reference to <code>this</code> for easy method chaining
2558     */
2559    public MeasureReport setGroup(List<MeasureReportGroupComponent> theGroup) { 
2560      this.group = theGroup;
2561      return this;
2562    }
2563
2564    public boolean hasGroup() { 
2565      if (this.group == null)
2566        return false;
2567      for (MeasureReportGroupComponent item : this.group)
2568        if (!item.isEmpty())
2569          return true;
2570      return false;
2571    }
2572
2573    public MeasureReportGroupComponent addGroup() { //3
2574      MeasureReportGroupComponent t = new MeasureReportGroupComponent();
2575      if (this.group == null)
2576        this.group = new ArrayList<MeasureReportGroupComponent>();
2577      this.group.add(t);
2578      return t;
2579    }
2580
2581    public MeasureReport addGroup(MeasureReportGroupComponent t) { //3
2582      if (t == null)
2583        return this;
2584      if (this.group == null)
2585        this.group = new ArrayList<MeasureReportGroupComponent>();
2586      this.group.add(t);
2587      return this;
2588    }
2589
2590    /**
2591     * @return The first repetition of repeating field {@link #group}, creating it if it does not already exist
2592     */
2593    public MeasureReportGroupComponent getGroupFirstRep() { 
2594      if (getGroup().isEmpty()) {
2595        addGroup();
2596      }
2597      return getGroup().get(0);
2598    }
2599
2600    /**
2601     * @return {@link #evaluatedResource} (A reference to a Bundle containing the Resources that were used in the calculation of this measure.)
2602     */
2603    public List<Reference> getEvaluatedResource() { 
2604      if (this.evaluatedResource == null)
2605        this.evaluatedResource = new ArrayList<Reference>();
2606      return this.evaluatedResource;
2607    }
2608
2609    /**
2610     * @return Returns a reference to <code>this</code> for easy method chaining
2611     */
2612    public MeasureReport setEvaluatedResource(List<Reference> theEvaluatedResource) { 
2613      this.evaluatedResource = theEvaluatedResource;
2614      return this;
2615    }
2616
2617    public boolean hasEvaluatedResource() { 
2618      if (this.evaluatedResource == null)
2619        return false;
2620      for (Reference item : this.evaluatedResource)
2621        if (!item.isEmpty())
2622          return true;
2623      return false;
2624    }
2625
2626    public Reference addEvaluatedResource() { //3
2627      Reference t = new Reference();
2628      if (this.evaluatedResource == null)
2629        this.evaluatedResource = new ArrayList<Reference>();
2630      this.evaluatedResource.add(t);
2631      return t;
2632    }
2633
2634    public MeasureReport addEvaluatedResource(Reference t) { //3
2635      if (t == null)
2636        return this;
2637      if (this.evaluatedResource == null)
2638        this.evaluatedResource = new ArrayList<Reference>();
2639      this.evaluatedResource.add(t);
2640      return this;
2641    }
2642
2643    /**
2644     * @return The first repetition of repeating field {@link #evaluatedResource}, creating it if it does not already exist
2645     */
2646    public Reference getEvaluatedResourceFirstRep() { 
2647      if (getEvaluatedResource().isEmpty()) {
2648        addEvaluatedResource();
2649      }
2650      return getEvaluatedResource().get(0);
2651    }
2652
2653    /**
2654     * @deprecated Use Reference#setResource(IBaseResource) instead
2655     */
2656    @Deprecated
2657    public List<Resource> getEvaluatedResourceTarget() { 
2658      if (this.evaluatedResourceTarget == null)
2659        this.evaluatedResourceTarget = new ArrayList<Resource>();
2660      return this.evaluatedResourceTarget;
2661    }
2662
2663      protected void listChildren(List<Property> children) {
2664        super.listChildren(children);
2665        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
2666        children.add(new Property("status", "code", "The MeasureReport status. No data will be available until the MeasureReport status is complete.", 0, 1, status));
2667        children.add(new Property("type", "code", "The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.", 0, 1, type));
2668        children.add(new Property("measure", "canonical(Measure)", "A reference to the Measure that was calculated to produce this report.", 0, 1, measure));
2669        children.add(new Property("subject", "Reference(Patient|Practitioner|PractitionerRole|Location|Device|RelatedPerson|Group)", "Optional subject identifying the individual or individuals the report is for.", 0, 1, subject));
2670        children.add(new Property("date", "dateTime", "The date this measure report was generated.", 0, 1, date));
2671        children.add(new Property("reporter", "Reference(Practitioner|PractitionerRole|Location|Organization)", "The individual, location, or organization that is reporting the data.", 0, 1, reporter));
2672        children.add(new Property("period", "Period", "The reporting period for which the report was calculated.", 0, 1, period));
2673        children.add(new Property("improvementNotation", "CodeableConcept", "Whether improvement in the measure is noted by an increase or decrease in the measure score.", 0, 1, improvementNotation));
2674        children.add(new Property("group", "", "The results of the calculation, one for each population group in the measure.", 0, java.lang.Integer.MAX_VALUE, group));
2675        children.add(new Property("evaluatedResource", "Reference(Any)", "A reference to a Bundle containing the Resources that were used in the calculation of this measure.", 0, java.lang.Integer.MAX_VALUE, evaluatedResource));
2676      }
2677
2678      @Override
2679      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2680        switch (_hash) {
2681        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
2682        case -892481550: /*status*/  return new Property("status", "code", "The MeasureReport status. No data will be available until the MeasureReport status is complete.", 0, 1, status);
2683        case 3575610: /*type*/  return new Property("type", "code", "The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.", 0, 1, type);
2684        case 938321246: /*measure*/  return new Property("measure", "canonical(Measure)", "A reference to the Measure that was calculated to produce this report.", 0, 1, measure);
2685        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Practitioner|PractitionerRole|Location|Device|RelatedPerson|Group)", "Optional subject identifying the individual or individuals the report is for.", 0, 1, subject);
2686        case 3076014: /*date*/  return new Property("date", "dateTime", "The date this measure report was generated.", 0, 1, date);
2687        case -427039519: /*reporter*/  return new Property("reporter", "Reference(Practitioner|PractitionerRole|Location|Organization)", "The individual, location, or organization that is reporting the data.", 0, 1, reporter);
2688        case -991726143: /*period*/  return new Property("period", "Period", "The reporting period for which the report was calculated.", 0, 1, period);
2689        case -2085456136: /*improvementNotation*/  return new Property("improvementNotation", "CodeableConcept", "Whether improvement in the measure is noted by an increase or decrease in the measure score.", 0, 1, improvementNotation);
2690        case 98629247: /*group*/  return new Property("group", "", "The results of the calculation, one for each population group in the measure.", 0, java.lang.Integer.MAX_VALUE, group);
2691        case -1056771047: /*evaluatedResource*/  return new Property("evaluatedResource", "Reference(Any)", "A reference to a Bundle containing the Resources that were used in the calculation of this measure.", 0, java.lang.Integer.MAX_VALUE, evaluatedResource);
2692        default: return super.getNamedProperty(_hash, _name, _checkValid);
2693        }
2694
2695      }
2696
2697      @Override
2698      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2699        switch (hash) {
2700        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2701        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<MeasureReportStatus>
2702        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<MeasureReportType>
2703        case 938321246: /*measure*/ return this.measure == null ? new Base[0] : new Base[] {this.measure}; // CanonicalType
2704        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2705        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
2706        case -427039519: /*reporter*/ return this.reporter == null ? new Base[0] : new Base[] {this.reporter}; // Reference
2707        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2708        case -2085456136: /*improvementNotation*/ return this.improvementNotation == null ? new Base[0] : new Base[] {this.improvementNotation}; // CodeableConcept
2709        case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupComponent
2710        case -1056771047: /*evaluatedResource*/ return this.evaluatedResource == null ? new Base[0] : this.evaluatedResource.toArray(new Base[this.evaluatedResource.size()]); // Reference
2711        default: return super.getProperty(hash, name, checkValid);
2712        }
2713
2714      }
2715
2716      @Override
2717      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2718        switch (hash) {
2719        case -1618432855: // identifier
2720          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2721          return value;
2722        case -892481550: // status
2723          value = new MeasureReportStatusEnumFactory().fromType(castToCode(value));
2724          this.status = (Enumeration) value; // Enumeration<MeasureReportStatus>
2725          return value;
2726        case 3575610: // type
2727          value = new MeasureReportTypeEnumFactory().fromType(castToCode(value));
2728          this.type = (Enumeration) value; // Enumeration<MeasureReportType>
2729          return value;
2730        case 938321246: // measure
2731          this.measure = castToCanonical(value); // CanonicalType
2732          return value;
2733        case -1867885268: // subject
2734          this.subject = castToReference(value); // Reference
2735          return value;
2736        case 3076014: // date
2737          this.date = castToDateTime(value); // DateTimeType
2738          return value;
2739        case -427039519: // reporter
2740          this.reporter = castToReference(value); // Reference
2741          return value;
2742        case -991726143: // period
2743          this.period = castToPeriod(value); // Period
2744          return value;
2745        case -2085456136: // improvementNotation
2746          this.improvementNotation = castToCodeableConcept(value); // CodeableConcept
2747          return value;
2748        case 98629247: // group
2749          this.getGroup().add((MeasureReportGroupComponent) value); // MeasureReportGroupComponent
2750          return value;
2751        case -1056771047: // evaluatedResource
2752          this.getEvaluatedResource().add(castToReference(value)); // Reference
2753          return value;
2754        default: return super.setProperty(hash, name, value);
2755        }
2756
2757      }
2758
2759      @Override
2760      public Base setProperty(String name, Base value) throws FHIRException {
2761        if (name.equals("identifier")) {
2762          this.getIdentifier().add(castToIdentifier(value));
2763        } else if (name.equals("status")) {
2764          value = new MeasureReportStatusEnumFactory().fromType(castToCode(value));
2765          this.status = (Enumeration) value; // Enumeration<MeasureReportStatus>
2766        } else if (name.equals("type")) {
2767          value = new MeasureReportTypeEnumFactory().fromType(castToCode(value));
2768          this.type = (Enumeration) value; // Enumeration<MeasureReportType>
2769        } else if (name.equals("measure")) {
2770          this.measure = castToCanonical(value); // CanonicalType
2771        } else if (name.equals("subject")) {
2772          this.subject = castToReference(value); // Reference
2773        } else if (name.equals("date")) {
2774          this.date = castToDateTime(value); // DateTimeType
2775        } else if (name.equals("reporter")) {
2776          this.reporter = castToReference(value); // Reference
2777        } else if (name.equals("period")) {
2778          this.period = castToPeriod(value); // Period
2779        } else if (name.equals("improvementNotation")) {
2780          this.improvementNotation = castToCodeableConcept(value); // CodeableConcept
2781        } else if (name.equals("group")) {
2782          this.getGroup().add((MeasureReportGroupComponent) value);
2783        } else if (name.equals("evaluatedResource")) {
2784          this.getEvaluatedResource().add(castToReference(value));
2785        } else
2786          return super.setProperty(name, value);
2787        return value;
2788      }
2789
2790      @Override
2791      public Base makeProperty(int hash, String name) throws FHIRException {
2792        switch (hash) {
2793        case -1618432855:  return addIdentifier(); 
2794        case -892481550:  return getStatusElement();
2795        case 3575610:  return getTypeElement();
2796        case 938321246:  return getMeasureElement();
2797        case -1867885268:  return getSubject(); 
2798        case 3076014:  return getDateElement();
2799        case -427039519:  return getReporter(); 
2800        case -991726143:  return getPeriod(); 
2801        case -2085456136:  return getImprovementNotation(); 
2802        case 98629247:  return addGroup(); 
2803        case -1056771047:  return addEvaluatedResource(); 
2804        default: return super.makeProperty(hash, name);
2805        }
2806
2807      }
2808
2809      @Override
2810      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2811        switch (hash) {
2812        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2813        case -892481550: /*status*/ return new String[] {"code"};
2814        case 3575610: /*type*/ return new String[] {"code"};
2815        case 938321246: /*measure*/ return new String[] {"canonical"};
2816        case -1867885268: /*subject*/ return new String[] {"Reference"};
2817        case 3076014: /*date*/ return new String[] {"dateTime"};
2818        case -427039519: /*reporter*/ return new String[] {"Reference"};
2819        case -991726143: /*period*/ return new String[] {"Period"};
2820        case -2085456136: /*improvementNotation*/ return new String[] {"CodeableConcept"};
2821        case 98629247: /*group*/ return new String[] {};
2822        case -1056771047: /*evaluatedResource*/ return new String[] {"Reference"};
2823        default: return super.getTypesForProperty(hash, name);
2824        }
2825
2826      }
2827
2828      @Override
2829      public Base addChild(String name) throws FHIRException {
2830        if (name.equals("identifier")) {
2831          return addIdentifier();
2832        }
2833        else if (name.equals("status")) {
2834          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.status");
2835        }
2836        else if (name.equals("type")) {
2837          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type");
2838        }
2839        else if (name.equals("measure")) {
2840          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.measure");
2841        }
2842        else if (name.equals("subject")) {
2843          this.subject = new Reference();
2844          return this.subject;
2845        }
2846        else if (name.equals("date")) {
2847          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.date");
2848        }
2849        else if (name.equals("reporter")) {
2850          this.reporter = new Reference();
2851          return this.reporter;
2852        }
2853        else if (name.equals("period")) {
2854          this.period = new Period();
2855          return this.period;
2856        }
2857        else if (name.equals("improvementNotation")) {
2858          this.improvementNotation = new CodeableConcept();
2859          return this.improvementNotation;
2860        }
2861        else if (name.equals("group")) {
2862          return addGroup();
2863        }
2864        else if (name.equals("evaluatedResource")) {
2865          return addEvaluatedResource();
2866        }
2867        else
2868          return super.addChild(name);
2869      }
2870
2871  public String fhirType() {
2872    return "MeasureReport";
2873
2874  }
2875
2876      public MeasureReport copy() {
2877        MeasureReport dst = new MeasureReport();
2878        copyValues(dst);
2879        return dst;
2880      }
2881
2882      public void copyValues(MeasureReport dst) {
2883        super.copyValues(dst);
2884        if (identifier != null) {
2885          dst.identifier = new ArrayList<Identifier>();
2886          for (Identifier i : identifier)
2887            dst.identifier.add(i.copy());
2888        };
2889        dst.status = status == null ? null : status.copy();
2890        dst.type = type == null ? null : type.copy();
2891        dst.measure = measure == null ? null : measure.copy();
2892        dst.subject = subject == null ? null : subject.copy();
2893        dst.date = date == null ? null : date.copy();
2894        dst.reporter = reporter == null ? null : reporter.copy();
2895        dst.period = period == null ? null : period.copy();
2896        dst.improvementNotation = improvementNotation == null ? null : improvementNotation.copy();
2897        if (group != null) {
2898          dst.group = new ArrayList<MeasureReportGroupComponent>();
2899          for (MeasureReportGroupComponent i : group)
2900            dst.group.add(i.copy());
2901        };
2902        if (evaluatedResource != null) {
2903          dst.evaluatedResource = new ArrayList<Reference>();
2904          for (Reference i : evaluatedResource)
2905            dst.evaluatedResource.add(i.copy());
2906        };
2907      }
2908
2909      protected MeasureReport typedCopy() {
2910        return copy();
2911      }
2912
2913      @Override
2914      public boolean equalsDeep(Base other_) {
2915        if (!super.equalsDeep(other_))
2916          return false;
2917        if (!(other_ instanceof MeasureReport))
2918          return false;
2919        MeasureReport o = (MeasureReport) other_;
2920        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
2921           && compareDeep(measure, o.measure, true) && compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true)
2922           && compareDeep(reporter, o.reporter, true) && compareDeep(period, o.period, true) && compareDeep(improvementNotation, o.improvementNotation, true)
2923           && compareDeep(group, o.group, true) && compareDeep(evaluatedResource, o.evaluatedResource, true)
2924          ;
2925      }
2926
2927      @Override
2928      public boolean equalsShallow(Base other_) {
2929        if (!super.equalsShallow(other_))
2930          return false;
2931        if (!(other_ instanceof MeasureReport))
2932          return false;
2933        MeasureReport o = (MeasureReport) other_;
2934        return compareValues(status, o.status, true) && compareValues(type, o.type, true) && compareValues(date, o.date, true)
2935          ;
2936      }
2937
2938      public boolean isEmpty() {
2939        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
2940          , measure, subject, date, reporter, period, improvementNotation, group, evaluatedResource
2941          );
2942      }
2943
2944  @Override
2945  public ResourceType getResourceType() {
2946    return ResourceType.MeasureReport;
2947   }
2948
2949 /**
2950   * Search parameter: <b>date</b>
2951   * <p>
2952   * Description: <b>The date of the measure report</b><br>
2953   * Type: <b>date</b><br>
2954   * Path: <b>MeasureReport.date</b><br>
2955   * </p>
2956   */
2957  @SearchParamDefinition(name="date", path="MeasureReport.date", description="The date of the measure report", type="date" )
2958  public static final String SP_DATE = "date";
2959 /**
2960   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2961   * <p>
2962   * Description: <b>The date of the measure report</b><br>
2963   * Type: <b>date</b><br>
2964   * Path: <b>MeasureReport.date</b><br>
2965   * </p>
2966   */
2967  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2968
2969 /**
2970   * Search parameter: <b>identifier</b>
2971   * <p>
2972   * Description: <b>External identifier of the measure report to be returned</b><br>
2973   * Type: <b>token</b><br>
2974   * Path: <b>MeasureReport.identifier</b><br>
2975   * </p>
2976   */
2977  @SearchParamDefinition(name="identifier", path="MeasureReport.identifier", description="External identifier of the measure report to be returned", type="token" )
2978  public static final String SP_IDENTIFIER = "identifier";
2979 /**
2980   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2981   * <p>
2982   * Description: <b>External identifier of the measure report to be returned</b><br>
2983   * Type: <b>token</b><br>
2984   * Path: <b>MeasureReport.identifier</b><br>
2985   * </p>
2986   */
2987  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2988
2989 /**
2990   * Search parameter: <b>period</b>
2991   * <p>
2992   * Description: <b>The period of the measure report</b><br>
2993   * Type: <b>date</b><br>
2994   * Path: <b>MeasureReport.period</b><br>
2995   * </p>
2996   */
2997  @SearchParamDefinition(name="period", path="MeasureReport.period", description="The period of the measure report", type="date" )
2998  public static final String SP_PERIOD = "period";
2999 /**
3000   * <b>Fluent Client</b> search parameter constant for <b>period</b>
3001   * <p>
3002   * Description: <b>The period of the measure report</b><br>
3003   * Type: <b>date</b><br>
3004   * Path: <b>MeasureReport.period</b><br>
3005   * </p>
3006   */
3007  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
3008
3009 /**
3010   * Search parameter: <b>measure</b>
3011   * <p>
3012   * Description: <b>The measure to return measure report results for</b><br>
3013   * Type: <b>reference</b><br>
3014   * Path: <b>MeasureReport.measure</b><br>
3015   * </p>
3016   */
3017  @SearchParamDefinition(name="measure", path="MeasureReport.measure", description="The measure to return measure report results for", type="reference", target={Measure.class } )
3018  public static final String SP_MEASURE = "measure";
3019 /**
3020   * <b>Fluent Client</b> search parameter constant for <b>measure</b>
3021   * <p>
3022   * Description: <b>The measure to return measure report results for</b><br>
3023   * Type: <b>reference</b><br>
3024   * Path: <b>MeasureReport.measure</b><br>
3025   * </p>
3026   */
3027  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEASURE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEASURE);
3028
3029/**
3030   * Constant for fluent queries to be used to add include statements. Specifies
3031   * the path value of "<b>MeasureReport:measure</b>".
3032   */
3033  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEASURE = new ca.uhn.fhir.model.api.Include("MeasureReport:measure").toLocked();
3034
3035 /**
3036   * Search parameter: <b>patient</b>
3037   * <p>
3038   * Description: <b>The identity of a patient to search for individual measure report results for</b><br>
3039   * Type: <b>reference</b><br>
3040   * Path: <b>MeasureReport.subject</b><br>
3041   * </p>
3042   */
3043  @SearchParamDefinition(name="patient", path="MeasureReport.subject.where(resolve() is Patient)", description="The identity of a patient to search for individual measure report results for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
3044  public static final String SP_PATIENT = "patient";
3045 /**
3046   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3047   * <p>
3048   * Description: <b>The identity of a patient to search for individual measure report results for</b><br>
3049   * Type: <b>reference</b><br>
3050   * Path: <b>MeasureReport.subject</b><br>
3051   * </p>
3052   */
3053  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3054
3055/**
3056   * Constant for fluent queries to be used to add include statements. Specifies
3057   * the path value of "<b>MeasureReport:patient</b>".
3058   */
3059  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MeasureReport:patient").toLocked();
3060
3061 /**
3062   * Search parameter: <b>subject</b>
3063   * <p>
3064   * Description: <b>The identity of a subject to search for individual measure report results for</b><br>
3065   * Type: <b>reference</b><br>
3066   * Path: <b>MeasureReport.subject</b><br>
3067   * </p>
3068   */
3069  @SearchParamDefinition(name="subject", path="MeasureReport.subject", description="The identity of a subject to search for individual measure report results for", type="reference", target={Device.class, Group.class, Location.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3070  public static final String SP_SUBJECT = "subject";
3071 /**
3072   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3073   * <p>
3074   * Description: <b>The identity of a subject to search for individual measure report results for</b><br>
3075   * Type: <b>reference</b><br>
3076   * Path: <b>MeasureReport.subject</b><br>
3077   * </p>
3078   */
3079  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3080
3081/**
3082   * Constant for fluent queries to be used to add include statements. Specifies
3083   * the path value of "<b>MeasureReport:subject</b>".
3084   */
3085  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MeasureReport:subject").toLocked();
3086
3087 /**
3088   * Search parameter: <b>reporter</b>
3089   * <p>
3090   * Description: <b>The reporter to return measure report results for</b><br>
3091   * Type: <b>reference</b><br>
3092   * Path: <b>MeasureReport.reporter</b><br>
3093   * </p>
3094   */
3095  @SearchParamDefinition(name="reporter", path="MeasureReport.reporter", description="The reporter to return measure report results for", type="reference", target={Location.class, Organization.class, Practitioner.class, PractitionerRole.class } )
3096  public static final String SP_REPORTER = "reporter";
3097 /**
3098   * <b>Fluent Client</b> search parameter constant for <b>reporter</b>
3099   * <p>
3100   * Description: <b>The reporter to return measure report results for</b><br>
3101   * Type: <b>reference</b><br>
3102   * Path: <b>MeasureReport.reporter</b><br>
3103   * </p>
3104   */
3105  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPORTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPORTER);
3106
3107/**
3108   * Constant for fluent queries to be used to add include statements. Specifies
3109   * the path value of "<b>MeasureReport:reporter</b>".
3110   */
3111  public static final ca.uhn.fhir.model.api.Include INCLUDE_REPORTER = new ca.uhn.fhir.model.api.Include("MeasureReport:reporter").toLocked();
3112
3113 /**
3114   * Search parameter: <b>status</b>
3115   * <p>
3116   * Description: <b>The status of the measure report</b><br>
3117   * Type: <b>token</b><br>
3118   * Path: <b>MeasureReport.status</b><br>
3119   * </p>
3120   */
3121  @SearchParamDefinition(name="status", path="MeasureReport.status", description="The status of the measure report", type="token" )
3122  public static final String SP_STATUS = "status";
3123 /**
3124   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3125   * <p>
3126   * Description: <b>The status of the measure report</b><br>
3127   * Type: <b>token</b><br>
3128   * Path: <b>MeasureReport.status</b><br>
3129   * </p>
3130   */
3131  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3132
3133 /**
3134   * Search parameter: <b>evaluated-resource</b>
3135   * <p>
3136   * Description: <b>An evaluated resource referenced by the measure report</b><br>
3137   * Type: <b>reference</b><br>
3138   * Path: <b>MeasureReport.evaluatedResource</b><br>
3139   * </p>
3140   */
3141  @SearchParamDefinition(name="evaluated-resource", path="MeasureReport.evaluatedResource", description="An evaluated resource referenced by the measure report", type="reference" )
3142  public static final String SP_EVALUATED_RESOURCE = "evaluated-resource";
3143 /**
3144   * <b>Fluent Client</b> search parameter constant for <b>evaluated-resource</b>
3145   * <p>
3146   * Description: <b>An evaluated resource referenced by the measure report</b><br>
3147   * Type: <b>reference</b><br>
3148   * Path: <b>MeasureReport.evaluatedResource</b><br>
3149   * </p>
3150   */
3151  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EVALUATED_RESOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EVALUATED_RESOURCE);
3152
3153/**
3154   * Constant for fluent queries to be used to add include statements. Specifies
3155   * the path value of "<b>MeasureReport:evaluated-resource</b>".
3156   */
3157  public static final ca.uhn.fhir.model.api.Include INCLUDE_EVALUATED_RESOURCE = new ca.uhn.fhir.model.api.Include("MeasureReport:evaluated-resource").toLocked();
3158
3159
3160}