1 <?php
namespace HL7\FHIR\STU3\FHIRDomainResource
;
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/)
7 * Class creation date: February 10th, 2018
10 use HL7\FHIR\STU3\FHIRResource\FHIRDomainResource
;
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
19 * An identifier that applies to this person in this role.
20 * @var \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier[]
22 public $identifier = [];
25 * Whether this practitioner's record is in active use.
26 * @var \HL7\FHIR\STU3\FHIRElement\FHIRBoolean
28 public $active = null;
31 * The name(s) associated with the practitioner.
32 * @var \HL7\FHIR\STU3\FHIRElement\FHIRHumanName[]
37 * A contact detail for the practitioner, e.g. a telephone number or an email address.
38 * @var \HL7\FHIR\STU3\FHIRElement\FHIRContactPoint[]
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[]
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;
56 * The date of birth for the practitioner.
57 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDate
59 public $birthDate = null;
62 * Image of the person.
63 * @var \HL7\FHIR\STU3\FHIRElement\FHIRAttachment[]
68 * Qualifications obtained by training and certification.
69 * @var \HL7\FHIR\STU3\FHIRResource\FHIRPractitioner\FHIRPractitionerQualification[]
71 public $qualification = [];
74 * A language the practitioner is able to use in patient communication.
75 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept[]
77 public $communication = [];
82 private $_fhirElementName = 'Practitioner';
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
;
94 * An identifier that applies to this person in this role.
95 * @param \HL7\FHIR\STU3\FHIRElement\FHIRIdentifier $identifier
98 public function addIdentifier($identifier)
100 $this->identifier
[] = $identifier;
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
118 public function setActive($active)
120 $this->active
= $active;
125 * The name(s) associated with the practitioner.
126 * @return \HL7\FHIR\STU3\FHIRElement\FHIRHumanName[]
128 public function getName()
134 * The name(s) associated with the practitioner.
135 * @param \HL7\FHIR\STU3\FHIRElement\FHIRHumanName $name
138 public function addName($name)
140 $this->name
[] = $name;
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
158 public function addTelecom($telecom)
160 $this->telecom
[] = $telecom;
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
180 public function addAddress($address)
182 $this->address
[] = $address;
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
200 public function setGender($gender)
202 $this->gender
= $gender;
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
220 public function setBirthDate($birthDate)
222 $this->birthDate
= $birthDate;
227 * Image of the person.
228 * @return \HL7\FHIR\STU3\FHIRElement\FHIRAttachment[]
230 public function getPhoto()
236 * Image of the person.
237 * @param \HL7\FHIR\STU3\FHIRElement\FHIRAttachment $photo
240 public function addPhoto($photo)
242 $this->photo
[] = $photo;
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
260 public function addQualification($qualification)
262 $this->qualification
[] = $qualification;
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
280 public function addCommunication($communication)
282 $this->communication
[] = $communication;
289 public function get_fhirElementName()
291 return $this->_fhirElementName
;
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);
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) {
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);
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);
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) {
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);
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);
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);
381 public function __toString()
383 return $this->get_fhirElementName();
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
)) {
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
)) {
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;
448 * @param boolean $returnSXE
449 * @param \SimpleXMLElement $sxe
450 * @return string|\SimpleXMLElement
452 public function xmlSerialize($returnSXE = false, $sxe = null)
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'));
505 return $sxe->saveXML();