1 <?php
namespace OpenEMR\FHIR\R4\FHIRResource\FHIRNutritionOrder
;
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/)
7 * Class creation date: June 14th, 2019
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
;
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
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;
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;
83 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity
85 public $rateQuantity = null;
88 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRRatio
90 public $rateRatio = null;
95 private $_fhirElementName = 'NutritionOrder.Administration';
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
111 public function setSchedule($schedule)
113 $this->schedule
= $schedule;
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
131 public function setQuantity($quantity)
133 $this->quantity
= $quantity;
138 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity
140 public function getRateQuantity()
142 return $this->rateQuantity
;
146 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity $rateQuantity
149 public function setRateQuantity($rateQuantity)
151 $this->rateQuantity
= $rateQuantity;
156 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRRatio
158 public function getRateRatio()
160 return $this->rateRatio
;
164 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRRatio $rateRatio
167 public function setRateRatio($rateRatio)
169 $this->rateRatio
= $rateRatio;
176 public function get_fhirElementName()
178 return $this->_fhirElementName
;
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);
208 public function __toString()
210 return $this->get_fhirElementName();
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
;
235 * @param boolean $returnSXE
236 * @param \SimpleXMLElement $sxe
237 * @return string|\SimpleXMLElement
239 public function xmlSerialize($returnSXE = false, $sxe = null)
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'));
260 return $sxe->saveXML();