1 <?php
namespace HL7\FHIR\STU3\FHIRResource\FHIRCommunicationRequest
;
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 * 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
18 * The device, practitioner, etc. who initiated the request.
19 * @var \HL7\FHIR\STU3\FHIRElement\FHIRReference
24 * The organization the device or practitioner was acting on behalf of.
25 * @var \HL7\FHIR\STU3\FHIRElement\FHIRReference
27 public $onBehalfOf = null;
32 private $_fhirElementName = 'CommunicationRequest.Requester';
35 * The device, practitioner, etc. who initiated the request.
36 * @return \HL7\FHIR\STU3\FHIRElement\FHIRReference
38 public function getAgent()
44 * The device, practitioner, etc. who initiated the request.
45 * @param \HL7\FHIR\STU3\FHIRElement\FHIRReference $agent
48 public function setAgent($agent)
50 $this->agent
= $agent;
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
;
64 * The organization the device or practitioner was acting on behalf of.
65 * @param \HL7\FHIR\STU3\FHIRElement\FHIRReference $onBehalfOf
68 public function setOnBehalfOf($onBehalfOf)
70 $this->onBehalfOf
= $onBehalfOf;
77 public function get_fhirElementName()
79 return $this->_fhirElementName
;
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);
103 public function __toString()
105 return $this->get_fhirElementName();
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
;
124 * @param boolean $returnSXE
125 * @param \SimpleXMLElement $sxe
126 * @return string|\SimpleXMLElement
128 public function xmlSerialize($returnSXE = false, $sxe = null)
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'));
143 return $sxe->saveXML();