1 <?php
namespace HL7\FHIR\STU3\FHIRResource\FHIRSpecimen
;
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
;
16 * A sample to be used for analysis.
18 class FHIRSpecimenCollection
extends FHIRBackboneElement
implements \JsonSerializable
21 * Person who collected the specimen.
22 * @var \HL7\FHIR\STU3\FHIRElement\FHIRReference
24 public $collector = null;
27 * @var \HL7\FHIR\STU3\FHIRElement\FHIRDateTime
29 public $collectedDateTime = null;
32 * @var \HL7\FHIR\STU3\FHIRElement\FHIRPeriod
34 public $collectedPeriod = null;
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;
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;
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;
57 private $_fhirElementName = 'Specimen.Collection';
60 * Person who collected the specimen.
61 * @return \HL7\FHIR\STU3\FHIRElement\FHIRReference
63 public function getCollector()
65 return $this->collector
;
69 * Person who collected the specimen.
70 * @param \HL7\FHIR\STU3\FHIRElement\FHIRReference $collector
73 public function setCollector($collector)
75 $this->collector
= $collector;
80 * @return \HL7\FHIR\STU3\FHIRElement\FHIRDateTime
82 public function getCollectedDateTime()
84 return $this->collectedDateTime
;
88 * @param \HL7\FHIR\STU3\FHIRElement\FHIRDateTime $collectedDateTime
91 public function setCollectedDateTime($collectedDateTime)
93 $this->collectedDateTime
= $collectedDateTime;
98 * @return \HL7\FHIR\STU3\FHIRElement\FHIRPeriod
100 public function getCollectedPeriod()
102 return $this->collectedPeriod
;
106 * @param \HL7\FHIR\STU3\FHIRElement\FHIRPeriod $collectedPeriod
109 public function setCollectedPeriod($collectedPeriod)
111 $this->collectedPeriod
= $collectedPeriod;
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
129 public function setQuantity($quantity)
131 $this->quantity
= $quantity;
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
149 public function setMethod($method)
151 $this->method
= $method;
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
169 public function setBodySite($bodySite)
171 $this->bodySite
= $bodySite;
178 public function get_fhirElementName()
180 return $this->_fhirElementName
;
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);
216 public function __toString()
218 return $this->get_fhirElementName();
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
;
249 * @param boolean $returnSXE
250 * @param \SimpleXMLElement $sxe
251 * @return string|\SimpleXMLElement
253 public function xmlSerialize($returnSXE = false, $sxe = null)
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'));
280 return $sxe->saveXML();