some fixes (#2481)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRElement / FHIRContactPointSystem.php
blobcd1d3a3ea0f5a2ed7256aa49687b8d5f4fec0eef
1 <?php namespace HL7\FHIR\STU3\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: February 10th, 2018
8 */
10 use HL7\FHIR\STU3\FHIRElement;
12 /**
13 * Telecommunications form for contact point
14 * If the element is present, it must have either a @value, an @id, or extensions
16 class FHIRContactPointSystem extends FHIRElement implements \JsonSerializable
18 /**
19 * @var string
21 public $value = null;
23 /**
24 * @var string
26 private $_fhirElementName = 'ContactPointSystem';
28 /**
29 * @return string
31 public function getValue()
33 return $this->value;
36 /**
37 * @param string $value
38 * @return $this
40 public function setValue($value)
42 $this->value = $value;
43 return $this;
46 /**
47 * @return string
49 public function get_fhirElementName()
51 return $this->_fhirElementName;
54 /**
55 * @param mixed $data
57 public function __construct($data = [])
59 if (is_array($data)) {
60 if (isset($data['value'])) {
61 $this->setValue($data['value']);
63 } else if (null !== $data) {
64 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
66 parent::__construct($data);
69 /**
70 * @return string
72 public function __toString()
74 return (string)$this->getValue();
77 /**
78 * @return mixed
80 public function jsonSerialize()
82 return $this->value;
85 /**
86 * @param boolean $returnSXE
87 * @param \SimpleXMLElement $sxe
88 * @return string|\SimpleXMLElement
90 public function xmlSerialize($returnSXE = false, $sxe = null)
92 if (null === $sxe) {
93 $sxe = new \SimpleXMLElement('<ContactPointSystem xmlns="http://hl7.org/fhir"></ContactPointSystem>');
95 $sxe->addAttribute('value', $this->value);
96 if ($returnSXE) {
97 return $sxe;
99 return $sxe->saveXML();