Phase 1 FHIR on PHP- Provider Client and implement classes. (#1422)
[openemr.git] / phpfhir / HL7 / FHIR / STU3 / src / FHIRResource / FHIRExpansionProfile / FHIRExpansionProfileExclude.php
blob016972feb84c8063b7771c88bde39ec81ace6590
1 <?php namespace HL7\FHIR\STU3\FHIRResource\FHIRExpansionProfile;
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 * Resource to define constraints on the Expansion of a FHIR ValueSet.
15 class FHIRExpansionProfileExclude extends FHIRBackboneElement implements \JsonSerializable
17 /**
18 * A data group for each designation to be excluded.
19 * @var \HL7\FHIR\STU3\FHIRResource\FHIRExpansionProfile\FHIRExpansionProfileDesignation2[]
21 public $designation = [];
23 /**
24 * @var string
26 private $_fhirElementName = 'ExpansionProfile.Exclude';
28 /**
29 * A data group for each designation to be excluded.
30 * @return \HL7\FHIR\STU3\FHIRResource\FHIRExpansionProfile\FHIRExpansionProfileDesignation2[]
32 public function getDesignation()
34 return $this->designation;
37 /**
38 * A data group for each designation to be excluded.
39 * @param \HL7\FHIR\STU3\FHIRResource\FHIRExpansionProfile\FHIRExpansionProfileDesignation2 $designation
40 * @return $this
42 public function addDesignation($designation)
44 $this->designation[] = $designation;
45 return $this;
48 /**
49 * @return string
51 public function get_fhirElementName()
53 return $this->_fhirElementName;
56 /**
57 * @param mixed $data
59 public function __construct($data = [])
61 if (is_array($data)) {
62 if (isset($data['designation'])) {
63 if (is_array($data['designation'])) {
64 foreach ($data['designation'] as $d) {
65 $this->addDesignation($d);
67 } else {
68 throw new \InvalidArgumentException('"designation" must be array of objects or null, '.gettype($data['designation']).' seen.');
71 } else if (null !== $data) {
72 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
74 parent::__construct($data);
77 /**
78 * @return string
80 public function __toString()
82 return $this->get_fhirElementName();
85 /**
86 * @return array
88 public function jsonSerialize()
90 $json = parent::jsonSerialize();
91 if (0 < count($this->designation)) {
92 $json['designation'] = [];
93 foreach ($this->designation as $designation) {
94 $json['designation'][] = $designation;
97 return $json;
101 * @param boolean $returnSXE
102 * @param \SimpleXMLElement $sxe
103 * @return string|\SimpleXMLElement
105 public function xmlSerialize($returnSXE = false, $sxe = null)
107 if (null === $sxe) {
108 $sxe = new \SimpleXMLElement('<ExpansionProfileExclude xmlns="http://hl7.org/fhir"></ExpansionProfileExclude>');
110 parent::xmlSerialize(true, $sxe);
111 if (0 < count($this->designation)) {
112 foreach ($this->designation as $designation) {
113 $designation->xmlSerialize(true, $sxe->addChild('designation'));
116 if ($returnSXE) {
117 return $sxe;
119 return $sxe->saveXML();