3 namespace OpenEMR\FHIR\R4\FHIRElement
;
6 * This class was generated with the PHPFHIR library (https://github.com/dcarbone/php-fhir) using
7 * class definitions from HL7 FHIR (https://www.hl7.org/fhir/)
9 * Class creation date: June 14th, 2019
13 * Copyright 2016-2017 Daniel Carbone (daniel.p.carbone@gmail.com)
15 * Licensed under the Apache License, Version 2.0 (the "License");
16 * you may not use this file except in compliance with the License.
17 * You may obtain a copy of the License at
19 * http://www.apache.org/licenses/LICENSE-2.0
21 * Unless required by applicable law or agreed to in writing, software
22 * distributed under the License is distributed on an "AS IS" BASIS,
23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 * See the License for the specific language governing permissions and
25 * limitations under the License.
28 * FHIR Copyright Notice:
30 * Copyright (c) 2011+, HL7, Inc.
31 * All rights reserved.
33 * Redistribution and use in source and binary forms, with or without modification,
34 * are permitted provided that the following conditions are met:
36 * * Redistributions of source code must retain the above copyright notice, this
37 * list of conditions and the following disclaimer.
38 * * Redistributions in binary form must reproduce the above copyright notice,
39 * this list of conditions and the following disclaimer in the documentation
40 * and/or other materials provided with the distribution.
41 * * Neither the name of HL7 nor the names of its contributors may be used to
42 * endorse or promote products derived from this software without specific
43 * prior written permission.
45 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
48 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
49 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
51 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
52 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
54 * POSSIBILITY OF SUCH DAMAGE.
57 * Generated on Thu, Dec 27, 2018 22:37+1100 for FHIR v4.0.0
59 * Note: the schemas & schematrons do not contain all of the rules about what makes resources
60 * valid. Implementers will still need to be familiar with the content of the specification and with
61 * any profiles that apply to the resources in order to make a conformant implementation.
65 use OpenEMR\FHIR\R4\FHIRElement
;
68 * A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.
69 * If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions
71 class FHIRTriggerDefinition
extends FHIRElement
implements \JsonSerializable
74 * The type of triggering event.
75 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRTriggerType
80 * A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context.
81 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRString
86 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRTiming
88 public $timingTiming = null;
91 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
93 public $timingReference = null;
96 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDate
98 public $timingDate = null;
101 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
103 public $timingDateTime = null;
106 * The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true.
107 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRDataRequirement[]
112 * A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires.
113 * @var \OpenEMR\FHIR\R4\FHIRElement\FHIRExpression
115 public $condition = null;
120 private $_fhirElementName = 'TriggerDefinition';
123 * The type of triggering event.
124 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRTriggerType
126 public function getType()
132 * The type of triggering event.
133 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRTriggerType $type
136 public function setType($type)
143 * A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context.
144 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRString
146 public function getName()
152 * A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context.
153 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRString $name
156 public function setName($name)
163 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRTiming
165 public function getTimingTiming()
167 return $this->timingTiming
;
171 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRTiming $timingTiming
174 public function setTimingTiming($timingTiming)
176 $this->timingTiming
= $timingTiming;
181 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRReference
183 public function getTimingReference()
185 return $this->timingReference
;
189 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRReference $timingReference
192 public function setTimingReference($timingReference)
194 $this->timingReference
= $timingReference;
199 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDate
201 public function getTimingDate()
203 return $this->timingDate
;
207 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDate $timingDate
210 public function setTimingDate($timingDate)
212 $this->timingDate
= $timingDate;
217 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime
219 public function getTimingDateTime()
221 return $this->timingDateTime
;
225 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDateTime $timingDateTime
228 public function setTimingDateTime($timingDateTime)
230 $this->timingDateTime
= $timingDateTime;
235 * The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true.
236 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRDataRequirement[]
238 public function getData()
244 * The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true.
245 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRDataRequirement $data
248 public function addData($data)
250 $this->data
[] = $data;
255 * A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires.
256 * @return \OpenEMR\FHIR\R4\FHIRElement\FHIRExpression
258 public function getCondition()
260 return $this->condition
;
264 * A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires.
265 * @param \OpenEMR\FHIR\R4\FHIRElement\FHIRExpression $condition
268 public function setCondition($condition)
270 $this->condition
= $condition;
277 public function get_fhirElementName()
279 return $this->_fhirElementName
;
285 public function __construct($data = [])
287 if (is_array($data)) {
288 if (isset($data['type'])) {
289 $this->setType($data['type']);
291 if (isset($data['name'])) {
292 $this->setName($data['name']);
294 if (isset($data['timingTiming'])) {
295 $this->setTimingTiming($data['timingTiming']);
297 if (isset($data['timingReference'])) {
298 $this->setTimingReference($data['timingReference']);
300 if (isset($data['timingDate'])) {
301 $this->setTimingDate($data['timingDate']);
303 if (isset($data['timingDateTime'])) {
304 $this->setTimingDateTime($data['timingDateTime']);
306 if (isset($data['data'])) {
307 if (is_array($data['data'])) {
308 foreach ($data['data'] as $d) {
312 throw new \
InvalidArgumentException('"data" must be array of objects or null, ' . gettype($data['data']) . ' seen.');
315 if (isset($data['condition'])) {
316 $this->setCondition($data['condition']);
318 } elseif (null !== $data) {
319 throw new \
InvalidArgumentException('$data expected to be array of values, saw "' . gettype($data) . '"');
321 parent
::__construct($data);
327 public function __toString()
329 return $this->get_fhirElementName();
335 public function jsonSerialize(): mixed
337 $json = parent
::jsonSerialize();
338 if (isset($this->type
)) {
339 $json['type'] = $this->type
;
341 if (isset($this->name
)) {
342 $json['name'] = $this->name
;
344 if (isset($this->timingTiming
)) {
345 $json['timingTiming'] = $this->timingTiming
;
347 if (isset($this->timingReference
)) {
348 $json['timingReference'] = $this->timingReference
;
350 if (isset($this->timingDate
)) {
351 $json['timingDate'] = $this->timingDate
;
353 if (isset($this->timingDateTime
)) {
354 $json['timingDateTime'] = $this->timingDateTime
;
356 if (0 < count($this->data
)) {
358 foreach ($this->data
as $data) {
359 $json['data'][] = $data;
362 if (isset($this->condition
)) {
363 $json['condition'] = $this->condition
;
369 * @param boolean $returnSXE
370 * @param \SimpleXMLElement $sxe
371 * @return string|\SimpleXMLElement
373 public function xmlSerialize($returnSXE = false, $sxe = null)
376 $sxe = new \
SimpleXMLElement('<TriggerDefinition xmlns="http://hl7.org/fhir"></TriggerDefinition>');
378 parent
::xmlSerialize(true, $sxe);
379 if (isset($this->type
)) {
380 $this->type
->xmlSerialize(true, $sxe->addChild('type'));
382 if (isset($this->name
)) {
383 $this->name
->xmlSerialize(true, $sxe->addChild('name'));
385 if (isset($this->timingTiming
)) {
386 $this->timingTiming
->xmlSerialize(true, $sxe->addChild('timingTiming'));
388 if (isset($this->timingReference
)) {
389 $this->timingReference
->xmlSerialize(true, $sxe->addChild('timingReference'));
391 if (isset($this->timingDate
)) {
392 $this->timingDate
->xmlSerialize(true, $sxe->addChild('timingDate'));
394 if (isset($this->timingDateTime
)) {
395 $this->timingDateTime
->xmlSerialize(true, $sxe->addChild('timingDateTime'));
397 if (0 < count($this->data
)) {
398 foreach ($this->data
as $data) {
399 $data->xmlSerialize(true, $sxe->addChild('data'));
402 if (isset($this->condition
)) {
403 $this->condition
->xmlSerialize(true, $sxe->addChild('condition'));
408 return $sxe->saveXML();