Move to FHIR current R4 release (#2482)
[openemr.git] / src / FHIR / R4 / FHIRResource / FHIRTestScript / FHIRTestScriptAction.php
blob95d5ae079353a5e9764a35fc8588a38e57b331b4
1 <?php namespace OpenEMR\FHIR\R4\FHIRResource\FHIRTestScript;
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: June 14th, 2019
8 *
9 * PHPFHIR Copyright:
11 * Copyright 2016-2017 Daniel Carbone (daniel.p.carbone@gmail.com)
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
26 * FHIR Copyright Notice:
28 * Copyright (c) 2011+, HL7, Inc.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without modification,
32 * are permitted provided that the following conditions are met:
34 * * Redistributions of source code must retain the above copyright notice, this
35 * list of conditions and the following disclaimer.
36 * * Redistributions in binary form must reproduce the above copyright notice,
37 * this list of conditions and the following disclaimer in the documentation
38 * and/or other materials provided with the distribution.
39 * * Neither the name of HL7 nor the names of its contributors may be used to
40 * endorse or promote products derived from this software without specific
41 * prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
45 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
46 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
47 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
49 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
50 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
52 * POSSIBILITY OF SUCH DAMAGE.
55 * Generated on Thu, Dec 27, 2018 22:37+1100 for FHIR v4.0.0
57 * Note: the schemas & schematrons do not contain all of the rules about what makes resources
58 * valid. Implementers will still need to be familiar with the content of the specification and with
59 * any profiles that apply to the resources in order to make a conformant implementation.
63 use OpenEMR\FHIR\R4\FHIRElement\FHIRBackboneElement;
65 /**
66 * A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.
68 class FHIRTestScriptAction extends FHIRBackboneElement implements \JsonSerializable
70 /**
71 * The operation to perform.
72 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRTestScript\FHIRTestScriptOperation
74 public $operation = null;
76 /**
77 * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
78 * @var \OpenEMR\FHIR\R4\FHIRResource\FHIRTestScript\FHIRTestScriptAssert
80 public $assert = null;
82 /**
83 * @var string
85 private $_fhirElementName = 'TestScript.Action';
87 /**
88 * The operation to perform.
89 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRTestScript\FHIRTestScriptOperation
91 public function getOperation()
93 return $this->operation;
96 /**
97 * The operation to perform.
98 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRTestScript\FHIRTestScriptOperation $operation
99 * @return $this
101 public function setOperation($operation)
103 $this->operation = $operation;
104 return $this;
108 * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
109 * @return \OpenEMR\FHIR\R4\FHIRResource\FHIRTestScript\FHIRTestScriptAssert
111 public function getAssert()
113 return $this->assert;
117 * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
118 * @param \OpenEMR\FHIR\R4\FHIRResource\FHIRTestScript\FHIRTestScriptAssert $assert
119 * @return $this
121 public function setAssert($assert)
123 $this->assert = $assert;
124 return $this;
128 * @return string
130 public function get_fhirElementName()
132 return $this->_fhirElementName;
136 * @param mixed $data
138 public function __construct($data = [])
140 if (is_array($data)) {
141 if (isset($data['operation'])) {
142 $this->setOperation($data['operation']);
144 if (isset($data['assert'])) {
145 $this->setAssert($data['assert']);
147 } else if (null !== $data) {
148 throw new \InvalidArgumentException('$data expected to be array of values, saw "'.gettype($data).'"');
150 parent::__construct($data);
154 * @return string
156 public function __toString()
158 return $this->get_fhirElementName();
162 * @return array
164 public function jsonSerialize()
166 $json = parent::jsonSerialize();
167 if (isset($this->operation)) {
168 $json['operation'] = $this->operation;
170 if (isset($this->assert)) {
171 $json['assert'] = $this->assert;
173 return $json;
177 * @param boolean $returnSXE
178 * @param \SimpleXMLElement $sxe
179 * @return string|\SimpleXMLElement
181 public function xmlSerialize($returnSXE = false, $sxe = null)
183 if (null === $sxe) {
184 $sxe = new \SimpleXMLElement('<TestScriptAction xmlns="http://hl7.org/fhir"></TestScriptAction>');
186 parent::xmlSerialize(true, $sxe);
187 if (isset($this->operation)) {
188 $this->operation->xmlSerialize(true, $sxe->addChild('operation'));
190 if (isset($this->assert)) {
191 $this->assert->xmlSerialize(true, $sxe->addChild('assert'));
193 if ($returnSXE) {
194 return $sxe;
196 return $sxe->saveXML();