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 * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
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 FHIRMeta
extends FHIRElement
implements \JsonSerializable
74 * The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
75 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRId
77 public $versionId = null;
80 * When the resource last changed - e.g. when the version changed.
81 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRInstant
83 public $lastUpdated = null;
86 * A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
87 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRUri
89 public $source = null;
92 * A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].
93 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCanonical[]
98 * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
99 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCoding[]
101 public $security = [];
104 * Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.
105 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCoding[]
112 private $_fhirElementName = 'Meta';
115 * The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
116 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRId
118 public function getVersionId()
120 return $this->versionId
;
124 * The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
125 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRId $versionId
128 public function setVersionId($versionId)
130 $this->versionId
= $versionId;
135 * When the resource last changed - e.g. when the version changed.
136 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRInstant
138 public function getLastUpdated()
140 return $this->lastUpdated
;
144 * When the resource last changed - e.g. when the version changed.
145 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRInstant $lastUpdated
148 public function setLastUpdated($lastUpdated)
150 $this->lastUpdated
= $lastUpdated;
155 * A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
156 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRUri
158 public function getSource()
160 return $this->source
;
164 * A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
165 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRUri $source
168 public function setSource($source)
170 $this->source
= $source;
175 * A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].
176 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCanonical[]
178 public function getProfile()
180 return $this->profile
;
184 * A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].
185 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCanonical $profile
188 public function addProfile($profile)
190 $this->profile
[] = $profile;
195 * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
196 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCoding[]
198 public function getSecurity()
200 return $this->security
;
204 * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
205 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCoding $security
208 public function addSecurity($security)
210 $this->security
[] = $security;
215 * Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.
216 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCoding[]
218 public function getTag()
224 * Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.
225 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCoding $tag
228 public function addTag($tag)
237 public function get_fhirElementName()
239 return $this->_fhirElementName
;
245 public function __construct($data = [])
247 if (is_array($data)) {
248 if (isset($data['versionId'])) {
249 $this->setVersionId($data['versionId']);
251 if (isset($data['lastUpdated'])) {
252 $this->setLastUpdated($data['lastUpdated']);
254 if (isset($data['source'])) {
255 $this->setSource($data['source']);
257 if (isset($data['profile'])) {
258 if (is_array($data['profile'])) {
259 foreach ($data['profile'] as $d) {
260 $this->addProfile($d);
263 throw new \
InvalidArgumentException('"profile" must be array of objects or null, ' . gettype($data['profile']) . ' seen.');
266 if (isset($data['security'])) {
267 if (is_array($data['security'])) {
268 foreach ($data['security'] as $d) {
269 $this->addSecurity($d);
272 throw new \
InvalidArgumentException('"security" must be array of objects or null, ' . gettype($data['security']) . ' seen.');
275 if (isset($data['tag'])) {
276 if (is_array($data['tag'])) {
277 foreach ($data['tag'] as $d) {
281 throw new \
InvalidArgumentException('"tag" must be array of objects or null, ' . gettype($data['tag']) . ' seen.');
284 } elseif (null !== $data) {
285 throw new \
InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
287 parent
::__construct($data);
293 public function __toString()
295 return $this->get_fhirElementName();
301 public function jsonSerialize(): mixed
303 $json = parent
::jsonSerialize();
304 if (isset($this->versionId
)) {
305 $json['versionId'] = $this->versionId
;
307 if (isset($this->lastUpdated
)) {
308 $json['lastUpdated'] = $this->lastUpdated
;
310 if (isset($this->source
)) {
311 $json['source'] = $this->source
;
313 if (0 < count($this->profile
)) {
314 $json['profile'] = [];
315 foreach ($this->profile
as $profile) {
316 $json['profile'][] = $profile;
319 if (0 < count($this->security
)) {
320 $json['security'] = [];
321 foreach ($this->security
as $security) {
322 $json['security'][] = $security;
325 if (0 < count($this->tag
)) {
327 foreach ($this->tag
as $tag) {
328 $json['tag'][] = $tag;
335 * @param boolean $returnSXE
336 * @param \SimpleXMLElement $sxe
337 * @return string|\SimpleXMLElement
339 public function xmlSerialize($returnSXE = false, $sxe = null)
342 $sxe = new \
SimpleXMLElement('<Meta xmlns="http://hl7.org/fhir"></Meta>');
344 parent
::xmlSerialize(true, $sxe);
345 if (isset($this->versionId
)) {
346 $this->versionId
->xmlSerialize(true, $sxe->addChild('versionId'));
348 if (isset($this->lastUpdated
)) {
349 $this->lastUpdated
->xmlSerialize(true, $sxe->addChild('lastUpdated'));
351 if (isset($this->source
)) {
352 $this->source
->xmlSerialize(true, $sxe->addChild('source'));
354 if (0 < count($this->profile
)) {
355 foreach ($this->profile
as $profile) {
356 $profile->xmlSerialize(true, $sxe->addChild('profile'));
359 if (0 < count($this->security
)) {
360 foreach ($this->security
as $security) {
361 $security->xmlSerialize(true, $sxe->addChild('security'));
364 if (0 < count($this->tag
)) {
365 foreach ($this->tag
as $tag) {
366 $tag->xmlSerialize(true, $sxe->addChild('tag'));
372 return $sxe->saveXML();