Phase 1 FHIR on PHP- Provider Client and implement classes. (#1422)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRResource / FHIRCommunicationRequest / FHIRCommunicationRequestRequester.php
blob074580596991bf329e4b4061d6ab4c0fc98b239d
1 <?php namespace HL7\FHIR\STU3\FHIRResource\FHIRCommunicationRequest;
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/)
7 * Class creation date: February 10th, 2018
8 */
10 use HL7\FHIR\STU3\FHIRElement\FHIRBackboneElement;
12 /**
13 * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.
15 class FHIRCommunicationRequestRequester extends FHIRBackboneElement implements \JsonSerializable
17 /**
18 * The device, practitioner, etc. who initiated the request.
19 * @var \HL7\FHIR\STU3\FHIRElement\FHIRReference
21 public $agent = null;
23 /**
24 * The organization the device or practitioner was acting on behalf of.
25 * @var \HL7\FHIR\STU3\FHIRElement\FHIRReference
27 public $onBehalfOf = null;
29 /**
30 * @var string
32 private $_fhirElementName = 'CommunicationRequest.Requester';
34 /**
35 * The device, practitioner, etc. who initiated the request.
36 * @return \HL7\FHIR\STU3\FHIRElement\FHIRReference
38 public function getAgent()
40 return $this->agent;
43 /**
44 * The device, practitioner, etc. who initiated the request.
45 * @param \HL7\FHIR\STU3\FHIRElement\FHIRReference $agent
46 * @return $this
48 public function setAgent($agent)
50 $this->agent = $agent;
51 return $this;
54 /**
55 * The organization the device or practitioner was acting on behalf of.
56 * @return \HL7\FHIR\STU3\FHIRElement\FHIRReference
58 public function getOnBehalfOf()
60 return $this->onBehalfOf;
63 /**
64 * The organization the device or practitioner was acting on behalf of.
65 * @param \HL7\FHIR\STU3\FHIRElement\FHIRReference $onBehalfOf
66 * @return $this
68 public function setOnBehalfOf($onBehalfOf)
70 $this->onBehalfOf = $onBehalfOf;
71 return $this;
74 /**
75 * @return string
77 public function get_fhirElementName()
79 return $this->_fhirElementName;
82 /**
83 * @param mixed $data
85 public function __construct($data = [])
87 if (is_array($data)) {
88 if (isset($data['agent'])) {
89 $this->setAgent($data['agent']);
91 if (isset($data['onBehalfOf'])) {
92 $this->setOnBehalfOf($data['onBehalfOf']);
94 } else if (null !== $data) {
95 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
97 parent::__construct($data);
101 * @return string
103 public function __toString()
105 return $this->get_fhirElementName();
109 * @return array
111 public function jsonSerialize()
113 $json = parent::jsonSerialize();
114 if (isset($this->agent)) {
115 $json['agent'] = $this->agent;
117 if (isset($this->onBehalfOf)) {
118 $json['onBehalfOf'] = $this->onBehalfOf;
120 return $json;
124 * @param boolean $returnSXE
125 * @param \SimpleXMLElement $sxe
126 * @return string|\SimpleXMLElement
128 public function xmlSerialize($returnSXE = false, $sxe = null)
130 if (null === $sxe) {
131 $sxe = new \SimpleXMLElement('<CommunicationRequestRequester xmlns="http://hl7.org/fhir"></CommunicationRequestRequester>');
133 parent::xmlSerialize(true, $sxe);
134 if (isset($this->agent)) {
135 $this->agent->xmlSerialize(true, $sxe->addChild('agent'));
137 if (isset($this->onBehalfOf)) {
138 $this->onBehalfOf->xmlSerialize(true, $sxe->addChild('onBehalfOf'));
140 if ($returnSXE) {
141 return $sxe;
143 return $sxe->saveXML();