some fixes (#2481)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRResource / FHIRStructureMap / FHIRStructureMapInput.php
blobf3cc405ae886963ab1d4207454480ece1d24f450
1 <?php namespace HL7\FHIR\STU3\FHIRResource\FHIRStructureMap;
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: February 10th, 2018
8 */
10 use HL7\FHIR\STU3\FHIRElement\FHIRBackboneElement;
12 /**
13 * A Map of relationships between 2 structures that can be used to transform data.
15 class FHIRStructureMapInput extends FHIRBackboneElement implements \JsonSerializable
17 /**
18 * Name for this instance of data.
19 * @var \HL7\FHIR\STU3\FHIRElement\FHIRId
21 public $name = null;
23 /**
24 * Type for this instance of data.
25 * @var \HL7\FHIR\STU3\FHIRElement\FHIRString
27 public $type = null;
29 /**
30 * Mode for this instance of data.
31 * @var \HL7\FHIR\STU3\FHIRElement\FHIRStructureMapInputMode
33 public $mode = null;
35 /**
36 * Documentation for this instance of data.
37 * @var \HL7\FHIR\STU3\FHIRElement\FHIRString
39 public $documentation = null;
41 /**
42 * @var string
44 private $_fhirElementName = 'StructureMap.Input';
46 /**
47 * Name for this instance of data.
48 * @return \HL7\FHIR\STU3\FHIRElement\FHIRId
50 public function getName()
52 return $this->name;
55 /**
56 * Name for this instance of data.
57 * @param \HL7\FHIR\STU3\FHIRElement\FHIRId $name
58 * @return $this
60 public function setName($name)
62 $this->name = $name;
63 return $this;
66 /**
67 * Type for this instance of data.
68 * @return \HL7\FHIR\STU3\FHIRElement\FHIRString
70 public function getType()
72 return $this->type;
75 /**
76 * Type for this instance of data.
77 * @param \HL7\FHIR\STU3\FHIRElement\FHIRString $type
78 * @return $this
80 public function setType($type)
82 $this->type = $type;
83 return $this;
86 /**
87 * Mode for this instance of data.
88 * @return \HL7\FHIR\STU3\FHIRElement\FHIRStructureMapInputMode
90 public function getMode()
92 return $this->mode;
95 /**
96 * Mode for this instance of data.
97 * @param \HL7\FHIR\STU3\FHIRElement\FHIRStructureMapInputMode $mode
98 * @return $this
100 public function setMode($mode)
102 $this->mode = $mode;
103 return $this;
107 * Documentation for this instance of data.
108 * @return \HL7\FHIR\STU3\FHIRElement\FHIRString
110 public function getDocumentation()
112 return $this->documentation;
116 * Documentation for this instance of data.
117 * @param \HL7\FHIR\STU3\FHIRElement\FHIRString $documentation
118 * @return $this
120 public function setDocumentation($documentation)
122 $this->documentation = $documentation;
123 return $this;
127 * @return string
129 public function get_fhirElementName()
131 return $this->_fhirElementName;
135 * @param mixed $data
137 public function __construct($data = [])
139 if (is_array($data)) {
140 if (isset($data['name'])) {
141 $this->setName($data['name']);
143 if (isset($data['type'])) {
144 $this->setType($data['type']);
146 if (isset($data['mode'])) {
147 $this->setMode($data['mode']);
149 if (isset($data['documentation'])) {
150 $this->setDocumentation($data['documentation']);
152 } else if (null !== $data) {
153 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
155 parent::__construct($data);
159 * @return string
161 public function __toString()
163 return $this->get_fhirElementName();
167 * @return array
169 public function jsonSerialize()
171 $json = parent::jsonSerialize();
172 if (isset($this->name)) {
173 $json['name'] = $this->name;
175 if (isset($this->type)) {
176 $json['type'] = $this->type;
178 if (isset($this->mode)) {
179 $json['mode'] = $this->mode;
181 if (isset($this->documentation)) {
182 $json['documentation'] = $this->documentation;
184 return $json;
188 * @param boolean $returnSXE
189 * @param \SimpleXMLElement $sxe
190 * @return string|\SimpleXMLElement
192 public function xmlSerialize($returnSXE = false, $sxe = null)
194 if (null === $sxe) {
195 $sxe = new \SimpleXMLElement('<StructureMapInput xmlns="http://hl7.org/fhir"></StructureMapInput>');
197 parent::xmlSerialize(true, $sxe);
198 if (isset($this->name)) {
199 $this->name->xmlSerialize(true, $sxe->addChild('name'));
201 if (isset($this->type)) {
202 $this->type->xmlSerialize(true, $sxe->addChild('type'));
204 if (isset($this->mode)) {
205 $this->mode->xmlSerialize(true, $sxe->addChild('mode'));
207 if (isset($this->documentation)) {
208 $this->documentation->xmlSerialize(true, $sxe->addChild('documentation'));
210 if ($returnSXE) {
211 return $sxe;
213 return $sxe->saveXML();