fixes: mostly php 8.3 fixes to prepare for next release (#6935)
[openemr.git] / src / FHIR / R4 / FHIRDomainResource / FHIRFamilyMemberHistory.php
blob65d55a0392045c43fb43811d8403cc79084fb8e0
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 * Significant health conditions for a person related to the patient relevant in the context of care for the patient.
69 * If the element is present, it must have either a @value, an @id, or extensions
71 class FHIRFamilyMemberHistory extends FHIRDomainResource implements \JsonSerializable
73 /**
74 * Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
75 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier[]
77 public $identifier = [];
79 /**
80 * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
81 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCanonical[]
83 public $instantiatesCanonical = [];
85 /**
86 * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
87 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRUri[]
89 public $instantiatesUri = [];
91 /**
92 * A code specifying the status of the record of the family history of a specific family member.
93 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRFamilyHistoryStatus
95 public $status = null;
97 /**
98 * Describes why the family member's history is not available.
99 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
101 public $dataAbsentReason = null;
104 * The person who this history concerns.
105 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
107 public $patient = null;
110 * The date (and possibly time) when the family member history was recorded or last updated.
111 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
113 public $date = null;
116 * This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
117 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
119 public $name = null;
122 * The type of relationship this person has to the patient (father, mother, brother etc.).
123 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
125 public $relationship = null;
128 * The birth sex of the family member.
129 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
131 public $sex = null;
134 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRPeriod
136 public $bornPeriod = null;
139 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDate
141 public $bornDate = null;
144 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
146 public $bornString = null;
149 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity\FHIRAge
151 public $ageAge = null;
154 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRRange
156 public $ageRange = null;
159 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
161 public $ageString = null;
164 * If true, indicates that the age value specified is an estimated value.
165 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRBoolean
167 public $estimatedAge = null;
170 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRBoolean
172 public $deceasedBoolean = null;
175 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity\FHIRAge
177 public $deceasedAge = null;
180 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRRange
182 public $deceasedRange = null;
185 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDate
187 public $deceasedDate = null;
190 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
192 public $deceasedString = null;
195 * Describes why the family member history occurred in coded or textual form.
196 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept[]
198 public $reasonCode = [];
201 * Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.
202 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
204 public $reasonReference = [];
207 * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.
208 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRAnnotation[]
210 public $note = [];
213 * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.
214 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRFamilyMemberHistory\FHIRFamilyMemberHistoryCondition[]
216 public $condition = [];
219 * @var string
221 private $_fhirElementName = 'FamilyMemberHistory';
224 * Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
225 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier[]
227 public function getIdentifier()
229 return $this->identifier;
233 * Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
234 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRIdentifier $identifier
235 * @return $this
237 public function addIdentifier($identifier)
239 $this->identifier[] = $identifier;
240 return $this;
244 * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
245 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCanonical[]
247 public function getInstantiatesCanonical()
249 return $this->instantiatesCanonical;
253 * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
254 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCanonical $instantiatesCanonical
255 * @return $this
257 public function addInstantiatesCanonical($instantiatesCanonical)
259 $this->instantiatesCanonical[] = $instantiatesCanonical;
260 return $this;
264 * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
265 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRUri[]
267 public function getInstantiatesUri()
269 return $this->instantiatesUri;
273 * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.
274 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRUri $instantiatesUri
275 * @return $this
277 public function addInstantiatesUri($instantiatesUri)
279 $this->instantiatesUri[] = $instantiatesUri;
280 return $this;
284 * A code specifying the status of the record of the family history of a specific family member.
285 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRFamilyHistoryStatus
287 public function getStatus()
289 return $this->status;
293 * A code specifying the status of the record of the family history of a specific family member.
294 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRFamilyHistoryStatus $status
295 * @return $this
297 public function setStatus($status)
299 $this->status = $status;
300 return $this;
304 * Describes why the family member's history is not available.
305 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
307 public function getDataAbsentReason()
309 return $this->dataAbsentReason;
313 * Describes why the family member's history is not available.
314 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $dataAbsentReason
315 * @return $this
317 public function setDataAbsentReason($dataAbsentReason)
319 $this->dataAbsentReason = $dataAbsentReason;
320 return $this;
324 * The person who this history concerns.
325 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
327 public function getPatient()
329 return $this->patient;
333 * The person who this history concerns.
334 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $patient
335 * @return $this
337 public function setPatient($patient)
339 $this->patient = $patient;
340 return $this;
344 * The date (and possibly time) when the family member history was recorded or last updated.
345 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
347 public function getDate()
349 return $this->date;
353 * The date (and possibly time) when the family member history was recorded or last updated.
354 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime $date
355 * @return $this
357 public function setDate($date)
359 $this->date = $date;
360 return $this;
364 * This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
365 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
367 public function getName()
369 return $this->name;
373 * This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".
374 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $name
375 * @return $this
377 public function setName($name)
379 $this->name = $name;
380 return $this;
384 * The type of relationship this person has to the patient (father, mother, brother etc.).
385 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
387 public function getRelationship()
389 return $this->relationship;
393 * The type of relationship this person has to the patient (father, mother, brother etc.).
394 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $relationship
395 * @return $this
397 public function setRelationship($relationship)
399 $this->relationship = $relationship;
400 return $this;
404 * The birth sex of the family member.
405 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept
407 public function getSex()
409 return $this->sex;
413 * The birth sex of the family member.
414 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $sex
415 * @return $this
417 public function setSex($sex)
419 $this->sex = $sex;
420 return $this;
424 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRPeriod
426 public function getBornPeriod()
428 return $this->bornPeriod;
432 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRPeriod $bornPeriod
433 * @return $this
435 public function setBornPeriod($bornPeriod)
437 $this->bornPeriod = $bornPeriod;
438 return $this;
442 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDate
444 public function getBornDate()
446 return $this->bornDate;
450 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDate $bornDate
451 * @return $this
453 public function setBornDate($bornDate)
455 $this->bornDate = $bornDate;
456 return $this;
460 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
462 public function getBornString()
464 return $this->bornString;
468 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $bornString
469 * @return $this
471 public function setBornString($bornString)
473 $this->bornString = $bornString;
474 return $this;
478 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity\FHIRAge
480 public function getAgeAge()
482 return $this->ageAge;
486 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity\FHIRAge $ageAge
487 * @return $this
489 public function setAgeAge($ageAge)
491 $this->ageAge = $ageAge;
492 return $this;
496 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRRange
498 public function getAgeRange()
500 return $this->ageRange;
504 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRRange $ageRange
505 * @return $this
507 public function setAgeRange($ageRange)
509 $this->ageRange = $ageRange;
510 return $this;
514 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
516 public function getAgeString()
518 return $this->ageString;
522 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $ageString
523 * @return $this
525 public function setAgeString($ageString)
527 $this->ageString = $ageString;
528 return $this;
532 * If true, indicates that the age value specified is an estimated value.
533 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRBoolean
535 public function getEstimatedAge()
537 return $this->estimatedAge;
541 * If true, indicates that the age value specified is an estimated value.
542 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRBoolean $estimatedAge
543 * @return $this
545 public function setEstimatedAge($estimatedAge)
547 $this->estimatedAge = $estimatedAge;
548 return $this;
552 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRBoolean
554 public function getDeceasedBoolean()
556 return $this->deceasedBoolean;
560 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRBoolean $deceasedBoolean
561 * @return $this
563 public function setDeceasedBoolean($deceasedBoolean)
565 $this->deceasedBoolean = $deceasedBoolean;
566 return $this;
570 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity\FHIRAge
572 public function getDeceasedAge()
574 return $this->deceasedAge;
578 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRQuantity\FHIRAge $deceasedAge
579 * @return $this
581 public function setDeceasedAge($deceasedAge)
583 $this->deceasedAge = $deceasedAge;
584 return $this;
588 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRRange
590 public function getDeceasedRange()
592 return $this->deceasedRange;
596 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRRange $deceasedRange
597 * @return $this
599 public function setDeceasedRange($deceasedRange)
601 $this->deceasedRange = $deceasedRange;
602 return $this;
606 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDate
608 public function getDeceasedDate()
610 return $this->deceasedDate;
614 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDate $deceasedDate
615 * @return $this
617 public function setDeceasedDate($deceasedDate)
619 $this->deceasedDate = $deceasedDate;
620 return $this;
624 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
626 public function getDeceasedString()
628 return $this->deceasedString;
632 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $deceasedString
633 * @return $this
635 public function setDeceasedString($deceasedString)
637 $this->deceasedString = $deceasedString;
638 return $this;
642 * Describes why the family member history occurred in coded or textual form.
643 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept[]
645 public function getReasonCode()
647 return $this->reasonCode;
651 * Describes why the family member history occurred in coded or textual form.
652 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRCodeableConcept $reasonCode
653 * @return $this
655 public function addReasonCode($reasonCode)
657 $this->reasonCode[] = $reasonCode;
658 return $this;
662 * Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.
663 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference[]
665 public function getReasonReference()
667 return $this->reasonReference;
671 * Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.
672 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $reasonReference
673 * @return $this
675 public function addReasonReference($reasonReference)
677 $this->reasonReference[] = $reasonReference;
678 return $this;
682 * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.
683 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRAnnotation[]
685 public function getNote()
687 return $this->note;
691 * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.
692 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRAnnotation $note
693 * @return $this
695 public function addNote($note)
697 $this->note[] = $note;
698 return $this;
702 * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.
703 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRFamilyMemberHistory\FHIRFamilyMemberHistoryCondition[]
705 public function getCondition()
707 return $this->condition;
711 * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.
712 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRFamilyMemberHistory\FHIRFamilyMemberHistoryCondition $condition
713 * @return $this
715 public function addCondition($condition)
717 $this->condition[] = $condition;
718 return $this;
722 * @return string
724 public function get_fhirElementName()
726 return $this->_fhirElementName;
730 * @param mixed $data
732 public function __construct($data = [])
734 if (is_array($data)) {
735 if (isset($data['identifier'])) {
736 if (is_array($data['identifier'])) {
737 foreach ($data['identifier'] as $d) {
738 $this->addIdentifier($d);
740 } else {
741 throw new \InvalidArgumentException('"identifier" must be array of objects or null, ' . gettype($data['identifier']) . ' seen.');
744 if (isset($data['instantiatesCanonical'])) {
745 if (is_array($data['instantiatesCanonical'])) {
746 foreach ($data['instantiatesCanonical'] as $d) {
747 $this->addInstantiatesCanonical($d);
749 } else {
750 throw new \InvalidArgumentException('"instantiatesCanonical" must be array of objects or null, ' . gettype($data['instantiatesCanonical']) . ' seen.');
753 if (isset($data['instantiatesUri'])) {
754 if (is_array($data['instantiatesUri'])) {
755 foreach ($data['instantiatesUri'] as $d) {
756 $this->addInstantiatesUri($d);
758 } else {
759 throw new \InvalidArgumentException('"instantiatesUri" must be array of objects or null, ' . gettype($data['instantiatesUri']) . ' seen.');
762 if (isset($data['status'])) {
763 $this->setStatus($data['status']);
765 if (isset($data['dataAbsentReason'])) {
766 $this->setDataAbsentReason($data['dataAbsentReason']);
768 if (isset($data['patient'])) {
769 $this->setPatient($data['patient']);
771 if (isset($data['date'])) {
772 $this->setDate($data['date']);
774 if (isset($data['name'])) {
775 $this->setName($data['name']);
777 if (isset($data['relationship'])) {
778 $this->setRelationship($data['relationship']);
780 if (isset($data['sex'])) {
781 $this->setSex($data['sex']);
783 if (isset($data['bornPeriod'])) {
784 $this->setBornPeriod($data['bornPeriod']);
786 if (isset($data['bornDate'])) {
787 $this->setBornDate($data['bornDate']);
789 if (isset($data['bornString'])) {
790 $this->setBornString($data['bornString']);
792 if (isset($data['ageAge'])) {
793 $this->setAgeAge($data['ageAge']);
795 if (isset($data['ageRange'])) {
796 $this->setAgeRange($data['ageRange']);
798 if (isset($data['ageString'])) {
799 $this->setAgeString($data['ageString']);
801 if (isset($data['estimatedAge'])) {
802 $this->setEstimatedAge($data['estimatedAge']);
804 if (isset($data['deceasedBoolean'])) {
805 $this->setDeceasedBoolean($data['deceasedBoolean']);
807 if (isset($data['deceasedAge'])) {
808 $this->setDeceasedAge($data['deceasedAge']);
810 if (isset($data['deceasedRange'])) {
811 $this->setDeceasedRange($data['deceasedRange']);
813 if (isset($data['deceasedDate'])) {
814 $this->setDeceasedDate($data['deceasedDate']);
816 if (isset($data['deceasedString'])) {
817 $this->setDeceasedString($data['deceasedString']);
819 if (isset($data['reasonCode'])) {
820 if (is_array($data['reasonCode'])) {
821 foreach ($data['reasonCode'] as $d) {
822 $this->addReasonCode($d);
824 } else {
825 throw new \InvalidArgumentException('"reasonCode" must be array of objects or null, ' . gettype($data['reasonCode']) . ' seen.');
828 if (isset($data['reasonReference'])) {
829 if (is_array($data['reasonReference'])) {
830 foreach ($data['reasonReference'] as $d) {
831 $this->addReasonReference($d);
833 } else {
834 throw new \InvalidArgumentException('"reasonReference" must be array of objects or null, ' . gettype($data['reasonReference']) . ' seen.');
837 if (isset($data['note'])) {
838 if (is_array($data['note'])) {
839 foreach ($data['note'] as $d) {
840 $this->addNote($d);
842 } else {
843 throw new \InvalidArgumentException('"note" must be array of objects or null, ' . gettype($data['note']) . ' seen.');
846 if (isset($data['condition'])) {
847 if (is_array($data['condition'])) {
848 foreach ($data['condition'] as $d) {
849 $this->addCondition($d);
851 } else {
852 throw new \InvalidArgumentException('"condition" must be array of objects or null, ' . gettype($data['condition']) . ' seen.');
855 } elseif (null !== $data) {
856 throw new \InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
858 parent::__construct($data);
862 * @return string
864 public function __toString()
866 return $this->get_fhirElementName();
870 * @return array
872 public function jsonSerialize(): mixed
874 $json = parent::jsonSerialize();
875 $json['resourceType'] = $this->_fhirElementName;
876 if (0 < count($this->identifier)) {
877 $json['identifier'] = [];
878 foreach ($this->identifier as $identifier) {
879 $json['identifier'][] = $identifier;
882 if (0 < count($this->instantiatesCanonical)) {
883 $json['instantiatesCanonical'] = [];
884 foreach ($this->instantiatesCanonical as $instantiatesCanonical) {
885 $json['instantiatesCanonical'][] = $instantiatesCanonical;
888 if (0 < count($this->instantiatesUri)) {
889 $json['instantiatesUri'] = [];
890 foreach ($this->instantiatesUri as $instantiatesUri) {
891 $json['instantiatesUri'][] = $instantiatesUri;
894 if (isset($this->status)) {
895 $json['status'] = $this->status;
897 if (isset($this->dataAbsentReason)) {
898 $json['dataAbsentReason'] = $this->dataAbsentReason;
900 if (isset($this->patient)) {
901 $json['patient'] = $this->patient;
903 if (isset($this->date)) {
904 $json['date'] = $this->date;
906 if (isset($this->name)) {
907 $json['name'] = $this->name;
909 if (isset($this->relationship)) {
910 $json['relationship'] = $this->relationship;
912 if (isset($this->sex)) {
913 $json['sex'] = $this->sex;
915 if (isset($this->bornPeriod)) {
916 $json['bornPeriod'] = $this->bornPeriod;
918 if (isset($this->bornDate)) {
919 $json['bornDate'] = $this->bornDate;
921 if (isset($this->bornString)) {
922 $json['bornString'] = $this->bornString;
924 if (isset($this->ageAge)) {
925 $json['ageAge'] = $this->ageAge;
927 if (isset($this->ageRange)) {
928 $json['ageRange'] = $this->ageRange;
930 if (isset($this->ageString)) {
931 $json['ageString'] = $this->ageString;
933 if (isset($this->estimatedAge)) {
934 $json['estimatedAge'] = $this->estimatedAge;
936 if (isset($this->deceasedBoolean)) {
937 $json['deceasedBoolean'] = $this->deceasedBoolean;
939 if (isset($this->deceasedAge)) {
940 $json['deceasedAge'] = $this->deceasedAge;
942 if (isset($this->deceasedRange)) {
943 $json['deceasedRange'] = $this->deceasedRange;
945 if (isset($this->deceasedDate)) {
946 $json['deceasedDate'] = $this->deceasedDate;
948 if (isset($this->deceasedString)) {
949 $json['deceasedString'] = $this->deceasedString;
951 if (0 < count($this->reasonCode)) {
952 $json['reasonCode'] = [];
953 foreach ($this->reasonCode as $reasonCode) {
954 $json['reasonCode'][] = $reasonCode;
957 if (0 < count($this->reasonReference)) {
958 $json['reasonReference'] = [];
959 foreach ($this->reasonReference as $reasonReference) {
960 $json['reasonReference'][] = $reasonReference;
963 if (0 < count($this->note)) {
964 $json['note'] = [];
965 foreach ($this->note as $note) {
966 $json['note'][] = $note;
969 if (0 < count($this->condition)) {
970 $json['condition'] = [];
971 foreach ($this->condition as $condition) {
972 $json['condition'][] = $condition;
975 return $json;
979 * @param boolean $returnSXE
980 * @param \SimpleXMLElement $sxe
981 * @return string|\SimpleXMLElement
983 public function xmlSerialize($returnSXE = false, $sxe = null)
985 if (null === $sxe) {
986 $sxe = new \SimpleXMLElement('<FamilyMemberHistory xmlns="http://hl7.org/fhir"></FamilyMemberHistory>');
988 parent::xmlSerialize(true, $sxe);
989 if (0 < count($this->identifier)) {
990 foreach ($this->identifier as $identifier) {
991 $identifier->xmlSerialize(true, $sxe->addChild('identifier'));
994 if (0 < count($this->instantiatesCanonical)) {
995 foreach ($this->instantiatesCanonical as $instantiatesCanonical) {
996 $instantiatesCanonical->xmlSerialize(true, $sxe->addChild('instantiatesCanonical'));
999 if (0 < count($this->instantiatesUri)) {
1000 foreach ($this->instantiatesUri as $instantiatesUri) {
1001 $instantiatesUri->xmlSerialize(true, $sxe->addChild('instantiatesUri'));
1004 if (isset($this->status)) {
1005 $this->status->xmlSerialize(true, $sxe->addChild('status'));
1007 if (isset($this->dataAbsentReason)) {
1008 $this->dataAbsentReason->xmlSerialize(true, $sxe->addChild('dataAbsentReason'));
1010 if (isset($this->patient)) {
1011 $this->patient->xmlSerialize(true, $sxe->addChild('patient'));
1013 if (isset($this->date)) {
1014 $this->date->xmlSerialize(true, $sxe->addChild('date'));
1016 if (isset($this->name)) {
1017 $this->name->xmlSerialize(true, $sxe->addChild('name'));
1019 if (isset($this->relationship)) {
1020 $this->relationship->xmlSerialize(true, $sxe->addChild('relationship'));
1022 if (isset($this->sex)) {
1023 $this->sex->xmlSerialize(true, $sxe->addChild('sex'));
1025 if (isset($this->bornPeriod)) {
1026 $this->bornPeriod->xmlSerialize(true, $sxe->addChild('bornPeriod'));
1028 if (isset($this->bornDate)) {
1029 $this->bornDate->xmlSerialize(true, $sxe->addChild('bornDate'));
1031 if (isset($this->bornString)) {
1032 $this->bornString->xmlSerialize(true, $sxe->addChild('bornString'));
1034 if (isset($this->ageAge)) {
1035 $this->ageAge->xmlSerialize(true, $sxe->addChild('ageAge'));
1037 if (isset($this->ageRange)) {
1038 $this->ageRange->xmlSerialize(true, $sxe->addChild('ageRange'));
1040 if (isset($this->ageString)) {
1041 $this->ageString->xmlSerialize(true, $sxe->addChild('ageString'));
1043 if (isset($this->estimatedAge)) {
1044 $this->estimatedAge->xmlSerialize(true, $sxe->addChild('estimatedAge'));
1046 if (isset($this->deceasedBoolean)) {
1047 $this->deceasedBoolean->xmlSerialize(true, $sxe->addChild('deceasedBoolean'));
1049 if (isset($this->deceasedAge)) {
1050 $this->deceasedAge->xmlSerialize(true, $sxe->addChild('deceasedAge'));
1052 if (isset($this->deceasedRange)) {
1053 $this->deceasedRange->xmlSerialize(true, $sxe->addChild('deceasedRange'));
1055 if (isset($this->deceasedDate)) {
1056 $this->deceasedDate->xmlSerialize(true, $sxe->addChild('deceasedDate'));
1058 if (isset($this->deceasedString)) {
1059 $this->deceasedString->xmlSerialize(true, $sxe->addChild('deceasedString'));
1061 if (0 < count($this->reasonCode)) {
1062 foreach ($this->reasonCode as $reasonCode) {
1063 $reasonCode->xmlSerialize(true, $sxe->addChild('reasonCode'));
1066 if (0 < count($this->reasonReference)) {
1067 foreach ($this->reasonReference as $reasonReference) {
1068 $reasonReference->xmlSerialize(true, $sxe->addChild('reasonReference'));
1071 if (0 < count($this->note)) {
1072 foreach ($this->note as $note) {
1073 $note->xmlSerialize(true, $sxe->addChild('note'));
1076 if (0 < count($this->condition)) {
1077 foreach ($this->condition as $condition) {
1078 $condition->xmlSerialize(true, $sxe->addChild('condition'));
1081 if ($returnSXE) {
1082 return $sxe;
1084 return $sxe->saveXML();