1 <?php
namespace HL7\FHIR\STU3\FHIRResource\FHIRExpansionProfile
;
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 * Resource to define constraints on the Expansion of a FHIR ValueSet.
15 class FHIRExpansionProfileExclude
extends FHIRBackboneElement
implements \JsonSerializable
18 * A data group for each designation to be excluded.
19 * @var \HL7\FHIR\STU3\FHIRResource\FHIRExpansionProfile\FHIRExpansionProfileDesignation2[]
21 public $designation = [];
26 private $_fhirElementName = 'ExpansionProfile.Exclude';
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
;
38 * A data group for each designation to be excluded.
39 * @param \HL7\FHIR\STU3\FHIRResource\FHIRExpansionProfile\FHIRExpansionProfileDesignation2 $designation
42 public function addDesignation($designation)
44 $this->designation
[] = $designation;
51 public function get_fhirElementName()
53 return $this->_fhirElementName
;
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);
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);
80 public function __toString()
82 return $this->get_fhirElementName();
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;
101 * @param boolean $returnSXE
102 * @param \SimpleXMLElement $sxe
103 * @return string|\SimpleXMLElement
105 public function xmlSerialize($returnSXE = false, $sxe = null)
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'));
119 return $sxe->saveXML();