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