001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.
052 */
053@ResourceDef(name="MeasureReport", profile="http://hl7.org/fhir/StructureDefinition/MeasureReport")
054public class MeasureReport extends DomainResource {
055
056    public enum MeasureReportStatus {
057        /**
058         * The report is complete and ready for use.
059         */
060        COMPLETE, 
061        /**
062         * The report is currently being generated.
063         */
064        PENDING, 
065        /**
066         * An error occurred attempting to generate the report.
067         */
068        ERROR, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static MeasureReportStatus fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("complete".equals(codeString))
077          return COMPLETE;
078        if ("pending".equals(codeString))
079          return PENDING;
080        if ("error".equals(codeString))
081          return ERROR;
082        if (Configuration.isAcceptInvalidEnums())
083          return null;
084        else
085          throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'");
086        }
087        public String toCode() {
088          switch (this) {
089            case COMPLETE: return "complete";
090            case PENDING: return "pending";
091            case ERROR: return "error";
092            default: return "?";
093          }
094        }
095        public String getSystem() {
096          switch (this) {
097            case COMPLETE: return "http://hl7.org/fhir/measure-report-status";
098            case PENDING: return "http://hl7.org/fhir/measure-report-status";
099            case ERROR: return "http://hl7.org/fhir/measure-report-status";
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            default: return "?";
109          }
110        }
111        public String getDisplay() {
112          switch (this) {
113            case COMPLETE: return "Complete";
114            case PENDING: return "Pending";
115            case ERROR: return "Error";
116            default: return "?";
117          }
118        }
119    }
120
121  public static class MeasureReportStatusEnumFactory implements EnumFactory<MeasureReportStatus> {
122    public MeasureReportStatus fromCode(String codeString) throws IllegalArgumentException {
123      if (codeString == null || "".equals(codeString))
124            if (codeString == null || "".equals(codeString))
125                return null;
126        if ("complete".equals(codeString))
127          return MeasureReportStatus.COMPLETE;
128        if ("pending".equals(codeString))
129          return MeasureReportStatus.PENDING;
130        if ("error".equals(codeString))
131          return MeasureReportStatus.ERROR;
132        throw new IllegalArgumentException("Unknown MeasureReportStatus code '"+codeString+"'");
133        }
134        public Enumeration<MeasureReportStatus> fromType(Base code) throws FHIRException {
135          if (code == null)
136            return null;
137          if (code.isEmpty())
138            return new Enumeration<MeasureReportStatus>(this);
139          String codeString = ((PrimitiveType) code).asStringValue();
140          if (codeString == null || "".equals(codeString))
141            return null;
142        if ("complete".equals(codeString))
143          return new Enumeration<MeasureReportStatus>(this, MeasureReportStatus.COMPLETE);
144        if ("pending".equals(codeString))
145          return new Enumeration<MeasureReportStatus>(this, MeasureReportStatus.PENDING);
146        if ("error".equals(codeString))
147          return new Enumeration<MeasureReportStatus>(this, MeasureReportStatus.ERROR);
148        throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'");
149        }
150    public String toCode(MeasureReportStatus code) {
151      if (code == MeasureReportStatus.COMPLETE)
152        return "complete";
153      if (code == MeasureReportStatus.PENDING)
154        return "pending";
155      if (code == MeasureReportStatus.ERROR)
156        return "error";
157      return "?";
158      }
159    public String toSystem(MeasureReportStatus code) {
160      return code.getSystem();
161      }
162    }
163
164    public enum MeasureReportType {
165        /**
166         * An individual report that provides information on the performance for a given measure with respect to a single subject.
167         */
168        INDIVIDUAL, 
169        /**
170         * A subject list report that includes a listing of subjects that satisfied each population criteria in the measure.
171         */
172        SUBJECTLIST, 
173        /**
174         * A summary report that returns the number of members in each population criteria for the measure.
175         */
176        SUMMARY, 
177        /**
178         * A data collection report that contains data-of-interest for the measure.
179         */
180        DATACOLLECTION, 
181        /**
182         * added to help the parsers with the generic types
183         */
184        NULL;
185        public static MeasureReportType fromCode(String codeString) throws FHIRException {
186            if (codeString == null || "".equals(codeString))
187                return null;
188        if ("individual".equals(codeString))
189          return INDIVIDUAL;
190        if ("subject-list".equals(codeString))
191          return SUBJECTLIST;
192        if ("summary".equals(codeString))
193          return SUMMARY;
194        if ("data-collection".equals(codeString))
195          return DATACOLLECTION;
196        if (Configuration.isAcceptInvalidEnums())
197          return null;
198        else
199          throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'");
200        }
201        public String toCode() {
202          switch (this) {
203            case INDIVIDUAL: return "individual";
204            case SUBJECTLIST: return "subject-list";
205            case SUMMARY: return "summary";
206            case DATACOLLECTION: return "data-collection";
207            default: return "?";
208          }
209        }
210        public String getSystem() {
211          switch (this) {
212            case INDIVIDUAL: return "http://hl7.org/fhir/measure-report-type";
213            case SUBJECTLIST: return "http://hl7.org/fhir/measure-report-type";
214            case SUMMARY: return "http://hl7.org/fhir/measure-report-type";
215            case DATACOLLECTION: return "http://hl7.org/fhir/measure-report-type";
216            default: return "?";
217          }
218        }
219        public String getDefinition() {
220          switch (this) {
221            case INDIVIDUAL: return "An individual report that provides information on the performance for a given measure with respect to a single subject.";
222            case SUBJECTLIST: return "A subject list report that includes a listing of subjects that satisfied each population criteria in the measure.";
223            case SUMMARY: return "A summary report that returns the number of members in each population criteria for the measure.";
224            case DATACOLLECTION: return "A data collection report that contains data-of-interest for the measure.";
225            default: return "?";
226          }
227        }
228        public String getDisplay() {
229          switch (this) {
230            case INDIVIDUAL: return "Individual";
231            case SUBJECTLIST: return "Subject List";
232            case SUMMARY: return "Summary";
233            case DATACOLLECTION: return "Data Collection";
234            default: return "?";
235          }
236        }
237    }
238
239  public static class MeasureReportTypeEnumFactory implements EnumFactory<MeasureReportType> {
240    public MeasureReportType fromCode(String codeString) throws IllegalArgumentException {
241      if (codeString == null || "".equals(codeString))
242            if (codeString == null || "".equals(codeString))
243                return null;
244        if ("individual".equals(codeString))
245          return MeasureReportType.INDIVIDUAL;
246        if ("subject-list".equals(codeString))
247          return MeasureReportType.SUBJECTLIST;
248        if ("summary".equals(codeString))
249          return MeasureReportType.SUMMARY;
250        if ("data-collection".equals(codeString))
251          return MeasureReportType.DATACOLLECTION;
252        throw new IllegalArgumentException("Unknown MeasureReportType code '"+codeString+"'");
253        }
254        public Enumeration<MeasureReportType> fromType(Base code) throws FHIRException {
255          if (code == null)
256            return null;
257          if (code.isEmpty())
258            return new Enumeration<MeasureReportType>(this);
259          String codeString = ((PrimitiveType) code).asStringValue();
260          if (codeString == null || "".equals(codeString))
261            return null;
262        if ("individual".equals(codeString))
263          return new Enumeration<MeasureReportType>(this, MeasureReportType.INDIVIDUAL);
264        if ("subject-list".equals(codeString))
265          return new Enumeration<MeasureReportType>(this, MeasureReportType.SUBJECTLIST);
266        if ("summary".equals(codeString))
267          return new Enumeration<MeasureReportType>(this, MeasureReportType.SUMMARY);
268        if ("data-collection".equals(codeString))
269          return new Enumeration<MeasureReportType>(this, MeasureReportType.DATACOLLECTION);
270        throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'");
271        }
272    public String toCode(MeasureReportType code) {
273      if (code == MeasureReportType.INDIVIDUAL)
274        return "individual";
275      if (code == MeasureReportType.SUBJECTLIST)
276        return "subject-list";
277      if (code == MeasureReportType.SUMMARY)
278        return "summary";
279      if (code == MeasureReportType.DATACOLLECTION)
280        return "data-collection";
281      return "?";
282      }
283    public String toSystem(MeasureReportType code) {
284      return code.getSystem();
285      }
286    }
287
288    public enum SubmitDataUpdateType {
289        /**
290         * In contrast to the Snapshot Update, the FHIR Parameters resource used in a Submit Data or the Collect Data scenario contains only the new and updated DEQM and QI Core Profiles since the last transaction. If the Consumer supports incremental updates, the contents of the updated payload updates the previous payload data.
291         */
292        INCREMENTAL, 
293        /**
294         * In contrast to the Incremental Update, the FHIR Parameters resource used in a Submit Data or the Collect Data scenario contains all the DEQM and QI Core Profiles for each transaction.  If the Consumer supports snapshot updates, the contents of the updated payload entirely replaces the previous payload
295         */
296        SNAPSHOT, 
297        /**
298         * added to help the parsers with the generic types
299         */
300        NULL;
301        public static SubmitDataUpdateType fromCode(String codeString) throws FHIRException {
302            if (codeString == null || "".equals(codeString))
303                return null;
304        if ("incremental".equals(codeString))
305          return INCREMENTAL;
306        if ("snapshot".equals(codeString))
307          return SNAPSHOT;
308        if (Configuration.isAcceptInvalidEnums())
309          return null;
310        else
311          throw new FHIRException("Unknown SubmitDataUpdateType code '"+codeString+"'");
312        }
313        public String toCode() {
314          switch (this) {
315            case INCREMENTAL: return "incremental";
316            case SNAPSHOT: return "snapshot";
317            default: return "?";
318          }
319        }
320        public String getSystem() {
321          switch (this) {
322            case INCREMENTAL: return "http://hl7.org/fhir/CodeSystem/submit-data-update-type";
323            case SNAPSHOT: return "http://hl7.org/fhir/CodeSystem/submit-data-update-type";
324            default: return "?";
325          }
326        }
327        public String getDefinition() {
328          switch (this) {
329            case INCREMENTAL: return "In contrast to the Snapshot Update, the FHIR Parameters resource used in a Submit Data or the Collect Data scenario contains only the new and updated DEQM and QI Core Profiles since the last transaction. If the Consumer supports incremental updates, the contents of the updated payload updates the previous payload data.";
330            case SNAPSHOT: return "In contrast to the Incremental Update, the FHIR Parameters resource used in a Submit Data or the Collect Data scenario contains all the DEQM and QI Core Profiles for each transaction.  If the Consumer supports snapshot updates, the contents of the updated payload entirely replaces the previous payload";
331            default: return "?";
332          }
333        }
334        public String getDisplay() {
335          switch (this) {
336            case INCREMENTAL: return "Incremental";
337            case SNAPSHOT: return "Snapshot";
338            default: return "?";
339          }
340        }
341    }
342
343  public static class SubmitDataUpdateTypeEnumFactory implements EnumFactory<SubmitDataUpdateType> {
344    public SubmitDataUpdateType fromCode(String codeString) throws IllegalArgumentException {
345      if (codeString == null || "".equals(codeString))
346            if (codeString == null || "".equals(codeString))
347                return null;
348        if ("incremental".equals(codeString))
349          return SubmitDataUpdateType.INCREMENTAL;
350        if ("snapshot".equals(codeString))
351          return SubmitDataUpdateType.SNAPSHOT;
352        throw new IllegalArgumentException("Unknown SubmitDataUpdateType code '"+codeString+"'");
353        }
354        public Enumeration<SubmitDataUpdateType> fromType(Base code) throws FHIRException {
355          if (code == null)
356            return null;
357          if (code.isEmpty())
358            return new Enumeration<SubmitDataUpdateType>(this);
359          String codeString = ((PrimitiveType) code).asStringValue();
360          if (codeString == null || "".equals(codeString))
361            return null;
362        if ("incremental".equals(codeString))
363          return new Enumeration<SubmitDataUpdateType>(this, SubmitDataUpdateType.INCREMENTAL);
364        if ("snapshot".equals(codeString))
365          return new Enumeration<SubmitDataUpdateType>(this, SubmitDataUpdateType.SNAPSHOT);
366        throw new FHIRException("Unknown SubmitDataUpdateType code '"+codeString+"'");
367        }
368    public String toCode(SubmitDataUpdateType code) {
369      if (code == SubmitDataUpdateType.INCREMENTAL)
370        return "incremental";
371      if (code == SubmitDataUpdateType.SNAPSHOT)
372        return "snapshot";
373      return "?";
374      }
375    public String toSystem(SubmitDataUpdateType code) {
376      return code.getSystem();
377      }
378    }
379
380    @Block()
381    public static class MeasureReportGroupComponent extends BackboneElement implements IBaseBackboneElement {
382        /**
383         * The meaning of the population group as defined in the measure definition.
384         */
385        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
386        @Description(shortDefinition="Meaning of the group", formalDefinition="The meaning of the population group as defined in the measure definition." )
387        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-group-example")
388        protected CodeableConcept code;
389
390        /**
391         * The populations that make up the population group, one for each type of population appropriate for the measure.
392         */
393        @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
394        @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." )
395        protected List<MeasureReportGroupPopulationComponent> population;
396
397        /**
398         * 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.
399         */
400        @Child(name = "measureScore", type = {Quantity.class, DateTimeType.class, CodeableConcept.class, Period.class, Range.class, Duration.class}, order=3, min=0, max=1, modifier=false, summary=true)
401        @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." )
402        protected DataType measureScore;
403
404        /**
405         * When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.
406         */
407        @Child(name = "stratifier", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
408        @Description(shortDefinition="Stratification results", formalDefinition="When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure." )
409        protected List<MeasureReportGroupStratifierComponent> stratifier;
410
411        private static final long serialVersionUID = -631288064L;
412
413    /**
414     * Constructor
415     */
416      public MeasureReportGroupComponent() {
417        super();
418      }
419
420        /**
421         * @return {@link #code} (The meaning of the population group as defined in the measure definition.)
422         */
423        public CodeableConcept getCode() { 
424          if (this.code == null)
425            if (Configuration.errorOnAutoCreate())
426              throw new Error("Attempt to auto-create MeasureReportGroupComponent.code");
427            else if (Configuration.doAutoCreate())
428              this.code = new CodeableConcept(); // cc
429          return this.code;
430        }
431
432        public boolean hasCode() { 
433          return this.code != null && !this.code.isEmpty();
434        }
435
436        /**
437         * @param value {@link #code} (The meaning of the population group as defined in the measure definition.)
438         */
439        public MeasureReportGroupComponent setCode(CodeableConcept value) { 
440          this.code = value;
441          return this;
442        }
443
444        /**
445         * @return {@link #population} (The populations that make up the population group, one for each type of population appropriate for the measure.)
446         */
447        public List<MeasureReportGroupPopulationComponent> getPopulation() { 
448          if (this.population == null)
449            this.population = new ArrayList<MeasureReportGroupPopulationComponent>();
450          return this.population;
451        }
452
453        /**
454         * @return Returns a reference to <code>this</code> for easy method chaining
455         */
456        public MeasureReportGroupComponent setPopulation(List<MeasureReportGroupPopulationComponent> thePopulation) { 
457          this.population = thePopulation;
458          return this;
459        }
460
461        public boolean hasPopulation() { 
462          if (this.population == null)
463            return false;
464          for (MeasureReportGroupPopulationComponent item : this.population)
465            if (!item.isEmpty())
466              return true;
467          return false;
468        }
469
470        public MeasureReportGroupPopulationComponent addPopulation() { //3
471          MeasureReportGroupPopulationComponent t = new MeasureReportGroupPopulationComponent();
472          if (this.population == null)
473            this.population = new ArrayList<MeasureReportGroupPopulationComponent>();
474          this.population.add(t);
475          return t;
476        }
477
478        public MeasureReportGroupComponent addPopulation(MeasureReportGroupPopulationComponent t) { //3
479          if (t == null)
480            return this;
481          if (this.population == null)
482            this.population = new ArrayList<MeasureReportGroupPopulationComponent>();
483          this.population.add(t);
484          return this;
485        }
486
487        /**
488         * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist {3}
489         */
490        public MeasureReportGroupPopulationComponent getPopulationFirstRep() { 
491          if (getPopulation().isEmpty()) {
492            addPopulation();
493          }
494          return getPopulation().get(0);
495        }
496
497        /**
498         * @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.)
499         */
500        public DataType getMeasureScore() { 
501          return this.measureScore;
502        }
503
504        /**
505         * @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.)
506         */
507        public Quantity getMeasureScoreQuantity() throws FHIRException { 
508          if (this.measureScore == null)
509            this.measureScore = new Quantity();
510          if (!(this.measureScore instanceof Quantity))
511            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.measureScore.getClass().getName()+" was encountered");
512          return (Quantity) this.measureScore;
513        }
514
515        public boolean hasMeasureScoreQuantity() { 
516          return this != null && this.measureScore instanceof Quantity;
517        }
518
519        /**
520         * @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.)
521         */
522        public DateTimeType getMeasureScoreDateTimeType() throws FHIRException { 
523          if (this.measureScore == null)
524            this.measureScore = new DateTimeType();
525          if (!(this.measureScore instanceof DateTimeType))
526            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.measureScore.getClass().getName()+" was encountered");
527          return (DateTimeType) this.measureScore;
528        }
529
530        public boolean hasMeasureScoreDateTimeType() { 
531          return this != null && this.measureScore instanceof DateTimeType;
532        }
533
534        /**
535         * @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.)
536         */
537        public CodeableConcept getMeasureScoreCodeableConcept() throws FHIRException { 
538          if (this.measureScore == null)
539            this.measureScore = new CodeableConcept();
540          if (!(this.measureScore instanceof CodeableConcept))
541            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.measureScore.getClass().getName()+" was encountered");
542          return (CodeableConcept) this.measureScore;
543        }
544
545        public boolean hasMeasureScoreCodeableConcept() { 
546          return this != null && this.measureScore instanceof CodeableConcept;
547        }
548
549        /**
550         * @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.)
551         */
552        public Period getMeasureScorePeriod() throws FHIRException { 
553          if (this.measureScore == null)
554            this.measureScore = new Period();
555          if (!(this.measureScore instanceof Period))
556            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.measureScore.getClass().getName()+" was encountered");
557          return (Period) this.measureScore;
558        }
559
560        public boolean hasMeasureScorePeriod() { 
561          return this != null && this.measureScore instanceof Period;
562        }
563
564        /**
565         * @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.)
566         */
567        public Range getMeasureScoreRange() throws FHIRException { 
568          if (this.measureScore == null)
569            this.measureScore = new Range();
570          if (!(this.measureScore instanceof Range))
571            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.measureScore.getClass().getName()+" was encountered");
572          return (Range) this.measureScore;
573        }
574
575        public boolean hasMeasureScoreRange() { 
576          return this != null && this.measureScore instanceof Range;
577        }
578
579        /**
580         * @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.)
581         */
582        public Duration getMeasureScoreDuration() throws FHIRException { 
583          if (this.measureScore == null)
584            this.measureScore = new Duration();
585          if (!(this.measureScore instanceof Duration))
586            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.measureScore.getClass().getName()+" was encountered");
587          return (Duration) this.measureScore;
588        }
589
590        public boolean hasMeasureScoreDuration() { 
591          return this != null && this.measureScore instanceof Duration;
592        }
593
594        public boolean hasMeasureScore() { 
595          return this.measureScore != null && !this.measureScore.isEmpty();
596        }
597
598        /**
599         * @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.)
600         */
601        public MeasureReportGroupComponent setMeasureScore(DataType value) { 
602          if (value != null && !(value instanceof Quantity || value instanceof DateTimeType || value instanceof CodeableConcept || value instanceof Period || value instanceof Range || value instanceof Duration))
603            throw new Error("Not the right type for MeasureReport.group.measureScore[x]: "+value.fhirType());
604          this.measureScore = value;
605          return this;
606        }
607
608        /**
609         * @return {@link #stratifier} (When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.)
610         */
611        public List<MeasureReportGroupStratifierComponent> getStratifier() { 
612          if (this.stratifier == null)
613            this.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
614          return this.stratifier;
615        }
616
617        /**
618         * @return Returns a reference to <code>this</code> for easy method chaining
619         */
620        public MeasureReportGroupComponent setStratifier(List<MeasureReportGroupStratifierComponent> theStratifier) { 
621          this.stratifier = theStratifier;
622          return this;
623        }
624
625        public boolean hasStratifier() { 
626          if (this.stratifier == null)
627            return false;
628          for (MeasureReportGroupStratifierComponent item : this.stratifier)
629            if (!item.isEmpty())
630              return true;
631          return false;
632        }
633
634        public MeasureReportGroupStratifierComponent addStratifier() { //3
635          MeasureReportGroupStratifierComponent t = new MeasureReportGroupStratifierComponent();
636          if (this.stratifier == null)
637            this.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
638          this.stratifier.add(t);
639          return t;
640        }
641
642        public MeasureReportGroupComponent addStratifier(MeasureReportGroupStratifierComponent t) { //3
643          if (t == null)
644            return this;
645          if (this.stratifier == null)
646            this.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
647          this.stratifier.add(t);
648          return this;
649        }
650
651        /**
652         * @return The first repetition of repeating field {@link #stratifier}, creating it if it does not already exist {3}
653         */
654        public MeasureReportGroupStratifierComponent getStratifierFirstRep() { 
655          if (getStratifier().isEmpty()) {
656            addStratifier();
657          }
658          return getStratifier().get(0);
659        }
660
661        protected void listChildren(List<Property> children) {
662          super.listChildren(children);
663          children.add(new Property("code", "CodeableConcept", "The meaning of the population group as defined in the measure definition.", 0, 1, code));
664          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));
665          children.add(new Property("measureScore[x]", "Quantity|dateTime|CodeableConcept|Period|Range|Duration", "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));
666          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));
667        }
668
669        @Override
670        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
671          switch (_hash) {
672          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The meaning of the population group as defined in the measure definition.", 0, 1, code);
673          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);
674          case 1854115884: /*measureScore[x]*/  return new Property("measureScore[x]", "Quantity|dateTime|CodeableConcept|Period|Range|Duration", "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);
675          case -386313260: /*measureScore*/  return new Property("measureScore[x]", "Quantity|dateTime|CodeableConcept|Period|Range|Duration", "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);
676          case -1880815489: /*measureScoreQuantity*/  return new Property("measureScore[x]", "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);
677          case 1196938127: /*measureScoreDateTime*/  return new Property("measureScore[x]", "dateTime", "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);
678          case -1193234131: /*measureScoreCodeableConcept*/  return new Property("measureScore[x]", "CodeableConcept", "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);
679          case -1939831115: /*measureScorePeriod*/  return new Property("measureScore[x]", "Period", "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);
680          case -615040567: /*measureScoreRange*/  return new Property("measureScore[x]", "Range", "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);
681          case 1707143560: /*measureScoreDuration*/  return new Property("measureScore[x]", "Duration", "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);
682          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);
683          default: return super.getNamedProperty(_hash, _name, _checkValid);
684          }
685
686        }
687
688      @Override
689      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
690        switch (hash) {
691        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
692        case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureReportGroupPopulationComponent
693        case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // DataType
694        case 90983669: /*stratifier*/ return this.stratifier == null ? new Base[0] : this.stratifier.toArray(new Base[this.stratifier.size()]); // MeasureReportGroupStratifierComponent
695        default: return super.getProperty(hash, name, checkValid);
696        }
697
698      }
699
700      @Override
701      public Base setProperty(int hash, String name, Base value) throws FHIRException {
702        switch (hash) {
703        case 3059181: // code
704          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
705          return value;
706        case -2023558323: // population
707          this.getPopulation().add((MeasureReportGroupPopulationComponent) value); // MeasureReportGroupPopulationComponent
708          return value;
709        case -386313260: // measureScore
710          this.measureScore = TypeConvertor.castToType(value); // DataType
711          return value;
712        case 90983669: // stratifier
713          this.getStratifier().add((MeasureReportGroupStratifierComponent) value); // MeasureReportGroupStratifierComponent
714          return value;
715        default: return super.setProperty(hash, name, value);
716        }
717
718      }
719
720      @Override
721      public Base setProperty(String name, Base value) throws FHIRException {
722        if (name.equals("code")) {
723          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
724        } else if (name.equals("population")) {
725          this.getPopulation().add((MeasureReportGroupPopulationComponent) value);
726        } else if (name.equals("measureScore[x]")) {
727          this.measureScore = TypeConvertor.castToType(value); // DataType
728        } else if (name.equals("stratifier")) {
729          this.getStratifier().add((MeasureReportGroupStratifierComponent) value);
730        } else
731          return super.setProperty(name, value);
732        return value;
733      }
734
735      @Override
736      public Base makeProperty(int hash, String name) throws FHIRException {
737        switch (hash) {
738        case 3059181:  return getCode();
739        case -2023558323:  return addPopulation(); 
740        case 1854115884:  return getMeasureScore();
741        case -386313260:  return getMeasureScore();
742        case 90983669:  return addStratifier(); 
743        default: return super.makeProperty(hash, name);
744        }
745
746      }
747
748      @Override
749      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
750        switch (hash) {
751        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
752        case -2023558323: /*population*/ return new String[] {};
753        case -386313260: /*measureScore*/ return new String[] {"Quantity", "dateTime", "CodeableConcept", "Period", "Range", "Duration"};
754        case 90983669: /*stratifier*/ return new String[] {};
755        default: return super.getTypesForProperty(hash, name);
756        }
757
758      }
759
760      @Override
761      public Base addChild(String name) throws FHIRException {
762        if (name.equals("code")) {
763          this.code = new CodeableConcept();
764          return this.code;
765        }
766        else if (name.equals("population")) {
767          return addPopulation();
768        }
769        else if (name.equals("measureScoreQuantity")) {
770          this.measureScore = new Quantity();
771          return this.measureScore;
772        }
773        else if (name.equals("measureScoreDateTime")) {
774          this.measureScore = new DateTimeType();
775          return this.measureScore;
776        }
777        else if (name.equals("measureScoreCodeableConcept")) {
778          this.measureScore = new CodeableConcept();
779          return this.measureScore;
780        }
781        else if (name.equals("measureScorePeriod")) {
782          this.measureScore = new Period();
783          return this.measureScore;
784        }
785        else if (name.equals("measureScoreRange")) {
786          this.measureScore = new Range();
787          return this.measureScore;
788        }
789        else if (name.equals("measureScoreDuration")) {
790          this.measureScore = new Duration();
791          return this.measureScore;
792        }
793        else if (name.equals("stratifier")) {
794          return addStratifier();
795        }
796        else
797          return super.addChild(name);
798      }
799
800      public MeasureReportGroupComponent copy() {
801        MeasureReportGroupComponent dst = new MeasureReportGroupComponent();
802        copyValues(dst);
803        return dst;
804      }
805
806      public void copyValues(MeasureReportGroupComponent dst) {
807        super.copyValues(dst);
808        dst.code = code == null ? null : code.copy();
809        if (population != null) {
810          dst.population = new ArrayList<MeasureReportGroupPopulationComponent>();
811          for (MeasureReportGroupPopulationComponent i : population)
812            dst.population.add(i.copy());
813        };
814        dst.measureScore = measureScore == null ? null : measureScore.copy();
815        if (stratifier != null) {
816          dst.stratifier = new ArrayList<MeasureReportGroupStratifierComponent>();
817          for (MeasureReportGroupStratifierComponent i : stratifier)
818            dst.stratifier.add(i.copy());
819        };
820      }
821
822      @Override
823      public boolean equalsDeep(Base other_) {
824        if (!super.equalsDeep(other_))
825          return false;
826        if (!(other_ instanceof MeasureReportGroupComponent))
827          return false;
828        MeasureReportGroupComponent o = (MeasureReportGroupComponent) other_;
829        return compareDeep(code, o.code, true) && compareDeep(population, o.population, true) && compareDeep(measureScore, o.measureScore, true)
830           && compareDeep(stratifier, o.stratifier, true);
831      }
832
833      @Override
834      public boolean equalsShallow(Base other_) {
835        if (!super.equalsShallow(other_))
836          return false;
837        if (!(other_ instanceof MeasureReportGroupComponent))
838          return false;
839        MeasureReportGroupComponent o = (MeasureReportGroupComponent) other_;
840        return true;
841      }
842
843      public boolean isEmpty() {
844        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, population, measureScore
845          , stratifier);
846      }
847
848  public String fhirType() {
849    return "MeasureReport.group";
850
851  }
852
853  }
854
855    @Block()
856    public static class MeasureReportGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement {
857        /**
858         * The type of the population.
859         */
860        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
861        @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." )
862        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-population")
863        protected CodeableConcept code;
864
865        /**
866         * The number of members of the population.
867         */
868        @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false)
869        @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population." )
870        protected IntegerType count;
871
872        /**
873         * This element refers to a List of subject level MeasureReport resources, one for each subject in this population.
874         */
875        @Child(name = "subjectResults", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=false)
876        @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." )
877        protected Reference subjectResults;
878
879        private static final long serialVersionUID = 1086153898L;
880
881    /**
882     * Constructor
883     */
884      public MeasureReportGroupPopulationComponent() {
885        super();
886      }
887
888        /**
889         * @return {@link #code} (The type of the population.)
890         */
891        public CodeableConcept getCode() { 
892          if (this.code == null)
893            if (Configuration.errorOnAutoCreate())
894              throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.code");
895            else if (Configuration.doAutoCreate())
896              this.code = new CodeableConcept(); // cc
897          return this.code;
898        }
899
900        public boolean hasCode() { 
901          return this.code != null && !this.code.isEmpty();
902        }
903
904        /**
905         * @param value {@link #code} (The type of the population.)
906         */
907        public MeasureReportGroupPopulationComponent setCode(CodeableConcept value) { 
908          this.code = value;
909          return this;
910        }
911
912        /**
913         * @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
914         */
915        public IntegerType getCountElement() { 
916          if (this.count == null)
917            if (Configuration.errorOnAutoCreate())
918              throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.count");
919            else if (Configuration.doAutoCreate())
920              this.count = new IntegerType(); // bb
921          return this.count;
922        }
923
924        public boolean hasCountElement() { 
925          return this.count != null && !this.count.isEmpty();
926        }
927
928        public boolean hasCount() { 
929          return this.count != null && !this.count.isEmpty();
930        }
931
932        /**
933         * @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
934         */
935        public MeasureReportGroupPopulationComponent setCountElement(IntegerType value) { 
936          this.count = value;
937          return this;
938        }
939
940        /**
941         * @return The number of members of the population.
942         */
943        public int getCount() { 
944          return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue();
945        }
946
947        /**
948         * @param value The number of members of the population.
949         */
950        public MeasureReportGroupPopulationComponent setCount(int value) { 
951            if (this.count == null)
952              this.count = new IntegerType();
953            this.count.setValue(value);
954          return this;
955        }
956
957        /**
958         * @return {@link #subjectResults} (This element refers to a List of subject level MeasureReport resources, one for each subject in this population.)
959         */
960        public Reference getSubjectResults() { 
961          if (this.subjectResults == null)
962            if (Configuration.errorOnAutoCreate())
963              throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.subjectResults");
964            else if (Configuration.doAutoCreate())
965              this.subjectResults = new Reference(); // cc
966          return this.subjectResults;
967        }
968
969        public boolean hasSubjectResults() { 
970          return this.subjectResults != null && !this.subjectResults.isEmpty();
971        }
972
973        /**
974         * @param value {@link #subjectResults} (This element refers to a List of subject level MeasureReport resources, one for each subject in this population.)
975         */
976        public MeasureReportGroupPopulationComponent setSubjectResults(Reference value) { 
977          this.subjectResults = value;
978          return this;
979        }
980
981        protected void listChildren(List<Property> children) {
982          super.listChildren(children);
983          children.add(new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code));
984          children.add(new Property("count", "integer", "The number of members of the population.", 0, 1, count));
985          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));
986        }
987
988        @Override
989        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
990          switch (_hash) {
991          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code);
992          case 94851343: /*count*/  return new Property("count", "integer", "The number of members of the population.", 0, 1, count);
993          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);
994          default: return super.getNamedProperty(_hash, _name, _checkValid);
995          }
996
997        }
998
999      @Override
1000      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1001        switch (hash) {
1002        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1003        case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType
1004        case 2136184106: /*subjectResults*/ return this.subjectResults == null ? new Base[0] : new Base[] {this.subjectResults}; // Reference
1005        default: return super.getProperty(hash, name, checkValid);
1006        }
1007
1008      }
1009
1010      @Override
1011      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1012        switch (hash) {
1013        case 3059181: // code
1014          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1015          return value;
1016        case 94851343: // count
1017          this.count = TypeConvertor.castToInteger(value); // IntegerType
1018          return value;
1019        case 2136184106: // subjectResults
1020          this.subjectResults = TypeConvertor.castToReference(value); // Reference
1021          return value;
1022        default: return super.setProperty(hash, name, value);
1023        }
1024
1025      }
1026
1027      @Override
1028      public Base setProperty(String name, Base value) throws FHIRException {
1029        if (name.equals("code")) {
1030          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1031        } else if (name.equals("count")) {
1032          this.count = TypeConvertor.castToInteger(value); // IntegerType
1033        } else if (name.equals("subjectResults")) {
1034          this.subjectResults = TypeConvertor.castToReference(value); // Reference
1035        } else
1036          return super.setProperty(name, value);
1037        return value;
1038      }
1039
1040      @Override
1041      public Base makeProperty(int hash, String name) throws FHIRException {
1042        switch (hash) {
1043        case 3059181:  return getCode();
1044        case 94851343:  return getCountElement();
1045        case 2136184106:  return getSubjectResults();
1046        default: return super.makeProperty(hash, name);
1047        }
1048
1049      }
1050
1051      @Override
1052      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1053        switch (hash) {
1054        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1055        case 94851343: /*count*/ return new String[] {"integer"};
1056        case 2136184106: /*subjectResults*/ return new String[] {"Reference"};
1057        default: return super.getTypesForProperty(hash, name);
1058        }
1059
1060      }
1061
1062      @Override
1063      public Base addChild(String name) throws FHIRException {
1064        if (name.equals("code")) {
1065          this.code = new CodeableConcept();
1066          return this.code;
1067        }
1068        else if (name.equals("count")) {
1069          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.group.population.count");
1070        }
1071        else if (name.equals("subjectResults")) {
1072          this.subjectResults = new Reference();
1073          return this.subjectResults;
1074        }
1075        else
1076          return super.addChild(name);
1077      }
1078
1079      public MeasureReportGroupPopulationComponent copy() {
1080        MeasureReportGroupPopulationComponent dst = new MeasureReportGroupPopulationComponent();
1081        copyValues(dst);
1082        return dst;
1083      }
1084
1085      public void copyValues(MeasureReportGroupPopulationComponent dst) {
1086        super.copyValues(dst);
1087        dst.code = code == null ? null : code.copy();
1088        dst.count = count == null ? null : count.copy();
1089        dst.subjectResults = subjectResults == null ? null : subjectResults.copy();
1090      }
1091
1092      @Override
1093      public boolean equalsDeep(Base other_) {
1094        if (!super.equalsDeep(other_))
1095          return false;
1096        if (!(other_ instanceof MeasureReportGroupPopulationComponent))
1097          return false;
1098        MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other_;
1099        return compareDeep(code, o.code, true) && compareDeep(count, o.count, true) && compareDeep(subjectResults, o.subjectResults, true)
1100          ;
1101      }
1102
1103      @Override
1104      public boolean equalsShallow(Base other_) {
1105        if (!super.equalsShallow(other_))
1106          return false;
1107        if (!(other_ instanceof MeasureReportGroupPopulationComponent))
1108          return false;
1109        MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other_;
1110        return compareValues(count, o.count, true);
1111      }
1112
1113      public boolean isEmpty() {
1114        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, count, subjectResults
1115          );
1116      }
1117
1118  public String fhirType() {
1119    return "MeasureReport.group.population";
1120
1121  }
1122
1123  }
1124
1125    @Block()
1126    public static class MeasureReportGroupStratifierComponent extends BackboneElement implements IBaseBackboneElement {
1127        /**
1128         * The meaning of this stratifier, as defined in the measure definition.
1129         */
1130        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1131        @Description(shortDefinition="What stratifier of the group", formalDefinition="The meaning of this stratifier, as defined in the measure definition." )
1132        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-stratifier-example")
1133        protected List<CodeableConcept> code;
1134
1135        /**
1136         * 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.
1137         */
1138        @Child(name = "stratum", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1139        @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." )
1140        protected List<StratifierGroupComponent> stratum;
1141
1142        private static final long serialVersionUID = 259550185L;
1143
1144    /**
1145     * Constructor
1146     */
1147      public MeasureReportGroupStratifierComponent() {
1148        super();
1149      }
1150
1151        /**
1152         * @return {@link #code} (The meaning of this stratifier, as defined in the measure definition.)
1153         */
1154        public List<CodeableConcept> getCode() { 
1155          if (this.code == null)
1156            this.code = new ArrayList<CodeableConcept>();
1157          return this.code;
1158        }
1159
1160        /**
1161         * @return Returns a reference to <code>this</code> for easy method chaining
1162         */
1163        public MeasureReportGroupStratifierComponent setCode(List<CodeableConcept> theCode) { 
1164          this.code = theCode;
1165          return this;
1166        }
1167
1168        public boolean hasCode() { 
1169          if (this.code == null)
1170            return false;
1171          for (CodeableConcept item : this.code)
1172            if (!item.isEmpty())
1173              return true;
1174          return false;
1175        }
1176
1177        public CodeableConcept addCode() { //3
1178          CodeableConcept t = new CodeableConcept();
1179          if (this.code == null)
1180            this.code = new ArrayList<CodeableConcept>();
1181          this.code.add(t);
1182          return t;
1183        }
1184
1185        public MeasureReportGroupStratifierComponent addCode(CodeableConcept t) { //3
1186          if (t == null)
1187            return this;
1188          if (this.code == null)
1189            this.code = new ArrayList<CodeableConcept>();
1190          this.code.add(t);
1191          return this;
1192        }
1193
1194        /**
1195         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3}
1196         */
1197        public CodeableConcept getCodeFirstRep() { 
1198          if (getCode().isEmpty()) {
1199            addCode();
1200          }
1201          return getCode().get(0);
1202        }
1203
1204        /**
1205         * @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.)
1206         */
1207        public List<StratifierGroupComponent> getStratum() { 
1208          if (this.stratum == null)
1209            this.stratum = new ArrayList<StratifierGroupComponent>();
1210          return this.stratum;
1211        }
1212
1213        /**
1214         * @return Returns a reference to <code>this</code> for easy method chaining
1215         */
1216        public MeasureReportGroupStratifierComponent setStratum(List<StratifierGroupComponent> theStratum) { 
1217          this.stratum = theStratum;
1218          return this;
1219        }
1220
1221        public boolean hasStratum() { 
1222          if (this.stratum == null)
1223            return false;
1224          for (StratifierGroupComponent item : this.stratum)
1225            if (!item.isEmpty())
1226              return true;
1227          return false;
1228        }
1229
1230        public StratifierGroupComponent addStratum() { //3
1231          StratifierGroupComponent t = new StratifierGroupComponent();
1232          if (this.stratum == null)
1233            this.stratum = new ArrayList<StratifierGroupComponent>();
1234          this.stratum.add(t);
1235          return t;
1236        }
1237
1238        public MeasureReportGroupStratifierComponent addStratum(StratifierGroupComponent t) { //3
1239          if (t == null)
1240            return this;
1241          if (this.stratum == null)
1242            this.stratum = new ArrayList<StratifierGroupComponent>();
1243          this.stratum.add(t);
1244          return this;
1245        }
1246
1247        /**
1248         * @return The first repetition of repeating field {@link #stratum}, creating it if it does not already exist {3}
1249         */
1250        public StratifierGroupComponent getStratumFirstRep() { 
1251          if (getStratum().isEmpty()) {
1252            addStratum();
1253          }
1254          return getStratum().get(0);
1255        }
1256
1257        protected void listChildren(List<Property> children) {
1258          super.listChildren(children);
1259          children.add(new Property("code", "CodeableConcept", "The meaning of this stratifier, as defined in the measure definition.", 0, java.lang.Integer.MAX_VALUE, code));
1260          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));
1261        }
1262
1263        @Override
1264        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1265          switch (_hash) {
1266          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);
1267          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);
1268          default: return super.getNamedProperty(_hash, _name, _checkValid);
1269          }
1270
1271        }
1272
1273      @Override
1274      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1275        switch (hash) {
1276        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
1277        case -1881991236: /*stratum*/ return this.stratum == null ? new Base[0] : this.stratum.toArray(new Base[this.stratum.size()]); // StratifierGroupComponent
1278        default: return super.getProperty(hash, name, checkValid);
1279        }
1280
1281      }
1282
1283      @Override
1284      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1285        switch (hash) {
1286        case 3059181: // code
1287          this.getCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1288          return value;
1289        case -1881991236: // stratum
1290          this.getStratum().add((StratifierGroupComponent) value); // StratifierGroupComponent
1291          return value;
1292        default: return super.setProperty(hash, name, value);
1293        }
1294
1295      }
1296
1297      @Override
1298      public Base setProperty(String name, Base value) throws FHIRException {
1299        if (name.equals("code")) {
1300          this.getCode().add(TypeConvertor.castToCodeableConcept(value));
1301        } else if (name.equals("stratum")) {
1302          this.getStratum().add((StratifierGroupComponent) value);
1303        } else
1304          return super.setProperty(name, value);
1305        return value;
1306      }
1307
1308      @Override
1309      public Base makeProperty(int hash, String name) throws FHIRException {
1310        switch (hash) {
1311        case 3059181:  return addCode(); 
1312        case -1881991236:  return addStratum(); 
1313        default: return super.makeProperty(hash, name);
1314        }
1315
1316      }
1317
1318      @Override
1319      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1320        switch (hash) {
1321        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1322        case -1881991236: /*stratum*/ return new String[] {};
1323        default: return super.getTypesForProperty(hash, name);
1324        }
1325
1326      }
1327
1328      @Override
1329      public Base addChild(String name) throws FHIRException {
1330        if (name.equals("code")) {
1331          return addCode();
1332        }
1333        else if (name.equals("stratum")) {
1334          return addStratum();
1335        }
1336        else
1337          return super.addChild(name);
1338      }
1339
1340      public MeasureReportGroupStratifierComponent copy() {
1341        MeasureReportGroupStratifierComponent dst = new MeasureReportGroupStratifierComponent();
1342        copyValues(dst);
1343        return dst;
1344      }
1345
1346      public void copyValues(MeasureReportGroupStratifierComponent dst) {
1347        super.copyValues(dst);
1348        if (code != null) {
1349          dst.code = new ArrayList<CodeableConcept>();
1350          for (CodeableConcept i : code)
1351            dst.code.add(i.copy());
1352        };
1353        if (stratum != null) {
1354          dst.stratum = new ArrayList<StratifierGroupComponent>();
1355          for (StratifierGroupComponent i : stratum)
1356            dst.stratum.add(i.copy());
1357        };
1358      }
1359
1360      @Override
1361      public boolean equalsDeep(Base other_) {
1362        if (!super.equalsDeep(other_))
1363          return false;
1364        if (!(other_ instanceof MeasureReportGroupStratifierComponent))
1365          return false;
1366        MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other_;
1367        return compareDeep(code, o.code, true) && compareDeep(stratum, o.stratum, true);
1368      }
1369
1370      @Override
1371      public boolean equalsShallow(Base other_) {
1372        if (!super.equalsShallow(other_))
1373          return false;
1374        if (!(other_ instanceof MeasureReportGroupStratifierComponent))
1375          return false;
1376        MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other_;
1377        return true;
1378      }
1379
1380      public boolean isEmpty() {
1381        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, stratum);
1382      }
1383
1384  public String fhirType() {
1385    return "MeasureReport.group.stratifier";
1386
1387  }
1388
1389  }
1390
1391    @Block()
1392    public static class StratifierGroupComponent extends BackboneElement implements IBaseBackboneElement {
1393        /**
1394         * 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.
1395         */
1396        @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, Quantity.class, Range.class, Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
1397        @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." )
1398        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measurereport-stratifier-value-example")
1399        protected DataType value;
1400
1401        /**
1402         * A stratifier component value.
1403         */
1404        @Child(name = "component", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1405        @Description(shortDefinition="Stratifier component values", formalDefinition="A stratifier component value." )
1406        protected List<StratifierGroupComponentComponent> component;
1407
1408        /**
1409         * The populations that make up the stratum, one for each type of population appropriate to the measure.
1410         */
1411        @Child(name = "population", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1412        @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." )
1413        protected List<StratifierGroupPopulationComponent> population;
1414
1415        /**
1416         * 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.
1417         */
1418        @Child(name = "measureScore", type = {Quantity.class, DateTimeType.class, CodeableConcept.class, Period.class, Range.class, Duration.class}, order=4, min=0, max=1, modifier=false, summary=false)
1419        @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." )
1420        protected DataType measureScore;
1421
1422        private static final long serialVersionUID = -1713783491L;
1423
1424    /**
1425     * Constructor
1426     */
1427      public StratifierGroupComponent() {
1428        super();
1429      }
1430
1431        /**
1432         * @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.)
1433         */
1434        public DataType getValue() { 
1435          return this.value;
1436        }
1437
1438        /**
1439         * @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.)
1440         */
1441        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
1442          if (this.value == null)
1443            this.value = new CodeableConcept();
1444          if (!(this.value instanceof CodeableConcept))
1445            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
1446          return (CodeableConcept) this.value;
1447        }
1448
1449        public boolean hasValueCodeableConcept() { 
1450          return this != null && this.value instanceof CodeableConcept;
1451        }
1452
1453        /**
1454         * @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.)
1455         */
1456        public BooleanType getValueBooleanType() throws FHIRException { 
1457          if (this.value == null)
1458            this.value = new BooleanType();
1459          if (!(this.value instanceof BooleanType))
1460            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
1461          return (BooleanType) this.value;
1462        }
1463
1464        public boolean hasValueBooleanType() { 
1465          return this != null && this.value instanceof BooleanType;
1466        }
1467
1468        /**
1469         * @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.)
1470         */
1471        public Quantity getValueQuantity() throws FHIRException { 
1472          if (this.value == null)
1473            this.value = new Quantity();
1474          if (!(this.value instanceof Quantity))
1475            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
1476          return (Quantity) this.value;
1477        }
1478
1479        public boolean hasValueQuantity() { 
1480          return this != null && this.value instanceof Quantity;
1481        }
1482
1483        /**
1484         * @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.)
1485         */
1486        public Range getValueRange() throws FHIRException { 
1487          if (this.value == null)
1488            this.value = new Range();
1489          if (!(this.value instanceof Range))
1490            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
1491          return (Range) this.value;
1492        }
1493
1494        public boolean hasValueRange() { 
1495          return this != null && this.value instanceof Range;
1496        }
1497
1498        /**
1499         * @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.)
1500         */
1501        public Reference getValueReference() throws FHIRException { 
1502          if (this.value == null)
1503            this.value = new Reference();
1504          if (!(this.value instanceof Reference))
1505            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
1506          return (Reference) this.value;
1507        }
1508
1509        public boolean hasValueReference() { 
1510          return this != null && this.value instanceof Reference;
1511        }
1512
1513        public boolean hasValue() { 
1514          return this.value != null && !this.value.isEmpty();
1515        }
1516
1517        /**
1518         * @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.)
1519         */
1520        public StratifierGroupComponent setValue(DataType value) { 
1521          if (value != null && !(value instanceof CodeableConcept || value instanceof BooleanType || value instanceof Quantity || value instanceof Range || value instanceof Reference))
1522            throw new Error("Not the right type for MeasureReport.group.stratifier.stratum.value[x]: "+value.fhirType());
1523          this.value = value;
1524          return this;
1525        }
1526
1527        /**
1528         * @return {@link #component} (A stratifier component value.)
1529         */
1530        public List<StratifierGroupComponentComponent> getComponent() { 
1531          if (this.component == null)
1532            this.component = new ArrayList<StratifierGroupComponentComponent>();
1533          return this.component;
1534        }
1535
1536        /**
1537         * @return Returns a reference to <code>this</code> for easy method chaining
1538         */
1539        public StratifierGroupComponent setComponent(List<StratifierGroupComponentComponent> theComponent) { 
1540          this.component = theComponent;
1541          return this;
1542        }
1543
1544        public boolean hasComponent() { 
1545          if (this.component == null)
1546            return false;
1547          for (StratifierGroupComponentComponent item : this.component)
1548            if (!item.isEmpty())
1549              return true;
1550          return false;
1551        }
1552
1553        public StratifierGroupComponentComponent addComponent() { //3
1554          StratifierGroupComponentComponent t = new StratifierGroupComponentComponent();
1555          if (this.component == null)
1556            this.component = new ArrayList<StratifierGroupComponentComponent>();
1557          this.component.add(t);
1558          return t;
1559        }
1560
1561        public StratifierGroupComponent addComponent(StratifierGroupComponentComponent t) { //3
1562          if (t == null)
1563            return this;
1564          if (this.component == null)
1565            this.component = new ArrayList<StratifierGroupComponentComponent>();
1566          this.component.add(t);
1567          return this;
1568        }
1569
1570        /**
1571         * @return The first repetition of repeating field {@link #component}, creating it if it does not already exist {3}
1572         */
1573        public StratifierGroupComponentComponent getComponentFirstRep() { 
1574          if (getComponent().isEmpty()) {
1575            addComponent();
1576          }
1577          return getComponent().get(0);
1578        }
1579
1580        /**
1581         * @return {@link #population} (The populations that make up the stratum, one for each type of population appropriate to the measure.)
1582         */
1583        public List<StratifierGroupPopulationComponent> getPopulation() { 
1584          if (this.population == null)
1585            this.population = new ArrayList<StratifierGroupPopulationComponent>();
1586          return this.population;
1587        }
1588
1589        /**
1590         * @return Returns a reference to <code>this</code> for easy method chaining
1591         */
1592        public StratifierGroupComponent setPopulation(List<StratifierGroupPopulationComponent> thePopulation) { 
1593          this.population = thePopulation;
1594          return this;
1595        }
1596
1597        public boolean hasPopulation() { 
1598          if (this.population == null)
1599            return false;
1600          for (StratifierGroupPopulationComponent item : this.population)
1601            if (!item.isEmpty())
1602              return true;
1603          return false;
1604        }
1605
1606        public StratifierGroupPopulationComponent addPopulation() { //3
1607          StratifierGroupPopulationComponent t = new StratifierGroupPopulationComponent();
1608          if (this.population == null)
1609            this.population = new ArrayList<StratifierGroupPopulationComponent>();
1610          this.population.add(t);
1611          return t;
1612        }
1613
1614        public StratifierGroupComponent addPopulation(StratifierGroupPopulationComponent t) { //3
1615          if (t == null)
1616            return this;
1617          if (this.population == null)
1618            this.population = new ArrayList<StratifierGroupPopulationComponent>();
1619          this.population.add(t);
1620          return this;
1621        }
1622
1623        /**
1624         * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist {3}
1625         */
1626        public StratifierGroupPopulationComponent getPopulationFirstRep() { 
1627          if (getPopulation().isEmpty()) {
1628            addPopulation();
1629          }
1630          return getPopulation().get(0);
1631        }
1632
1633        /**
1634         * @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.)
1635         */
1636        public DataType getMeasureScore() { 
1637          return this.measureScore;
1638        }
1639
1640        /**
1641         * @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.)
1642         */
1643        public Quantity getMeasureScoreQuantity() throws FHIRException { 
1644          if (this.measureScore == null)
1645            this.measureScore = new Quantity();
1646          if (!(this.measureScore instanceof Quantity))
1647            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.measureScore.getClass().getName()+" was encountered");
1648          return (Quantity) this.measureScore;
1649        }
1650
1651        public boolean hasMeasureScoreQuantity() { 
1652          return this != null && this.measureScore instanceof Quantity;
1653        }
1654
1655        /**
1656         * @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.)
1657         */
1658        public DateTimeType getMeasureScoreDateTimeType() throws FHIRException { 
1659          if (this.measureScore == null)
1660            this.measureScore = new DateTimeType();
1661          if (!(this.measureScore instanceof DateTimeType))
1662            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.measureScore.getClass().getName()+" was encountered");
1663          return (DateTimeType) this.measureScore;
1664        }
1665
1666        public boolean hasMeasureScoreDateTimeType() { 
1667          return this != null && this.measureScore instanceof DateTimeType;
1668        }
1669
1670        /**
1671         * @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.)
1672         */
1673        public CodeableConcept getMeasureScoreCodeableConcept() throws FHIRException { 
1674          if (this.measureScore == null)
1675            this.measureScore = new CodeableConcept();
1676          if (!(this.measureScore instanceof CodeableConcept))
1677            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.measureScore.getClass().getName()+" was encountered");
1678          return (CodeableConcept) this.measureScore;
1679        }
1680
1681        public boolean hasMeasureScoreCodeableConcept() { 
1682          return this != null && this.measureScore instanceof CodeableConcept;
1683        }
1684
1685        /**
1686         * @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.)
1687         */
1688        public Period getMeasureScorePeriod() throws FHIRException { 
1689          if (this.measureScore == null)
1690            this.measureScore = new Period();
1691          if (!(this.measureScore instanceof Period))
1692            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.measureScore.getClass().getName()+" was encountered");
1693          return (Period) this.measureScore;
1694        }
1695
1696        public boolean hasMeasureScorePeriod() { 
1697          return this != null && this.measureScore instanceof Period;
1698        }
1699
1700        /**
1701         * @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.)
1702         */
1703        public Range getMeasureScoreRange() throws FHIRException { 
1704          if (this.measureScore == null)
1705            this.measureScore = new Range();
1706          if (!(this.measureScore instanceof Range))
1707            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.measureScore.getClass().getName()+" was encountered");
1708          return (Range) this.measureScore;
1709        }
1710
1711        public boolean hasMeasureScoreRange() { 
1712          return this != null && this.measureScore instanceof Range;
1713        }
1714
1715        /**
1716         * @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.)
1717         */
1718        public Duration getMeasureScoreDuration() throws FHIRException { 
1719          if (this.measureScore == null)
1720            this.measureScore = new Duration();
1721          if (!(this.measureScore instanceof Duration))
1722            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.measureScore.getClass().getName()+" was encountered");
1723          return (Duration) this.measureScore;
1724        }
1725
1726        public boolean hasMeasureScoreDuration() { 
1727          return this != null && this.measureScore instanceof Duration;
1728        }
1729
1730        public boolean hasMeasureScore() { 
1731          return this.measureScore != null && !this.measureScore.isEmpty();
1732        }
1733
1734        /**
1735         * @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.)
1736         */
1737        public StratifierGroupComponent setMeasureScore(DataType value) { 
1738          if (value != null && !(value instanceof Quantity || value instanceof DateTimeType || value instanceof CodeableConcept || value instanceof Period || value instanceof Range || value instanceof Duration))
1739            throw new Error("Not the right type for MeasureReport.group.stratifier.stratum.measureScore[x]: "+value.fhirType());
1740          this.measureScore = value;
1741          return this;
1742        }
1743
1744        protected void listChildren(List<Property> children) {
1745          super.listChildren(children);
1746          children.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "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));
1747          children.add(new Property("component", "", "A stratifier component value.", 0, java.lang.Integer.MAX_VALUE, component));
1748          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));
1749          children.add(new Property("measureScore[x]", "Quantity|dateTime|CodeableConcept|Period|Range|Duration", "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));
1750        }
1751
1752        @Override
1753        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1754          switch (_hash) {
1755          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "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);
1756          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "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);
1757          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "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);
1758          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "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);
1759          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "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);
1760          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "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);
1761          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference", "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);
1762          case -1399907075: /*component*/  return new Property("component", "", "A stratifier component value.", 0, java.lang.Integer.MAX_VALUE, component);
1763          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);
1764          case 1854115884: /*measureScore[x]*/  return new Property("measureScore[x]", "Quantity|dateTime|CodeableConcept|Period|Range|Duration", "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);
1765          case -386313260: /*measureScore*/  return new Property("measureScore[x]", "Quantity|dateTime|CodeableConcept|Period|Range|Duration", "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);
1766          case -1880815489: /*measureScoreQuantity*/  return new Property("measureScore[x]", "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);
1767          case 1196938127: /*measureScoreDateTime*/  return new Property("measureScore[x]", "dateTime", "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);
1768          case -1193234131: /*measureScoreCodeableConcept*/  return new Property("measureScore[x]", "CodeableConcept", "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);
1769          case -1939831115: /*measureScorePeriod*/  return new Property("measureScore[x]", "Period", "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);
1770          case -615040567: /*measureScoreRange*/  return new Property("measureScore[x]", "Range", "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);
1771          case 1707143560: /*measureScoreDuration*/  return new Property("measureScore[x]", "Duration", "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);
1772          default: return super.getNamedProperty(_hash, _name, _checkValid);
1773          }
1774
1775        }
1776
1777      @Override
1778      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1779        switch (hash) {
1780        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
1781        case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // StratifierGroupComponentComponent
1782        case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // StratifierGroupPopulationComponent
1783        case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // DataType
1784        default: return super.getProperty(hash, name, checkValid);
1785        }
1786
1787      }
1788
1789      @Override
1790      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1791        switch (hash) {
1792        case 111972721: // value
1793          this.value = TypeConvertor.castToType(value); // DataType
1794          return value;
1795        case -1399907075: // component
1796          this.getComponent().add((StratifierGroupComponentComponent) value); // StratifierGroupComponentComponent
1797          return value;
1798        case -2023558323: // population
1799          this.getPopulation().add((StratifierGroupPopulationComponent) value); // StratifierGroupPopulationComponent
1800          return value;
1801        case -386313260: // measureScore
1802          this.measureScore = TypeConvertor.castToType(value); // DataType
1803          return value;
1804        default: return super.setProperty(hash, name, value);
1805        }
1806
1807      }
1808
1809      @Override
1810      public Base setProperty(String name, Base value) throws FHIRException {
1811        if (name.equals("value[x]")) {
1812          this.value = TypeConvertor.castToType(value); // DataType
1813        } else if (name.equals("component")) {
1814          this.getComponent().add((StratifierGroupComponentComponent) value);
1815        } else if (name.equals("population")) {
1816          this.getPopulation().add((StratifierGroupPopulationComponent) value);
1817        } else if (name.equals("measureScore[x]")) {
1818          this.measureScore = TypeConvertor.castToType(value); // DataType
1819        } else
1820          return super.setProperty(name, value);
1821        return value;
1822      }
1823
1824      @Override
1825      public Base makeProperty(int hash, String name) throws FHIRException {
1826        switch (hash) {
1827        case -1410166417:  return getValue();
1828        case 111972721:  return getValue();
1829        case -1399907075:  return addComponent(); 
1830        case -2023558323:  return addPopulation(); 
1831        case 1854115884:  return getMeasureScore();
1832        case -386313260:  return getMeasureScore();
1833        default: return super.makeProperty(hash, name);
1834        }
1835
1836      }
1837
1838      @Override
1839      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1840        switch (hash) {
1841        case 111972721: /*value*/ return new String[] {"CodeableConcept", "boolean", "Quantity", "Range", "Reference"};
1842        case -1399907075: /*component*/ return new String[] {};
1843        case -2023558323: /*population*/ return new String[] {};
1844        case -386313260: /*measureScore*/ return new String[] {"Quantity", "dateTime", "CodeableConcept", "Period", "Range", "Duration"};
1845        default: return super.getTypesForProperty(hash, name);
1846        }
1847
1848      }
1849
1850      @Override
1851      public Base addChild(String name) throws FHIRException {
1852        if (name.equals("valueCodeableConcept")) {
1853          this.value = new CodeableConcept();
1854          return this.value;
1855        }
1856        else if (name.equals("valueBoolean")) {
1857          this.value = new BooleanType();
1858          return this.value;
1859        }
1860        else if (name.equals("valueQuantity")) {
1861          this.value = new Quantity();
1862          return this.value;
1863        }
1864        else if (name.equals("valueRange")) {
1865          this.value = new Range();
1866          return this.value;
1867        }
1868        else if (name.equals("valueReference")) {
1869          this.value = new Reference();
1870          return this.value;
1871        }
1872        else if (name.equals("component")) {
1873          return addComponent();
1874        }
1875        else if (name.equals("population")) {
1876          return addPopulation();
1877        }
1878        else if (name.equals("measureScoreQuantity")) {
1879          this.measureScore = new Quantity();
1880          return this.measureScore;
1881        }
1882        else if (name.equals("measureScoreDateTime")) {
1883          this.measureScore = new DateTimeType();
1884          return this.measureScore;
1885        }
1886        else if (name.equals("measureScoreCodeableConcept")) {
1887          this.measureScore = new CodeableConcept();
1888          return this.measureScore;
1889        }
1890        else if (name.equals("measureScorePeriod")) {
1891          this.measureScore = new Period();
1892          return this.measureScore;
1893        }
1894        else if (name.equals("measureScoreRange")) {
1895          this.measureScore = new Range();
1896          return this.measureScore;
1897        }
1898        else if (name.equals("measureScoreDuration")) {
1899          this.measureScore = new Duration();
1900          return this.measureScore;
1901        }
1902        else
1903          return super.addChild(name);
1904      }
1905
1906      public StratifierGroupComponent copy() {
1907        StratifierGroupComponent dst = new StratifierGroupComponent();
1908        copyValues(dst);
1909        return dst;
1910      }
1911
1912      public void copyValues(StratifierGroupComponent dst) {
1913        super.copyValues(dst);
1914        dst.value = value == null ? null : value.copy();
1915        if (component != null) {
1916          dst.component = new ArrayList<StratifierGroupComponentComponent>();
1917          for (StratifierGroupComponentComponent i : component)
1918            dst.component.add(i.copy());
1919        };
1920        if (population != null) {
1921          dst.population = new ArrayList<StratifierGroupPopulationComponent>();
1922          for (StratifierGroupPopulationComponent i : population)
1923            dst.population.add(i.copy());
1924        };
1925        dst.measureScore = measureScore == null ? null : measureScore.copy();
1926      }
1927
1928      @Override
1929      public boolean equalsDeep(Base other_) {
1930        if (!super.equalsDeep(other_))
1931          return false;
1932        if (!(other_ instanceof StratifierGroupComponent))
1933          return false;
1934        StratifierGroupComponent o = (StratifierGroupComponent) other_;
1935        return compareDeep(value, o.value, true) && compareDeep(component, o.component, true) && compareDeep(population, o.population, true)
1936           && compareDeep(measureScore, o.measureScore, true);
1937      }
1938
1939      @Override
1940      public boolean equalsShallow(Base other_) {
1941        if (!super.equalsShallow(other_))
1942          return false;
1943        if (!(other_ instanceof StratifierGroupComponent))
1944          return false;
1945        StratifierGroupComponent o = (StratifierGroupComponent) other_;
1946        return true;
1947      }
1948
1949      public boolean isEmpty() {
1950        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, component, population
1951          , measureScore);
1952      }
1953
1954  public String fhirType() {
1955    return "MeasureReport.group.stratifier.stratum";
1956
1957  }
1958
1959  }
1960
1961    @Block()
1962    public static class StratifierGroupComponentComponent extends BackboneElement implements IBaseBackboneElement {
1963        /**
1964         * The code for the stratum component value.
1965         */
1966        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1967        @Description(shortDefinition="What stratifier component of the group", formalDefinition="The code for the stratum component value." )
1968        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-stratifier-example")
1969        protected CodeableConcept code;
1970
1971        /**
1972         * The stratum component value.
1973         */
1974        @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, Quantity.class, Range.class, Reference.class}, order=2, min=1, max=1, modifier=false, summary=false)
1975        @Description(shortDefinition="The stratum component value, e.g. male", formalDefinition="The stratum component value." )
1976        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measurereport-stratifier-value-example")
1977        protected DataType value;
1978
1979        private static final long serialVersionUID = -1950789033L;
1980
1981    /**
1982     * Constructor
1983     */
1984      public StratifierGroupComponentComponent() {
1985        super();
1986      }
1987
1988    /**
1989     * Constructor
1990     */
1991      public StratifierGroupComponentComponent(CodeableConcept code, DataType value) {
1992        super();
1993        this.setCode(code);
1994        this.setValue(value);
1995      }
1996
1997        /**
1998         * @return {@link #code} (The code for the stratum component value.)
1999         */
2000        public CodeableConcept getCode() { 
2001          if (this.code == null)
2002            if (Configuration.errorOnAutoCreate())
2003              throw new Error("Attempt to auto-create StratifierGroupComponentComponent.code");
2004            else if (Configuration.doAutoCreate())
2005              this.code = new CodeableConcept(); // cc
2006          return this.code;
2007        }
2008
2009        public boolean hasCode() { 
2010          return this.code != null && !this.code.isEmpty();
2011        }
2012
2013        /**
2014         * @param value {@link #code} (The code for the stratum component value.)
2015         */
2016        public StratifierGroupComponentComponent setCode(CodeableConcept value) { 
2017          this.code = value;
2018          return this;
2019        }
2020
2021        /**
2022         * @return {@link #value} (The stratum component value.)
2023         */
2024        public DataType getValue() { 
2025          return this.value;
2026        }
2027
2028        /**
2029         * @return {@link #value} (The stratum component value.)
2030         */
2031        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
2032          if (this.value == null)
2033            this.value = new CodeableConcept();
2034          if (!(this.value instanceof CodeableConcept))
2035            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
2036          return (CodeableConcept) this.value;
2037        }
2038
2039        public boolean hasValueCodeableConcept() { 
2040          return this != null && this.value instanceof CodeableConcept;
2041        }
2042
2043        /**
2044         * @return {@link #value} (The stratum component value.)
2045         */
2046        public BooleanType getValueBooleanType() throws FHIRException { 
2047          if (this.value == null)
2048            this.value = new BooleanType();
2049          if (!(this.value instanceof BooleanType))
2050            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
2051          return (BooleanType) this.value;
2052        }
2053
2054        public boolean hasValueBooleanType() { 
2055          return this != null && this.value instanceof BooleanType;
2056        }
2057
2058        /**
2059         * @return {@link #value} (The stratum component value.)
2060         */
2061        public Quantity getValueQuantity() throws FHIRException { 
2062          if (this.value == null)
2063            this.value = new Quantity();
2064          if (!(this.value instanceof Quantity))
2065            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
2066          return (Quantity) this.value;
2067        }
2068
2069        public boolean hasValueQuantity() { 
2070          return this != null && this.value instanceof Quantity;
2071        }
2072
2073        /**
2074         * @return {@link #value} (The stratum component value.)
2075         */
2076        public Range getValueRange() throws FHIRException { 
2077          if (this.value == null)
2078            this.value = new Range();
2079          if (!(this.value instanceof Range))
2080            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
2081          return (Range) this.value;
2082        }
2083
2084        public boolean hasValueRange() { 
2085          return this != null && this.value instanceof Range;
2086        }
2087
2088        /**
2089         * @return {@link #value} (The stratum component value.)
2090         */
2091        public Reference getValueReference() throws FHIRException { 
2092          if (this.value == null)
2093            this.value = new Reference();
2094          if (!(this.value instanceof Reference))
2095            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
2096          return (Reference) this.value;
2097        }
2098
2099        public boolean hasValueReference() { 
2100          return this != null && this.value instanceof Reference;
2101        }
2102
2103        public boolean hasValue() { 
2104          return this.value != null && !this.value.isEmpty();
2105        }
2106
2107        /**
2108         * @param value {@link #value} (The stratum component value.)
2109         */
2110        public StratifierGroupComponentComponent setValue(DataType value) { 
2111          if (value != null && !(value instanceof CodeableConcept || value instanceof BooleanType || value instanceof Quantity || value instanceof Range || value instanceof Reference))
2112            throw new Error("Not the right type for MeasureReport.group.stratifier.stratum.component.value[x]: "+value.fhirType());
2113          this.value = value;
2114          return this;
2115        }
2116
2117        protected void listChildren(List<Property> children) {
2118          super.listChildren(children);
2119          children.add(new Property("code", "CodeableConcept", "The code for the stratum component value.", 0, 1, code));
2120          children.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The stratum component value.", 0, 1, value));
2121        }
2122
2123        @Override
2124        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2125          switch (_hash) {
2126          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The code for the stratum component value.", 0, 1, code);
2127          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The stratum component value.", 0, 1, value);
2128          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The stratum component value.", 0, 1, value);
2129          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "The stratum component value.", 0, 1, value);
2130          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "The stratum component value.", 0, 1, value);
2131          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The stratum component value.", 0, 1, value);
2132          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "The stratum component value.", 0, 1, value);
2133          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference", "The stratum component value.", 0, 1, value);
2134          default: return super.getNamedProperty(_hash, _name, _checkValid);
2135          }
2136
2137        }
2138
2139      @Override
2140      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2141        switch (hash) {
2142        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2143        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
2144        default: return super.getProperty(hash, name, checkValid);
2145        }
2146
2147      }
2148
2149      @Override
2150      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2151        switch (hash) {
2152        case 3059181: // code
2153          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2154          return value;
2155        case 111972721: // value
2156          this.value = TypeConvertor.castToType(value); // DataType
2157          return value;
2158        default: return super.setProperty(hash, name, value);
2159        }
2160
2161      }
2162
2163      @Override
2164      public Base setProperty(String name, Base value) throws FHIRException {
2165        if (name.equals("code")) {
2166          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2167        } else if (name.equals("value[x]")) {
2168          this.value = TypeConvertor.castToType(value); // DataType
2169        } else
2170          return super.setProperty(name, value);
2171        return value;
2172      }
2173
2174      @Override
2175      public Base makeProperty(int hash, String name) throws FHIRException {
2176        switch (hash) {
2177        case 3059181:  return getCode();
2178        case -1410166417:  return getValue();
2179        case 111972721:  return getValue();
2180        default: return super.makeProperty(hash, name);
2181        }
2182
2183      }
2184
2185      @Override
2186      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2187        switch (hash) {
2188        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2189        case 111972721: /*value*/ return new String[] {"CodeableConcept", "boolean", "Quantity", "Range", "Reference"};
2190        default: return super.getTypesForProperty(hash, name);
2191        }
2192
2193      }
2194
2195      @Override
2196      public Base addChild(String name) throws FHIRException {
2197        if (name.equals("code")) {
2198          this.code = new CodeableConcept();
2199          return this.code;
2200        }
2201        else if (name.equals("valueCodeableConcept")) {
2202          this.value = new CodeableConcept();
2203          return this.value;
2204        }
2205        else if (name.equals("valueBoolean")) {
2206          this.value = new BooleanType();
2207          return this.value;
2208        }
2209        else if (name.equals("valueQuantity")) {
2210          this.value = new Quantity();
2211          return this.value;
2212        }
2213        else if (name.equals("valueRange")) {
2214          this.value = new Range();
2215          return this.value;
2216        }
2217        else if (name.equals("valueReference")) {
2218          this.value = new Reference();
2219          return this.value;
2220        }
2221        else
2222          return super.addChild(name);
2223      }
2224
2225      public StratifierGroupComponentComponent copy() {
2226        StratifierGroupComponentComponent dst = new StratifierGroupComponentComponent();
2227        copyValues(dst);
2228        return dst;
2229      }
2230
2231      public void copyValues(StratifierGroupComponentComponent dst) {
2232        super.copyValues(dst);
2233        dst.code = code == null ? null : code.copy();
2234        dst.value = value == null ? null : value.copy();
2235      }
2236
2237      @Override
2238      public boolean equalsDeep(Base other_) {
2239        if (!super.equalsDeep(other_))
2240          return false;
2241        if (!(other_ instanceof StratifierGroupComponentComponent))
2242          return false;
2243        StratifierGroupComponentComponent o = (StratifierGroupComponentComponent) other_;
2244        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
2245      }
2246
2247      @Override
2248      public boolean equalsShallow(Base other_) {
2249        if (!super.equalsShallow(other_))
2250          return false;
2251        if (!(other_ instanceof StratifierGroupComponentComponent))
2252          return false;
2253        StratifierGroupComponentComponent o = (StratifierGroupComponentComponent) other_;
2254        return true;
2255      }
2256
2257      public boolean isEmpty() {
2258        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
2259      }
2260
2261  public String fhirType() {
2262    return "MeasureReport.group.stratifier.stratum.component";
2263
2264  }
2265
2266  }
2267
2268    @Block()
2269    public static class StratifierGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement {
2270        /**
2271         * The type of the population.
2272         */
2273        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
2274        @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." )
2275        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-population")
2276        protected CodeableConcept code;
2277
2278        /**
2279         * The number of members of the population in this stratum.
2280         */
2281        @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2282        @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population in this stratum." )
2283        protected IntegerType count;
2284
2285        /**
2286         * This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.
2287         */
2288        @Child(name = "subjectResults", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=false)
2289        @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." )
2290        protected Reference subjectResults;
2291
2292        private static final long serialVersionUID = 1086153898L;
2293
2294    /**
2295     * Constructor
2296     */
2297      public StratifierGroupPopulationComponent() {
2298        super();
2299      }
2300
2301        /**
2302         * @return {@link #code} (The type of the population.)
2303         */
2304        public CodeableConcept getCode() { 
2305          if (this.code == null)
2306            if (Configuration.errorOnAutoCreate())
2307              throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.code");
2308            else if (Configuration.doAutoCreate())
2309              this.code = new CodeableConcept(); // cc
2310          return this.code;
2311        }
2312
2313        public boolean hasCode() { 
2314          return this.code != null && !this.code.isEmpty();
2315        }
2316
2317        /**
2318         * @param value {@link #code} (The type of the population.)
2319         */
2320        public StratifierGroupPopulationComponent setCode(CodeableConcept value) { 
2321          this.code = value;
2322          return this;
2323        }
2324
2325        /**
2326         * @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
2327         */
2328        public IntegerType getCountElement() { 
2329          if (this.count == null)
2330            if (Configuration.errorOnAutoCreate())
2331              throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.count");
2332            else if (Configuration.doAutoCreate())
2333              this.count = new IntegerType(); // bb
2334          return this.count;
2335        }
2336
2337        public boolean hasCountElement() { 
2338          return this.count != null && !this.count.isEmpty();
2339        }
2340
2341        public boolean hasCount() { 
2342          return this.count != null && !this.count.isEmpty();
2343        }
2344
2345        /**
2346         * @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
2347         */
2348        public StratifierGroupPopulationComponent setCountElement(IntegerType value) { 
2349          this.count = value;
2350          return this;
2351        }
2352
2353        /**
2354         * @return The number of members of the population in this stratum.
2355         */
2356        public int getCount() { 
2357          return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue();
2358        }
2359
2360        /**
2361         * @param value The number of members of the population in this stratum.
2362         */
2363        public StratifierGroupPopulationComponent setCount(int value) { 
2364            if (this.count == null)
2365              this.count = new IntegerType();
2366            this.count.setValue(value);
2367          return this;
2368        }
2369
2370        /**
2371         * @return {@link #subjectResults} (This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.)
2372         */
2373        public Reference getSubjectResults() { 
2374          if (this.subjectResults == null)
2375            if (Configuration.errorOnAutoCreate())
2376              throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.subjectResults");
2377            else if (Configuration.doAutoCreate())
2378              this.subjectResults = new Reference(); // cc
2379          return this.subjectResults;
2380        }
2381
2382        public boolean hasSubjectResults() { 
2383          return this.subjectResults != null && !this.subjectResults.isEmpty();
2384        }
2385
2386        /**
2387         * @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.)
2388         */
2389        public StratifierGroupPopulationComponent setSubjectResults(Reference value) { 
2390          this.subjectResults = value;
2391          return this;
2392        }
2393
2394        protected void listChildren(List<Property> children) {
2395          super.listChildren(children);
2396          children.add(new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code));
2397          children.add(new Property("count", "integer", "The number of members of the population in this stratum.", 0, 1, count));
2398          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));
2399        }
2400
2401        @Override
2402        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2403          switch (_hash) {
2404          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The type of the population.", 0, 1, code);
2405          case 94851343: /*count*/  return new Property("count", "integer", "The number of members of the population in this stratum.", 0, 1, count);
2406          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);
2407          default: return super.getNamedProperty(_hash, _name, _checkValid);
2408          }
2409
2410        }
2411
2412      @Override
2413      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2414        switch (hash) {
2415        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2416        case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType
2417        case 2136184106: /*subjectResults*/ return this.subjectResults == null ? new Base[0] : new Base[] {this.subjectResults}; // Reference
2418        default: return super.getProperty(hash, name, checkValid);
2419        }
2420
2421      }
2422
2423      @Override
2424      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2425        switch (hash) {
2426        case 3059181: // code
2427          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2428          return value;
2429        case 94851343: // count
2430          this.count = TypeConvertor.castToInteger(value); // IntegerType
2431          return value;
2432        case 2136184106: // subjectResults
2433          this.subjectResults = TypeConvertor.castToReference(value); // Reference
2434          return value;
2435        default: return super.setProperty(hash, name, value);
2436        }
2437
2438      }
2439
2440      @Override
2441      public Base setProperty(String name, Base value) throws FHIRException {
2442        if (name.equals("code")) {
2443          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2444        } else if (name.equals("count")) {
2445          this.count = TypeConvertor.castToInteger(value); // IntegerType
2446        } else if (name.equals("subjectResults")) {
2447          this.subjectResults = TypeConvertor.castToReference(value); // Reference
2448        } else
2449          return super.setProperty(name, value);
2450        return value;
2451      }
2452
2453      @Override
2454      public Base makeProperty(int hash, String name) throws FHIRException {
2455        switch (hash) {
2456        case 3059181:  return getCode();
2457        case 94851343:  return getCountElement();
2458        case 2136184106:  return getSubjectResults();
2459        default: return super.makeProperty(hash, name);
2460        }
2461
2462      }
2463
2464      @Override
2465      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2466        switch (hash) {
2467        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2468        case 94851343: /*count*/ return new String[] {"integer"};
2469        case 2136184106: /*subjectResults*/ return new String[] {"Reference"};
2470        default: return super.getTypesForProperty(hash, name);
2471        }
2472
2473      }
2474
2475      @Override
2476      public Base addChild(String name) throws FHIRException {
2477        if (name.equals("code")) {
2478          this.code = new CodeableConcept();
2479          return this.code;
2480        }
2481        else if (name.equals("count")) {
2482          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.group.stratifier.stratum.population.count");
2483        }
2484        else if (name.equals("subjectResults")) {
2485          this.subjectResults = new Reference();
2486          return this.subjectResults;
2487        }
2488        else
2489          return super.addChild(name);
2490      }
2491
2492      public StratifierGroupPopulationComponent copy() {
2493        StratifierGroupPopulationComponent dst = new StratifierGroupPopulationComponent();
2494        copyValues(dst);
2495        return dst;
2496      }
2497
2498      public void copyValues(StratifierGroupPopulationComponent dst) {
2499        super.copyValues(dst);
2500        dst.code = code == null ? null : code.copy();
2501        dst.count = count == null ? null : count.copy();
2502        dst.subjectResults = subjectResults == null ? null : subjectResults.copy();
2503      }
2504
2505      @Override
2506      public boolean equalsDeep(Base other_) {
2507        if (!super.equalsDeep(other_))
2508          return false;
2509        if (!(other_ instanceof StratifierGroupPopulationComponent))
2510          return false;
2511        StratifierGroupPopulationComponent o = (StratifierGroupPopulationComponent) other_;
2512        return compareDeep(code, o.code, true) && compareDeep(count, o.count, true) && compareDeep(subjectResults, o.subjectResults, true)
2513          ;
2514      }
2515
2516      @Override
2517      public boolean equalsShallow(Base other_) {
2518        if (!super.equalsShallow(other_))
2519          return false;
2520        if (!(other_ instanceof StratifierGroupPopulationComponent))
2521          return false;
2522        StratifierGroupPopulationComponent o = (StratifierGroupPopulationComponent) other_;
2523        return compareValues(count, o.count, true);
2524      }
2525
2526      public boolean isEmpty() {
2527        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, count, subjectResults
2528          );
2529      }
2530
2531  public String fhirType() {
2532    return "MeasureReport.group.stratifier.stratum.population";
2533
2534  }
2535
2536  }
2537
2538    /**
2539     * 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.
2540     */
2541    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2542    @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." )
2543    protected List<Identifier> identifier;
2544
2545    /**
2546     * The MeasureReport status. No data will be available until the MeasureReport status is complete.
2547     */
2548    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2549    @Description(shortDefinition="complete | pending | error", formalDefinition="The MeasureReport status. No data will be available until the MeasureReport status is complete." )
2550    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-report-status")
2551    protected Enumeration<MeasureReportStatus> status;
2552
2553    /**
2554     * 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.
2555     */
2556    @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
2557    @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." )
2558    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-report-type")
2559    protected Enumeration<MeasureReportType> type;
2560
2561    /**
2562     * Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver.
2563     */
2564    @Child(name = "dataUpdateType", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true)
2565    @Description(shortDefinition="incremental | snapshot", formalDefinition="Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver." )
2566    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/submit-data-update-type")
2567    protected Enumeration<SubmitDataUpdateType> dataUpdateType;
2568
2569    /**
2570     * A reference to the Measure that was calculated to produce this report.
2571     */
2572    @Child(name = "measure", type = {CanonicalType.class}, order=4, min=1, max=1, modifier=false, summary=true)
2573    @Description(shortDefinition="What measure was calculated", formalDefinition="A reference to the Measure that was calculated to produce this report." )
2574    protected CanonicalType measure;
2575
2576    /**
2577     * Optional subject identifying the individual or individuals the report is for.
2578     */
2579    @Child(name = "subject", type = {Patient.class, Practitioner.class, PractitionerRole.class, Location.class, Device.class, RelatedPerson.class, Group.class}, order=5, min=0, max=1, modifier=false, summary=true)
2580    @Description(shortDefinition="What individual(s) the report is for", formalDefinition="Optional subject identifying the individual or individuals the report is for." )
2581    protected Reference subject;
2582
2583    /**
2584     * The date this measure report was generated.
2585     */
2586    @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
2587    @Description(shortDefinition="When the report was generated", formalDefinition="The date this measure report was generated." )
2588    protected DateTimeType date;
2589
2590    /**
2591     * The individual, location, or organization that is reporting the data.
2592     */
2593    @Child(name = "reporter", type = {Practitioner.class, PractitionerRole.class, Location.class, Organization.class, Group.class}, order=7, min=0, max=1, modifier=false, summary=true)
2594    @Description(shortDefinition="Who is reporting the data", formalDefinition="The individual, location, or organization that is reporting the data." )
2595    protected Reference reporter;
2596
2597    /**
2598     * A reference to the vendor who queried the data, calculated results and/or generated the report. The ?reporting vendor? is intended to represent the submitting entity when it is not the same as the reporting entity. This extension is used when the Receiver is interested in getting vendor information in the report.
2599     */
2600    @Child(name = "reportingVendor", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
2601    @Description(shortDefinition="What vendor prepared the data", formalDefinition="A reference to the vendor who queried the data, calculated results and/or generated the report. The ?reporting vendor? is intended to represent the submitting entity when it is not the same as the reporting entity. This extension is used when the Receiver is interested in getting vendor information in the report." )
2602    protected Reference reportingVendor;
2603
2604    /**
2605     * The reporting period for which the report was calculated.
2606     */
2607    @Child(name = "period", type = {Period.class}, order=9, min=1, max=1, modifier=false, summary=true)
2608    @Description(shortDefinition="What period the report covers", formalDefinition="The reporting period for which the report was calculated." )
2609    protected Period period;
2610
2611    /**
2612     * Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. It is expected to be the same as the scoring element on the referenced Measure.
2613     */
2614    @Child(name = "scoring", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=true, summary=true)
2615    @Description(shortDefinition="What scoring method (e.g. proportion, ratio, continuous-variable)", formalDefinition="Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. It is expected to be the same as the scoring element on the referenced Measure." )
2616    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-scoring")
2617    protected CodeableConcept scoring;
2618
2619    /**
2620     * Whether improvement in the measure is noted by an increase or decrease in the measure score.
2621     */
2622    @Child(name = "improvementNotation", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=true, summary=true)
2623    @Description(shortDefinition="increase | decrease", formalDefinition="Whether improvement in the measure is noted by an increase or decrease in the measure score." )
2624    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measure-improvement-notation")
2625    protected CodeableConcept improvementNotation;
2626
2627    /**
2628     * The results of the calculation, one for each population group in the measure.
2629     */
2630    @Child(name = "group", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2631    @Description(shortDefinition="Measure results for each group", formalDefinition="The results of the calculation, one for each population group in the measure." )
2632    protected List<MeasureReportGroupComponent> group;
2633
2634    /**
2635     * A reference to a Bundle containing the Resources that were used in the calculation of this measure.
2636     */
2637    @Child(name = "evaluatedResource", type = {Reference.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2638    @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." )
2639    protected List<Reference> evaluatedResource;
2640
2641    private static final long serialVersionUID = 1493960612L;
2642
2643  /**
2644   * Constructor
2645   */
2646    public MeasureReport() {
2647      super();
2648    }
2649
2650  /**
2651   * Constructor
2652   */
2653    public MeasureReport(MeasureReportStatus status, MeasureReportType type, String measure, Period period) {
2654      super();
2655      this.setStatus(status);
2656      this.setType(type);
2657      this.setMeasure(measure);
2658      this.setPeriod(period);
2659    }
2660
2661    /**
2662     * @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.)
2663     */
2664    public List<Identifier> getIdentifier() { 
2665      if (this.identifier == null)
2666        this.identifier = new ArrayList<Identifier>();
2667      return this.identifier;
2668    }
2669
2670    /**
2671     * @return Returns a reference to <code>this</code> for easy method chaining
2672     */
2673    public MeasureReport setIdentifier(List<Identifier> theIdentifier) { 
2674      this.identifier = theIdentifier;
2675      return this;
2676    }
2677
2678    public boolean hasIdentifier() { 
2679      if (this.identifier == null)
2680        return false;
2681      for (Identifier item : this.identifier)
2682        if (!item.isEmpty())
2683          return true;
2684      return false;
2685    }
2686
2687    public Identifier addIdentifier() { //3
2688      Identifier t = new Identifier();
2689      if (this.identifier == null)
2690        this.identifier = new ArrayList<Identifier>();
2691      this.identifier.add(t);
2692      return t;
2693    }
2694
2695    public MeasureReport addIdentifier(Identifier t) { //3
2696      if (t == null)
2697        return this;
2698      if (this.identifier == null)
2699        this.identifier = new ArrayList<Identifier>();
2700      this.identifier.add(t);
2701      return this;
2702    }
2703
2704    /**
2705     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2706     */
2707    public Identifier getIdentifierFirstRep() { 
2708      if (getIdentifier().isEmpty()) {
2709        addIdentifier();
2710      }
2711      return getIdentifier().get(0);
2712    }
2713
2714    /**
2715     * @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
2716     */
2717    public Enumeration<MeasureReportStatus> getStatusElement() { 
2718      if (this.status == null)
2719        if (Configuration.errorOnAutoCreate())
2720          throw new Error("Attempt to auto-create MeasureReport.status");
2721        else if (Configuration.doAutoCreate())
2722          this.status = new Enumeration<MeasureReportStatus>(new MeasureReportStatusEnumFactory()); // bb
2723      return this.status;
2724    }
2725
2726    public boolean hasStatusElement() { 
2727      return this.status != null && !this.status.isEmpty();
2728    }
2729
2730    public boolean hasStatus() { 
2731      return this.status != null && !this.status.isEmpty();
2732    }
2733
2734    /**
2735     * @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
2736     */
2737    public MeasureReport setStatusElement(Enumeration<MeasureReportStatus> value) { 
2738      this.status = value;
2739      return this;
2740    }
2741
2742    /**
2743     * @return The MeasureReport status. No data will be available until the MeasureReport status is complete.
2744     */
2745    public MeasureReportStatus getStatus() { 
2746      return this.status == null ? null : this.status.getValue();
2747    }
2748
2749    /**
2750     * @param value The MeasureReport status. No data will be available until the MeasureReport status is complete.
2751     */
2752    public MeasureReport setStatus(MeasureReportStatus value) { 
2753        if (this.status == null)
2754          this.status = new Enumeration<MeasureReportStatus>(new MeasureReportStatusEnumFactory());
2755        this.status.setValue(value);
2756      return this;
2757    }
2758
2759    /**
2760     * @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
2761     */
2762    public Enumeration<MeasureReportType> getTypeElement() { 
2763      if (this.type == null)
2764        if (Configuration.errorOnAutoCreate())
2765          throw new Error("Attempt to auto-create MeasureReport.type");
2766        else if (Configuration.doAutoCreate())
2767          this.type = new Enumeration<MeasureReportType>(new MeasureReportTypeEnumFactory()); // bb
2768      return this.type;
2769    }
2770
2771    public boolean hasTypeElement() { 
2772      return this.type != null && !this.type.isEmpty();
2773    }
2774
2775    public boolean hasType() { 
2776      return this.type != null && !this.type.isEmpty();
2777    }
2778
2779    /**
2780     * @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
2781     */
2782    public MeasureReport setTypeElement(Enumeration<MeasureReportType> value) { 
2783      this.type = value;
2784      return this;
2785    }
2786
2787    /**
2788     * @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.
2789     */
2790    public MeasureReportType getType() { 
2791      return this.type == null ? null : this.type.getValue();
2792    }
2793
2794    /**
2795     * @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.
2796     */
2797    public MeasureReport setType(MeasureReportType value) { 
2798        if (this.type == null)
2799          this.type = new Enumeration<MeasureReportType>(new MeasureReportTypeEnumFactory());
2800        this.type.setValue(value);
2801      return this;
2802    }
2803
2804    /**
2805     * @return {@link #dataUpdateType} (Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver.). This is the underlying object with id, value and extensions. The accessor "getDataUpdateType" gives direct access to the value
2806     */
2807    public Enumeration<SubmitDataUpdateType> getDataUpdateTypeElement() { 
2808      if (this.dataUpdateType == null)
2809        if (Configuration.errorOnAutoCreate())
2810          throw new Error("Attempt to auto-create MeasureReport.dataUpdateType");
2811        else if (Configuration.doAutoCreate())
2812          this.dataUpdateType = new Enumeration<SubmitDataUpdateType>(new SubmitDataUpdateTypeEnumFactory()); // bb
2813      return this.dataUpdateType;
2814    }
2815
2816    public boolean hasDataUpdateTypeElement() { 
2817      return this.dataUpdateType != null && !this.dataUpdateType.isEmpty();
2818    }
2819
2820    public boolean hasDataUpdateType() { 
2821      return this.dataUpdateType != null && !this.dataUpdateType.isEmpty();
2822    }
2823
2824    /**
2825     * @param value {@link #dataUpdateType} (Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver.). This is the underlying object with id, value and extensions. The accessor "getDataUpdateType" gives direct access to the value
2826     */
2827    public MeasureReport setDataUpdateTypeElement(Enumeration<SubmitDataUpdateType> value) { 
2828      this.dataUpdateType = value;
2829      return this;
2830    }
2831
2832    /**
2833     * @return Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver.
2834     */
2835    public SubmitDataUpdateType getDataUpdateType() { 
2836      return this.dataUpdateType == null ? null : this.dataUpdateType.getValue();
2837    }
2838
2839    /**
2840     * @param value Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver.
2841     */
2842    public MeasureReport setDataUpdateType(SubmitDataUpdateType value) { 
2843      if (value == null)
2844        this.dataUpdateType = null;
2845      else {
2846        if (this.dataUpdateType == null)
2847          this.dataUpdateType = new Enumeration<SubmitDataUpdateType>(new SubmitDataUpdateTypeEnumFactory());
2848        this.dataUpdateType.setValue(value);
2849      }
2850      return this;
2851    }
2852
2853    /**
2854     * @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
2855     */
2856    public CanonicalType getMeasureElement() { 
2857      if (this.measure == null)
2858        if (Configuration.errorOnAutoCreate())
2859          throw new Error("Attempt to auto-create MeasureReport.measure");
2860        else if (Configuration.doAutoCreate())
2861          this.measure = new CanonicalType(); // bb
2862      return this.measure;
2863    }
2864
2865    public boolean hasMeasureElement() { 
2866      return this.measure != null && !this.measure.isEmpty();
2867    }
2868
2869    public boolean hasMeasure() { 
2870      return this.measure != null && !this.measure.isEmpty();
2871    }
2872
2873    /**
2874     * @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
2875     */
2876    public MeasureReport setMeasureElement(CanonicalType value) { 
2877      this.measure = value;
2878      return this;
2879    }
2880
2881    /**
2882     * @return A reference to the Measure that was calculated to produce this report.
2883     */
2884    public String getMeasure() { 
2885      return this.measure == null ? null : this.measure.getValue();
2886    }
2887
2888    /**
2889     * @param value A reference to the Measure that was calculated to produce this report.
2890     */
2891    public MeasureReport setMeasure(String value) { 
2892        if (this.measure == null)
2893          this.measure = new CanonicalType();
2894        this.measure.setValue(value);
2895      return this;
2896    }
2897
2898    /**
2899     * @return {@link #subject} (Optional subject identifying the individual or individuals the report is for.)
2900     */
2901    public Reference getSubject() { 
2902      if (this.subject == null)
2903        if (Configuration.errorOnAutoCreate())
2904          throw new Error("Attempt to auto-create MeasureReport.subject");
2905        else if (Configuration.doAutoCreate())
2906          this.subject = new Reference(); // cc
2907      return this.subject;
2908    }
2909
2910    public boolean hasSubject() { 
2911      return this.subject != null && !this.subject.isEmpty();
2912    }
2913
2914    /**
2915     * @param value {@link #subject} (Optional subject identifying the individual or individuals the report is for.)
2916     */
2917    public MeasureReport setSubject(Reference value) { 
2918      this.subject = value;
2919      return this;
2920    }
2921
2922    /**
2923     * @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
2924     */
2925    public DateTimeType getDateElement() { 
2926      if (this.date == null)
2927        if (Configuration.errorOnAutoCreate())
2928          throw new Error("Attempt to auto-create MeasureReport.date");
2929        else if (Configuration.doAutoCreate())
2930          this.date = new DateTimeType(); // bb
2931      return this.date;
2932    }
2933
2934    public boolean hasDateElement() { 
2935      return this.date != null && !this.date.isEmpty();
2936    }
2937
2938    public boolean hasDate() { 
2939      return this.date != null && !this.date.isEmpty();
2940    }
2941
2942    /**
2943     * @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
2944     */
2945    public MeasureReport setDateElement(DateTimeType value) { 
2946      this.date = value;
2947      return this;
2948    }
2949
2950    /**
2951     * @return The date this measure report was generated.
2952     */
2953    public Date getDate() { 
2954      return this.date == null ? null : this.date.getValue();
2955    }
2956
2957    /**
2958     * @param value The date this measure report was generated.
2959     */
2960    public MeasureReport setDate(Date value) { 
2961      if (value == null)
2962        this.date = null;
2963      else {
2964        if (this.date == null)
2965          this.date = new DateTimeType();
2966        this.date.setValue(value);
2967      }
2968      return this;
2969    }
2970
2971    /**
2972     * @return {@link #reporter} (The individual, location, or organization that is reporting the data.)
2973     */
2974    public Reference getReporter() { 
2975      if (this.reporter == null)
2976        if (Configuration.errorOnAutoCreate())
2977          throw new Error("Attempt to auto-create MeasureReport.reporter");
2978        else if (Configuration.doAutoCreate())
2979          this.reporter = new Reference(); // cc
2980      return this.reporter;
2981    }
2982
2983    public boolean hasReporter() { 
2984      return this.reporter != null && !this.reporter.isEmpty();
2985    }
2986
2987    /**
2988     * @param value {@link #reporter} (The individual, location, or organization that is reporting the data.)
2989     */
2990    public MeasureReport setReporter(Reference value) { 
2991      this.reporter = value;
2992      return this;
2993    }
2994
2995    /**
2996     * @return {@link #reportingVendor} (A reference to the vendor who queried the data, calculated results and/or generated the report. The ?reporting vendor? is intended to represent the submitting entity when it is not the same as the reporting entity. This extension is used when the Receiver is interested in getting vendor information in the report.)
2997     */
2998    public Reference getReportingVendor() { 
2999      if (this.reportingVendor == null)
3000        if (Configuration.errorOnAutoCreate())
3001          throw new Error("Attempt to auto-create MeasureReport.reportingVendor");
3002        else if (Configuration.doAutoCreate())
3003          this.reportingVendor = new Reference(); // cc
3004      return this.reportingVendor;
3005    }
3006
3007    public boolean hasReportingVendor() { 
3008      return this.reportingVendor != null && !this.reportingVendor.isEmpty();
3009    }
3010
3011    /**
3012     * @param value {@link #reportingVendor} (A reference to the vendor who queried the data, calculated results and/or generated the report. The ?reporting vendor? is intended to represent the submitting entity when it is not the same as the reporting entity. This extension is used when the Receiver is interested in getting vendor information in the report.)
3013     */
3014    public MeasureReport setReportingVendor(Reference value) { 
3015      this.reportingVendor = value;
3016      return this;
3017    }
3018
3019    /**
3020     * @return {@link #period} (The reporting period for which the report was calculated.)
3021     */
3022    public Period getPeriod() { 
3023      if (this.period == null)
3024        if (Configuration.errorOnAutoCreate())
3025          throw new Error("Attempt to auto-create MeasureReport.period");
3026        else if (Configuration.doAutoCreate())
3027          this.period = new Period(); // cc
3028      return this.period;
3029    }
3030
3031    public boolean hasPeriod() { 
3032      return this.period != null && !this.period.isEmpty();
3033    }
3034
3035    /**
3036     * @param value {@link #period} (The reporting period for which the report was calculated.)
3037     */
3038    public MeasureReport setPeriod(Period value) { 
3039      this.period = value;
3040      return this;
3041    }
3042
3043    /**
3044     * @return {@link #scoring} (Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. It is expected to be the same as the scoring element on the referenced Measure.)
3045     */
3046    public CodeableConcept getScoring() { 
3047      if (this.scoring == null)
3048        if (Configuration.errorOnAutoCreate())
3049          throw new Error("Attempt to auto-create MeasureReport.scoring");
3050        else if (Configuration.doAutoCreate())
3051          this.scoring = new CodeableConcept(); // cc
3052      return this.scoring;
3053    }
3054
3055    public boolean hasScoring() { 
3056      return this.scoring != null && !this.scoring.isEmpty();
3057    }
3058
3059    /**
3060     * @param value {@link #scoring} (Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. It is expected to be the same as the scoring element on the referenced Measure.)
3061     */
3062    public MeasureReport setScoring(CodeableConcept value) { 
3063      this.scoring = value;
3064      return this;
3065    }
3066
3067    /**
3068     * @return {@link #improvementNotation} (Whether improvement in the measure is noted by an increase or decrease in the measure score.)
3069     */
3070    public CodeableConcept getImprovementNotation() { 
3071      if (this.improvementNotation == null)
3072        if (Configuration.errorOnAutoCreate())
3073          throw new Error("Attempt to auto-create MeasureReport.improvementNotation");
3074        else if (Configuration.doAutoCreate())
3075          this.improvementNotation = new CodeableConcept(); // cc
3076      return this.improvementNotation;
3077    }
3078
3079    public boolean hasImprovementNotation() { 
3080      return this.improvementNotation != null && !this.improvementNotation.isEmpty();
3081    }
3082
3083    /**
3084     * @param value {@link #improvementNotation} (Whether improvement in the measure is noted by an increase or decrease in the measure score.)
3085     */
3086    public MeasureReport setImprovementNotation(CodeableConcept value) { 
3087      this.improvementNotation = value;
3088      return this;
3089    }
3090
3091    /**
3092     * @return {@link #group} (The results of the calculation, one for each population group in the measure.)
3093     */
3094    public List<MeasureReportGroupComponent> getGroup() { 
3095      if (this.group == null)
3096        this.group = new ArrayList<MeasureReportGroupComponent>();
3097      return this.group;
3098    }
3099
3100    /**
3101     * @return Returns a reference to <code>this</code> for easy method chaining
3102     */
3103    public MeasureReport setGroup(List<MeasureReportGroupComponent> theGroup) { 
3104      this.group = theGroup;
3105      return this;
3106    }
3107
3108    public boolean hasGroup() { 
3109      if (this.group == null)
3110        return false;
3111      for (MeasureReportGroupComponent item : this.group)
3112        if (!item.isEmpty())
3113          return true;
3114      return false;
3115    }
3116
3117    public MeasureReportGroupComponent addGroup() { //3
3118      MeasureReportGroupComponent t = new MeasureReportGroupComponent();
3119      if (this.group == null)
3120        this.group = new ArrayList<MeasureReportGroupComponent>();
3121      this.group.add(t);
3122      return t;
3123    }
3124
3125    public MeasureReport addGroup(MeasureReportGroupComponent t) { //3
3126      if (t == null)
3127        return this;
3128      if (this.group == null)
3129        this.group = new ArrayList<MeasureReportGroupComponent>();
3130      this.group.add(t);
3131      return this;
3132    }
3133
3134    /**
3135     * @return The first repetition of repeating field {@link #group}, creating it if it does not already exist {3}
3136     */
3137    public MeasureReportGroupComponent getGroupFirstRep() { 
3138      if (getGroup().isEmpty()) {
3139        addGroup();
3140      }
3141      return getGroup().get(0);
3142    }
3143
3144    /**
3145     * @return {@link #evaluatedResource} (A reference to a Bundle containing the Resources that were used in the calculation of this measure.)
3146     */
3147    public List<Reference> getEvaluatedResource() { 
3148      if (this.evaluatedResource == null)
3149        this.evaluatedResource = new ArrayList<Reference>();
3150      return this.evaluatedResource;
3151    }
3152
3153    /**
3154     * @return Returns a reference to <code>this</code> for easy method chaining
3155     */
3156    public MeasureReport setEvaluatedResource(List<Reference> theEvaluatedResource) { 
3157      this.evaluatedResource = theEvaluatedResource;
3158      return this;
3159    }
3160
3161    public boolean hasEvaluatedResource() { 
3162      if (this.evaluatedResource == null)
3163        return false;
3164      for (Reference item : this.evaluatedResource)
3165        if (!item.isEmpty())
3166          return true;
3167      return false;
3168    }
3169
3170    public Reference addEvaluatedResource() { //3
3171      Reference t = new Reference();
3172      if (this.evaluatedResource == null)
3173        this.evaluatedResource = new ArrayList<Reference>();
3174      this.evaluatedResource.add(t);
3175      return t;
3176    }
3177
3178    public MeasureReport addEvaluatedResource(Reference t) { //3
3179      if (t == null)
3180        return this;
3181      if (this.evaluatedResource == null)
3182        this.evaluatedResource = new ArrayList<Reference>();
3183      this.evaluatedResource.add(t);
3184      return this;
3185    }
3186
3187    /**
3188     * @return The first repetition of repeating field {@link #evaluatedResource}, creating it if it does not already exist {3}
3189     */
3190    public Reference getEvaluatedResourceFirstRep() { 
3191      if (getEvaluatedResource().isEmpty()) {
3192        addEvaluatedResource();
3193      }
3194      return getEvaluatedResource().get(0);
3195    }
3196
3197      protected void listChildren(List<Property> children) {
3198        super.listChildren(children);
3199        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));
3200        children.add(new Property("status", "code", "The MeasureReport status. No data will be available until the MeasureReport status is complete.", 0, 1, status));
3201        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));
3202        children.add(new Property("dataUpdateType", "code", "Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver.", 0, 1, dataUpdateType));
3203        children.add(new Property("measure", "canonical(Measure)", "A reference to the Measure that was calculated to produce this report.", 0, 1, measure));
3204        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));
3205        children.add(new Property("date", "dateTime", "The date this measure report was generated.", 0, 1, date));
3206        children.add(new Property("reporter", "Reference(Practitioner|PractitionerRole|Location|Organization|Group)", "The individual, location, or organization that is reporting the data.", 0, 1, reporter));
3207        children.add(new Property("reportingVendor", "Reference(Organization)", "A reference to the vendor who queried the data, calculated results and/or generated the report. The ?reporting vendor? is intended to represent the submitting entity when it is not the same as the reporting entity. This extension is used when the Receiver is interested in getting vendor information in the report.", 0, 1, reportingVendor));
3208        children.add(new Property("period", "Period", "The reporting period for which the report was calculated.", 0, 1, period));
3209        children.add(new Property("scoring", "CodeableConcept", "Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. It is expected to be the same as the scoring element on the referenced Measure.", 0, 1, scoring));
3210        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));
3211        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));
3212        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));
3213      }
3214
3215      @Override
3216      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3217        switch (_hash) {
3218        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);
3219        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);
3220        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);
3221        case -425890067: /*dataUpdateType*/  return new Property("dataUpdateType", "code", "Indicates whether the data submitted in an data-exchange report represents a snapshot or incremental update. A snapshot update replaces all previously submitted data for the receiver, whereas an incremental update represents only updated and/or changed data and should be applied as a differential update to the existing submitted data for the receiver.", 0, 1, dataUpdateType);
3222        case 938321246: /*measure*/  return new Property("measure", "canonical(Measure)", "A reference to the Measure that was calculated to produce this report.", 0, 1, measure);
3223        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);
3224        case 3076014: /*date*/  return new Property("date", "dateTime", "The date this measure report was generated.", 0, 1, date);
3225        case -427039519: /*reporter*/  return new Property("reporter", "Reference(Practitioner|PractitionerRole|Location|Organization|Group)", "The individual, location, or organization that is reporting the data.", 0, 1, reporter);
3226        case 581336342: /*reportingVendor*/  return new Property("reportingVendor", "Reference(Organization)", "A reference to the vendor who queried the data, calculated results and/or generated the report. The ?reporting vendor? is intended to represent the submitting entity when it is not the same as the reporting entity. This extension is used when the Receiver is interested in getting vendor information in the report.", 0, 1, reportingVendor);
3227        case -991726143: /*period*/  return new Property("period", "Period", "The reporting period for which the report was calculated.", 0, 1, period);
3228        case 1924005583: /*scoring*/  return new Property("scoring", "CodeableConcept", "Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. It is expected to be the same as the scoring element on the referenced Measure.", 0, 1, scoring);
3229        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);
3230        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);
3231        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);
3232        default: return super.getNamedProperty(_hash, _name, _checkValid);
3233        }
3234
3235      }
3236
3237      @Override
3238      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3239        switch (hash) {
3240        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3241        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<MeasureReportStatus>
3242        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<MeasureReportType>
3243        case -425890067: /*dataUpdateType*/ return this.dataUpdateType == null ? new Base[0] : new Base[] {this.dataUpdateType}; // Enumeration<SubmitDataUpdateType>
3244        case 938321246: /*measure*/ return this.measure == null ? new Base[0] : new Base[] {this.measure}; // CanonicalType
3245        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
3246        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3247        case -427039519: /*reporter*/ return this.reporter == null ? new Base[0] : new Base[] {this.reporter}; // Reference
3248        case 581336342: /*reportingVendor*/ return this.reportingVendor == null ? new Base[0] : new Base[] {this.reportingVendor}; // Reference
3249        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
3250        case 1924005583: /*scoring*/ return this.scoring == null ? new Base[0] : new Base[] {this.scoring}; // CodeableConcept
3251        case -2085456136: /*improvementNotation*/ return this.improvementNotation == null ? new Base[0] : new Base[] {this.improvementNotation}; // CodeableConcept
3252        case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupComponent
3253        case -1056771047: /*evaluatedResource*/ return this.evaluatedResource == null ? new Base[0] : this.evaluatedResource.toArray(new Base[this.evaluatedResource.size()]); // Reference
3254        default: return super.getProperty(hash, name, checkValid);
3255        }
3256
3257      }
3258
3259      @Override
3260      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3261        switch (hash) {
3262        case -1618432855: // identifier
3263          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3264          return value;
3265        case -892481550: // status
3266          value = new MeasureReportStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3267          this.status = (Enumeration) value; // Enumeration<MeasureReportStatus>
3268          return value;
3269        case 3575610: // type
3270          value = new MeasureReportTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3271          this.type = (Enumeration) value; // Enumeration<MeasureReportType>
3272          return value;
3273        case -425890067: // dataUpdateType
3274          value = new SubmitDataUpdateTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3275          this.dataUpdateType = (Enumeration) value; // Enumeration<SubmitDataUpdateType>
3276          return value;
3277        case 938321246: // measure
3278          this.measure = TypeConvertor.castToCanonical(value); // CanonicalType
3279          return value;
3280        case -1867885268: // subject
3281          this.subject = TypeConvertor.castToReference(value); // Reference
3282          return value;
3283        case 3076014: // date
3284          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
3285          return value;
3286        case -427039519: // reporter
3287          this.reporter = TypeConvertor.castToReference(value); // Reference
3288          return value;
3289        case 581336342: // reportingVendor
3290          this.reportingVendor = TypeConvertor.castToReference(value); // Reference
3291          return value;
3292        case -991726143: // period
3293          this.period = TypeConvertor.castToPeriod(value); // Period
3294          return value;
3295        case 1924005583: // scoring
3296          this.scoring = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3297          return value;
3298        case -2085456136: // improvementNotation
3299          this.improvementNotation = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3300          return value;
3301        case 98629247: // group
3302          this.getGroup().add((MeasureReportGroupComponent) value); // MeasureReportGroupComponent
3303          return value;
3304        case -1056771047: // evaluatedResource
3305          this.getEvaluatedResource().add(TypeConvertor.castToReference(value)); // Reference
3306          return value;
3307        default: return super.setProperty(hash, name, value);
3308        }
3309
3310      }
3311
3312      @Override
3313      public Base setProperty(String name, Base value) throws FHIRException {
3314        if (name.equals("identifier")) {
3315          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3316        } else if (name.equals("status")) {
3317          value = new MeasureReportStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3318          this.status = (Enumeration) value; // Enumeration<MeasureReportStatus>
3319        } else if (name.equals("type")) {
3320          value = new MeasureReportTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3321          this.type = (Enumeration) value; // Enumeration<MeasureReportType>
3322        } else if (name.equals("dataUpdateType")) {
3323          value = new SubmitDataUpdateTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3324          this.dataUpdateType = (Enumeration) value; // Enumeration<SubmitDataUpdateType>
3325        } else if (name.equals("measure")) {
3326          this.measure = TypeConvertor.castToCanonical(value); // CanonicalType
3327        } else if (name.equals("subject")) {
3328          this.subject = TypeConvertor.castToReference(value); // Reference
3329        } else if (name.equals("date")) {
3330          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
3331        } else if (name.equals("reporter")) {
3332          this.reporter = TypeConvertor.castToReference(value); // Reference
3333        } else if (name.equals("reportingVendor")) {
3334          this.reportingVendor = TypeConvertor.castToReference(value); // Reference
3335        } else if (name.equals("period")) {
3336          this.period = TypeConvertor.castToPeriod(value); // Period
3337        } else if (name.equals("scoring")) {
3338          this.scoring = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3339        } else if (name.equals("improvementNotation")) {
3340          this.improvementNotation = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3341        } else if (name.equals("group")) {
3342          this.getGroup().add((MeasureReportGroupComponent) value);
3343        } else if (name.equals("evaluatedResource")) {
3344          this.getEvaluatedResource().add(TypeConvertor.castToReference(value));
3345        } else
3346          return super.setProperty(name, value);
3347        return value;
3348      }
3349
3350      @Override
3351      public Base makeProperty(int hash, String name) throws FHIRException {
3352        switch (hash) {
3353        case -1618432855:  return addIdentifier(); 
3354        case -892481550:  return getStatusElement();
3355        case 3575610:  return getTypeElement();
3356        case -425890067:  return getDataUpdateTypeElement();
3357        case 938321246:  return getMeasureElement();
3358        case -1867885268:  return getSubject();
3359        case 3076014:  return getDateElement();
3360        case -427039519:  return getReporter();
3361        case 581336342:  return getReportingVendor();
3362        case -991726143:  return getPeriod();
3363        case 1924005583:  return getScoring();
3364        case -2085456136:  return getImprovementNotation();
3365        case 98629247:  return addGroup(); 
3366        case -1056771047:  return addEvaluatedResource(); 
3367        default: return super.makeProperty(hash, name);
3368        }
3369
3370      }
3371
3372      @Override
3373      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3374        switch (hash) {
3375        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3376        case -892481550: /*status*/ return new String[] {"code"};
3377        case 3575610: /*type*/ return new String[] {"code"};
3378        case -425890067: /*dataUpdateType*/ return new String[] {"code"};
3379        case 938321246: /*measure*/ return new String[] {"canonical"};
3380        case -1867885268: /*subject*/ return new String[] {"Reference"};
3381        case 3076014: /*date*/ return new String[] {"dateTime"};
3382        case -427039519: /*reporter*/ return new String[] {"Reference"};
3383        case 581336342: /*reportingVendor*/ return new String[] {"Reference"};
3384        case -991726143: /*period*/ return new String[] {"Period"};
3385        case 1924005583: /*scoring*/ return new String[] {"CodeableConcept"};
3386        case -2085456136: /*improvementNotation*/ return new String[] {"CodeableConcept"};
3387        case 98629247: /*group*/ return new String[] {};
3388        case -1056771047: /*evaluatedResource*/ return new String[] {"Reference"};
3389        default: return super.getTypesForProperty(hash, name);
3390        }
3391
3392      }
3393
3394      @Override
3395      public Base addChild(String name) throws FHIRException {
3396        if (name.equals("identifier")) {
3397          return addIdentifier();
3398        }
3399        else if (name.equals("status")) {
3400          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.status");
3401        }
3402        else if (name.equals("type")) {
3403          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type");
3404        }
3405        else if (name.equals("dataUpdateType")) {
3406          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.dataUpdateType");
3407        }
3408        else if (name.equals("measure")) {
3409          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.measure");
3410        }
3411        else if (name.equals("subject")) {
3412          this.subject = new Reference();
3413          return this.subject;
3414        }
3415        else if (name.equals("date")) {
3416          throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.date");
3417        }
3418        else if (name.equals("reporter")) {
3419          this.reporter = new Reference();
3420          return this.reporter;
3421        }
3422        else if (name.equals("reportingVendor")) {
3423          this.reportingVendor = new Reference();
3424          return this.reportingVendor;
3425        }
3426        else if (name.equals("period")) {
3427          this.period = new Period();
3428          return this.period;
3429        }
3430        else if (name.equals("scoring")) {
3431          this.scoring = new CodeableConcept();
3432          return this.scoring;
3433        }
3434        else if (name.equals("improvementNotation")) {
3435          this.improvementNotation = new CodeableConcept();
3436          return this.improvementNotation;
3437        }
3438        else if (name.equals("group")) {
3439          return addGroup();
3440        }
3441        else if (name.equals("evaluatedResource")) {
3442          return addEvaluatedResource();
3443        }
3444        else
3445          return super.addChild(name);
3446      }
3447
3448  public String fhirType() {
3449    return "MeasureReport";
3450
3451  }
3452
3453      public MeasureReport copy() {
3454        MeasureReport dst = new MeasureReport();
3455        copyValues(dst);
3456        return dst;
3457      }
3458
3459      public void copyValues(MeasureReport dst) {
3460        super.copyValues(dst);
3461        if (identifier != null) {
3462          dst.identifier = new ArrayList<Identifier>();
3463          for (Identifier i : identifier)
3464            dst.identifier.add(i.copy());
3465        };
3466        dst.status = status == null ? null : status.copy();
3467        dst.type = type == null ? null : type.copy();
3468        dst.dataUpdateType = dataUpdateType == null ? null : dataUpdateType.copy();
3469        dst.measure = measure == null ? null : measure.copy();
3470        dst.subject = subject == null ? null : subject.copy();
3471        dst.date = date == null ? null : date.copy();
3472        dst.reporter = reporter == null ? null : reporter.copy();
3473        dst.reportingVendor = reportingVendor == null ? null : reportingVendor.copy();
3474        dst.period = period == null ? null : period.copy();
3475        dst.scoring = scoring == null ? null : scoring.copy();
3476        dst.improvementNotation = improvementNotation == null ? null : improvementNotation.copy();
3477        if (group != null) {
3478          dst.group = new ArrayList<MeasureReportGroupComponent>();
3479          for (MeasureReportGroupComponent i : group)
3480            dst.group.add(i.copy());
3481        };
3482        if (evaluatedResource != null) {
3483          dst.evaluatedResource = new ArrayList<Reference>();
3484          for (Reference i : evaluatedResource)
3485            dst.evaluatedResource.add(i.copy());
3486        };
3487      }
3488
3489      protected MeasureReport typedCopy() {
3490        return copy();
3491      }
3492
3493      @Override
3494      public boolean equalsDeep(Base other_) {
3495        if (!super.equalsDeep(other_))
3496          return false;
3497        if (!(other_ instanceof MeasureReport))
3498          return false;
3499        MeasureReport o = (MeasureReport) other_;
3500        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
3501           && compareDeep(dataUpdateType, o.dataUpdateType, true) && compareDeep(measure, o.measure, true)
3502           && compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true) && compareDeep(reporter, o.reporter, true)
3503           && compareDeep(reportingVendor, o.reportingVendor, true) && compareDeep(period, o.period, true)
3504           && compareDeep(scoring, o.scoring, true) && compareDeep(improvementNotation, o.improvementNotation, true)
3505           && compareDeep(group, o.group, true) && compareDeep(evaluatedResource, o.evaluatedResource, true)
3506          ;
3507      }
3508
3509      @Override
3510      public boolean equalsShallow(Base other_) {
3511        if (!super.equalsShallow(other_))
3512          return false;
3513        if (!(other_ instanceof MeasureReport))
3514          return false;
3515        MeasureReport o = (MeasureReport) other_;
3516        return compareValues(status, o.status, true) && compareValues(type, o.type, true) && compareValues(dataUpdateType, o.dataUpdateType, true)
3517           && compareValues(measure, o.measure, true) && compareValues(date, o.date, true);
3518      }
3519
3520      public boolean isEmpty() {
3521        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
3522          , dataUpdateType, measure, subject, date, reporter, reportingVendor, period, scoring
3523          , improvementNotation, group, evaluatedResource);
3524      }
3525
3526  @Override
3527  public ResourceType getResourceType() {
3528    return ResourceType.MeasureReport;
3529   }
3530
3531 /**
3532   * Search parameter: <b>date</b>
3533   * <p>
3534   * Description: <b>The date of the measure report</b><br>
3535   * Type: <b>date</b><br>
3536   * Path: <b>MeasureReport.date</b><br>
3537   * </p>
3538   */
3539  @SearchParamDefinition(name="date", path="MeasureReport.date", description="The date of the measure report", type="date" )
3540  public static final String SP_DATE = "date";
3541 /**
3542   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3543   * <p>
3544   * Description: <b>The date of the measure report</b><br>
3545   * Type: <b>date</b><br>
3546   * Path: <b>MeasureReport.date</b><br>
3547   * </p>
3548   */
3549  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3550
3551 /**
3552   * Search parameter: <b>evaluated-resource</b>
3553   * <p>
3554   * Description: <b>An evaluated resource referenced by the measure report</b><br>
3555   * Type: <b>reference</b><br>
3556   * Path: <b>MeasureReport.evaluatedResource</b><br>
3557   * </p>
3558   */
3559  @SearchParamDefinition(name="evaluated-resource", path="MeasureReport.evaluatedResource", description="An evaluated resource referenced by the measure report", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
3560  public static final String SP_EVALUATED_RESOURCE = "evaluated-resource";
3561 /**
3562   * <b>Fluent Client</b> search parameter constant for <b>evaluated-resource</b>
3563   * <p>
3564   * Description: <b>An evaluated resource referenced by the measure report</b><br>
3565   * Type: <b>reference</b><br>
3566   * Path: <b>MeasureReport.evaluatedResource</b><br>
3567   * </p>
3568   */
3569  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EVALUATED_RESOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EVALUATED_RESOURCE);
3570
3571/**
3572   * Constant for fluent queries to be used to add include statements. Specifies
3573   * the path value of "<b>MeasureReport:evaluated-resource</b>".
3574   */
3575  public static final ca.uhn.fhir.model.api.Include INCLUDE_EVALUATED_RESOURCE = new ca.uhn.fhir.model.api.Include("MeasureReport:evaluated-resource").toLocked();
3576
3577 /**
3578   * Search parameter: <b>identifier</b>
3579   * <p>
3580   * Description: <b>External identifier of the measure report to be returned</b><br>
3581   * Type: <b>token</b><br>
3582   * Path: <b>MeasureReport.identifier</b><br>
3583   * </p>
3584   */
3585  @SearchParamDefinition(name="identifier", path="MeasureReport.identifier", description="External identifier of the measure report to be returned", type="token" )
3586  public static final String SP_IDENTIFIER = "identifier";
3587 /**
3588   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3589   * <p>
3590   * Description: <b>External identifier of the measure report to be returned</b><br>
3591   * Type: <b>token</b><br>
3592   * Path: <b>MeasureReport.identifier</b><br>
3593   * </p>
3594   */
3595  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3596
3597 /**
3598   * Search parameter: <b>measure</b>
3599   * <p>
3600   * Description: <b>The measure to return measure report results for</b><br>
3601   * Type: <b>reference</b><br>
3602   * Path: <b>MeasureReport.measure</b><br>
3603   * </p>
3604   */
3605  @SearchParamDefinition(name="measure", path="MeasureReport.measure", description="The measure to return measure report results for", type="reference", target={Measure.class } )
3606  public static final String SP_MEASURE = "measure";
3607 /**
3608   * <b>Fluent Client</b> search parameter constant for <b>measure</b>
3609   * <p>
3610   * Description: <b>The measure to return measure report results for</b><br>
3611   * Type: <b>reference</b><br>
3612   * Path: <b>MeasureReport.measure</b><br>
3613   * </p>
3614   */
3615  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEASURE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEASURE);
3616
3617/**
3618   * Constant for fluent queries to be used to add include statements. Specifies
3619   * the path value of "<b>MeasureReport:measure</b>".
3620   */
3621  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEASURE = new ca.uhn.fhir.model.api.Include("MeasureReport:measure").toLocked();
3622
3623 /**
3624   * Search parameter: <b>patient</b>
3625   * <p>
3626   * Description: <b>The identity of a patient to search for individual measure report results for</b><br>
3627   * Type: <b>reference</b><br>
3628   * Path: <b>MeasureReport.subject.where(resolve() is Patient)</b><br>
3629   * </p>
3630   */
3631  @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="Base FHIR compartment definition for Patient") }, target={Device.class, Group.class, Location.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3632  public static final String SP_PATIENT = "patient";
3633 /**
3634   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3635   * <p>
3636   * Description: <b>The identity of a patient to search for individual measure report results for</b><br>
3637   * Type: <b>reference</b><br>
3638   * Path: <b>MeasureReport.subject.where(resolve() is Patient)</b><br>
3639   * </p>
3640   */
3641  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3642
3643/**
3644   * Constant for fluent queries to be used to add include statements. Specifies
3645   * the path value of "<b>MeasureReport:patient</b>".
3646   */
3647  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MeasureReport:patient").toLocked();
3648
3649 /**
3650   * Search parameter: <b>period</b>
3651   * <p>
3652   * Description: <b>The period of the measure report</b><br>
3653   * Type: <b>date</b><br>
3654   * Path: <b>MeasureReport.period</b><br>
3655   * </p>
3656   */
3657  @SearchParamDefinition(name="period", path="MeasureReport.period", description="The period of the measure report", type="date" )
3658  public static final String SP_PERIOD = "period";
3659 /**
3660   * <b>Fluent Client</b> search parameter constant for <b>period</b>
3661   * <p>
3662   * Description: <b>The period of the measure report</b><br>
3663   * Type: <b>date</b><br>
3664   * Path: <b>MeasureReport.period</b><br>
3665   * </p>
3666   */
3667  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
3668
3669 /**
3670   * Search parameter: <b>reporter</b>
3671   * <p>
3672   * Description: <b>The reporter to return measure report results for</b><br>
3673   * Type: <b>reference</b><br>
3674   * Path: <b>MeasureReport.reporter</b><br>
3675   * </p>
3676   */
3677  @SearchParamDefinition(name="reporter", path="MeasureReport.reporter", description="The reporter to return measure report results for", type="reference", target={Group.class, Location.class, Organization.class, Practitioner.class, PractitionerRole.class } )
3678  public static final String SP_REPORTER = "reporter";
3679 /**
3680   * <b>Fluent Client</b> search parameter constant for <b>reporter</b>
3681   * <p>
3682   * Description: <b>The reporter to return measure report results for</b><br>
3683   * Type: <b>reference</b><br>
3684   * Path: <b>MeasureReport.reporter</b><br>
3685   * </p>
3686   */
3687  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPORTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPORTER);
3688
3689/**
3690   * Constant for fluent queries to be used to add include statements. Specifies
3691   * the path value of "<b>MeasureReport:reporter</b>".
3692   */
3693  public static final ca.uhn.fhir.model.api.Include INCLUDE_REPORTER = new ca.uhn.fhir.model.api.Include("MeasureReport:reporter").toLocked();
3694
3695 /**
3696   * Search parameter: <b>status</b>
3697   * <p>
3698   * Description: <b>The status of the measure report</b><br>
3699   * Type: <b>token</b><br>
3700   * Path: <b>MeasureReport.status</b><br>
3701   * </p>
3702   */
3703  @SearchParamDefinition(name="status", path="MeasureReport.status", description="The status of the measure report", type="token" )
3704  public static final String SP_STATUS = "status";
3705 /**
3706   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3707   * <p>
3708   * Description: <b>The status of the measure report</b><br>
3709   * Type: <b>token</b><br>
3710   * Path: <b>MeasureReport.status</b><br>
3711   * </p>
3712   */
3713  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3714
3715 /**
3716   * Search parameter: <b>subject</b>
3717   * <p>
3718   * Description: <b>The identity of a subject to search for individual measure report results for</b><br>
3719   * Type: <b>reference</b><br>
3720   * Path: <b>MeasureReport.subject</b><br>
3721   * </p>
3722   */
3723  @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 } )
3724  public static final String SP_SUBJECT = "subject";
3725 /**
3726   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3727   * <p>
3728   * Description: <b>The identity of a subject to search for individual measure report results for</b><br>
3729   * Type: <b>reference</b><br>
3730   * Path: <b>MeasureReport.subject</b><br>
3731   * </p>
3732   */
3733  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3734
3735/**
3736   * Constant for fluent queries to be used to add include statements. Specifies
3737   * the path value of "<b>MeasureReport:subject</b>".
3738   */
3739  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MeasureReport:subject").toLocked();
3740
3741
3742}
3743