1 <?php
namespace HL7\FHIR\STU3\FHIRResource\FHIRPatient
;
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\FHIRElement\FHIRBackboneElement
;
13 * Demographics and other administrative information about an individual or animal receiving care or other health-related services.
15 class FHIRPatientCommunication
extends FHIRBackboneElement
implements \JsonSerializable
18 * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.
19 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
21 public $language = null;
24 * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).
25 * @var \HL7\FHIR\STU3\FHIRElement\FHIRBoolean
27 public $preferred = null;
32 private $_fhirElementName = 'Patient.Communication';
35 * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.
36 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
38 public function getLanguage()
40 return $this->language
;
44 * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.
45 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $language
48 public function setLanguage($language)
50 $this->language
= $language;
55 * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).
56 * @return \HL7\FHIR\STU3\FHIRElement\FHIRBoolean
58 public function getPreferred()
60 return $this->preferred
;
64 * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).
65 * @param \HL7\FHIR\STU3\FHIRElement\FHIRBoolean $preferred
68 public function setPreferred($preferred)
70 $this->preferred
= $preferred;
77 public function get_fhirElementName()
79 return $this->_fhirElementName
;
85 public function __construct($data = [])
87 if (is_array($data)) {
88 if (isset($data['language'])) {
89 $this->setLanguage($data['language']);
91 if (isset($data['preferred'])) {
92 $this->setPreferred($data['preferred']);
94 } else if (null !== $data) {
95 throw new \
InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
97 parent
::__construct($data);
103 public function __toString()
105 return $this->get_fhirElementName();
111 public function jsonSerialize()
113 $json = parent
::jsonSerialize();
114 if (isset($this->language
)) {
115 $json['language'] = $this->language
;
117 if (isset($this->preferred
)) {
118 $json['preferred'] = $this->preferred
;
124 * @param boolean $returnSXE
125 * @param \SimpleXMLElement $sxe
126 * @return string|\SimpleXMLElement
128 public function xmlSerialize($returnSXE = false, $sxe = null)
131 $sxe = new \
SimpleXMLElement('<PatientCommunication xmlns="http://hl7.org/fhir"></PatientCommunication>');
133 parent
::xmlSerialize(true, $sxe);
134 if (isset($this->language
)) {
135 $this->language
->xmlSerialize(true, $sxe->addChild('language'));
137 if (isset($this->preferred
)) {
138 $this->preferred
->xmlSerialize(true, $sxe->addChild('preferred'));
143 return $sxe->saveXML();