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