fhir_rs/resource/r5/
code_system.rs

1use crate::prelude::*;
2
3#[derive(Resource, Debug, Clone, Default)]
4#[fhir(base="DomainResource")]
5pub struct CodeSystem {
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 code system, represented as a URI (globally unique) (Coding.system)
31    #[fhir(name="url", min="0", max="1", summary=true, modifier=false, choice="")]
32    pub url: Option<UriDt>,
33    /// Additional identifier for the code system (business identifier)
34    #[fhir(name="identifier", min="0", max="*", summary=true, modifier=false, choice="")]
35    pub identifier: Option<Vec<Identifier>>,
36    /// Business version of the code system (Coding.version)
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 code system (computer friendly)
43    #[fhir(name="name", min="0", max="1", summary=true, modifier=false, choice="")]
44    pub name: Option<StringDt>,
45    /// Name for this code system (human friendly)
46    #[fhir(name="title", min="0", max="1", summary=true, 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 code system
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 for code system (if applicable)
70    #[fhir(name="jurisdiction", min="0", max="*", summary=true, modifier=false, choice="")]
71    pub jurisdiction: Option<Vec<CodeableConcept>>,
72    /// Why this code system 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    /// When the CodeSystem was approved by publisher
82    #[fhir(name="approvalDate", min="0", max="1", summary=false, modifier=false, choice="")]
83    pub approval_date: Option<DateDt>,
84    /// When the CodeSystem was last reviewed by the publisher
85    #[fhir(name="lastReviewDate", min="0", max="1", summary=false, modifier=false, choice="")]
86    pub last_review_date: Option<DateDt>,
87    /// When the CodeSystem is expected to be used
88    #[fhir(name="effectivePeriod", min="0", max="1", summary=true, modifier=false, choice="")]
89    pub effective_period: Option<Period>,
90    /// E.g. Education, Treatment, Assessment, etc
91    #[fhir(name="topic", min="0", max="*", summary=false, modifier=false, choice="")]
92    pub topic: Option<Vec<CodeableConcept>>,
93    /// Who authored the CodeSystem
94    #[fhir(name="author", min="0", max="*", summary=false, modifier=false, choice="")]
95    pub author: Option<Vec<ContactDetail>>,
96    /// Who edited the CodeSystem
97    #[fhir(name="editor", min="0", max="*", summary=false, modifier=false, choice="")]
98    pub editor: Option<Vec<ContactDetail>>,
99    /// Who reviewed the CodeSystem
100    #[fhir(name="reviewer", min="0", max="*", summary=false, modifier=false, choice="")]
101    pub reviewer: Option<Vec<ContactDetail>>,
102    /// Who endorsed the CodeSystem
103    #[fhir(name="endorser", min="0", max="*", summary=false, modifier=false, choice="")]
104    pub endorser: Option<Vec<ContactDetail>>,
105    /// Additional documentation, citations, etc
106    #[fhir(name="relatedArtifact", min="0", max="*", summary=false, modifier=false, choice="")]
107    pub related_artifact: Option<Vec<RelatedArtifact>>,
108    /// If code comparison is case sensitive
109    #[fhir(name="caseSensitive", min="0", max="1", summary=true, modifier=false, choice="")]
110    pub case_sensitive: Option<BooleanDt>,
111    /// Canonical reference to the value set with entire code system
112    #[fhir(name="valueSet", min="0", max="1", summary=true, modifier=false, choice="")]
113    pub value_set: Option<CanonicalDt>,
114    /// grouped-by | is-a | part-of | classified-with
115    #[fhir(name="hierarchyMeaning", min="0", max="1", summary=true, modifier=false, choice="")]
116    pub hierarchy_meaning: Option<CodeDt>,
117    /// If code system defines a compositional grammar
118    #[fhir(name="compositional", min="0", max="1", summary=true, modifier=false, choice="")]
119    pub compositional: Option<BooleanDt>,
120    /// If definitions are not stable
121    #[fhir(name="versionNeeded", min="0", max="1", summary=true, modifier=false, choice="")]
122    pub version_needed: Option<BooleanDt>,
123    /// not-present | example | fragment | complete | supplement
124    #[fhir(name="content", min="1", max="1", summary=true, modifier=false, choice="")]
125    pub content: Option<CodeDt>,
126    /// Canonical URL of Code System this adds designations and properties to
127    #[fhir(name="supplements", min="0", max="1", summary=true, modifier=false, choice="")]
128    pub supplements: Option<CanonicalDt>,
129    /// Total concepts in the code system
130    #[fhir(name="count", min="0", max="1", summary=true, modifier=false, choice="")]
131    pub count: Option<UnsignedIntDt>,
132    /// Filter that can be used in a value set
133    #[fhir(name="filter", min="0", max="*", summary=true, modifier=false, choice="")]
134    pub filter: Option<Vec<CodeSystemFilterBackboneElement>>,
135    /// Additional information supplied about each concept
136    #[fhir(name="property", min="0", max="*", summary=true, modifier=false, choice="")]
137    pub property: Option<Vec<CodeSystemPropertyBackboneElement>>,
138    /// Concepts in the code system
139    #[fhir(name="concept", min="0", max="*", summary=false, modifier=false, choice="")]
140    pub concept: Option<Vec<CodeSystemConceptBackboneElement>>,
141}
142
143#[derive(Element, BackboneElement, Debug, Clone, Default)]
144pub struct CodeSystemFilterBackboneElement {
145    /// Unique id for inter-element referencing
146    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
147    pub id: Option<String>,
148    /// Additional content defined by implementations
149    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
150    pub extension: Option<Vec<Extension>>,
151    /// Extensions that cannot be ignored even if unrecognized
152    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
153    pub modifier_extension: Option<Vec<Extension>>,
154    /// Code that identifies the filter
155    #[fhir(name="code", min="1", max="1", summary=true, modifier=false, choice="")]
156    pub code: Option<CodeDt>,
157    /// How or why the filter is used
158    #[fhir(name="description", min="0", max="1", summary=true, modifier=false, choice="")]
159    pub description: Option<StringDt>,
160    /// = | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | child-of | descendent-leaf | exists
161    #[fhir(name="operator", min="1", max="*", summary=true, modifier=false, choice="")]
162    pub operator: Option<Vec<CodeDt>>,
163    /// What to use for the value
164    #[fhir(name="value", min="1", max="1", summary=true, modifier=false, choice="")]
165    pub value: Option<StringDt>,
166}
167
168#[derive(Element, BackboneElement, Debug, Clone, Default)]
169pub struct CodeSystemPropertyBackboneElement {
170    /// Unique id for inter-element referencing
171    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
172    pub id: Option<String>,
173    /// Additional content defined by implementations
174    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
175    pub extension: Option<Vec<Extension>>,
176    /// Extensions that cannot be ignored even if unrecognized
177    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
178    pub modifier_extension: Option<Vec<Extension>>,
179    /// Identifies the property on the concepts, and when referred to in operations
180    #[fhir(name="code", min="1", max="1", summary=true, modifier=false, choice="")]
181    pub code: Option<CodeDt>,
182    /// Formal identifier for the property
183    #[fhir(name="uri", min="0", max="1", summary=true, modifier=false, choice="")]
184    pub uri: Option<UriDt>,
185    /// Why the property is defined, and/or what it conveys
186    #[fhir(name="description", min="0", max="1", summary=true, modifier=false, choice="")]
187    pub description: Option<StringDt>,
188    /// code | Coding | string | integer | boolean | dateTime | decimal
189    #[fhir(name="type", min="1", max="1", summary=true, modifier=false, choice="")]
190    pub type_: Option<CodeDt>,
191}
192
193#[derive(Element, BackboneElement, Debug, Clone, Default)]
194pub struct CodeSystemConceptBackboneElement {
195    /// Unique id for inter-element referencing
196    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
197    pub id: Option<String>,
198    /// Additional content defined by implementations
199    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
200    pub extension: Option<Vec<Extension>>,
201    /// Extensions that cannot be ignored even if unrecognized
202    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
203    pub modifier_extension: Option<Vec<Extension>>,
204    /// Code that identifies concept
205    #[fhir(name="code", min="1", max="1", summary=false, modifier=false, choice="")]
206    pub code: Option<CodeDt>,
207    /// Text to display to the user
208    #[fhir(name="display", min="0", max="1", summary=false, modifier=false, choice="")]
209    pub display: Option<StringDt>,
210    /// Formal definition
211    #[fhir(name="definition", min="0", max="1", summary=false, modifier=false, choice="")]
212    pub definition: Option<StringDt>,
213    /// Additional representations for the concept
214    #[fhir(name="designation", min="0", max="*", summary=false, modifier=false, choice="")]
215    pub designation: Option<Vec<CodeSystemConceptDesignationBackboneElement>>,
216    /// Property value for the concept
217    #[fhir(name="property", min="0", max="*", summary=false, modifier=false, choice="")]
218    pub property: Option<Vec<CodeSystemConceptPropertyBackboneElement>>,
219    /// Child Concepts (is-a/contains/categorizes)
220    #[fhir(name="concept", min="0", max="*", summary=false, modifier=false, choice="")]
221    pub concept: Option<Vec<CodeSystemConceptBackboneElement>>,
222}
223
224#[derive(Element, BackboneElement, Debug, Clone, Default)]
225pub struct CodeSystemConceptDesignationBackboneElement {
226    /// Unique id for inter-element referencing
227    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
228    pub id: Option<String>,
229    /// Additional content defined by implementations
230    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
231    pub extension: Option<Vec<Extension>>,
232    /// Extensions that cannot be ignored even if unrecognized
233    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
234    pub modifier_extension: Option<Vec<Extension>>,
235    /// Human language of the designation
236    #[fhir(name="language", min="0", max="1", summary=false, modifier=false, choice="")]
237    pub language: Option<CodeDt>,
238    /// Details how this designation would be used
239    #[fhir(name="use", min="0", max="1", summary=false, modifier=false, choice="")]
240    pub use_: Option<Coding>,
241    /// Additional ways how this designation would be used
242    #[fhir(name="additionalUse", min="0", max="*", summary=false, modifier=false, choice="")]
243    pub additional_use: Option<Vec<Coding>>,
244    /// The text value for this designation
245    #[fhir(name="value", min="1", max="1", summary=false, modifier=false, choice="")]
246    pub value: Option<StringDt>,
247}
248
249#[derive(Element, BackboneElement, Debug, Clone, Default)]
250pub struct CodeSystemConceptPropertyBackboneElement {
251    /// Unique id for inter-element referencing
252    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
253    pub id: Option<String>,
254    /// Additional content defined by implementations
255    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
256    pub extension: Option<Vec<Extension>>,
257    /// Extensions that cannot be ignored even if unrecognized
258    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
259    pub modifier_extension: Option<Vec<Extension>>,
260    /// Reference to CodeSystem.property.code
261    #[fhir(name="code", min="1", max="1", summary=false, modifier=false, choice="")]
262    pub code: Option<CodeDt>,
263    /// Value of the property for this concept
264    #[fhir(name="value", min="1", max="1", summary=false, modifier=false, choice="")]
265    pub value: Option<DecimalDt>,
266}
267