fixes: mostly php 8.3 fixes to prepare for next release (#6935)
[openemr.git] / src / FHIR / R4 / FHIRResource / FHIRConceptMap / FHIRConceptMapTarget.php
blob908a299144011d2a2c10d58dba5d8a4ddd1a44df
1 <?php
3 namespace OpenEMR\FHIR\R4\FHIRResource\FHIRConceptMap;
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 * A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.
70 class FHIRConceptMapTarget extends FHIRBackboneElement implements \JsonSerializable
72 /**
73 * Identity (code or path) or the element/item that the map refers to.
74 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCode
76 public $code = null;
78 /**
79 * The display for the code. The display is only provided to help editors when editing the concept map.
80 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
82 public $display = null;
84 /**
85 * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).
86 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRConceptMapEquivalence
88 public $equivalence = null;
90 /**
91 * A description of status/issues in mapping that conveys additional information not represented in the structured data.
92 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
94 public $comment = null;
96 /**
97 * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.
98 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRConceptMap\FHIRConceptMapDependsOn[]
100 public $dependsOn = [];
103 * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.
104 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRConceptMap\FHIRConceptMapDependsOn[]
106 public $product = [];
109 * @var string
111 private $_fhirElementName = 'ConceptMap.Target';
114 * Identity (code or path) or the element/item that the map refers to.
115 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCode
117 public function getCode()
119 return $this->code;
123 * Identity (code or path) or the element/item that the map refers to.
124 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCode $code
125 * @return $this
127 public function setCode($code)
129 $this->code = $code;
130 return $this;
134 * The display for the code. The display is only provided to help editors when editing the concept map.
135 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
137 public function getDisplay()
139 return $this->display;
143 * The display for the code. The display is only provided to help editors when editing the concept map.
144 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $display
145 * @return $this
147 public function setDisplay($display)
149 $this->display = $display;
150 return $this;
154 * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).
155 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRConceptMapEquivalence
157 public function getEquivalence()
159 return $this->equivalence;
163 * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).
164 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRConceptMapEquivalence $equivalence
165 * @return $this
167 public function setEquivalence($equivalence)
169 $this->equivalence = $equivalence;
170 return $this;
174 * A description of status/issues in mapping that conveys additional information not represented in the structured data.
175 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
177 public function getComment()
179 return $this->comment;
183 * A description of status/issues in mapping that conveys additional information not represented in the structured data.
184 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $comment
185 * @return $this
187 public function setComment($comment)
189 $this->comment = $comment;
190 return $this;
194 * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.
195 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRConceptMap\FHIRConceptMapDependsOn[]
197 public function getDependsOn()
199 return $this->dependsOn;
203 * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.
204 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRConceptMap\FHIRConceptMapDependsOn $dependsOn
205 * @return $this
207 public function addDependsOn($dependsOn)
209 $this->dependsOn[] = $dependsOn;
210 return $this;
214 * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.
215 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRConceptMap\FHIRConceptMapDependsOn[]
217 public function getProduct()
219 return $this->product;
223 * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.
224 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRConceptMap\FHIRConceptMapDependsOn $product
225 * @return $this
227 public function addProduct($product)
229 $this->product[] = $product;
230 return $this;
234 * @return string
236 public function get_fhirElementName()
238 return $this->_fhirElementName;
242 * @param mixed $data
244 public function __construct($data = [])
246 if (is_array($data)) {
247 if (isset($data['code'])) {
248 $this->setCode($data['code']);
250 if (isset($data['display'])) {
251 $this->setDisplay($data['display']);
253 if (isset($data['equivalence'])) {
254 $this->setEquivalence($data['equivalence']);
256 if (isset($data['comment'])) {
257 $this->setComment($data['comment']);
259 if (isset($data['dependsOn'])) {
260 if (is_array($data['dependsOn'])) {
261 foreach ($data['dependsOn'] as $d) {
262 $this->addDependsOn($d);
264 } else {
265 throw new \InvalidArgumentException('"dependsOn" must be array of objects or null, ' . gettype($data['dependsOn']) . ' seen.');
268 if (isset($data['product'])) {
269 if (is_array($data['product'])) {
270 foreach ($data['product'] as $d) {
271 $this->addProduct($d);
273 } else {
274 throw new \InvalidArgumentException('"product" must be array of objects or null, ' . gettype($data['product']) . ' seen.');
277 } elseif (null !== $data) {
278 throw new \InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
280 parent::__construct($data);
284 * @return string
286 public function __toString()
288 return $this->get_fhirElementName();
292 * @return array
294 public function jsonSerialize(): mixed
296 $json = parent::jsonSerialize();
297 if (isset($this->code)) {
298 $json['code'] = $this->code;
300 if (isset($this->display)) {
301 $json['display'] = $this->display;
303 if (isset($this->equivalence)) {
304 $json['equivalence'] = $this->equivalence;
306 if (isset($this->comment)) {
307 $json['comment'] = $this->comment;
309 if (0 < count($this->dependsOn)) {
310 $json['dependsOn'] = [];
311 foreach ($this->dependsOn as $dependsOn) {
312 $json['dependsOn'][] = $dependsOn;
315 if (0 < count($this->product)) {
316 $json['product'] = [];
317 foreach ($this->product as $product) {
318 $json['product'][] = $product;
321 return $json;
325 * @param boolean $returnSXE
326 * @param \SimpleXMLElement $sxe
327 * @return string|\SimpleXMLElement
329 public function xmlSerialize($returnSXE = false, $sxe = null)
331 if (null === $sxe) {
332 $sxe = new \SimpleXMLElement('<ConceptMapTarget xmlns="http://hl7.org/fhir"></ConceptMapTarget>');
334 parent::xmlSerialize(true, $sxe);
335 if (isset($this->code)) {
336 $this->code->xmlSerialize(true, $sxe->addChild('code'));
338 if (isset($this->display)) {
339 $this->display->xmlSerialize(true, $sxe->addChild('display'));
341 if (isset($this->equivalence)) {
342 $this->equivalence->xmlSerialize(true, $sxe->addChild('equivalence'));
344 if (isset($this->comment)) {
345 $this->comment->xmlSerialize(true, $sxe->addChild('comment'));
347 if (0 < count($this->dependsOn)) {
348 foreach ($this->dependsOn as $dependsOn) {
349 $dependsOn->xmlSerialize(true, $sxe->addChild('dependsOn'));
352 if (0 < count($this->product)) {
353 foreach ($this->product as $product) {
354 $product->xmlSerialize(true, $sxe->addChild('product'));
357 if ($returnSXE) {
358 return $sxe;
360 return $sxe->saveXML();