some fixes (#2481)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRElement / FHIRSampledData.php
blob974dd71d7b16e44674fcfa21febc035153b89995
1 <?php namespace HL7\FHIR\STU3\FHIRElement;
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;
12 /**
13 * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
14 * If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions
16 class FHIRSampledData extends FHIRElement implements \JsonSerializable
18 /**
19 * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.
20 * @var \HL7\FHIR\STU3\FHIRElement\FHIRQuantity
22 public $origin = null;
24 /**
25 * The length of time between sampling times, measured in milliseconds.
26 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
28 public $period = null;
30 /**
31 * A correction factor that is applied to the sampled data points before they are added to the origin.
32 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
34 public $factor = null;
36 /**
37 * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
38 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
40 public $lowerLimit = null;
42 /**
43 * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
44 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
46 public $upperLimit = null;
48 /**
49 * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.
50 * @var \HL7\FHIR\STU3\FHIRElement\FHIRPositiveInt
52 public $dimensions = null;
54 /**
55 * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.
56 * @var \HL7\FHIR\STU3\FHIRElement\FHIRSampledDataDataType
58 public $data = null;
60 /**
61 * @var string
63 private $_fhirElementName = 'SampledData';
65 /**
66 * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.
67 * @return \HL7\FHIR\STU3\FHIRElement\FHIRQuantity
69 public function getOrigin()
71 return $this->origin;
74 /**
75 * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.
76 * @param \HL7\FHIR\STU3\FHIRElement\FHIRQuantity $origin
77 * @return $this
79 public function setOrigin($origin)
81 $this->origin = $origin;
82 return $this;
85 /**
86 * The length of time between sampling times, measured in milliseconds.
87 * @return \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
89 public function getPeriod()
91 return $this->period;
94 /**
95 * The length of time between sampling times, measured in milliseconds.
96 * @param \HL7\FHIR\STU3\FHIRElement\FHIRDecimal $period
97 * @return $this
99 public function setPeriod($period)
101 $this->period = $period;
102 return $this;
106 * A correction factor that is applied to the sampled data points before they are added to the origin.
107 * @return \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
109 public function getFactor()
111 return $this->factor;
115 * A correction factor that is applied to the sampled data points before they are added to the origin.
116 * @param \HL7\FHIR\STU3\FHIRElement\FHIRDecimal $factor
117 * @return $this
119 public function setFactor($factor)
121 $this->factor = $factor;
122 return $this;
126 * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
127 * @return \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
129 public function getLowerLimit()
131 return $this->lowerLimit;
135 * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
136 * @param \HL7\FHIR\STU3\FHIRElement\FHIRDecimal $lowerLimit
137 * @return $this
139 public function setLowerLimit($lowerLimit)
141 $this->lowerLimit = $lowerLimit;
142 return $this;
146 * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
147 * @return \HL7\FHIR\STU3\FHIRElement\FHIRDecimal
149 public function getUpperLimit()
151 return $this->upperLimit;
155 * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
156 * @param \HL7\FHIR\STU3\FHIRElement\FHIRDecimal $upperLimit
157 * @return $this
159 public function setUpperLimit($upperLimit)
161 $this->upperLimit = $upperLimit;
162 return $this;
166 * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.
167 * @return \HL7\FHIR\STU3\FHIRElement\FHIRPositiveInt
169 public function getDimensions()
171 return $this->dimensions;
175 * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.
176 * @param \HL7\FHIR\STU3\FHIRElement\FHIRPositiveInt $dimensions
177 * @return $this
179 public function setDimensions($dimensions)
181 $this->dimensions = $dimensions;
182 return $this;
186 * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.
187 * @return \HL7\FHIR\STU3\FHIRElement\FHIRSampledDataDataType
189 public function getData()
191 return $this->data;
195 * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.
196 * @param \HL7\FHIR\STU3\FHIRElement\FHIRSampledDataDataType $data
197 * @return $this
199 public function setData($data)
201 $this->data = $data;
202 return $this;
206 * @return string
208 public function get_fhirElementName()
210 return $this->_fhirElementName;
214 * @param mixed $data
216 public function __construct($data = [])
218 if (is_array($data)) {
219 if (isset($data['origin'])) {
220 $this->setOrigin($data['origin']);
222 if (isset($data['period'])) {
223 $this->setPeriod($data['period']);
225 if (isset($data['factor'])) {
226 $this->setFactor($data['factor']);
228 if (isset($data['lowerLimit'])) {
229 $this->setLowerLimit($data['lowerLimit']);
231 if (isset($data['upperLimit'])) {
232 $this->setUpperLimit($data['upperLimit']);
234 if (isset($data['dimensions'])) {
235 $this->setDimensions($data['dimensions']);
237 if (isset($data['data'])) {
238 $this->setData($data['data']);
240 } else if (null !== $data) {
241 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
243 parent::__construct($data);
247 * @return string
249 public function __toString()
251 return $this->get_fhirElementName();
255 * @return array
257 public function jsonSerialize()
259 $json = parent::jsonSerialize();
260 if (isset($this->origin)) {
261 $json['origin'] = $this->origin;
263 if (isset($this->period)) {
264 $json['period'] = $this->period;
266 if (isset($this->factor)) {
267 $json['factor'] = $this->factor;
269 if (isset($this->lowerLimit)) {
270 $json['lowerLimit'] = $this->lowerLimit;
272 if (isset($this->upperLimit)) {
273 $json['upperLimit'] = $this->upperLimit;
275 if (isset($this->dimensions)) {
276 $json['dimensions'] = $this->dimensions;
278 if (isset($this->data)) {
279 $json['data'] = $this->data;
281 return $json;
285 * @param boolean $returnSXE
286 * @param \SimpleXMLElement $sxe
287 * @return string|\SimpleXMLElement
289 public function xmlSerialize($returnSXE = false, $sxe = null)
291 if (null === $sxe) {
292 $sxe = new \SimpleXMLElement('<SampledData xmlns="http://hl7.org/fhir"></SampledData>');
294 parent::xmlSerialize(true, $sxe);
295 if (isset($this->origin)) {
296 $this->origin->xmlSerialize(true, $sxe->addChild('origin'));
298 if (isset($this->period)) {
299 $this->period->xmlSerialize(true, $sxe->addChild('period'));
301 if (isset($this->factor)) {
302 $this->factor->xmlSerialize(true, $sxe->addChild('factor'));
304 if (isset($this->lowerLimit)) {
305 $this->lowerLimit->xmlSerialize(true, $sxe->addChild('lowerLimit'));
307 if (isset($this->upperLimit)) {
308 $this->upperLimit->xmlSerialize(true, $sxe->addChild('upperLimit'));
310 if (isset($this->dimensions)) {
311 $this->dimensions->xmlSerialize(true, $sxe->addChild('dimensions'));
313 if (isset($this->data)) {
314 $this->data->xmlSerialize(true, $sxe->addChild('data'));
316 if ($returnSXE) {
317 return $sxe;
319 return $sxe->saveXML();