some fixes (#2481)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRDomainResource / FHIRPractitioner.php
blob0ce1df792f5299e08a5a35666ddf8dab5ad0d02e
1 <?php namespace HL7\FHIR\STU3\FHIRDomainResource;
3 /*!
4 * This class was generated with the PHPFHIR library (https://github.com/dcarbone/php-fhir) using
5 * class definitions from HL7 FHIR (https://www.hl7.org/fhir/)
6 *
7 * Class creation date: February 10th, 2018
8 */
10 use HL7\FHIR\STU3\FHIRResource\FHIRDomainResource;
12 /**
13 * A person who is directly or indirectly involved in the provisioning of healthcare.
14 * If the element is present, it must have either a @value, an @id, or extensions
16 class FHIRPractitioner extends FHIRDomainResource implements \JsonSerializable
18 /**
19 * An identifier that applies to this person in this role.
20 * @var \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier[]
22 public $identifier = [];
24 /**
25 * Whether this practitioner's record is in active use.
26 * @var \HL7\FHIR\STU3\FHIRElement\FHIRBoolean
28 public $active = null;
30 /**
31 * The name(s) associated with the practitioner.
32 * @var \HL7\FHIR\STU3\FHIRElement\FHIRHumanName[]
34 public $name = [];
36 /**
37 * A contact detail for the practitioner, e.g. a telephone number or an email address.
38 * @var \HL7\FHIR\STU3\FHIRElement\FHIRContactPoint[]
40 public $telecom = [];
42 /**
43 * Address(es) of the practitioner that are not role specific (typically home address).
44 Work addresses are not typically entered in this property as they are usually role dependent.
45 * @var \HL7\FHIR\STU3\FHIRElement\FHIRAddress[]
47 public $address = [];
49 /**
50 * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
51 * @var \HL7\FHIR\STU3\FHIRElement\FHIRAdministrativeGender
53 public $gender = null;
55 /**
56 * The date of birth for the practitioner.
57 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDate
59 public $birthDate = null;
61 /**
62 * Image of the person.
63 * @var \HL7\FHIR\STU3\FHIRElement\FHIRAttachment[]
65 public $photo = [];
67 /**
68 * Qualifications obtained by training and certification.
69 * @var \HL7\FHIR\STU3\FHIRResource\FHIRPractitioner\FHIRPractitionerQualification[]
71 public $qualification = [];
73 /**
74 * A language the practitioner is able to use in patient communication.
75 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept[]
77 public $communication = [];
79 /**
80 * @var string
82 private $_fhirElementName = 'Practitioner';
84 /**
85 * An identifier that applies to this person in this role.
86 * @return \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier[]
88 public function getIdentifier()
90 return $this->identifier;
93 /**
94 * An identifier that applies to this person in this role.
95 * @param \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier $identifier
96 * @return $this
98 public function addIdentifier($identifier)
100 $this->identifier[] = $identifier;
101 return $this;
105 * Whether this practitioner's record is in active use.
106 * @return \HL7\FHIR\STU3\FHIRElement\FHIRBoolean
108 public function getActive()
110 return $this->active;
114 * Whether this practitioner's record is in active use.
115 * @param \HL7\FHIR\STU3\FHIRElement\FHIRBoolean $active
116 * @return $this
118 public function setActive($active)
120 $this->active = $active;
121 return $this;
125 * The name(s) associated with the practitioner.
126 * @return \HL7\FHIR\STU3\FHIRElement\FHIRHumanName[]
128 public function getName()
130 return $this->name;
134 * The name(s) associated with the practitioner.
135 * @param \HL7\FHIR\STU3\FHIRElement\FHIRHumanName $name
136 * @return $this
138 public function addName($name)
140 $this->name[] = $name;
141 return $this;
145 * A contact detail for the practitioner, e.g. a telephone number or an email address.
146 * @return \HL7\FHIR\STU3\FHIRElement\FHIRContactPoint[]
148 public function getTelecom()
150 return $this->telecom;
154 * A contact detail for the practitioner, e.g. a telephone number or an email address.
155 * @param \HL7\FHIR\STU3\FHIRElement\FHIRContactPoint $telecom
156 * @return $this
158 public function addTelecom($telecom)
160 $this->telecom[] = $telecom;
161 return $this;
165 * Address(es) of the practitioner that are not role specific (typically home address).
166 Work addresses are not typically entered in this property as they are usually role dependent.
167 * @return \HL7\FHIR\STU3\FHIRElement\FHIRAddress[]
169 public function getAddress()
171 return $this->address;
175 * Address(es) of the practitioner that are not role specific (typically home address).
176 Work addresses are not typically entered in this property as they are usually role dependent.
177 * @param \HL7\FHIR\STU3\FHIRElement\FHIRAddress $address
178 * @return $this
180 public function addAddress($address)
182 $this->address[] = $address;
183 return $this;
187 * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
188 * @return \HL7\FHIR\STU3\FHIRElement\FHIRAdministrativeGender
190 public function getGender()
192 return $this->gender;
196 * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
197 * @param \HL7\FHIR\STU3\FHIRElement\FHIRAdministrativeGender $gender
198 * @return $this
200 public function setGender($gender)
202 $this->gender = $gender;
203 return $this;
207 * The date of birth for the practitioner.
208 * @return \HL7\FHIR\STU3\FHIRElement\FHIRDate
210 public function getBirthDate()
212 return $this->birthDate;
216 * The date of birth for the practitioner.
217 * @param \HL7\FHIR\STU3\FHIRElement\FHIRDate $birthDate
218 * @return $this
220 public function setBirthDate($birthDate)
222 $this->birthDate = $birthDate;
223 return $this;
227 * Image of the person.
228 * @return \HL7\FHIR\STU3\FHIRElement\FHIRAttachment[]
230 public function getPhoto()
232 return $this->photo;
236 * Image of the person.
237 * @param \HL7\FHIR\STU3\FHIRElement\FHIRAttachment $photo
238 * @return $this
240 public function addPhoto($photo)
242 $this->photo[] = $photo;
243 return $this;
247 * Qualifications obtained by training and certification.
248 * @return \HL7\FHIR\STU3\FHIRResource\FHIRPractitioner\FHIRPractitionerQualification[]
250 public function getQualification()
252 return $this->qualification;
256 * Qualifications obtained by training and certification.
257 * @param \HL7\FHIR\STU3\FHIRResource\FHIRPractitioner\FHIRPractitionerQualification $qualification
258 * @return $this
260 public function addQualification($qualification)
262 $this->qualification[] = $qualification;
263 return $this;
267 * A language the practitioner is able to use in patient communication.
268 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept[]
270 public function getCommunication()
272 return $this->communication;
276 * A language the practitioner is able to use in patient communication.
277 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $communication
278 * @return $this
280 public function addCommunication($communication)
282 $this->communication[] = $communication;
283 return $this;
287 * @return string
289 public function get_fhirElementName()
291 return $this->_fhirElementName;
295 * @param mixed $data
297 public function __construct($data = [])
299 if (is_array($data)) {
300 if (isset($data['identifier'])) {
301 if (is_array($data['identifier'])) {
302 foreach ($data['identifier'] as $d) {
303 $this->addIdentifier($d);
305 } else {
306 throw new \InvalidArgumentException('"identifier" must be array of objects or null, '.gettype($data['identifier']).' seen.');
309 if (isset($data['active'])) {
310 $this->setActive($data['active']);
312 if (isset($data['name'])) {
313 if (is_array($data['name'])) {
314 foreach ($data['name'] as $d) {
315 $this->addName($d);
317 } else {
318 throw new \InvalidArgumentException('"name" must be array of objects or null, '.gettype($data['name']).' seen.');
321 if (isset($data['telecom'])) {
322 if (is_array($data['telecom'])) {
323 foreach ($data['telecom'] as $d) {
324 $this->addTelecom($d);
326 } else {
327 throw new \InvalidArgumentException('"telecom" must be array of objects or null, '.gettype($data['telecom']).' seen.');
330 if (isset($data['address'])) {
331 if (is_array($data['address'])) {
332 foreach ($data['address'] as $d) {
333 $this->addAddress($d);
335 } else {
336 throw new \InvalidArgumentException('"address" must be array of objects or null, '.gettype($data['address']).' seen.');
339 if (isset($data['gender'])) {
340 $this->setGender($data['gender']);
342 if (isset($data['birthDate'])) {
343 $this->setBirthDate($data['birthDate']);
345 if (isset($data['photo'])) {
346 if (is_array($data['photo'])) {
347 foreach ($data['photo'] as $d) {
348 $this->addPhoto($d);
350 } else {
351 throw new \InvalidArgumentException('"photo" must be array of objects or null, '.gettype($data['photo']).' seen.');
354 if (isset($data['qualification'])) {
355 if (is_array($data['qualification'])) {
356 foreach ($data['qualification'] as $d) {
357 $this->addQualification($d);
359 } else {
360 throw new \InvalidArgumentException('"qualification" must be array of objects or null, '.gettype($data['qualification']).' seen.');
363 if (isset($data['communication'])) {
364 if (is_array($data['communication'])) {
365 foreach ($data['communication'] as $d) {
366 $this->addCommunication($d);
368 } else {
369 throw new \InvalidArgumentException('"communication" must be array of objects or null, '.gettype($data['communication']).' seen.');
372 } else if (null !== $data) {
373 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
375 parent::__construct($data);
379 * @return string
381 public function __toString()
383 return $this->get_fhirElementName();
387 * @return array
389 public function jsonSerialize()
391 $json = parent::jsonSerialize();
392 $json['resourceType'] = $this->_fhirElementName;
393 if (0 < count($this->identifier)) {
394 $json['identifier'] = [];
395 foreach ($this->identifier as $identifier) {
396 $json['identifier'][] = $identifier;
399 if (isset($this->active)) {
400 $json['active'] = $this->active;
402 if (0 < count($this->name)) {
403 $json['name'] = [];
404 foreach ($this->name as $name) {
405 $json['name'][] = $name;
408 if (0 < count($this->telecom)) {
409 $json['telecom'] = [];
410 foreach ($this->telecom as $telecom) {
411 $json['telecom'][] = $telecom;
414 if (0 < count($this->address)) {
415 $json['address'] = [];
416 foreach ($this->address as $address) {
417 $json['address'][] = $address;
420 if (isset($this->gender)) {
421 $json['gender'] = $this->gender;
423 if (isset($this->birthDate)) {
424 $json['birthDate'] = $this->birthDate;
426 if (0 < count($this->photo)) {
427 $json['photo'] = [];
428 foreach ($this->photo as $photo) {
429 $json['photo'][] = $photo;
432 if (0 < count($this->qualification)) {
433 $json['qualification'] = [];
434 foreach ($this->qualification as $qualification) {
435 $json['qualification'][] = $qualification;
438 if (0 < count($this->communication)) {
439 $json['communication'] = [];
440 foreach ($this->communication as $communication) {
441 $json['communication'][] = $communication;
444 return $json;
448 * @param boolean $returnSXE
449 * @param \SimpleXMLElement $sxe
450 * @return string|\SimpleXMLElement
452 public function xmlSerialize($returnSXE = false, $sxe = null)
454 if (null === $sxe) {
455 $sxe = new \SimpleXMLElement('<Practitioner xmlns="http://hl7.org/fhir"></Practitioner>');
457 parent::xmlSerialize(true, $sxe);
458 if (0 < count($this->identifier)) {
459 foreach ($this->identifier as $identifier) {
460 $identifier->xmlSerialize(true, $sxe->addChild('identifier'));
463 if (isset($this->active)) {
464 $this->active->xmlSerialize(true, $sxe->addChild('active'));
466 if (0 < count($this->name)) {
467 foreach ($this->name as $name) {
468 $name->xmlSerialize(true, $sxe->addChild('name'));
471 if (0 < count($this->telecom)) {
472 foreach ($this->telecom as $telecom) {
473 $telecom->xmlSerialize(true, $sxe->addChild('telecom'));
476 if (0 < count($this->address)) {
477 foreach ($this->address as $address) {
478 $address->xmlSerialize(true, $sxe->addChild('address'));
481 if (isset($this->gender)) {
482 $this->gender->xmlSerialize(true, $sxe->addChild('gender'));
484 if (isset($this->birthDate)) {
485 $this->birthDate->xmlSerialize(true, $sxe->addChild('birthDate'));
487 if (0 < count($this->photo)) {
488 foreach ($this->photo as $photo) {
489 $photo->xmlSerialize(true, $sxe->addChild('photo'));
492 if (0 < count($this->qualification)) {
493 foreach ($this->qualification as $qualification) {
494 $qualification->xmlSerialize(true, $sxe->addChild('qualification'));
497 if (0 < count($this->communication)) {
498 foreach ($this->communication as $communication) {
499 $communication->xmlSerialize(true, $sxe->addChild('communication'));
502 if ($returnSXE) {
503 return $sxe;
505 return $sxe->saveXML();