Skip to main content

fhir_rs/resource/r5/
test_plan.rs

1use crate::prelude::*;
2
3#[derive(Resource, Debug, Clone, Default)]
4#[fhir(base="DomainResource")]
5pub struct TestPlan {
6    /// Logical id of this artifact
7    #[fhir(name="id", min="0", max="1", summary=true, modifier=false, choice="")]
8    pub id: Option<Id>,
9    /// Metadata about the resource
10    #[fhir(name="meta", min="0", max="1", summary=true, modifier=false, choice="")]
11    pub meta: Option<Meta>,
12    /// A set of rules under which this content was created
13    #[fhir(name="implicitRules", min="0", max="1", summary=true, modifier=true)]
14    pub implicit_rules: Option<UriDt>,
15    /// Language of the resource content
16    #[fhir(name="language", min="0", max="1", summary=false, modifier=false, choice="")]
17    pub language: Option<CodeDt>,
18    /// Text summary of the resource, for human interpretation
19    #[fhir(name="text", min="0", max="1", summary=false, modifier=false, choice="")]
20    pub text: Option<Narrative>,
21    /// Contained, inline Resources
22    #[fhir(name="contained", min="0", max="*", summary=false, modifier=false, choice="")]
23    pub contained: Option<Vec<AnyResource>>,
24    /// Additional content defined by implementations
25    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
26    pub extension: Option<Vec<Extension>>,
27    /// Extensions that cannot be ignored
28    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
29    pub modifier_extension: Option<Vec<Extension>>,
30    /// Canonical identifier for this test plan, represented as a URI (globally unique)
31    #[fhir(name="url", min="0", max="1", summary=true, modifier=false, choice="")]
32    pub url: Option<UriDt>,
33    /// Business identifier identifier for the test plan
34    #[fhir(name="identifier", min="0", max="*", summary=true, modifier=false, choice="")]
35    pub identifier: Option<Vec<Identifier>>,
36    /// Business version of the test plan
37    #[fhir(name="version", min="0", max="1", summary=true, modifier=false, choice="")]
38    pub version: Option<StringDt>,
39    /// How to compare versions
40    #[fhir(name="versionAlgorithm", min="0", max="1", summary=true, modifier=false, choice="")]
41    pub version_algorithm: Option<Coding>,
42    /// Name for this test plan (computer friendly)
43    #[fhir(name="name", min="0", max="1", summary=true, modifier=false, choice="")]
44    pub name: Option<StringDt>,
45    /// Name for this test plan (human friendly)
46    #[fhir(name="title", min="0", max="1", summary=false, modifier=false, choice="")]
47    pub title: Option<StringDt>,
48    /// draft | active | retired | unknown
49    #[fhir(name="status", min="1", max="1", summary=true, modifier=true)]
50    pub status: Option<CodeDt>,
51    /// For testing purposes, not real usage
52    #[fhir(name="experimental", min="0", max="1", summary=true, modifier=false, choice="")]
53    pub experimental: Option<BooleanDt>,
54    /// Date last changed
55    #[fhir(name="date", min="0", max="1", summary=true, modifier=false, choice="")]
56    pub date: Option<DateTimeDt>,
57    /// Name of the publisher/steward (organization or individual)
58    #[fhir(name="publisher", min="0", max="1", summary=true, modifier=false, choice="")]
59    pub publisher: Option<StringDt>,
60    /// Contact details for the publisher
61    #[fhir(name="contact", min="0", max="*", summary=true, modifier=false, choice="")]
62    pub contact: Option<Vec<ContactDetail>>,
63    /// Natural language description of the test plan
64    #[fhir(name="description", min="0", max="1", summary=false, modifier=false, choice="")]
65    pub description: Option<MarkdownDt>,
66    /// The context that the content is intended to support
67    #[fhir(name="useContext", min="0", max="*", summary=true, modifier=false, choice="")]
68    pub use_context: Option<Vec<UsageContext>>,
69    /// Intended jurisdiction where the test plan applies (if applicable)
70    #[fhir(name="jurisdiction", min="0", max="*", summary=true, modifier=false, choice="")]
71    pub jurisdiction: Option<Vec<CodeableConcept>>,
72    /// Why this test plan is defined
73    #[fhir(name="purpose", min="0", max="1", summary=false, modifier=false, choice="")]
74    pub purpose: Option<MarkdownDt>,
75    /// Use and/or publishing restrictions
76    #[fhir(name="copyright", min="0", max="1", summary=false, modifier=false, choice="")]
77    pub copyright: Option<MarkdownDt>,
78    /// Copyright holder and year(s)
79    #[fhir(name="copyrightLabel", min="0", max="1", summary=false, modifier=false, choice="")]
80    pub copyright_label: Option<StringDt>,
81    /// The category of the Test Plan - can be acceptance, unit, performance
82    #[fhir(name="category", min="0", max="*", summary=false, modifier=false, choice="")]
83    pub category: Option<Vec<CodeableConcept>>,
84    /// What is being tested with this Test Plan - a conformance resource, or narrative criteria, or an external reference
85    #[fhir(name="scope", min="0", max="*", summary=false, modifier=false, choice="")]
86    pub scope: Option<Vec<Reference>>,
87    /// A description of test tools to be used in the test plan - narrative for now
88    #[fhir(name="testTools", min="0", max="1", summary=false, modifier=false, choice="")]
89    pub test_tools: Option<MarkdownDt>,
90    /// The required criteria to execute the test plan - e.g. preconditions, previous tests
91    #[fhir(name="dependency", min="0", max="*", summary=false, modifier=false, choice="")]
92    pub dependency: Option<Vec<TestPlanDependencyBackboneElement>>,
93    /// The threshold or criteria for the test plan to be considered successfully executed - narrative
94    #[fhir(name="exitCriteria", min="0", max="1", summary=false, modifier=false, choice="")]
95    pub exit_criteria: Option<MarkdownDt>,
96    /// The test cases that constitute this plan
97    #[fhir(name="testCase", min="0", max="*", summary=false, modifier=false, choice="")]
98    pub test_case: Option<Vec<TestPlanTestCaseBackboneElement>>,
99}
100
101#[derive(Element, BackboneElement, Debug, Clone, Default)]
102pub struct TestPlanDependencyBackboneElement {
103    /// Unique id for inter-element referencing
104    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
105    pub id: Option<String>,
106    /// Additional content defined by implementations
107    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
108    pub extension: Option<Vec<Extension>>,
109    /// Extensions that cannot be ignored even if unrecognized
110    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
111    pub modifier_extension: Option<Vec<Extension>>,
112    /// Description of the dependency criterium
113    #[fhir(name="description", min="0", max="1", summary=false, modifier=false, choice="")]
114    pub description: Option<MarkdownDt>,
115    /// Link to predecessor test plans
116    #[fhir(name="predecessor", min="0", max="1", summary=false, modifier=false, choice="")]
117    pub predecessor: Option<Reference>,
118}
119
120#[derive(Element, BackboneElement, Debug, Clone, Default)]
121pub struct TestPlanTestCaseBackboneElement {
122    /// Unique id for inter-element referencing
123    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
124    pub id: Option<String>,
125    /// Additional content defined by implementations
126    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
127    pub extension: Option<Vec<Extension>>,
128    /// Extensions that cannot be ignored even if unrecognized
129    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
130    pub modifier_extension: Option<Vec<Extension>>,
131    /// Sequence of test case in the test plan
132    #[fhir(name="sequence", min="0", max="1", summary=false, modifier=false, choice="")]
133    pub sequence: Option<IntegerDt>,
134    /// The scope or artifact covered by the case
135    #[fhir(name="scope", min="0", max="*", summary=false, modifier=false, choice="")]
136    pub scope: Option<Vec<Reference>>,
137    /// Required criteria to execute the test case
138    #[fhir(name="dependency", min="0", max="*", summary=false, modifier=false, choice="")]
139    pub dependency: Option<Vec<TestPlanTestCaseDependencyBackboneElement>>,
140    /// The actual test to be executed
141    #[fhir(name="testRun", min="0", max="*", summary=false, modifier=false, choice="")]
142    pub test_run: Option<Vec<TestPlanTestCaseTestRunBackboneElement>>,
143    /// The test data used in the test case
144    #[fhir(name="testData", min="0", max="*", summary=false, modifier=false, choice="")]
145    pub test_data: Option<Vec<TestPlanTestCaseTestDataBackboneElement>>,
146    /// Test assertions or expectations
147    #[fhir(name="assertion", min="0", max="*", summary=false, modifier=false, choice="")]
148    pub assertion: Option<Vec<TestPlanTestCaseAssertionBackboneElement>>,
149}
150
151#[derive(Element, BackboneElement, Debug, Clone, Default)]
152pub struct TestPlanTestCaseDependencyBackboneElement {
153    /// Unique id for inter-element referencing
154    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
155    pub id: Option<String>,
156    /// Additional content defined by implementations
157    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
158    pub extension: Option<Vec<Extension>>,
159    /// Extensions that cannot be ignored even if unrecognized
160    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
161    pub modifier_extension: Option<Vec<Extension>>,
162    /// Description of the criteria
163    #[fhir(name="description", min="0", max="1", summary=false, modifier=false, choice="")]
164    pub description: Option<MarkdownDt>,
165    /// Link to predecessor test plans
166    #[fhir(name="predecessor", min="0", max="1", summary=false, modifier=false, choice="")]
167    pub predecessor: Option<Reference>,
168}
169
170#[derive(Element, BackboneElement, Debug, Clone, Default)]
171pub struct TestPlanTestCaseTestDataBackboneElement {
172    /// Unique id for inter-element referencing
173    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
174    pub id: Option<String>,
175    /// Additional content defined by implementations
176    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
177    pub extension: Option<Vec<Extension>>,
178    /// Extensions that cannot be ignored even if unrecognized
179    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
180    pub modifier_extension: Option<Vec<Extension>>,
181    /// The type of test data description, e.g. 'synthea'
182    #[fhir(name="type", min="1", max="1", summary=false, modifier=false, choice="")]
183    pub type_: Option<Coding>,
184    /// The actual test resources when they exist
185    #[fhir(name="content", min="0", max="1", summary=false, modifier=false, choice="")]
186    pub content: Option<Reference>,
187    /// Pointer to a definition of test resources - narrative or structured e.g. synthetic data generation, etc
188    #[fhir(name="source", min="0", max="1", summary=false, modifier=false, choice="")]
189    pub source: Option<Reference>,
190}
191
192#[derive(Element, BackboneElement, Debug, Clone, Default)]
193pub struct TestPlanTestCaseTestRunBackboneElement {
194    /// Unique id for inter-element referencing
195    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
196    pub id: Option<String>,
197    /// Additional content defined by implementations
198    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
199    pub extension: Option<Vec<Extension>>,
200    /// Extensions that cannot be ignored even if unrecognized
201    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
202    pub modifier_extension: Option<Vec<Extension>>,
203    /// The narrative description of the tests
204    #[fhir(name="narrative", min="0", max="1", summary=false, modifier=false, choice="")]
205    pub narrative: Option<MarkdownDt>,
206    /// The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript
207    #[fhir(name="script", min="0", max="1", summary=false, modifier=false, choice="")]
208    pub script: Option<TestPlanTestCaseTestRunScriptBackboneElement>,
209}
210
211#[derive(Element, BackboneElement, Debug, Clone, Default)]
212pub struct TestPlanTestCaseTestRunScriptBackboneElement {
213    /// Unique id for inter-element referencing
214    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
215    pub id: Option<String>,
216    /// Additional content defined by implementations
217    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
218    pub extension: Option<Vec<Extension>>,
219    /// Extensions that cannot be ignored even if unrecognized
220    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
221    pub modifier_extension: Option<Vec<Extension>>,
222    /// The language for the test cases e.g. 'gherkin', 'testscript'
223    #[fhir(name="language", min="0", max="1", summary=false, modifier=false, choice="")]
224    pub language: Option<CodeableConcept>,
225    /// The actual content of the cases - references to TestScripts or externally defined content
226    #[fhir(name="source", min="0", max="1", summary=false, modifier=false, choice="")]
227    pub source: Option<Reference>,
228}
229
230#[derive(Element, BackboneElement, Debug, Clone, Default)]
231pub struct TestPlanTestCaseAssertionBackboneElement {
232    /// Unique id for inter-element referencing
233    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
234    pub id: Option<String>,
235    /// Additional content defined by implementations
236    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
237    pub extension: Option<Vec<Extension>>,
238    /// Extensions that cannot be ignored even if unrecognized
239    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
240    pub modifier_extension: Option<Vec<Extension>>,
241    /// Assertion type - for example 'informative' or 'required' 
242    #[fhir(name="type", min="0", max="*", summary=false, modifier=false, choice="")]
243    pub type_: Option<Vec<CodeableConcept>>,
244    /// The focus or object of the assertion
245    #[fhir(name="object", min="0", max="*", summary=false, modifier=false, choice="")]
246    pub object: Option<Vec<CodeableReference>>,
247    /// The actual result assertion
248    #[fhir(name="result", min="0", max="*", summary=false, modifier=false, choice="")]
249    pub result: Option<Vec<CodeableReference>>,
250}
251