fixes: mostly php 8.3 fixes to prepare for next release (#6935)
[openemr.git] / src / FHIR / R4 / FHIRResource / FHIRSubstanceSourceMaterial / FHIRSubstanceSourceMaterialFractionDescription.php
blobec51e44d8b049b61a56c40b50559959b3bcf26ae
1 <?php
3 namespace OpenEMR\FHIR\R4\FHIRResource\FHIRSubstanceSourceMaterial;
5 /*!
6 * This class was generated with the PHPFHIR library (https://github.com/dcarbone/php-fhir) using
7 * class definitions from HL7 FHIR (https://www.hl7.org/fhir/)
9 * Class creation date: June 14th, 2019
11 * PHPFHIR Copyright:
13 * Copyright 2016-2017 Daniel Carbone (daniel.p.carbone@gmail.com)
15 * Licensed under the Apache License, Version 2.0 (the "License");
16 * you may not use this file except in compliance with the License.
17 * You may obtain a copy of the License at
19 * http://www.apache.org/licenses/LICENSE-2.0
21 * Unless required by applicable law or agreed to in writing, software
22 * distributed under the License is distributed on an "AS IS" BASIS,
23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 * See the License for the specific language governing permissions and
25 * limitations under the License.
28 * FHIR Copyright Notice:
30 * Copyright (c) 2011+, HL7, Inc.
31 * All rights reserved.
33 * Redistribution and use in source and binary forms, with or without modification,
34 * are permitted provided that the following conditions are met:
36 * * Redistributions of source code must retain the above copyright notice, this
37 * list of conditions and the following disclaimer.
38 * * Redistributions in binary form must reproduce the above copyright notice,
39 * this list of conditions and the following disclaimer in the documentation
40 * and/or other materials provided with the distribution.
41 * * Neither the name of HL7 nor the names of its contributors may be used to
42 * endorse or promote products derived from this software without specific
43 * prior written permission.
45 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
48 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
49 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
51 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
52 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
54 * POSSIBILITY OF SUCH DAMAGE.
57 * Generated on Thu, Dec 27, 2018 22:37+1100 for FHIR v4.0.0
59 * Note: the schemas & schematrons do not contain all of the rules about what makes resources
60 * valid. Implementers will still need to be familiar with the content of the specification and with
61 * any profiles that apply to the resources in order to make a conformant implementation.
65 use OpenEMR\FHIR\R4\FHIRElement\FHIRBackboneElement;
67 /**
68 * Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.
70 class FHIRSubstanceSourceMaterialFractionDescription extends FHIRBackboneElement implements \JsonSerializable
72 /**
73 * This element is capturing information about the fraction of a plant part, or human plasma for fractionation.
74 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
76 public $fraction = null;
78 /**
79 * The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.
80 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
82 public $materialType = null;
84 /**
85 * @var string
87 private $_fhirElementName = 'SubstanceSourceMaterial.FractionDescription';
89 /**
90 * This element is capturing information about the fraction of a plant part, or human plasma for fractionation.
91 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
93 public function getFraction()
95 return $this->fraction;
98 /**
99 * This element is capturing information about the fraction of a plant part, or human plasma for fractionation.
100 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $fraction
101 * @return $this
103 public function setFraction($fraction)
105 $this->fraction = $fraction;
106 return $this;
110 * The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.
111 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
113 public function getMaterialType()
115 return $this->materialType;
119 * The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.
120 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $materialType
121 * @return $this
123 public function setMaterialType($materialType)
125 $this->materialType = $materialType;
126 return $this;
130 * @return string
132 public function get_fhirElementName()
134 return $this->_fhirElementName;
138 * @param mixed $data
140 public function __construct($data = [])
142 if (is_array($data)) {
143 if (isset($data['fraction'])) {
144 $this->setFraction($data['fraction']);
146 if (isset($data['materialType'])) {
147 $this->setMaterialType($data['materialType']);
149 } elseif (null !== $data) {
150 throw new \InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
152 parent::__construct($data);
156 * @return string
158 public function __toString()
160 return $this->get_fhirElementName();
164 * @return array
166 public function jsonSerialize(): mixed
168 $json = parent::jsonSerialize();
169 if (isset($this->fraction)) {
170 $json['fraction'] = $this->fraction;
172 if (isset($this->materialType)) {
173 $json['materialType'] = $this->materialType;
175 return $json;
179 * @param boolean $returnSXE
180 * @param \SimpleXMLElement $sxe
181 * @return string|\SimpleXMLElement
183 public function xmlSerialize($returnSXE = false, $sxe = null)
185 if (null === $sxe) {
186 $sxe = new \SimpleXMLElement('<SubstanceSourceMaterialFractionDescription xmlns="http://hl7.org/fhir"></SubstanceSourceMaterialFractionDescription>');
188 parent::xmlSerialize(true, $sxe);
189 if (isset($this->fraction)) {
190 $this->fraction->xmlSerialize(true, $sxe->addChild('fraction'));
192 if (isset($this->materialType)) {
193 $this->materialType->xmlSerialize(true, $sxe->addChild('materialType'));
195 if ($returnSXE) {
196 return $sxe;
198 return $sxe->saveXML();