Phase 1 FHIR on PHP- Provider Client and implement classes. (#1422)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRResource / FHIRSpecimen / FHIRSpecimenCollection.php
blob736fdce02ae9c04fd4cde551ace6d7160976af6d
1 <?php namespace HL7\FHIR\STU3\FHIRResource\FHIRSpecimen;
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
13 use HL7\FHIR\STU3\FHIRElement\FHIRBackboneElement;
15 /**
16 * A sample to be used for analysis.
18 class FHIRSpecimenCollection extends FHIRBackboneElement implements \JsonSerializable
20 /**
21 * Person who collected the specimen.
22 * @var \HL7\FHIR\STU3\FHIRElement\FHIRReference
24 public $collector = null;
26 /**
27 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDateTime
29 public $collectedDateTime = null;
31 /**
32 * @var \HL7\FHIR\STU3\FHIRElement\FHIRPeriod
34 public $collectedPeriod = null;
36 /**
37 * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.
38 * @var \HL7\FHIR\STU3\FHIRElement\FHIRQuantity
40 public $quantity = null;
42 /**
43 * A coded value specifying the technique that is used to perform the procedure.
44 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
46 public $method = null;
48 /**
49 * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.
50 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
52 public $bodySite = null;
54 /**
55 * @var string
57 private $_fhirElementName = 'Specimen.Collection';
59 /**
60 * Person who collected the specimen.
61 * @return \HL7\FHIR\STU3\FHIRElement\FHIRReference
63 public function getCollector()
65 return $this->collector;
68 /**
69 * Person who collected the specimen.
70 * @param \HL7\FHIR\STU3\FHIRElement\FHIRReference $collector
71 * @return $this
73 public function setCollector($collector)
75 $this->collector = $collector;
76 return $this;
79 /**
80 * @return \HL7\FHIR\STU3\FHIRElement\FHIRDateTime
82 public function getCollectedDateTime()
84 return $this->collectedDateTime;
87 /**
88 * @param \HL7\FHIR\STU3\FHIRElement\FHIRDateTime $collectedDateTime
89 * @return $this
91 public function setCollectedDateTime($collectedDateTime)
93 $this->collectedDateTime = $collectedDateTime;
94 return $this;
97 /**
98 * @return \HL7\FHIR\STU3\FHIRElement\FHIRPeriod
100 public function getCollectedPeriod()
102 return $this->collectedPeriod;
106 * @param \HL7\FHIR\STU3\FHIRElement\FHIRPeriod $collectedPeriod
107 * @return $this
109 public function setCollectedPeriod($collectedPeriod)
111 $this->collectedPeriod = $collectedPeriod;
112 return $this;
116 * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.
117 * @return \HL7\FHIR\STU3\FHIRElement\FHIRQuantity
119 public function getQuantity()
121 return $this->quantity;
125 * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.
126 * @param \HL7\FHIR\STU3\FHIRElement\FHIRQuantity $quantity
127 * @return $this
129 public function setQuantity($quantity)
131 $this->quantity = $quantity;
132 return $this;
136 * A coded value specifying the technique that is used to perform the procedure.
137 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
139 public function getMethod()
141 return $this->method;
145 * A coded value specifying the technique that is used to perform the procedure.
146 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $method
147 * @return $this
149 public function setMethod($method)
151 $this->method = $method;
152 return $this;
156 * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.
157 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
159 public function getBodySite()
161 return $this->bodySite;
165 * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.
166 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $bodySite
167 * @return $this
169 public function setBodySite($bodySite)
171 $this->bodySite = $bodySite;
172 return $this;
176 * @return string
178 public function get_fhirElementName()
180 return $this->_fhirElementName;
184 * @param mixed $data
186 public function __construct($data = [])
188 if (is_array($data)) {
189 if (isset($data['collector'])) {
190 $this->setCollector($data['collector']);
192 if (isset($data['collectedDateTime'])) {
193 $this->setCollectedDateTime($data['collectedDateTime']);
195 if (isset($data['collectedPeriod'])) {
196 $this->setCollectedPeriod($data['collectedPeriod']);
198 if (isset($data['quantity'])) {
199 $this->setQuantity($data['quantity']);
201 if (isset($data['method'])) {
202 $this->setMethod($data['method']);
204 if (isset($data['bodySite'])) {
205 $this->setBodySite($data['bodySite']);
207 } else if (null !== $data) {
208 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
210 parent::__construct($data);
214 * @return string
216 public function __toString()
218 return $this->get_fhirElementName();
222 * @return array
224 public function jsonSerialize()
226 $json = parent::jsonSerialize();
227 if (isset($this->collector)) {
228 $json['collector'] = $this->collector;
230 if (isset($this->collectedDateTime)) {
231 $json['collectedDateTime'] = $this->collectedDateTime;
233 if (isset($this->collectedPeriod)) {
234 $json['collectedPeriod'] = $this->collectedPeriod;
236 if (isset($this->quantity)) {
237 $json['quantity'] = $this->quantity;
239 if (isset($this->method)) {
240 $json['method'] = $this->method;
242 if (isset($this->bodySite)) {
243 $json['bodySite'] = $this->bodySite;
245 return $json;
249 * @param boolean $returnSXE
250 * @param \SimpleXMLElement $sxe
251 * @return string|\SimpleXMLElement
253 public function xmlSerialize($returnSXE = false, $sxe = null)
255 if (null === $sxe) {
256 $sxe = new \SimpleXMLElement('<SpecimenCollection xmlns="http://hl7.org/fhir"></SpecimenCollection>');
258 parent::xmlSerialize(true, $sxe);
259 if (isset($this->collector)) {
260 $this->collector->xmlSerialize(true, $sxe->addChild('collector'));
262 if (isset($this->collectedDateTime)) {
263 $this->collectedDateTime->xmlSerialize(true, $sxe->addChild('collectedDateTime'));
265 if (isset($this->collectedPeriod)) {
266 $this->collectedPeriod->xmlSerialize(true, $sxe->addChild('collectedPeriod'));
268 if (isset($this->quantity)) {
269 $this->quantity->xmlSerialize(true, $sxe->addChild('quantity'));
271 if (isset($this->method)) {
272 $this->method->xmlSerialize(true, $sxe->addChild('method'));
274 if (isset($this->bodySite)) {
275 $this->bodySite->xmlSerialize(true, $sxe->addChild('bodySite'));
277 if ($returnSXE) {
278 return $sxe;
280 return $sxe->saveXML();