Move to FHIR current R4 release (#2482)
[openemr.git] / src / FHIR / R4 / FHIRResource / FHIRNutritionOrder / FHIRNutritionOrderAdministration.php
blob3a0d51505ee73f620e2bbe6c243e00d8caed3eb8
1 <?php namespace OpenEMR\FHIR\R4\FHIRResource\FHIRNutritionOrder;
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: June 14th, 2019
8 *
9 * PHPFHIR Copyright:
11 * Copyright 2016-2017 Daniel Carbone (daniel.p.carbone@gmail.com)
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
26 * FHIR Copyright Notice:
28 * Copyright (c) 2011+, HL7, Inc.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without modification,
32 * are permitted provided that the following conditions are met:
34 * * Redistributions of source code must retain the above copyright notice, this
35 * list of conditions and the following disclaimer.
36 * * Redistributions in binary form must reproduce the above copyright notice,
37 * this list of conditions and the following disclaimer in the documentation
38 * and/or other materials provided with the distribution.
39 * * Neither the name of HL7 nor the names of its contributors may be used to
40 * endorse or promote products derived from this software without specific
41 * prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
45 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
46 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
47 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
49 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
50 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
52 * POSSIBILITY OF SUCH DAMAGE.
55 * Generated on Thu, Dec 27, 2018 22:37+1100 for FHIR v4.0.0
57 * Note: the schemas & schematrons do not contain all of the rules about what makes resources
58 * valid. Implementers will still need to be familiar with the content of the specification and with
59 * any profiles that apply to the resources in order to make a conformant implementation.
63 use OpenEMR\FHIR\R4\FHIRElement\FHIRBackboneElement;
65 /**
66 * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.
68 class FHIRNutritionOrderAdministration extends FHIRBackboneElement implements \JsonSerializable
70 /**
71 * The time period and frequency at which the enteral formula should be delivered to the patient.
72 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRTiming
74 public $schedule = null;
76 /**
77 * The volume of formula to provide to the patient per the specified administration schedule.
78 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity
80 public $quantity = null;
82 /**
83 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity
85 public $rateQuantity = null;
87 /**
88 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRRatio
90 public $rateRatio = null;
92 /**
93 * @var string
95 private $_fhirElementName = 'NutritionOrder.Administration';
97 /**
98 * The time period and frequency at which the enteral formula should be delivered to the patient.
99 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRTiming
101 public function getSchedule()
103 return $this->schedule;
107 * The time period and frequency at which the enteral formula should be delivered to the patient.
108 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRTiming $schedule
109 * @return $this
111 public function setSchedule($schedule)
113 $this->schedule = $schedule;
114 return $this;
118 * The volume of formula to provide to the patient per the specified administration schedule.
119 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity
121 public function getQuantity()
123 return $this->quantity;
127 * The volume of formula to provide to the patient per the specified administration schedule.
128 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity $quantity
129 * @return $this
131 public function setQuantity($quantity)
133 $this->quantity = $quantity;
134 return $this;
138 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity
140 public function getRateQuantity()
142 return $this->rateQuantity;
146 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity $rateQuantity
147 * @return $this
149 public function setRateQuantity($rateQuantity)
151 $this->rateQuantity = $rateQuantity;
152 return $this;
156 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRRatio
158 public function getRateRatio()
160 return $this->rateRatio;
164 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRRatio $rateRatio
165 * @return $this
167 public function setRateRatio($rateRatio)
169 $this->rateRatio = $rateRatio;
170 return $this;
174 * @return string
176 public function get_fhirElementName()
178 return $this->_fhirElementName;
182 * @param mixed $data
184 public function __construct($data = [])
186 if (is_array($data)) {
187 if (isset($data['schedule'])) {
188 $this->setSchedule($data['schedule']);
190 if (isset($data['quantity'])) {
191 $this->setQuantity($data['quantity']);
193 if (isset($data['rateQuantity'])) {
194 $this->setRateQuantity($data['rateQuantity']);
196 if (isset($data['rateRatio'])) {
197 $this->setRateRatio($data['rateRatio']);
199 } else if (null !== $data) {
200 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
202 parent::__construct($data);
206 * @return string
208 public function __toString()
210 return $this->get_fhirElementName();
214 * @return array
216 public function jsonSerialize()
218 $json = parent::jsonSerialize();
219 if (isset($this->schedule)) {
220 $json['schedule'] = $this->schedule;
222 if (isset($this->quantity)) {
223 $json['quantity'] = $this->quantity;
225 if (isset($this->rateQuantity)) {
226 $json['rateQuantity'] = $this->rateQuantity;
228 if (isset($this->rateRatio)) {
229 $json['rateRatio'] = $this->rateRatio;
231 return $json;
235 * @param boolean $returnSXE
236 * @param \SimpleXMLElement $sxe
237 * @return string|\SimpleXMLElement
239 public function xmlSerialize($returnSXE = false, $sxe = null)
241 if (null === $sxe) {
242 $sxe = new \SimpleXMLElement('<NutritionOrderAdministration xmlns="http://hl7.org/fhir"></NutritionOrderAdministration>');
244 parent::xmlSerialize(true, $sxe);
245 if (isset($this->schedule)) {
246 $this->schedule->xmlSerialize(true, $sxe->addChild('schedule'));
248 if (isset($this->quantity)) {
249 $this->quantity->xmlSerialize(true, $sxe->addChild('quantity'));
251 if (isset($this->rateQuantity)) {
252 $this->rateQuantity->xmlSerialize(true, $sxe->addChild('rateQuantity'));
254 if (isset($this->rateRatio)) {
255 $this->rateRatio->xmlSerialize(true, $sxe->addChild('rateRatio'));
257 if ($returnSXE) {
258 return $sxe;
260 return $sxe->saveXML();