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