some fixes (#2481)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRResource / FHIRMeasure / FHIRMeasureSupplementalData.php
blobe0e3d8d194dab27a4dc940bd8110815fc7f6b7f2
1 <?php namespace HL7\FHIR\STU3\FHIRResource\FHIRMeasure;
3 /*!
4 * This class was generated with the PHPFHIR library (https://github.com/dcarbone/php-fhir) using
5 * class definitions from HL7 FHIR (https://www.hl7.org/fhir/)
6 *
7 * Class creation date: February 10th, 2018
8 */
10 use HL7\FHIR\STU3\FHIRElement\FHIRBackboneElement;
12 /**
13 * The Measure resource provides the definition of a quality measure.
15 class FHIRMeasureSupplementalData extends FHIRBackboneElement implements \JsonSerializable
17 /**
18 * An identifier for the supplemental data.
19 * @var \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier
21 public $identifier = null;
23 /**
24 * An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.
25 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept[]
27 public $usage = [];
29 /**
30 * The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.
31 * @var \HL7\FHIR\STU3\FHIRElement\FHIRString
33 public $criteria = null;
35 /**
36 * The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.
37 * @var \HL7\FHIR\STU3\FHIRElement\FHIRString
39 public $path = null;
41 /**
42 * @var string
44 private $_fhirElementName = 'Measure.SupplementalData';
46 /**
47 * An identifier for the supplemental data.
48 * @return \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier
50 public function getIdentifier()
52 return $this->identifier;
55 /**
56 * An identifier for the supplemental data.
57 * @param \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier $identifier
58 * @return $this
60 public function setIdentifier($identifier)
62 $this->identifier = $identifier;
63 return $this;
66 /**
67 * An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.
68 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept[]
70 public function getUsage()
72 return $this->usage;
75 /**
76 * An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.
77 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $usage
78 * @return $this
80 public function addUsage($usage)
82 $this->usage[] = $usage;
83 return $this;
86 /**
87 * The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.
88 * @return \HL7\FHIR\STU3\FHIRElement\FHIRString
90 public function getCriteria()
92 return $this->criteria;
95 /**
96 * The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.
97 * @param \HL7\FHIR\STU3\FHIRElement\FHIRString $criteria
98 * @return $this
100 public function setCriteria($criteria)
102 $this->criteria = $criteria;
103 return $this;
107 * The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.
108 * @return \HL7\FHIR\STU3\FHIRElement\FHIRString
110 public function getPath()
112 return $this->path;
116 * The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.
117 * @param \HL7\FHIR\STU3\FHIRElement\FHIRString $path
118 * @return $this
120 public function setPath($path)
122 $this->path = $path;
123 return $this;
127 * @return string
129 public function get_fhirElementName()
131 return $this->_fhirElementName;
135 * @param mixed $data
137 public function __construct($data = [])
139 if (is_array($data)) {
140 if (isset($data['identifier'])) {
141 $this->setIdentifier($data['identifier']);
143 if (isset($data['usage'])) {
144 if (is_array($data['usage'])) {
145 foreach ($data['usage'] as $d) {
146 $this->addUsage($d);
148 } else {
149 throw new \InvalidArgumentException('"usage" must be array of objects or null, '.gettype($data['usage']).' seen.');
152 if (isset($data['criteria'])) {
153 $this->setCriteria($data['criteria']);
155 if (isset($data['path'])) {
156 $this->setPath($data['path']);
158 } else if (null !== $data) {
159 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
161 parent::__construct($data);
165 * @return string
167 public function __toString()
169 return $this->get_fhirElementName();
173 * @return array
175 public function jsonSerialize()
177 $json = parent::jsonSerialize();
178 if (isset($this->identifier)) {
179 $json['identifier'] = $this->identifier;
181 if (0 < count($this->usage)) {
182 $json['usage'] = [];
183 foreach ($this->usage as $usage) {
184 $json['usage'][] = $usage;
187 if (isset($this->criteria)) {
188 $json['criteria'] = $this->criteria;
190 if (isset($this->path)) {
191 $json['path'] = $this->path;
193 return $json;
197 * @param boolean $returnSXE
198 * @param \SimpleXMLElement $sxe
199 * @return string|\SimpleXMLElement
201 public function xmlSerialize($returnSXE = false, $sxe = null)
203 if (null === $sxe) {
204 $sxe = new \SimpleXMLElement('<MeasureSupplementalData xmlns="http://hl7.org/fhir"></MeasureSupplementalData>');
206 parent::xmlSerialize(true, $sxe);
207 if (isset($this->identifier)) {
208 $this->identifier->xmlSerialize(true, $sxe->addChild('identifier'));
210 if (0 < count($this->usage)) {
211 foreach ($this->usage as $usage) {
212 $usage->xmlSerialize(true, $sxe->addChild('usage'));
215 if (isset($this->criteria)) {
216 $this->criteria->xmlSerialize(true, $sxe->addChild('criteria'));
218 if (isset($this->path)) {
219 $this->path->xmlSerialize(true, $sxe->addChild('path'));
221 if ($returnSXE) {
222 return $sxe;
224 return $sxe->saveXML();