fixes: mostly php 8.3 fixes to prepare for next release (#6935)
[openemr.git] / src / FHIR / R4 / FHIRDomainResource / FHIRDocumentManifest.php
blob184f44cf7385e2d19cf24a3042c28f1746b4a267
1 <?php
3 namespace OpenEMR\FHIR\R4\FHIRDomainResource;
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\FHIRResource\FHIRDomainResource;
67 /**
68 * A collection of documents compiled for a purpose together with metadata that applies to the collection.
69 * If the element is present, it must have either a @value, an @id, or extensions
71 class FHIRDocumentManifest extends FHIRDomainResource implements \JsonSerializable
73 /**
74 * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.
75 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier
77 public $masterIdentifier = null;
79 /**
80 * Other identifiers associated with the document manifest, including version independent identifiers.
81 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier[]
83 public $identifier = [];
85 /**
86 * The status of this document manifest.
87 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDocumentReferenceStatus
89 public $status = null;
91 /**
92 * The code specifying the type of clinical activity that resulted in placing the associated content into the DocumentManifest.
93 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
95 public $type = null;
97 /**
98 * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).
99 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
101 public $subject = null;
104 * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.).
105 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
107 public $created = null;
110 * Identifies who is the author of the manifest. Manifest author is not necessarly the author of the references included.
111 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
113 public $author = [];
116 * A patient, practitioner, or organization for which this set of documents is intended.
117 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
119 public $recipient = [];
122 * Identifies the source system, application, or software that produced the document manifest.
123 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRUri
125 public $source = null;
128 * Human-readable description of the source document. This is sometimes known as the "title".
129 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
131 public $description = null;
134 * The list of Resources that consist of the parts of this manifest.
135 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
137 public $content = [];
140 * Related identifiers or resources associated with the DocumentManifest.
141 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRDocumentManifest\FHIRDocumentManifestRelated[]
143 public $related = [];
146 * @var string
148 private $_fhirElementName = 'DocumentManifest';
151 * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.
152 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier
154 public function getMasterIdentifier()
156 return $this->masterIdentifier;
160 * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.
161 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier $masterIdentifier
162 * @return $this
164 public function setMasterIdentifier($masterIdentifier)
166 $this->masterIdentifier = $masterIdentifier;
167 return $this;
171 * Other identifiers associated with the document manifest, including version independent identifiers.
172 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier[]
174 public function getIdentifier()
176 return $this->identifier;
180 * Other identifiers associated with the document manifest, including version independent identifiers.
181 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier $identifier
182 * @return $this
184 public function addIdentifier($identifier)
186 $this->identifier[] = $identifier;
187 return $this;
191 * The status of this document manifest.
192 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDocumentReferenceStatus
194 public function getStatus()
196 return $this->status;
200 * The status of this document manifest.
201 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDocumentReferenceStatus $status
202 * @return $this
204 public function setStatus($status)
206 $this->status = $status;
207 return $this;
211 * The code specifying the type of clinical activity that resulted in placing the associated content into the DocumentManifest.
212 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
214 public function getType()
216 return $this->type;
220 * The code specifying the type of clinical activity that resulted in placing the associated content into the DocumentManifest.
221 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $type
222 * @return $this
224 public function setType($type)
226 $this->type = $type;
227 return $this;
231 * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).
232 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
234 public function getSubject()
236 return $this->subject;
240 * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).
241 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $subject
242 * @return $this
244 public function setSubject($subject)
246 $this->subject = $subject;
247 return $this;
251 * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.).
252 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
254 public function getCreated()
256 return $this->created;
260 * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.).
261 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime $created
262 * @return $this
264 public function setCreated($created)
266 $this->created = $created;
267 return $this;
271 * Identifies who is the author of the manifest. Manifest author is not necessarly the author of the references included.
272 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
274 public function getAuthor()
276 return $this->author;
280 * Identifies who is the author of the manifest. Manifest author is not necessarly the author of the references included.
281 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $author
282 * @return $this
284 public function addAuthor($author)
286 $this->author[] = $author;
287 return $this;
291 * A patient, practitioner, or organization for which this set of documents is intended.
292 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
294 public function getRecipient()
296 return $this->recipient;
300 * A patient, practitioner, or organization for which this set of documents is intended.
301 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $recipient
302 * @return $this
304 public function addRecipient($recipient)
306 $this->recipient[] = $recipient;
307 return $this;
311 * Identifies the source system, application, or software that produced the document manifest.
312 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRUri
314 public function getSource()
316 return $this->source;
320 * Identifies the source system, application, or software that produced the document manifest.
321 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRUri $source
322 * @return $this
324 public function setSource($source)
326 $this->source = $source;
327 return $this;
331 * Human-readable description of the source document. This is sometimes known as the "title".
332 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
334 public function getDescription()
336 return $this->description;
340 * Human-readable description of the source document. This is sometimes known as the "title".
341 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $description
342 * @return $this
344 public function setDescription($description)
346 $this->description = $description;
347 return $this;
351 * The list of Resources that consist of the parts of this manifest.
352 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
354 public function getContent()
356 return $this->content;
360 * The list of Resources that consist of the parts of this manifest.
361 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $content
362 * @return $this
364 public function addContent($content)
366 $this->content[] = $content;
367 return $this;
371 * Related identifiers or resources associated with the DocumentManifest.
372 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRDocumentManifest\FHIRDocumentManifestRelated[]
374 public function getRelated()
376 return $this->related;
380 * Related identifiers or resources associated with the DocumentManifest.
381 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRDocumentManifest\FHIRDocumentManifestRelated $related
382 * @return $this
384 public function addRelated($related)
386 $this->related[] = $related;
387 return $this;
391 * @return string
393 public function get_fhirElementName()
395 return $this->_fhirElementName;
399 * @param mixed $data
401 public function __construct($data = [])
403 if (is_array($data)) {
404 if (isset($data['masterIdentifier'])) {
405 $this->setMasterIdentifier($data['masterIdentifier']);
407 if (isset($data['identifier'])) {
408 if (is_array($data['identifier'])) {
409 foreach ($data['identifier'] as $d) {
410 $this->addIdentifier($d);
412 } else {
413 throw new \InvalidArgumentException('"identifier" must be array of objects or null, ' . gettype($data['identifier']) . ' seen.');
416 if (isset($data['status'])) {
417 $this->setStatus($data['status']);
419 if (isset($data['type'])) {
420 $this->setType($data['type']);
422 if (isset($data['subject'])) {
423 $this->setSubject($data['subject']);
425 if (isset($data['created'])) {
426 $this->setCreated($data['created']);
428 if (isset($data['author'])) {
429 if (is_array($data['author'])) {
430 foreach ($data['author'] as $d) {
431 $this->addAuthor($d);
433 } else {
434 throw new \InvalidArgumentException('"author" must be array of objects or null, ' . gettype($data['author']) . ' seen.');
437 if (isset($data['recipient'])) {
438 if (is_array($data['recipient'])) {
439 foreach ($data['recipient'] as $d) {
440 $this->addRecipient($d);
442 } else {
443 throw new \InvalidArgumentException('"recipient" must be array of objects or null, ' . gettype($data['recipient']) . ' seen.');
446 if (isset($data['source'])) {
447 $this->setSource($data['source']);
449 if (isset($data['description'])) {
450 $this->setDescription($data['description']);
452 if (isset($data['content'])) {
453 if (is_array($data['content'])) {
454 foreach ($data['content'] as $d) {
455 $this->addContent($d);
457 } else {
458 throw new \InvalidArgumentException('"content" must be array of objects or null, ' . gettype($data['content']) . ' seen.');
461 if (isset($data['related'])) {
462 if (is_array($data['related'])) {
463 foreach ($data['related'] as $d) {
464 $this->addRelated($d);
466 } else {
467 throw new \InvalidArgumentException('"related" must be array of objects or null, ' . gettype($data['related']) . ' seen.');
470 } elseif (null !== $data) {
471 throw new \InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
473 parent::__construct($data);
477 * @return string
479 public function __toString()
481 return $this->get_fhirElementName();
485 * @return array
487 public function jsonSerialize(): mixed
489 $json = parent::jsonSerialize();
490 $json['resourceType'] = $this->_fhirElementName;
491 if (isset($this->masterIdentifier)) {
492 $json['masterIdentifier'] = $this->masterIdentifier;
494 if (0 < count($this->identifier)) {
495 $json['identifier'] = [];
496 foreach ($this->identifier as $identifier) {
497 $json['identifier'][] = $identifier;
500 if (isset($this->status)) {
501 $json['status'] = $this->status;
503 if (isset($this->type)) {
504 $json['type'] = $this->type;
506 if (isset($this->subject)) {
507 $json['subject'] = $this->subject;
509 if (isset($this->created)) {
510 $json['created'] = $this->created;
512 if (0 < count($this->author)) {
513 $json['author'] = [];
514 foreach ($this->author as $author) {
515 $json['author'][] = $author;
518 if (0 < count($this->recipient)) {
519 $json['recipient'] = [];
520 foreach ($this->recipient as $recipient) {
521 $json['recipient'][] = $recipient;
524 if (isset($this->source)) {
525 $json['source'] = $this->source;
527 if (isset($this->description)) {
528 $json['description'] = $this->description;
530 if (0 < count($this->content)) {
531 $json['content'] = [];
532 foreach ($this->content as $content) {
533 $json['content'][] = $content;
536 if (0 < count($this->related)) {
537 $json['related'] = [];
538 foreach ($this->related as $related) {
539 $json['related'][] = $related;
542 return $json;
546 * @param boolean $returnSXE
547 * @param \SimpleXMLElement $sxe
548 * @return string|\SimpleXMLElement
550 public function xmlSerialize($returnSXE = false, $sxe = null)
552 if (null === $sxe) {
553 $sxe = new \SimpleXMLElement('<DocumentManifest xmlns="http://hl7.org/fhir"></DocumentManifest>');
555 parent::xmlSerialize(true, $sxe);
556 if (isset($this->masterIdentifier)) {
557 $this->masterIdentifier->xmlSerialize(true, $sxe->addChild('masterIdentifier'));
559 if (0 < count($this->identifier)) {
560 foreach ($this->identifier as $identifier) {
561 $identifier->xmlSerialize(true, $sxe->addChild('identifier'));
564 if (isset($this->status)) {
565 $this->status->xmlSerialize(true, $sxe->addChild('status'));
567 if (isset($this->type)) {
568 $this->type->xmlSerialize(true, $sxe->addChild('type'));
570 if (isset($this->subject)) {
571 $this->subject->xmlSerialize(true, $sxe->addChild('subject'));
573 if (isset($this->created)) {
574 $this->created->xmlSerialize(true, $sxe->addChild('created'));
576 if (0 < count($this->author)) {
577 foreach ($this->author as $author) {
578 $author->xmlSerialize(true, $sxe->addChild('author'));
581 if (0 < count($this->recipient)) {
582 foreach ($this->recipient as $recipient) {
583 $recipient->xmlSerialize(true, $sxe->addChild('recipient'));
586 if (isset($this->source)) {
587 $this->source->xmlSerialize(true, $sxe->addChild('source'));
589 if (isset($this->description)) {
590 $this->description->xmlSerialize(true, $sxe->addChild('description'));
592 if (0 < count($this->content)) {
593 foreach ($this->content as $content) {
594 $content->xmlSerialize(true, $sxe->addChild('content'));
597 if (0 < count($this->related)) {
598 foreach ($this->related as $related) {
599 $related->xmlSerialize(true, $sxe->addChild('related'));
602 if ($returnSXE) {
603 return $sxe;
605 return $sxe->saveXML();