fixes: mostly php 8.3 fixes to prepare for next release (#6935)
[openemr.git] / src / FHIR / R4 / FHIRDomainResource / FHIRImmunizationEvaluation.php
blobcd1db549af26f8e7da48177eb3adfd405d075af9
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 * Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those recommendations.
69 * If the element is present, it must have either a @value, an @id, or extensions
71 class FHIRImmunizationEvaluation extends FHIRDomainResource implements \JsonSerializable
73 /**
74 * A unique identifier assigned to this immunization evaluation record.
75 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier[]
77 public $identifier = [];
79 /**
80 * Indicates the current status of the evaluation of the vaccination administration event.
81 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRImmunizationEvaluationStatusCodes
83 public $status = null;
85 /**
86 * The individual for whom the evaluation is being done.
87 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
89 public $patient = null;
91 /**
92 * The date the evaluation of the vaccine administration event was performed.
93 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
95 public $date = null;
97 /**
98 * Indicates the authority who published the protocol (e.g. ACIP).
99 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
101 public $authority = null;
104 * The vaccine preventable disease the dose is being evaluated against.
105 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
107 public $targetDisease = null;
110 * The vaccine administration event being evaluated.
111 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
113 public $immunizationEvent = null;
116 * Indicates if the dose is valid or not valid with respect to the published recommendations.
117 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
119 public $doseStatus = null;
122 * Provides an explanation as to why the vaccine administration event is valid or not relative to the published recommendations.
123 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept[]
125 public $doseStatusReason = [];
128 * Additional information about the evaluation.
129 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
131 public $description = null;
134 * One possible path to achieve presumed immunity against a disease - within the context of an authority.
135 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
137 public $series = null;
140 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRPositiveInt
142 public $doseNumberPositiveInt = null;
145 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
147 public $doseNumberString = null;
150 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRPositiveInt
152 public $seriesDosesPositiveInt = null;
155 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
157 public $seriesDosesString = null;
160 * @var string
162 private $_fhirElementName = 'ImmunizationEvaluation';
165 * A unique identifier assigned to this immunization evaluation record.
166 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier[]
168 public function getIdentifier()
170 return $this->identifier;
174 * A unique identifier assigned to this immunization evaluation record.
175 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier $identifier
176 * @return $this
178 public function addIdentifier($identifier)
180 $this->identifier[] = $identifier;
181 return $this;
185 * Indicates the current status of the evaluation of the vaccination administration event.
186 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRImmunizationEvaluationStatusCodes
188 public function getStatus()
190 return $this->status;
194 * Indicates the current status of the evaluation of the vaccination administration event.
195 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRImmunizationEvaluationStatusCodes $status
196 * @return $this
198 public function setStatus($status)
200 $this->status = $status;
201 return $this;
205 * The individual for whom the evaluation is being done.
206 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
208 public function getPatient()
210 return $this->patient;
214 * The individual for whom the evaluation is being done.
215 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $patient
216 * @return $this
218 public function setPatient($patient)
220 $this->patient = $patient;
221 return $this;
225 * The date the evaluation of the vaccine administration event was performed.
226 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
228 public function getDate()
230 return $this->date;
234 * The date the evaluation of the vaccine administration event was performed.
235 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime $date
236 * @return $this
238 public function setDate($date)
240 $this->date = $date;
241 return $this;
245 * Indicates the authority who published the protocol (e.g. ACIP).
246 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
248 public function getAuthority()
250 return $this->authority;
254 * Indicates the authority who published the protocol (e.g. ACIP).
255 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $authority
256 * @return $this
258 public function setAuthority($authority)
260 $this->authority = $authority;
261 return $this;
265 * The vaccine preventable disease the dose is being evaluated against.
266 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
268 public function getTargetDisease()
270 return $this->targetDisease;
274 * The vaccine preventable disease the dose is being evaluated against.
275 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $targetDisease
276 * @return $this
278 public function setTargetDisease($targetDisease)
280 $this->targetDisease = $targetDisease;
281 return $this;
285 * The vaccine administration event being evaluated.
286 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
288 public function getImmunizationEvent()
290 return $this->immunizationEvent;
294 * The vaccine administration event being evaluated.
295 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $immunizationEvent
296 * @return $this
298 public function setImmunizationEvent($immunizationEvent)
300 $this->immunizationEvent = $immunizationEvent;
301 return $this;
305 * Indicates if the dose is valid or not valid with respect to the published recommendations.
306 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
308 public function getDoseStatus()
310 return $this->doseStatus;
314 * Indicates if the dose is valid or not valid with respect to the published recommendations.
315 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $doseStatus
316 * @return $this
318 public function setDoseStatus($doseStatus)
320 $this->doseStatus = $doseStatus;
321 return $this;
325 * Provides an explanation as to why the vaccine administration event is valid or not relative to the published recommendations.
326 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept[]
328 public function getDoseStatusReason()
330 return $this->doseStatusReason;
334 * Provides an explanation as to why the vaccine administration event is valid or not relative to the published recommendations.
335 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $doseStatusReason
336 * @return $this
338 public function addDoseStatusReason($doseStatusReason)
340 $this->doseStatusReason[] = $doseStatusReason;
341 return $this;
345 * Additional information about the evaluation.
346 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
348 public function getDescription()
350 return $this->description;
354 * Additional information about the evaluation.
355 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $description
356 * @return $this
358 public function setDescription($description)
360 $this->description = $description;
361 return $this;
365 * One possible path to achieve presumed immunity against a disease - within the context of an authority.
366 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
368 public function getSeries()
370 return $this->series;
374 * One possible path to achieve presumed immunity against a disease - within the context of an authority.
375 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $series
376 * @return $this
378 public function setSeries($series)
380 $this->series = $series;
381 return $this;
385 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRPositiveInt
387 public function getDoseNumberPositiveInt()
389 return $this->doseNumberPositiveInt;
393 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRPositiveInt $doseNumberPositiveInt
394 * @return $this
396 public function setDoseNumberPositiveInt($doseNumberPositiveInt)
398 $this->doseNumberPositiveInt = $doseNumberPositiveInt;
399 return $this;
403 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
405 public function getDoseNumberString()
407 return $this->doseNumberString;
411 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $doseNumberString
412 * @return $this
414 public function setDoseNumberString($doseNumberString)
416 $this->doseNumberString = $doseNumberString;
417 return $this;
421 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRPositiveInt
423 public function getSeriesDosesPositiveInt()
425 return $this->seriesDosesPositiveInt;
429 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRPositiveInt $seriesDosesPositiveInt
430 * @return $this
432 public function setSeriesDosesPositiveInt($seriesDosesPositiveInt)
434 $this->seriesDosesPositiveInt = $seriesDosesPositiveInt;
435 return $this;
439 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
441 public function getSeriesDosesString()
443 return $this->seriesDosesString;
447 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $seriesDosesString
448 * @return $this
450 public function setSeriesDosesString($seriesDosesString)
452 $this->seriesDosesString = $seriesDosesString;
453 return $this;
457 * @return string
459 public function get_fhirElementName()
461 return $this->_fhirElementName;
465 * @param mixed $data
467 public function __construct($data = [])
469 if (is_array($data)) {
470 if (isset($data['identifier'])) {
471 if (is_array($data['identifier'])) {
472 foreach ($data['identifier'] as $d) {
473 $this->addIdentifier($d);
475 } else {
476 throw new \InvalidArgumentException('"identifier" must be array of objects or null, ' . gettype($data['identifier']) . ' seen.');
479 if (isset($data['status'])) {
480 $this->setStatus($data['status']);
482 if (isset($data['patient'])) {
483 $this->setPatient($data['patient']);
485 if (isset($data['date'])) {
486 $this->setDate($data['date']);
488 if (isset($data['authority'])) {
489 $this->setAuthority($data['authority']);
491 if (isset($data['targetDisease'])) {
492 $this->setTargetDisease($data['targetDisease']);
494 if (isset($data['immunizationEvent'])) {
495 $this->setImmunizationEvent($data['immunizationEvent']);
497 if (isset($data['doseStatus'])) {
498 $this->setDoseStatus($data['doseStatus']);
500 if (isset($data['doseStatusReason'])) {
501 if (is_array($data['doseStatusReason'])) {
502 foreach ($data['doseStatusReason'] as $d) {
503 $this->addDoseStatusReason($d);
505 } else {
506 throw new \InvalidArgumentException('"doseStatusReason" must be array of objects or null, ' . gettype($data['doseStatusReason']) . ' seen.');
509 if (isset($data['description'])) {
510 $this->setDescription($data['description']);
512 if (isset($data['series'])) {
513 $this->setSeries($data['series']);
515 if (isset($data['doseNumberPositiveInt'])) {
516 $this->setDoseNumberPositiveInt($data['doseNumberPositiveInt']);
518 if (isset($data['doseNumberString'])) {
519 $this->setDoseNumberString($data['doseNumberString']);
521 if (isset($data['seriesDosesPositiveInt'])) {
522 $this->setSeriesDosesPositiveInt($data['seriesDosesPositiveInt']);
524 if (isset($data['seriesDosesString'])) {
525 $this->setSeriesDosesString($data['seriesDosesString']);
527 } elseif (null !== $data) {
528 throw new \InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
530 parent::__construct($data);
534 * @return string
536 public function __toString()
538 return $this->get_fhirElementName();
542 * @return array
544 public function jsonSerialize(): mixed
546 $json = parent::jsonSerialize();
547 $json['resourceType'] = $this->_fhirElementName;
548 if (0 < count($this->identifier)) {
549 $json['identifier'] = [];
550 foreach ($this->identifier as $identifier) {
551 $json['identifier'][] = $identifier;
554 if (isset($this->status)) {
555 $json['status'] = $this->status;
557 if (isset($this->patient)) {
558 $json['patient'] = $this->patient;
560 if (isset($this->date)) {
561 $json['date'] = $this->date;
563 if (isset($this->authority)) {
564 $json['authority'] = $this->authority;
566 if (isset($this->targetDisease)) {
567 $json['targetDisease'] = $this->targetDisease;
569 if (isset($this->immunizationEvent)) {
570 $json['immunizationEvent'] = $this->immunizationEvent;
572 if (isset($this->doseStatus)) {
573 $json['doseStatus'] = $this->doseStatus;
575 if (0 < count($this->doseStatusReason)) {
576 $json['doseStatusReason'] = [];
577 foreach ($this->doseStatusReason as $doseStatusReason) {
578 $json['doseStatusReason'][] = $doseStatusReason;
581 if (isset($this->description)) {
582 $json['description'] = $this->description;
584 if (isset($this->series)) {
585 $json['series'] = $this->series;
587 if (isset($this->doseNumberPositiveInt)) {
588 $json['doseNumberPositiveInt'] = $this->doseNumberPositiveInt;
590 if (isset($this->doseNumberString)) {
591 $json['doseNumberString'] = $this->doseNumberString;
593 if (isset($this->seriesDosesPositiveInt)) {
594 $json['seriesDosesPositiveInt'] = $this->seriesDosesPositiveInt;
596 if (isset($this->seriesDosesString)) {
597 $json['seriesDosesString'] = $this->seriesDosesString;
599 return $json;
603 * @param boolean $returnSXE
604 * @param \SimpleXMLElement $sxe
605 * @return string|\SimpleXMLElement
607 public function xmlSerialize($returnSXE = false, $sxe = null)
609 if (null === $sxe) {
610 $sxe = new \SimpleXMLElement('<ImmunizationEvaluation xmlns="http://hl7.org/fhir"></ImmunizationEvaluation>');
612 parent::xmlSerialize(true, $sxe);
613 if (0 < count($this->identifier)) {
614 foreach ($this->identifier as $identifier) {
615 $identifier->xmlSerialize(true, $sxe->addChild('identifier'));
618 if (isset($this->status)) {
619 $this->status->xmlSerialize(true, $sxe->addChild('status'));
621 if (isset($this->patient)) {
622 $this->patient->xmlSerialize(true, $sxe->addChild('patient'));
624 if (isset($this->date)) {
625 $this->date->xmlSerialize(true, $sxe->addChild('date'));
627 if (isset($this->authority)) {
628 $this->authority->xmlSerialize(true, $sxe->addChild('authority'));
630 if (isset($this->targetDisease)) {
631 $this->targetDisease->xmlSerialize(true, $sxe->addChild('targetDisease'));
633 if (isset($this->immunizationEvent)) {
634 $this->immunizationEvent->xmlSerialize(true, $sxe->addChild('immunizationEvent'));
636 if (isset($this->doseStatus)) {
637 $this->doseStatus->xmlSerialize(true, $sxe->addChild('doseStatus'));
639 if (0 < count($this->doseStatusReason)) {
640 foreach ($this->doseStatusReason as $doseStatusReason) {
641 $doseStatusReason->xmlSerialize(true, $sxe->addChild('doseStatusReason'));
644 if (isset($this->description)) {
645 $this->description->xmlSerialize(true, $sxe->addChild('description'));
647 if (isset($this->series)) {
648 $this->series->xmlSerialize(true, $sxe->addChild('series'));
650 if (isset($this->doseNumberPositiveInt)) {
651 $this->doseNumberPositiveInt->xmlSerialize(true, $sxe->addChild('doseNumberPositiveInt'));
653 if (isset($this->doseNumberString)) {
654 $this->doseNumberString->xmlSerialize(true, $sxe->addChild('doseNumberString'));
656 if (isset($this->seriesDosesPositiveInt)) {
657 $this->seriesDosesPositiveInt->xmlSerialize(true, $sxe->addChild('seriesDosesPositiveInt'));
659 if (isset($this->seriesDosesString)) {
660 $this->seriesDosesString->xmlSerialize(true, $sxe->addChild('seriesDosesString'));
662 if ($returnSXE) {
663 return $sxe;
665 return $sxe->saveXML();