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