3 namespace OpenEMR\FHIR\R4\FHIRElement
;
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
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
;
68 * Base definition for all elements that are defined inside a resource - but not those in a data type.
69 * 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
71 class FHIRBackboneElement
extends FHIRElement
implements \JsonSerializable
74 * May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
76 Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
77 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRExtension[]
79 public $modifierExtension = [];
84 private $_fhirElementName = 'BackboneElement';
87 * May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
89 Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
90 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRExtension[]
92 public function getModifierExtension()
94 return $this->modifierExtension
;
98 * May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.
100 Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
101 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRExtension $modifierExtension
104 public function addModifierExtension($modifierExtension)
106 $this->modifierExtension
[] = $modifierExtension;
113 public function get_fhirElementName()
115 return $this->_fhirElementName
;
121 public function __construct($data = [])
123 if (is_array($data)) {
124 if (isset($data['modifierExtension'])) {
125 if (is_array($data['modifierExtension'])) {
126 foreach ($data['modifierExtension'] as $d) {
127 $this->addModifierExtension($d);
130 throw new \
InvalidArgumentException('"modifierExtension" must be array of objects or null, ' . gettype($data['modifierExtension']) . ' seen.');
133 } elseif (null !== $data) {
134 throw new \
InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
136 parent
::__construct($data);
142 public function __toString()
144 return $this->get_fhirElementName();
150 public function jsonSerialize(): mixed
152 $json = parent
::jsonSerialize();
153 if (0 < count($this->modifierExtension
)) {
154 $json['modifierExtension'] = [];
155 foreach ($this->modifierExtension
as $modifierExtension) {
156 $json['modifierExtension'][] = $modifierExtension;
163 * @param boolean $returnSXE
164 * @param \SimpleXMLElement $sxe
165 * @return string|\SimpleXMLElement
167 public function xmlSerialize($returnSXE = false, $sxe = null)
170 $sxe = new \
SimpleXMLElement('<BackboneElement xmlns="http://hl7.org/fhir"></BackboneElement>');
172 parent
::xmlSerialize(true, $sxe);
173 if (0 < count($this->modifierExtension
)) {
174 foreach ($this->modifierExtension
as $modifierExtension) {
175 $modifierExtension->xmlSerialize(true, $sxe->addChild('modifierExtension'));
181 return $sxe->saveXML();