Move to FHIR current R4 release (#2482)
[openemr.git] / src / FHIR / R4 / FHIRElement / FHIRSpecimenStatus.php
blob6b3a8006402c6edcbc7340bed8fa95482226f48f
1 <?php namespace OpenEMR\FHIR\R4\FHIRElement;
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/)
6 *
7 * Class creation date: June 14th, 2019
8 *
9 * PHPFHIR Copyright:
11 * Copyright 2016-2017 Daniel Carbone (daniel.p.carbone@gmail.com)
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
26 * FHIR Copyright Notice:
28 * Copyright (c) 2011+, HL7, Inc.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without modification,
32 * are permitted provided that the following conditions are met:
34 * * Redistributions of source code must retain the above copyright notice, this
35 * list of conditions and the following disclaimer.
36 * * Redistributions in binary form must reproduce the above copyright notice,
37 * this list of conditions and the following disclaimer in the documentation
38 * and/or other materials provided with the distribution.
39 * * Neither the name of HL7 nor the names of its contributors may be used to
40 * endorse or promote products derived from this software without specific
41 * prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
45 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
46 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
47 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
49 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
50 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
52 * POSSIBILITY OF SUCH DAMAGE.
55 * Generated on Thu, Dec 27, 2018 22:37+1100 for FHIR v4.0.0
57 * Note: the schemas & schematrons do not contain all of the rules about what makes resources
58 * valid. Implementers will still need to be familiar with the content of the specification and with
59 * any profiles that apply to the resources in order to make a conformant implementation.
63 use OpenEMR\FHIR\R4\FHIRElement;
65 /**
66 * Codes providing the status/availability of a specimen.
67 * If the element is present, it must have either a @value, an @id, or extensions
69 class FHIRSpecimenStatus extends FHIRElement implements \JsonSerializable
71 /**
72 * @var string
74 public $value = null;
76 /**
77 * @var string
79 private $_fhirElementName = 'SpecimenStatus';
81 /**
82 * @return string
84 public function getValue()
86 return $this->value;
89 /**
90 * @param string $value
91 * @return $this
93 public function setValue($value)
95 $this->value = $value;
96 return $this;
99 /**
100 * @return string
102 public function get_fhirElementName()
104 return $this->_fhirElementName;
108 * @param mixed $data
110 public function __construct($data = [])
112 if (is_array($data)) {
113 if (isset($data['value'])) {
114 $this->setValue($data['value']);
116 } else if (null !== $data) {
117 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
119 parent::__construct($data);
123 * @return string
125 public function __toString()
127 return (string)$this->getValue();
131 * @return mixed
133 public function jsonSerialize()
135 return $this->value;
139 * @param boolean $returnSXE
140 * @param \SimpleXMLElement $sxe
141 * @return string|\SimpleXMLElement
143 public function xmlSerialize($returnSXE = false, $sxe = null)
145 if (null === $sxe) {
146 $sxe = new \SimpleXMLElement('<SpecimenStatus xmlns="http://hl7.org/fhir"></SpecimenStatus>');
148 $sxe->addAttribute('value', $this->value);
149 if ($returnSXE) {
150 return $sxe;
152 return $sxe->saveXML();