1 <?php
namespace HL7\FHIR\STU3\FHIRResource\FHIRClaim
;
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 provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.
15 class FHIRClaimDiagnosis
extends FHIRBackboneElement
implements \JsonSerializable
18 * Sequence of diagnosis which serves to provide a link.
19 * @var \HL7\FHIR\STU3\FHIRElement\FHIRPositiveInt
21 public $sequence = null;
24 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
26 public $diagnosisCodeableConcept = null;
29 * @var \HL7\FHIR\STU3\FHIRElement\FHIRReference
31 public $diagnosisReference = null;
34 * The type of the Diagnosis, for example: admitting, primary, secondary, discharge.
35 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept[]
40 * The package billing code, for example DRG, based on the assigned grouping code system.
41 * @var \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
43 public $packageCode = null;
48 private $_fhirElementName = 'Claim.Diagnosis';
51 * Sequence of diagnosis which serves to provide a link.
52 * @return \HL7\FHIR\STU3\FHIRElement\FHIRPositiveInt
54 public function getSequence()
56 return $this->sequence
;
60 * Sequence of diagnosis which serves to provide a link.
61 * @param \HL7\FHIR\STU3\FHIRElement\FHIRPositiveInt $sequence
64 public function setSequence($sequence)
66 $this->sequence
= $sequence;
71 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
73 public function getDiagnosisCodeableConcept()
75 return $this->diagnosisCodeableConcept
;
79 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $diagnosisCodeableConcept
82 public function setDiagnosisCodeableConcept($diagnosisCodeableConcept)
84 $this->diagnosisCodeableConcept
= $diagnosisCodeableConcept;
89 * @return \HL7\FHIR\STU3\FHIRElement\FHIRReference
91 public function getDiagnosisReference()
93 return $this->diagnosisReference
;
97 * @param \HL7\FHIR\STU3\FHIRElement\FHIRReference $diagnosisReference
100 public function setDiagnosisReference($diagnosisReference)
102 $this->diagnosisReference
= $diagnosisReference;
107 * The type of the Diagnosis, for example: admitting, primary, secondary, discharge.
108 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept[]
110 public function getType()
116 * The type of the Diagnosis, for example: admitting, primary, secondary, discharge.
117 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $type
120 public function addType($type)
122 $this->type
[] = $type;
127 * The package billing code, for example DRG, based on the assigned grouping code system.
128 * @return \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept
130 public function getPackageCode()
132 return $this->packageCode
;
136 * The package billing code, for example DRG, based on the assigned grouping code system.
137 * @param \HL7\FHIR\STU3\FHIRElement\FHIRCodeableConcept $packageCode
140 public function setPackageCode($packageCode)
142 $this->packageCode
= $packageCode;
149 public function get_fhirElementName()
151 return $this->_fhirElementName
;
157 public function __construct($data = [])
159 if (is_array($data)) {
160 if (isset($data['sequence'])) {
161 $this->setSequence($data['sequence']);
163 if (isset($data['diagnosisCodeableConcept'])) {
164 $this->setDiagnosisCodeableConcept($data['diagnosisCodeableConcept']);
166 if (isset($data['diagnosisReference'])) {
167 $this->setDiagnosisReference($data['diagnosisReference']);
169 if (isset($data['type'])) {
170 if (is_array($data['type'])) {
171 foreach ($data['type'] as $d) {
175 throw new \
InvalidArgumentException('"type" must be array of objects or null, '.gettype($data['type']).' seen.');
178 if (isset($data['packageCode'])) {
179 $this->setPackageCode($data['packageCode']);
181 } else if (null !== $data) {
182 throw new \
InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
184 parent
::__construct($data);
190 public function __toString()
192 return $this->get_fhirElementName();
198 public function jsonSerialize()
200 $json = parent
::jsonSerialize();
201 if (isset($this->sequence
)) {
202 $json['sequence'] = $this->sequence
;
204 if (isset($this->diagnosisCodeableConcept
)) {
205 $json['diagnosisCodeableConcept'] = $this->diagnosisCodeableConcept
;
207 if (isset($this->diagnosisReference
)) {
208 $json['diagnosisReference'] = $this->diagnosisReference
;
210 if (0 < count($this->type
)) {
212 foreach ($this->type
as $type) {
213 $json['type'][] = $type;
216 if (isset($this->packageCode
)) {
217 $json['packageCode'] = $this->packageCode
;
223 * @param boolean $returnSXE
224 * @param \SimpleXMLElement $sxe
225 * @return string|\SimpleXMLElement
227 public function xmlSerialize($returnSXE = false, $sxe = null)
230 $sxe = new \
SimpleXMLElement('<ClaimDiagnosis xmlns="http://hl7.org/fhir"></ClaimDiagnosis>');
232 parent
::xmlSerialize(true, $sxe);
233 if (isset($this->sequence
)) {
234 $this->sequence
->xmlSerialize(true, $sxe->addChild('sequence'));
236 if (isset($this->diagnosisCodeableConcept
)) {
237 $this->diagnosisCodeableConcept
->xmlSerialize(true, $sxe->addChild('diagnosisCodeableConcept'));
239 if (isset($this->diagnosisReference
)) {
240 $this->diagnosisReference
->xmlSerialize(true, $sxe->addChild('diagnosisReference'));
242 if (0 < count($this->type
)) {
243 foreach ($this->type
as $type) {
244 $type->xmlSerialize(true, $sxe->addChild('type'));
247 if (isset($this->packageCode
)) {
248 $this->packageCode
->xmlSerialize(true, $sxe->addChild('packageCode'));
253 return $sxe->saveXML();