1#![allow(non_snake_case)]
2#![doc = " @generated by `bash scripts/operation_build.sh` - do not edit."]
3#[doc = "This operation is used to search for and return notifications that have been previously triggered by"]
4#[doc = "a topic-based Subscription in R4."]
5pub mod BackportSubscriptionEvents {
6 use haste_fhir_model::r4::generated::resources::{
7 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
8 };
9 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRString};
10 use haste_fhir_operation_error::OperationOutcomeError;
11 use haste_fhir_ops::derive::{FromParameters, ToParameters};
12 use std::sync::LazyLock;
13 pub const CODE: &str = "events";
14 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"backport-subscription-events","text":{"status":"extensions","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>URL: [base]/Subscription/[id]/$events</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>eventsSinceNumber</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#string\">string</a></td><td/><td><div><p>The starting event number, inclusive of this event (lower bound).</p>\n</div></td></tr><tr><td>IN</td><td>eventsUntilNumber</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#string\">string</a></td><td/><td><div><p>The ending event number, inclusive of this event (upper bound).</p>\n</div></td></tr><tr><td>IN</td><td>content</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#code\">code</a></td><td/><td><div><p>Requested content style of returned data. Codes from backport-content-value-set (e.g., empty, id-only, full-resource). This is a hint to the server what a client would prefer, and MAY be ignored.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4B/bundle.html\">Bundle</a></td><td/><td><div><p>The operation returns a valid notification bundle, with the first entry being the subscription status information resource. The bundle type is "history".</p>\n</div></td></tr></table></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":0},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"fhir"}],"url":"http://hl7.org/fhir/uv/subscriptions-backport/OperationDefinition/backport-subscription-events","version":"1.2.0-ballot","name":"R5SubscriptionEvents","title":"Subscription Events Operation","status":"active","kind":"operation","date":"2020-11-30","publisher":"HL7 International / FHIR Infrastructure","contact":[{"name":"HL7 International / FHIR Infrastructure","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/fiwg"}]},{"name":"Gino Canessa","telecom":[{"system":"email","value":"mailto:gino.canessa@microsoft.com"}]}],"description":"This operation is used to search for and return notifications that have been previously triggered by a topic-based Subscription in R4.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"001","display":"World"}]}],"affectsState":false,"code":"events","resource":["Subscription"],"system":false,"type":false,"instance":true,"parameter":[{"name":"eventsSinceNumber","use":"in","min":0,"max":"1","documentation":"The starting event number, inclusive of this event (lower bound).","type":"string"},{"name":"eventsUntilNumber","use":"in","min":0,"max":"1","documentation":"The ending event number, inclusive of this event (upper bound).","type":"string"},{"name":"content","use":"in","min":0,"max":"1","documentation":"Requested content style of returned data. Codes from backport-content-value-set (e.g., empty, id-only, full-resource). This is a hint to the server what a client would prefer, and MAY be ignored.","type":"code"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The operation returns a valid notification bundle, with the first entry being the subscription status information resource. The bundle type is \"history\".","type":"Bundle"}]}"#;
15 #[doc = "The `OperationDefinition` this module was generated from."]
16 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
17 serde_json::from_str(OPERATION_DEFINITION_JSON)
18 .expect("Generated OperationDefinition JSON must deserialize.")
19 });
20 #[derive(Debug, FromParameters, ToParameters)]
21 pub struct Input {
22 #[doc = "The starting event number, inclusive of this event (lower bound)."]
23 pub eventsSinceNumber: Option<FHIRString>,
24 #[doc = "The ending event number, inclusive of this event (upper bound)."]
25 pub eventsUntilNumber: Option<FHIRString>,
26 #[doc = "Requested content style of returned data. Codes from backport-content-value-set (e.g., empty,"]
27 #[doc = "id-only, full-resource). This is a hint to the server what a client would prefer, and MAY be"]
28 #[doc = "ignored."]
29 pub content: Option<FHIRCode>,
30 }
31 impl From<Input> for Resource {
32 fn from(value: Input) -> Self {
33 let parameters: Vec<ParametersParameter> = value.into();
34 Resource::Parameters(Parameters {
35 parameter: Some(parameters),
36 ..Default::default()
37 })
38 }
39 }
40 #[derive(Debug, FromParameters)]
41 pub struct Output {
42 #[doc = "The operation returns a valid notification bundle, with the first entry being the subscription"]
43 #[doc = "status information resource. The bundle type is \"history\"."]
44 #[parameter_rename = "return"]
45 pub return_: Bundle,
46 }
47 impl From<Output> for Resource {
48 fn from(value: Output) -> Self {
49 Resource::Bundle(value.return_)
50 }
51 }
52}
53#[doc = "This operation is used to get a token for a websocket client to use in order to bind to one or more"]
54#[doc = "subscriptions."]
55pub mod BackportSubscriptionGetWsBindingToken {
56 use haste_fhir_model::r4::generated::resources::{
57 OperationDefinition, Parameters, ParametersParameter, Resource,
58 };
59 use haste_fhir_model::r4::generated::types::{FHIRDateTime, FHIRId, FHIRString, FHIRUrl};
60 use haste_fhir_operation_error::OperationOutcomeError;
61 use haste_fhir_ops::derive::{FromParameters, ToParameters};
62 use std::sync::LazyLock;
63 pub const CODE: &str = "get-ws-binding-token";
64 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"backport-subscription-get-ws-binding-token","text":{"status":"extensions","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>URL: [base]/Subscription/$get-ws-binding-token</p><p>URL: [base]/Subscription/[id]/$get-ws-binding-token</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>id</td><td/><td>0..*</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#id\">id</a></td><td/><td><div><p>At the Instance level, this parameter is ignored. At the Resource level, one or more parameters containing a FHIR id for a Subscription to get a token for. In the absense of any specified ids, the server may either return a token for all Subscriptions available to the caller with a channel-type of websocket or fail the request.</p>\n</div></td></tr><tr><td>OUT</td><td>token</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#string\">string</a></td><td/><td><div><p>An access token that a client may use to show authorization during a websocket connection.</p>\n</div></td></tr><tr><td>OUT</td><td>expiration</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The date and time this token is valid until.</p>\n</div></td></tr><tr><td>OUT</td><td>subscription</td><td/><td>0..*</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#string\">string</a></td><td/><td><div><p>The subscriptions this token is valid for.</p>\n</div></td></tr><tr><td>OUT</td><td>websocket-url</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#url\">url</a></td><td/><td><div><p>The URL the client should use to connect to Websockets.</p>\n</div></td></tr></table></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":0},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"fhir"}],"url":"http://hl7.org/fhir/uv/subscriptions-backport/OperationDefinition/backport-subscription-get-ws-binding-token","version":"1.2.0-ballot","name":"R5SubscriptionGetWsBindingToken","title":"Get WS Binding Token for Subscription Operation","status":"active","kind":"operation","date":"2020-11-30","publisher":"HL7 International / FHIR Infrastructure","contact":[{"name":"HL7 International / FHIR Infrastructure","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/fiwg"}]},{"name":"Gino Canessa","telecom":[{"system":"email","value":"mailto:gino.canessa@microsoft.com"}]}],"description":"This operation is used to get a token for a websocket client to use in order to bind to one or more subscriptions.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"001","display":"World"}]}],"affectsState":false,"code":"get-ws-binding-token","resource":["Subscription"],"system":false,"type":true,"instance":true,"parameter":[{"name":"id","use":"in","min":0,"max":"*","documentation":"At the Instance level, this parameter is ignored. At the Resource level, one or more parameters containing a FHIR id for a Subscription to get a token for. In the absense of any specified ids, the server may either return a token for all Subscriptions available to the caller with a channel-type of websocket or fail the request.","type":"id"},{"name":"token","use":"out","min":1,"max":"1","documentation":"An access token that a client may use to show authorization during a websocket connection.","type":"string"},{"name":"expiration","use":"out","min":1,"max":"1","documentation":"The date and time this token is valid until.","type":"dateTime"},{"name":"subscription","use":"out","min":0,"max":"*","documentation":"The subscriptions this token is valid for.","type":"string"},{"name":"websocket-url","use":"out","min":1,"max":"1","documentation":"The URL the client should use to connect to Websockets.","type":"url"}]}"#;
65 #[doc = "The `OperationDefinition` this module was generated from."]
66 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
67 serde_json::from_str(OPERATION_DEFINITION_JSON)
68 .expect("Generated OperationDefinition JSON must deserialize.")
69 });
70 #[derive(Debug, FromParameters, ToParameters)]
71 pub struct Input {
72 #[doc = "At the Instance level, this parameter is ignored. At the Resource level, one or more parameters"]
73 #[doc = "containing a FHIR id for a Subscription to get a token for. In the absense of any specified ids, the"]
74 #[doc = "server may either return a token for all Subscriptions available to the caller with a channel-type"]
75 #[doc = "of websocket or fail the request."]
76 pub id: Option<Vec<FHIRId>>,
77 }
78 impl From<Input> for Resource {
79 fn from(value: Input) -> Self {
80 let parameters: Vec<ParametersParameter> = value.into();
81 Resource::Parameters(Parameters {
82 parameter: Some(parameters),
83 ..Default::default()
84 })
85 }
86 }
87 #[derive(Debug, FromParameters, ToParameters)]
88 pub struct Output {
89 #[doc = "An access token that a client may use to show authorization during a websocket connection."]
90 pub token: FHIRString,
91 #[doc = "The date and time this token is valid until."]
92 pub expiration: FHIRDateTime,
93 #[doc = "The subscriptions this token is valid for."]
94 pub subscription: Option<Vec<FHIRString>>,
95 #[doc = "The URL the client should use to connect to Websockets."]
96 #[parameter_rename = "websocket-url"]
97 pub websocket_url: FHIRUrl,
98 }
99 impl From<Output> for Resource {
100 fn from(value: Output) -> Self {
101 let parameters: Vec<ParametersParameter> = value.into();
102 Resource::Parameters(Parameters {
103 parameter: Some(parameters),
104 ..Default::default()
105 })
106 }
107 }
108}
109#[doc = "This operation is used to resend notifications that have been previously triggered by a topic-based"]
110#[doc = "Subscription in R4."]
111pub mod BackportSubscriptionResend {
112 use haste_fhir_model::r4::generated::resources::{
113 OperationDefinition, OperationOutcome, Parameters, ParametersParameter, Resource,
114 };
115 use haste_fhir_model::r4::generated::types::{FHIRInstant, FHIRString};
116 use haste_fhir_operation_error::OperationOutcomeError;
117 use haste_fhir_ops::derive::{FromParameters, ToParameters};
118 use std::sync::LazyLock;
119 pub const CODE: &str = "resend";
120 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"backport-subscription-resend","text":{"status":"extensions","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>URL: [base]/Subscription/[id]/$resend</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>eventsSinceNumber</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#string\">string</a></td><td/><td><div><p>The starting event number, inclusive of this event (lower bound).</p>\n</div></td></tr><tr><td>IN</td><td>eventsUntilNumber</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#string\">string</a></td><td/><td><div><p>The ending event number, inclusive of this event (upper bound).</p>\n</div></td></tr><tr><td>IN</td><td>eventsSinceInstant</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#instant\">instant</a></td><td/><td><div><p>The starting event date/time, inclusive of this instant (lower bound).</p>\n</div></td></tr><tr><td>IN</td><td>eventsUntilInstant</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#instant\">instant</a></td><td/><td><div><p>The ending event date/time, inclusive of this instant (upper bound).</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4B/operationoutcome.html\">OperationOutcome</a></td><td/><td><div><p>Outcome of this request.</p>\n</div></td></tr></table></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":0},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"fhir"}],"url":"http://hl7.org/fhir/uv/subscriptions-backport/OperationDefinition/backport-subscription-resend","version":"1.2.0-ballot","name":"SubscriptionResend","title":"Subscription Resend Operation","status":"active","kind":"operation","date":"2020-11-30","publisher":"HL7 International / FHIR Infrastructure","contact":[{"name":"HL7 International / FHIR Infrastructure","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/fiwg"}]},{"name":"Gino Canessa","telecom":[{"system":"email","value":"mailto:gino.canessa@microsoft.com"}]}],"description":"This operation is used to resend notifications that have been previously triggered by a topic-based Subscription in R4.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"001","display":"World"}]}],"affectsState":false,"code":"resend","resource":["Subscription"],"system":false,"type":false,"instance":true,"parameter":[{"name":"eventsSinceNumber","use":"in","min":0,"max":"1","documentation":"The starting event number, inclusive of this event (lower bound).","type":"string"},{"name":"eventsUntilNumber","use":"in","min":0,"max":"1","documentation":"The ending event number, inclusive of this event (upper bound).","type":"string"},{"name":"eventsSinceInstant","use":"in","min":0,"max":"1","documentation":"The starting event date/time, inclusive of this instant (lower bound).","type":"instant"},{"name":"eventsUntilInstant","use":"in","min":0,"max":"1","documentation":"The ending event date/time, inclusive of this instant (upper bound).","type":"instant"},{"name":"return","use":"out","min":1,"max":"1","documentation":"Outcome of this request.","type":"OperationOutcome"}]}"#;
121 #[doc = "The `OperationDefinition` this module was generated from."]
122 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
123 serde_json::from_str(OPERATION_DEFINITION_JSON)
124 .expect("Generated OperationDefinition JSON must deserialize.")
125 });
126 #[derive(Debug, FromParameters, ToParameters)]
127 pub struct Input {
128 #[doc = "The starting event number, inclusive of this event (lower bound)."]
129 pub eventsSinceNumber: Option<FHIRString>,
130 #[doc = "The ending event number, inclusive of this event (upper bound)."]
131 pub eventsUntilNumber: Option<FHIRString>,
132 #[doc = "The starting event date/time, inclusive of this instant (lower bound)."]
133 pub eventsSinceInstant: Option<FHIRInstant>,
134 #[doc = "The ending event date/time, inclusive of this instant (upper bound)."]
135 pub eventsUntilInstant: Option<FHIRInstant>,
136 }
137 impl From<Input> for Resource {
138 fn from(value: Input) -> Self {
139 let parameters: Vec<ParametersParameter> = value.into();
140 Resource::Parameters(Parameters {
141 parameter: Some(parameters),
142 ..Default::default()
143 })
144 }
145 }
146 #[derive(Debug, FromParameters)]
147 pub struct Output {
148 #[doc = "Outcome of this request."]
149 #[parameter_rename = "return"]
150 pub return_: OperationOutcome,
151 }
152 impl From<Output> for Resource {
153 fn from(value: Output) -> Self {
154 Resource::OperationOutcome(value.return_)
155 }
156 }
157}
158#[doc = "This operation is used to return the current status information about one or more topic-based"]
159#[doc = "Subscriptions in R4."]
160pub mod BackportSubscriptionStatus {
161 use haste_fhir_model::r4::generated::resources::{
162 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
163 };
164 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRId};
165 use haste_fhir_operation_error::OperationOutcomeError;
166 use haste_fhir_ops::derive::{FromParameters, ToParameters};
167 use std::sync::LazyLock;
168 pub const CODE: &str = "status";
169 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"backport-subscription-status","text":{"status":"extensions","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>URL: [base]/Subscription/$status</p><p>URL: [base]/Subscription/[id]/$status</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>id</td><td/><td>0..*</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#id\">id</a></td><td/><td><div><p>At the Instance level, this parameter is ignored. At the Resource level, one or more parameters containing a FHIR id for a Subscription to get status information for. In the absence of any specified ids, the server returns the status for all Subscriptions available to the caller. Multiple values are joined via OR (e.g., "id1" OR "id2").</p>\n</div></td></tr><tr><td>IN</td><td>status</td><td/><td>0..*</td><td><a href=\"http://hl7.org/fhir/R4B/datatypes.html#code\">code</a></td><td/><td><div><p>At the Instance level, this parameter is ignored. At the Resource level, a Subscription status to filter by (e.g., "active"). In the absence of any specified status values, the server does not filter contents based on the status. Multiple values are joined via OR (e.g., "error" OR "off").</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4B/bundle.html\">Bundle</a></td><td/><td><div><p>The operation returns a bundle containing one or more subscription status resources, one per Subscription being queried. The Bundle type is "searchset".</p>\n</div></td></tr></table></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":0},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"fhir"}],"url":"http://hl7.org/fhir/uv/subscriptions-backport/OperationDefinition/backport-subscription-status","version":"1.2.0-ballot","name":"R5SubscriptionStatus","title":"Subscription Status Operation","status":"active","kind":"operation","date":"2020-11-30","publisher":"HL7 International / FHIR Infrastructure","contact":[{"name":"HL7 International / FHIR Infrastructure","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/fiwg"}]},{"name":"Gino Canessa","telecom":[{"system":"email","value":"mailto:gino.canessa@microsoft.com"}]}],"description":"This operation is used to return the current status information about one or more topic-based Subscriptions in R4.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"001","display":"World"}]}],"affectsState":false,"code":"status","resource":["Subscription"],"system":false,"type":true,"instance":true,"parameter":[{"name":"id","use":"in","min":0,"max":"*","documentation":"At the Instance level, this parameter is ignored. At the Resource level, one or more parameters containing a FHIR id for a Subscription to get status information for. In the absence of any specified ids, the server returns the status for all Subscriptions available to the caller. Multiple values are joined via OR (e.g., \"id1\" OR \"id2\").","type":"id"},{"name":"status","use":"in","min":0,"max":"*","documentation":"At the Instance level, this parameter is ignored. At the Resource level, a Subscription status to filter by (e.g., \"active\"). In the absence of any specified status values, the server does not filter contents based on the status. Multiple values are joined via OR (e.g., \"error\" OR \"off\").","type":"code"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The operation returns a bundle containing one or more subscription status resources, one per Subscription being queried. The Bundle type is \"searchset\".","type":"Bundle"}]}"#;
170 #[doc = "The `OperationDefinition` this module was generated from."]
171 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
172 serde_json::from_str(OPERATION_DEFINITION_JSON)
173 .expect("Generated OperationDefinition JSON must deserialize.")
174 });
175 #[derive(Debug, FromParameters, ToParameters)]
176 pub struct Input {
177 #[doc = "At the Instance level, this parameter is ignored. At the Resource level, one or more parameters"]
178 #[doc = "containing a FHIR id for a Subscription to get status information for. In the absence of any"]
179 #[doc = "specified ids, the server returns the status for all Subscriptions available to the caller. Multiple"]
180 #[doc = "values are joined via OR (e.g., \"id1\" OR \"id2\")."]
181 pub id: Option<Vec<FHIRId>>,
182 #[doc = "At the Instance level, this parameter is ignored. At the Resource level, a Subscription status to"]
183 #[doc = "filter by (e.g., \"active\"). In the absence of any specified status values, the server does not"]
184 #[doc = "filter contents based on the status. Multiple values are joined via OR (e.g., \"error\" OR \"off\")."]
185 pub status: Option<Vec<FHIRCode>>,
186 }
187 impl From<Input> for Resource {
188 fn from(value: Input) -> Self {
189 let parameters: Vec<ParametersParameter> = value.into();
190 Resource::Parameters(Parameters {
191 parameter: Some(parameters),
192 ..Default::default()
193 })
194 }
195 }
196 #[derive(Debug, FromParameters)]
197 pub struct Output {
198 #[doc = "The operation returns a bundle containing one or more subscription status resources, one per"]
199 #[doc = "Subscription being queried. The Bundle type is \"searchset\"."]
200 #[parameter_rename = "return"]
201 pub return_: Bundle,
202 }
203 impl From<Output> for Resource {
204 fn from(value: Output) -> Self {
205 Resource::Bundle(value.return_)
206 }
207 }
208}
209#[doc = "Get Project resource for the current project."]
210pub mod ProjectInformation {
211 use haste_fhir_model::r4::generated::resources::{
212 OperationDefinition, Parameters, ParametersParameter, Project, Resource,
213 };
214 use haste_fhir_operation_error::OperationOutcomeError;
215 use haste_fhir_ops::derive::{FromParameters, ToParameters};
216 use std::sync::LazyLock;
217 pub const CODE: &str = "current-project";
218 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"project-information","url":"https://haste.health/OperationDefinition/project-information","version":"4.0.1","name":"Current Project Information","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Get Project resource for the current project.","code":"current-project","system":true,"type":false,"instance":false,"parameter":[{"name":"project","use":"out","min":1,"max":"1","documentation":"Users current project.","type":"Project"}]}"#;
219 #[doc = "The `OperationDefinition` this module was generated from."]
220 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
221 serde_json::from_str(OPERATION_DEFINITION_JSON)
222 .expect("Generated OperationDefinition JSON must deserialize.")
223 });
224 #[derive(Debug, FromParameters, ToParameters)]
225 pub struct Input {}
226 impl From<Input> for Resource {
227 fn from(value: Input) -> Self {
228 let parameters: Vec<ParametersParameter> = value.into();
229 Resource::Parameters(Parameters {
230 parameter: Some(parameters),
231 ..Default::default()
232 })
233 }
234 }
235 #[derive(Debug, FromParameters, ToParameters)]
236 pub struct Output {
237 #[doc = "Users current project."]
238 pub project: Project,
239 }
240 impl From<Output> for Resource {
241 fn from(value: Output) -> Self {
242 let parameters: Vec<ParametersParameter> = value.into();
243 Resource::Parameters(Parameters {
244 parameter: Some(parameters),
245 ..Default::default()
246 })
247 }
248 }
249}
250#[doc = "Get tenant information for the current tenant."]
251pub mod TenantInformation {
252 use haste_fhir_model::r4::generated::resources::{
253 OperationDefinition, Parameters, ParametersParameter, Resource,
254 };
255 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRString};
256 use haste_fhir_operation_error::OperationOutcomeError;
257 use haste_fhir_ops::derive::{FromParameters, ToParameters};
258 use std::sync::LazyLock;
259 pub const CODE: &str = "current-tenant";
260 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"tenant-information","url":"https://haste.health/OperationDefinition/tenant-information","version":"4.0.1","name":"Current Tenant Information","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Get tenant information for the current tenant.","code":"current-tenant","system":true,"type":false,"instance":false,"parameter":[{"name":"id","use":"out","min":1,"max":"1","documentation":"tenant id","type":"string"},{"name":"subscription","use":"out","min":1,"max":"1","documentation":"tenant subscription level","type":"code"}]}"#;
261 #[doc = "The `OperationDefinition` this module was generated from."]
262 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
263 serde_json::from_str(OPERATION_DEFINITION_JSON)
264 .expect("Generated OperationDefinition JSON must deserialize.")
265 });
266 #[derive(Debug, FromParameters, ToParameters)]
267 pub struct Input {}
268 impl From<Input> for Resource {
269 fn from(value: Input) -> Self {
270 let parameters: Vec<ParametersParameter> = value.into();
271 Resource::Parameters(Parameters {
272 parameter: Some(parameters),
273 ..Default::default()
274 })
275 }
276 }
277 #[derive(Debug, FromParameters, ToParameters)]
278 pub struct Output {
279 #[doc = "tenant id"]
280 pub id: FHIRString,
281 #[doc = "tenant subscription level"]
282 pub subscription: FHIRCode,
283 }
284 impl From<Output> for Resource {
285 fn from(value: Output) -> Self {
286 let parameters: Vec<ParametersParameter> = value.into();
287 Resource::Parameters(Parameters {
288 parameter: Some(parameters),
289 ..Default::default()
290 })
291 }
292 }
293}
294#[doc = "Get tenant endpoint information for the current tenant."]
295pub mod TenantEndpointInformation {
296 use haste_fhir_model::r4::generated::resources::{
297 OperationDefinition, Parameters, ParametersParameter, Resource,
298 };
299 use haste_fhir_model::r4::generated::types::FHIRUri;
300 use haste_fhir_operation_error::OperationOutcomeError;
301 use haste_fhir_ops::derive::{FromParameters, ToParameters};
302 use std::sync::LazyLock;
303 pub const CODE: &str = "endpoints";
304 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"tenant-endpoint-information","url":"https://haste.health/OperationDefinition/tenant-endpoint-information","version":"4.0.1","name":"Current Tenant Endpoint Information","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Get tenant endpoint information for the current tenant.","code":"endpoints","system":true,"type":false,"instance":false,"parameter":[{"name":"fhir-r4-base-url","use":"out","min":1,"max":"1","documentation":"FHIR R4 Endpoint URL.","type":"uri"},{"name":"fhir-r4-capabilities-url","use":"out","min":1,"max":"1","documentation":"FHIR R4 Capabilities URL.","type":"uri"},{"name":"oidc-discovery-url","use":"out","min":1,"max":"1","documentation":"OIDC Discovery URL.","type":"uri"},{"name":"oidc-token-endpoint","use":"out","min":1,"max":"1","documentation":"OIDC Token Endpoint.","type":"uri"},{"name":"oidc-authorize-endpoint","use":"out","min":1,"max":"1","documentation":"OIDC Authorize Endpoint.","type":"uri"},{"name":"oidc-jwks-endpoint","use":"out","min":1,"max":"1","documentation":"OIDC JWKS Endpoint.","type":"uri"},{"name":"mcp-endpoint","use":"out","min":1,"max":"1","documentation":"Model context protocol endpoint.","type":"uri"}]}"#;
305 #[doc = "The `OperationDefinition` this module was generated from."]
306 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
307 serde_json::from_str(OPERATION_DEFINITION_JSON)
308 .expect("Generated OperationDefinition JSON must deserialize.")
309 });
310 #[derive(Debug, FromParameters, ToParameters)]
311 pub struct Input {}
312 impl From<Input> for Resource {
313 fn from(value: Input) -> Self {
314 let parameters: Vec<ParametersParameter> = value.into();
315 Resource::Parameters(Parameters {
316 parameter: Some(parameters),
317 ..Default::default()
318 })
319 }
320 }
321 #[derive(Debug, FromParameters, ToParameters)]
322 pub struct Output {
323 #[doc = "FHIR R4 Endpoint URL."]
324 #[parameter_rename = "fhir-r4-base-url"]
325 pub fhir_r4_base_url: FHIRUri,
326 #[doc = "FHIR R4 Capabilities URL."]
327 #[parameter_rename = "fhir-r4-capabilities-url"]
328 pub fhir_r4_capabilities_url: FHIRUri,
329 #[doc = "OIDC Discovery URL."]
330 #[parameter_rename = "oidc-discovery-url"]
331 pub oidc_discovery_url: FHIRUri,
332 #[doc = "OIDC Token Endpoint."]
333 #[parameter_rename = "oidc-token-endpoint"]
334 pub oidc_token_endpoint: FHIRUri,
335 #[doc = "OIDC Authorize Endpoint."]
336 #[parameter_rename = "oidc-authorize-endpoint"]
337 pub oidc_authorize_endpoint: FHIRUri,
338 #[doc = "OIDC JWKS Endpoint."]
339 #[parameter_rename = "oidc-jwks-endpoint"]
340 pub oidc_jwks_endpoint: FHIRUri,
341 #[doc = "Model context protocol endpoint."]
342 #[parameter_rename = "mcp-endpoint"]
343 pub mcp_endpoint: FHIRUri,
344 }
345 impl From<Output> for Resource {
346 fn from(value: Output) -> Self {
347 let parameters: Vec<ParametersParameter> = value.into();
348 Resource::Parameters(Parameters {
349 parameter: Some(parameters),
350 ..Default::default()
351 })
352 }
353 }
354}
355#[doc = "Evaluate an Access Policy."]
356pub mod HasteHealthEvaluatePolicy {
357 use haste_fhir_model::r4::generated::resources::{
358 Bundle, OperationDefinition, OperationOutcome, Parameters, ParametersParameter, Resource,
359 };
360 use haste_fhir_model::r4::generated::types::Reference;
361 use haste_fhir_operation_error::OperationOutcomeError;
362 use haste_fhir_ops::derive::{FromParameters, ToParameters};
363 use std::sync::LazyLock;
364 pub const CODE: &str = "evaluate-policy";
365 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-evaluate-policy","url":"https://haste.health/OperationDefinition/evaluate-policy","version":"4.0.1","name":"EvaluateAccessPolicy","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Evaluate an Access Policy.","code":"evaluate-policy","resource":["AccessPolicyV2"],"system":false,"type":false,"instance":true,"parameter":[{"name":"user","use":"in","min":0,"max":"1","documentation":"The user to evaluate the policy against. Defaults to logged in user if not present.","type":"Reference"},{"name":"request","use":"in","min":1,"max":"1","documentation":"The requests to evaluate against the policy.","type":"Bundle"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the policy evaluation.","type":"OperationOutcome"}]}"#;
366 #[doc = "The `OperationDefinition` this module was generated from."]
367 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
368 serde_json::from_str(OPERATION_DEFINITION_JSON)
369 .expect("Generated OperationDefinition JSON must deserialize.")
370 });
371 #[derive(Debug, FromParameters, ToParameters)]
372 pub struct Input {
373 #[doc = "The user to evaluate the policy against. Defaults to logged in user if not present."]
374 pub user: Option<Reference>,
375 #[doc = "The requests to evaluate against the policy."]
376 pub request: Bundle,
377 }
378 impl From<Input> for Resource {
379 fn from(value: Input) -> Self {
380 let parameters: Vec<ParametersParameter> = value.into();
381 Resource::Parameters(Parameters {
382 parameter: Some(parameters),
383 ..Default::default()
384 })
385 }
386 }
387 #[derive(Debug, FromParameters)]
388 pub struct Output {
389 #[doc = "The result of the policy evaluation."]
390 #[parameter_rename = "return"]
391 pub return_: OperationOutcome,
392 }
393 impl From<Output> for Resource {
394 fn from(value: Output) -> Self {
395 Resource::OperationOutcome(value.return_)
396 }
397 }
398}
399#[doc = "Parse `HL7v2` messages."]
400pub mod Hl7v2Parse {
401 use haste_fhir_model::r4::generated::resources::{
402 HL7V2, OperationDefinition, Parameters, ParametersParameter, Resource,
403 };
404 use haste_fhir_model::r4::generated::types::FHIRString;
405 use haste_fhir_operation_error::OperationOutcomeError;
406 use haste_fhir_ops::derive::{FromParameters, ToParameters};
407 use std::sync::LazyLock;
408 pub const CODE: &str = "hl7v2-parse";
409 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"hl7v2-parse","url":"https://haste.health/OperationDefinition/hl7v2-parse","version":"4.0.1","name":"HL7v2 Parse","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Parse HL7v2 messages.","code":"hl7v2-parse","system":true,"type":false,"instance":false,"parameter":[{"name":"hl7v2","use":"in","min":1,"max":"1","documentation":"HL7v2 message to be parsed.","type":"string"},{"name":"hl7v2","use":"out","min":1,"max":"1","documentation":"Parsed HL7v2 message.","type":"HL7V2"}]}"#;
410 #[doc = "The `OperationDefinition` this module was generated from."]
411 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
412 serde_json::from_str(OPERATION_DEFINITION_JSON)
413 .expect("Generated OperationDefinition JSON must deserialize.")
414 });
415 #[derive(Debug, FromParameters, ToParameters)]
416 pub struct Input {
417 #[doc = "`HL7v2` message to be parsed."]
418 pub hl7v2: FHIRString,
419 }
420 impl From<Input> for Resource {
421 fn from(value: Input) -> Self {
422 let parameters: Vec<ParametersParameter> = value.into();
423 Resource::Parameters(Parameters {
424 parameter: Some(parameters),
425 ..Default::default()
426 })
427 }
428 }
429 #[derive(Debug, FromParameters, ToParameters)]
430 pub struct Output {
431 #[doc = "Parsed `HL7v2` message."]
432 pub hl7v2: HL7V2,
433 }
434 impl From<Output> for Resource {
435 fn from(value: Output) -> Self {
436 let parameters: Vec<ParametersParameter> = value.into();
437 Resource::Parameters(Parameters {
438 parameter: Some(parameters),
439 ..Default::default()
440 })
441 }
442 }
443}
444#[doc = "Get the registration information for an identity provider."]
445pub mod HasteHealthIdpRegistrationInfo {
446 use haste_fhir_model::r4::generated::resources::{
447 OperationDefinition, Parameters, ParametersParameter, Resource,
448 };
449 use haste_fhir_model::r4::generated::types::FHIRString;
450 use haste_fhir_operation_error::OperationOutcomeError;
451 use haste_fhir_ops::derive::{FromParameters, ToParameters};
452 use std::sync::LazyLock;
453 pub const CODE: &str = "registration-info";
454 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-idp-registration-info","url":"https://haste.health/OperationDefinition/identity-provider-registration-info","version":"4.0.1","name":"IdentityProviderRegistrationInformation","status":"draft","kind":"operation","publisher":"HasteHealth","description":"Get the registration information for an identity provider.","code":"registration-info","resource":["IdentityProvider"],"system":false,"type":false,"instance":true,"parameter":[{"name":"information","use":"out","min":0,"max":"*","documentation":"IdentityProviders registration information.","part":[{"name":"name","use":"out","min":1,"max":"1","documentation":"The name of the property.","type":"string"},{"name":"value","use":"out","min":1,"max":"1","documentation":"the value of the property.","type":"string"}]}]}"#;
455 #[doc = "The `OperationDefinition` this module was generated from."]
456 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
457 serde_json::from_str(OPERATION_DEFINITION_JSON)
458 .expect("Generated OperationDefinition JSON must deserialize.")
459 });
460 #[derive(Debug, FromParameters, ToParameters)]
461 pub struct Input {}
462 impl From<Input> for Resource {
463 fn from(value: Input) -> Self {
464 let parameters: Vec<ParametersParameter> = value.into();
465 Resource::Parameters(Parameters {
466 parameter: Some(parameters),
467 ..Default::default()
468 })
469 }
470 }
471 #[derive(Debug, FromParameters, ToParameters)]
472 pub struct OutputInformation {
473 #[doc = "The name of the property."]
474 pub name: FHIRString,
475 #[doc = "the value of the property."]
476 pub value: FHIRString,
477 }
478 impl From<OutputInformation> for Resource {
479 fn from(value: OutputInformation) -> Self {
480 let parameters: Vec<ParametersParameter> = value.into();
481 Resource::Parameters(Parameters {
482 parameter: Some(parameters),
483 ..Default::default()
484 })
485 }
486 }
487 #[derive(Debug, FromParameters, ToParameters)]
488 pub struct Output {
489 #[doc = "`IdentityProviders` registration information."]
490 #[parameter_nested]
491 pub information: Option<Vec<OutputInformation>>,
492 }
493 impl From<Output> for Resource {
494 fn from(value: Output) -> Self {
495 let parameters: Vec<ParametersParameter> = value.into();
496 Resource::Parameters(Parameters {
497 parameter: Some(parameters),
498 ..Default::default()
499 })
500 }
501 }
502}
503#[doc = "Install FHIR packages (implementation guides) into the current project: their profiles, extensions,"]
504#[doc = "`ValueSets`, `CodeSystems`, `ConceptMaps`, `NamingSystems` and `SearchParameters`. Name a package to"]
505#[doc = "fetch it from the package registry, or upload its .tgz. Each installed package is recorded as an"]
506#[doc = "`ImplementationGuide` whose id is the package name. Installing a package that is already installed"]
507#[doc = "replaces it with the version given. Everything is written in one transaction."]
508pub mod HasteHealthImplementationguideInstall {
509 use haste_fhir_model::r4::generated::resources::{
510 OperationDefinition, OperationOutcome, Parameters, ParametersParameter, Resource,
511 };
512 use haste_fhir_model::r4::generated::types::{
513 FHIRBase64Binary, FHIRBoolean, FHIRCode, FHIRInteger, FHIRString,
514 };
515 use haste_fhir_operation_error::OperationOutcomeError;
516 use haste_fhir_ops::derive::{FromParameters, ToParameters};
517 use std::sync::LazyLock;
518 pub const CODE: &str = "install";
519 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-implementationguide-install","url":"https://haste.health/OperationDefinition/implementationguide-install","version":"4.0.1","name":"Install Implementation Guide","status":"draft","kind":"operation","date":"2026-10-30T22:00:00+00:00","publisher":"HasteHealth","description":"Install FHIR packages (implementation guides) into the current project: their profiles, extensions, ValueSets, CodeSystems, ConceptMaps, NamingSystems and SearchParameters. Name a package to fetch it from the package registry, or upload its .tgz. Each installed package is recorded as an ImplementationGuide whose id is the package name. Installing a package that is already installed replaces it with the version given. Everything is written in one transaction.","affectsState":true,"code":"install","resource":["ImplementationGuide"],"system":false,"type":true,"instance":false,"parameter":[{"name":"package","use":"in","min":0,"max":"*","documentation":"A package to fetch from the package registry: 'name@version' (or 'name#version'), 'name@6.1.x' for the newest patch, or 'name' alone for the latest version. Example: 'hl7.fhir.us.core@6.1.0'.","type":"string"},{"name":"npmContent","use":"in","min":0,"max":"*","documentation":"A package tarball (.tgz), base64 encoded. Its dependencies are taken from the other uploaded tarballs first, then from the package registry.","type":"base64Binary"},{"name":"dependencies","use":"in","min":0,"max":"1","documentation":"Also install the packages these depend on (default true). A dependency that is already installed, in any version, is left as it is. The FHIR core packages are built in, and the server skips the large terminology packages (hl7.terminology, VSAC, PHIN VADS) unless they are named directly.","type":"boolean"},{"name":"examples","use":"in","min":0,"max":"1","documentation":"Also install the example resources of the packages named or uploaded (default false). Dependencies' examples are never installed.","type":"boolean"},{"name":"package","use":"out","min":0,"max":"*","documentation":"One for each package considered: the ones asked for and their dependencies.","part":[{"name":"name","use":"out","min":1,"max":"1","documentation":"The package name.","type":"string"},{"name":"version","use":"out","min":1,"max":"1","documentation":"The version installed, or for a skipped package the version asked for.","type":"string"},{"name":"status","use":"out","min":1,"max":"1","documentation":"installed (it was not installed before), updated (it replaced an installed version) or skipped (see reason).","type":"code"},{"name":"previousVersion","use":"out","min":0,"max":"1","documentation":"For updated, the version it replaced.","type":"string"},{"name":"resources","use":"out","min":0,"max":"1","documentation":"How many of its resources were written.","type":"integer"},{"name":"reason","use":"out","min":0,"max":"1","documentation":"Why a package was skipped.","type":"string"}]},{"name":"outcome","use":"out","min":0,"max":"1","documentation":"Warnings about resources that were not installed, for example a resource that could not be read or whose id is taken by a resource the package did not install.","type":"OperationOutcome"}]}"#;
520 #[doc = "The `OperationDefinition` this module was generated from."]
521 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
522 serde_json::from_str(OPERATION_DEFINITION_JSON)
523 .expect("Generated OperationDefinition JSON must deserialize.")
524 });
525 #[derive(Debug, FromParameters, ToParameters)]
526 pub struct Input {
527 #[doc = "A package to fetch from the package registry: 'name@version' (or 'name#version'), 'name@6.1.x' for"]
528 #[doc = "the newest patch, or `name` alone for the latest version. Example: 'hl7.fhir.us.core@6.1.0'."]
529 pub package: Option<Vec<FHIRString>>,
530 #[doc = "A package tarball (.tgz), base64 encoded. Its dependencies are taken from the other uploaded"]
531 #[doc = "tarballs first, then from the package registry."]
532 pub npmContent: Option<Vec<FHIRBase64Binary>>,
533 #[doc = "Also install the packages these depend on (default true). A dependency that is already installed, in"]
534 #[doc = "any version, is left as it is. The FHIR core packages are built in, and the server skips the large"]
535 #[doc = "terminology packages (hl7.terminology, VSAC, PHIN VADS) unless they are named directly."]
536 pub dependencies: Option<FHIRBoolean>,
537 #[doc = "Also install the example resources of the packages named or uploaded (default false). Dependencies'"]
538 #[doc = "examples are never installed."]
539 pub examples: Option<FHIRBoolean>,
540 }
541 impl From<Input> for Resource {
542 fn from(value: Input) -> Self {
543 let parameters: Vec<ParametersParameter> = value.into();
544 Resource::Parameters(Parameters {
545 parameter: Some(parameters),
546 ..Default::default()
547 })
548 }
549 }
550 #[derive(Debug, FromParameters, ToParameters)]
551 pub struct OutputPackage {
552 #[doc = "The package name."]
553 pub name: FHIRString,
554 #[doc = "The version installed, or for a skipped package the version asked for."]
555 pub version: FHIRString,
556 #[doc = "installed (it was not installed before), updated (it replaced an installed version) or skipped (see"]
557 #[doc = "reason)."]
558 pub status: FHIRCode,
559 #[doc = "For updated, the version it replaced."]
560 pub previousVersion: Option<FHIRString>,
561 #[doc = "How many of its resources were written."]
562 pub resources: Option<FHIRInteger>,
563 #[doc = "Why a package was skipped."]
564 pub reason: Option<FHIRString>,
565 }
566 impl From<OutputPackage> for Resource {
567 fn from(value: OutputPackage) -> Self {
568 let parameters: Vec<ParametersParameter> = value.into();
569 Resource::Parameters(Parameters {
570 parameter: Some(parameters),
571 ..Default::default()
572 })
573 }
574 }
575 #[derive(Debug, FromParameters, ToParameters)]
576 pub struct Output {
577 #[doc = "One for each package considered: the ones asked for and their dependencies."]
578 #[parameter_nested]
579 pub package: Option<Vec<OutputPackage>>,
580 #[doc = "Warnings about resources that were not installed, for example a resource that could not be read or"]
581 #[doc = "whose id is taken by a resource the package did not install."]
582 pub outcome: Option<OperationOutcome>,
583 }
584 impl From<Output> for Resource {
585 fn from(value: Output) -> Self {
586 let parameters: Vec<ParametersParameter> = value.into();
587 Resource::Parameters(Parameters {
588 parameter: Some(parameters),
589 ..Default::default()
590 })
591 }
592 }
593}
594#[doc = "Uninstall a package that $install installed in the current project: delete the resources it"]
595#[doc = "installed and its `ImplementationGuide` record. Packages it depends on stay installed."]
596pub mod HasteHealthImplementationguideUninstall {
597 use haste_fhir_model::r4::generated::resources::{
598 OperationDefinition, OperationOutcome, Parameters, ParametersParameter, Resource,
599 };
600 use haste_fhir_model::r4::generated::types::FHIRString;
601 use haste_fhir_operation_error::OperationOutcomeError;
602 use haste_fhir_ops::derive::{FromParameters, ToParameters};
603 use std::sync::LazyLock;
604 pub const CODE: &str = "uninstall";
605 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-implementationguide-uninstall","url":"https://haste.health/OperationDefinition/implementationguide-uninstall","version":"4.0.1","name":"Uninstall Implementation Guide","status":"draft","kind":"operation","date":"2026-10-30T22:00:00+00:00","publisher":"HasteHealth","description":"Uninstall a package that $install installed in the current project: delete the resources it installed and its ImplementationGuide record. Packages it depends on stay installed.","affectsState":true,"code":"uninstall","resource":["ImplementationGuide"],"system":false,"type":true,"instance":false,"parameter":[{"name":"name","use":"in","min":1,"max":"1","documentation":"The package name, for example 'hl7.fhir.us.core'.","type":"string"},{"name":"version","use":"in","min":0,"max":"1","documentation":"The installed version. When given and another version is installed, nothing is uninstalled.","type":"string"},{"name":"return","use":"out","min":1,"max":"1","documentation":"What was uninstalled.","type":"OperationOutcome"}]}"#;
606 #[doc = "The `OperationDefinition` this module was generated from."]
607 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
608 serde_json::from_str(OPERATION_DEFINITION_JSON)
609 .expect("Generated OperationDefinition JSON must deserialize.")
610 });
611 #[derive(Debug, FromParameters, ToParameters)]
612 pub struct Input {
613 #[doc = "The package name, for example 'hl7.fhir.us.core'."]
614 pub name: FHIRString,
615 #[doc = "The installed version. When given and another version is installed, nothing is uninstalled."]
616 pub version: Option<FHIRString>,
617 }
618 impl From<Input> for Resource {
619 fn from(value: Input) -> Self {
620 let parameters: Vec<ParametersParameter> = value.into();
621 Resource::Parameters(Parameters {
622 parameter: Some(parameters),
623 ..Default::default()
624 })
625 }
626 }
627 #[derive(Debug, FromParameters)]
628 pub struct Output {
629 #[doc = "What was uninstalled."]
630 #[parameter_rename = "return"]
631 pub return_: OperationOutcome,
632 }
633 impl From<Output> for Resource {
634 fn from(value: Output) -> Self {
635 Resource::OperationOutcome(value.return_)
636 }
637 }
638}
639#[doc = "Show resources that failed search indexing for the current tenant and project."]
640pub mod HasteHealthIndexingErrors {
641 use haste_fhir_model::r4::generated::resources::{
642 OperationDefinition, Parameters, ParametersParameter, Resource,
643 };
644 use haste_fhir_model::r4::generated::types::{
645 FHIRBoolean, FHIRCode, FHIRDateTime, FHIRId, FHIRInteger, FHIRString,
646 };
647 use haste_fhir_operation_error::OperationOutcomeError;
648 use haste_fhir_ops::derive::{FromParameters, ToParameters};
649 use std::sync::LazyLock;
650 pub const CODE: &str = "indexing-errors";
651 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-indexing-errors","url":"https://haste.health/OperationDefinition/indexing-errors","version":"4.0.1","name":"Show Indexing Errors","status":"draft","kind":"operation","date":"2026-08-14T22:29:23+00:00","publisher":"HasteHealth","description":"Show resources that failed search indexing for the current tenant and project.","code":"indexing-errors","system":true,"type":false,"instance":false,"parameter":[{"name":"resolve","use":"in","min":0,"max":"1","documentation":"If true, mark the indexing errors as resolved.","type":"boolean"},{"name":"errors","use":"out","min":0,"max":"*","documentation":"The resources that failed search indexing.","part":[{"name":"id","use":"out","min":1,"max":"1","documentation":"Version id of the resource that failed to index.","type":"id"},{"name":"version_id","use":"out","min":1,"max":"1","documentation":"Version id of the resource that failed to index.","type":"id"},{"name":"resource_type","use":"out","min":1,"max":"1","documentation":"FHIR resource type of the resource that failed to index.","type":"code"},{"name":"fhir_method","use":"out","min":1,"max":"1","documentation":"The operation (create, update or delete) that failed to index.","type":"code"},{"name":"sequence","use":"out","min":1,"max":"1","documentation":"Sequence position of the resource in the indexing stream.","type":"integer"},{"name":"attempt_count","use":"out","min":1,"max":"1","documentation":"Number of times indexing has been attempted for this resource.","type":"integer"},{"name":"error_message","use":"out","min":1,"max":"1","documentation":"The error that occurred while indexing.","type":"string"},{"name":"first_failed_at","use":"out","min":1,"max":"1","documentation":"When this resource first failed indexing.","type":"dateTime"},{"name":"last_failed_at","use":"out","min":1,"max":"1","documentation":"When this resource most recently failed indexing.","type":"dateTime"},{"name":"resolved_at","use":"out","min":0,"max":"1","documentation":"When this failure was marked resolved, if it has been.","type":"dateTime"}]}]}"#;
652 #[doc = "The `OperationDefinition` this module was generated from."]
653 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
654 serde_json::from_str(OPERATION_DEFINITION_JSON)
655 .expect("Generated OperationDefinition JSON must deserialize.")
656 });
657 #[derive(Debug, FromParameters, ToParameters)]
658 pub struct Input {
659 #[doc = "If true, mark the indexing errors as resolved."]
660 pub resolve: Option<FHIRBoolean>,
661 }
662 impl From<Input> for Resource {
663 fn from(value: Input) -> Self {
664 let parameters: Vec<ParametersParameter> = value.into();
665 Resource::Parameters(Parameters {
666 parameter: Some(parameters),
667 ..Default::default()
668 })
669 }
670 }
671 #[derive(Debug, FromParameters, ToParameters)]
672 pub struct OutputErrors {
673 #[doc = "Version id of the resource that failed to index."]
674 pub id: FHIRId,
675 #[doc = "Version id of the resource that failed to index."]
676 pub version_id: FHIRId,
677 #[doc = "FHIR resource type of the resource that failed to index."]
678 pub resource_type: FHIRCode,
679 #[doc = "The operation (create, update or delete) that failed to index."]
680 pub fhir_method: FHIRCode,
681 #[doc = "Sequence position of the resource in the indexing stream."]
682 pub sequence: FHIRInteger,
683 #[doc = "Number of times indexing has been attempted for this resource."]
684 pub attempt_count: FHIRInteger,
685 #[doc = "The error that occurred while indexing."]
686 pub error_message: FHIRString,
687 #[doc = "When this resource first failed indexing."]
688 pub first_failed_at: FHIRDateTime,
689 #[doc = "When this resource most recently failed indexing."]
690 pub last_failed_at: FHIRDateTime,
691 #[doc = "When this failure was marked resolved, if it has been."]
692 pub resolved_at: Option<FHIRDateTime>,
693 }
694 impl From<OutputErrors> for Resource {
695 fn from(value: OutputErrors) -> Self {
696 let parameters: Vec<ParametersParameter> = value.into();
697 Resource::Parameters(Parameters {
698 parameter: Some(parameters),
699 ..Default::default()
700 })
701 }
702 }
703 #[derive(Debug, FromParameters, ToParameters)]
704 pub struct Output {
705 #[doc = "The resources that failed search indexing."]
706 #[parameter_nested]
707 pub errors: Option<Vec<OutputErrors>>,
708 }
709 impl From<Output> for Resource {
710 fn from(value: Output) -> Self {
711 let parameters: Vec<ParametersParameter> = value.into();
712 Resource::Parameters(Parameters {
713 parameter: Some(parameters),
714 ..Default::default()
715 })
716 }
717 }
718}
719#[doc = "Delete refresh token from the user for the client."]
720pub mod HasteHealthDeleteRefreshToken {
721 use haste_fhir_model::r4::generated::resources::{
722 OperationDefinition, OperationOutcome, Parameters, ParametersParameter, Resource,
723 };
724 use haste_fhir_model::r4::generated::types::{FHIRId, FHIRString};
725 use haste_fhir_operation_error::OperationOutcomeError;
726 use haste_fhir_ops::derive::{FromParameters, ToParameters};
727 use std::sync::LazyLock;
728 pub const CODE: &str = "delete-refresh-token";
729 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-delete-refresh-token","url":"https://haste.health/OperationDefinition/delete-refresh-tokens","version":"4.0.1","name":"Delete refresh token","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Delete refresh token from the user for the client.","affectsState":true,"code":"delete-refresh-token","system":true,"type":false,"instance":false,"parameter":[{"name":"client_id","use":"in","min":1,"max":"1","documentation":"Client id for refresh token to delete.","type":"id"},{"name":"user_agent","use":"in","min":0,"max":"1","documentation":"User agent of the refresh token to delete.","type":"string"},{"name":"return","use":"out","min":1,"max":"1","documentation":"Result of the delete operation.","type":"OperationOutcome"}]}"#;
730 #[doc = "The `OperationDefinition` this module was generated from."]
731 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
732 serde_json::from_str(OPERATION_DEFINITION_JSON)
733 .expect("Generated OperationDefinition JSON must deserialize.")
734 });
735 #[derive(Debug, FromParameters, ToParameters)]
736 pub struct Input {
737 #[doc = "Client id for refresh token to delete."]
738 pub client_id: FHIRId,
739 #[doc = "User agent of the refresh token to delete."]
740 pub user_agent: Option<FHIRString>,
741 }
742 impl From<Input> for Resource {
743 fn from(value: Input) -> Self {
744 let parameters: Vec<ParametersParameter> = value.into();
745 Resource::Parameters(Parameters {
746 parameter: Some(parameters),
747 ..Default::default()
748 })
749 }
750 }
751 #[derive(Debug, FromParameters)]
752 pub struct Output {
753 #[doc = "Result of the delete operation."]
754 #[parameter_rename = "return"]
755 pub return_: OperationOutcome,
756 }
757 impl From<Output> for Resource {
758 fn from(value: Output) -> Self {
759 Resource::OperationOutcome(value.return_)
760 }
761 }
762}
763#[doc = "Show list of users refresh tokens."]
764pub mod HasteHealthListRefreshTokens {
765 use haste_fhir_model::r4::generated::resources::{
766 OperationDefinition, Parameters, ParametersParameter, Resource,
767 };
768 use haste_fhir_model::r4::generated::types::{FHIRDateTime, FHIRId, FHIRString};
769 use haste_fhir_operation_error::OperationOutcomeError;
770 use haste_fhir_ops::derive::{FromParameters, ToParameters};
771 use std::sync::LazyLock;
772 pub const CODE: &str = "refresh-tokens";
773 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-list-refresh-tokens","url":"https://haste-health.app/OperationDefinition/list-refresh-tokens","version":"4.0.1","name":"Show Refresh Tokens","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Show list of users refresh tokens.","code":"refresh-tokens","system":true,"type":false,"instance":false,"parameter":[{"name":"refresh-tokens","use":"out","min":0,"max":"*","documentation":"The result of the operation.","part":[{"name":"client_id","use":"out","min":1,"max":"1","documentation":"Client for refresh token.","type":"id"},{"name":"user_agent","use":"out","min":1,"max":"1","documentation":"User agent of the refresh token.","type":"string"},{"name":"created_at","use":"out","min":1,"max":"1","documentation":"When the refresh token was created.","type":"dateTime"}]}]}"#;
774 #[doc = "The `OperationDefinition` this module was generated from."]
775 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
776 serde_json::from_str(OPERATION_DEFINITION_JSON)
777 .expect("Generated OperationDefinition JSON must deserialize.")
778 });
779 #[derive(Debug, FromParameters, ToParameters)]
780 pub struct Input {}
781 impl From<Input> for Resource {
782 fn from(value: Input) -> Self {
783 let parameters: Vec<ParametersParameter> = value.into();
784 Resource::Parameters(Parameters {
785 parameter: Some(parameters),
786 ..Default::default()
787 })
788 }
789 }
790 #[derive(Debug, FromParameters, ToParameters)]
791 pub struct OutputRefreshTokens {
792 #[doc = "Client for refresh token."]
793 pub client_id: FHIRId,
794 #[doc = "User agent of the refresh token."]
795 pub user_agent: FHIRString,
796 #[doc = "When the refresh token was created."]
797 pub created_at: FHIRDateTime,
798 }
799 impl From<OutputRefreshTokens> for Resource {
800 fn from(value: OutputRefreshTokens) -> Self {
801 let parameters: Vec<ParametersParameter> = value.into();
802 Resource::Parameters(Parameters {
803 parameter: Some(parameters),
804 ..Default::default()
805 })
806 }
807 }
808 #[derive(Debug, FromParameters, ToParameters)]
809 pub struct Output {
810 #[doc = "The result of the operation."]
811 #[parameter_rename = "refresh-tokens"]
812 #[parameter_nested]
813 pub refresh_tokens: Option<Vec<OutputRefreshTokens>>,
814 }
815 impl From<Output> for Resource {
816 fn from(value: Output) -> Self {
817 let parameters: Vec<ParametersParameter> = value.into();
818 Resource::Parameters(Parameters {
819 parameter: Some(parameters),
820 ..Default::default()
821 })
822 }
823 }
824}
825#[doc = "Delete scope from user accepted scopes for the client."]
826pub mod HasteHealthDeleteScope {
827 use haste_fhir_model::r4::generated::resources::{
828 OperationDefinition, OperationOutcome, Parameters, ParametersParameter, Resource,
829 };
830 use haste_fhir_model::r4::generated::types::FHIRId;
831 use haste_fhir_operation_error::OperationOutcomeError;
832 use haste_fhir_ops::derive::{FromParameters, ToParameters};
833 use std::sync::LazyLock;
834 pub const CODE: &str = "delete-scope";
835 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-delete-scope","url":"https://haste.health/OperationDefinition/delete-scopes","version":"4.0.1","name":"Delete Scope","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Delete scope from user accepted scopes for the client.","affectsState":true,"code":"delete-scope","system":true,"type":false,"instance":false,"parameter":[{"name":"client_id","use":"in","min":1,"max":"1","documentation":"Client for which scopes are being shown.","type":"id"},{"name":"return","use":"out","min":1,"max":"1","documentation":"Result of the delete operation.","type":"OperationOutcome"}]}"#;
836 #[doc = "The `OperationDefinition` this module was generated from."]
837 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
838 serde_json::from_str(OPERATION_DEFINITION_JSON)
839 .expect("Generated OperationDefinition JSON must deserialize.")
840 });
841 #[derive(Debug, FromParameters, ToParameters)]
842 pub struct Input {
843 #[doc = "Client for which scopes are being shown."]
844 pub client_id: FHIRId,
845 }
846 impl From<Input> for Resource {
847 fn from(value: Input) -> Self {
848 let parameters: Vec<ParametersParameter> = value.into();
849 Resource::Parameters(Parameters {
850 parameter: Some(parameters),
851 ..Default::default()
852 })
853 }
854 }
855 #[derive(Debug, FromParameters)]
856 pub struct Output {
857 #[doc = "Result of the delete operation."]
858 #[parameter_rename = "return"]
859 pub return_: OperationOutcome,
860 }
861 impl From<Output> for Resource {
862 fn from(value: Output) -> Self {
863 Resource::OperationOutcome(value.return_)
864 }
865 }
866}
867#[doc = "Show list of user accepted scopes for apps."]
868pub mod HasteHealthListScopes {
869 use haste_fhir_model::r4::generated::resources::{
870 OperationDefinition, Parameters, ParametersParameter, Resource,
871 };
872 use haste_fhir_model::r4::generated::types::{FHIRDateTime, FHIRId, FHIRString};
873 use haste_fhir_operation_error::OperationOutcomeError;
874 use haste_fhir_ops::derive::{FromParameters, ToParameters};
875 use std::sync::LazyLock;
876 pub const CODE: &str = "scopes";
877 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-list-scopes","url":"https://haste.health/OperationDefinition/list-scopes","version":"4.0.1","name":"Show Scopes","status":"draft","kind":"operation","date":"2023-11-15T22:29:23+00:00","publisher":"HasteHealth","description":"Show list of user accepted scopes for apps.","code":"scopes","system":true,"type":false,"instance":false,"parameter":[{"name":"scopes","use":"out","min":0,"max":"*","documentation":"The result of the operation.","part":[{"name":"client_id","use":"out","min":1,"max":"1","documentation":"Client for which scopes are being shown.","type":"id"},{"name":"scopes","use":"out","min":1,"max":"1","documentation":"Scopes user accepted.","type":"string"},{"name":"created_at","use":"out","min":1,"max":"1","documentation":"When the scopes were accepted.","type":"dateTime"}]}]}"#;
878 #[doc = "The `OperationDefinition` this module was generated from."]
879 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
880 serde_json::from_str(OPERATION_DEFINITION_JSON)
881 .expect("Generated OperationDefinition JSON must deserialize.")
882 });
883 #[derive(Debug, FromParameters, ToParameters)]
884 pub struct Input {}
885 impl From<Input> for Resource {
886 fn from(value: Input) -> Self {
887 let parameters: Vec<ParametersParameter> = value.into();
888 Resource::Parameters(Parameters {
889 parameter: Some(parameters),
890 ..Default::default()
891 })
892 }
893 }
894 #[derive(Debug, FromParameters, ToParameters)]
895 pub struct OutputScopes {
896 #[doc = "Client for which scopes are being shown."]
897 pub client_id: FHIRId,
898 #[doc = "Scopes user accepted."]
899 pub scopes: FHIRString,
900 #[doc = "When the scopes were accepted."]
901 pub created_at: FHIRDateTime,
902 }
903 impl From<OutputScopes> for Resource {
904 fn from(value: OutputScopes) -> Self {
905 let parameters: Vec<ParametersParameter> = value.into();
906 Resource::Parameters(Parameters {
907 parameter: Some(parameters),
908 ..Default::default()
909 })
910 }
911 }
912 #[derive(Debug, FromParameters, ToParameters)]
913 pub struct Output {
914 #[doc = "The result of the operation."]
915 #[parameter_nested]
916 pub scopes: Option<Vec<OutputScopes>>,
917 }
918 impl From<Output> for Resource {
919 fn from(value: Output) -> Self {
920 let parameters: Vec<ParametersParameter> = value.into();
921 Resource::Parameters(Parameters {
922 parameter: Some(parameters),
923 ..Default::default()
924 })
925 }
926 }
927}
928#[doc = "Starts a SMART App Launch EHR launch of this client application for a patient, and optionally one of"]
929#[doc = "the patient's encounters. Only a signed-in user can start a launch, and the same user must then"]
930#[doc = "authorize the app. Open the returned url to start the app."]
931pub mod HasteHealthSmartLaunch {
932 use haste_fhir_model::r4::generated::resources::{
933 OperationDefinition, Parameters, ParametersParameter, Resource,
934 };
935 use haste_fhir_model::r4::generated::types::{FHIRString, FHIRUri, Reference};
936 use haste_fhir_operation_error::OperationOutcomeError;
937 use haste_fhir_ops::derive::{FromParameters, ToParameters};
938 use std::sync::LazyLock;
939 pub const CODE: &str = "launch";
940 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-smart-launch","url":"https://haste.health/OperationDefinition/smart-launch","version":"4.0.1","name":"SMART EHR launch","status":"draft","kind":"operation","date":"2026-10-07T00:00:00+00:00","publisher":"HasteHealth","description":"Starts a SMART App Launch EHR launch of this client application for a patient, and optionally one of the patient's encounters. Only a signed-in user can start a launch, and the same user must then authorize the app. Open the returned url to start the app.","affectsState":true,"code":"launch","resource":["ClientApplication"],"system":false,"type":false,"instance":true,"parameter":[{"name":"patient","use":"in","min":1,"max":"1","documentation":"The patient the app is launched for. The caller must be able to read it.","type":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient"]},{"name":"encounter","use":"in","min":0,"max":"1","documentation":"The encounter the app is launched in. It must be the patient's, and the caller must be able to read it.","type":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]},{"name":"launch","use":"out","min":1,"max":"1","documentation":"The opaque launch value the app passes back at authorization. It expires five minutes after it is created.","type":"string"},{"name":"iss","use":"out","min":1,"max":"1","documentation":"The FHIR base URL the app is launched against.","type":"uri"},{"name":"url","use":"out","min":1,"max":"1","documentation":"The client's launchUri with iss and launch added to its query. Open it to start the app.","type":"uri"}]}"#;
941 #[doc = "The `OperationDefinition` this module was generated from."]
942 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
943 serde_json::from_str(OPERATION_DEFINITION_JSON)
944 .expect("Generated OperationDefinition JSON must deserialize.")
945 });
946 #[derive(Debug, FromParameters, ToParameters)]
947 pub struct Input {
948 #[doc = "The patient the app is launched for. The caller must be able to read it."]
949 pub patient: Reference,
950 #[doc = "The encounter the app is launched in. It must be the patient's, and the caller must be able to read"]
951 #[doc = "it."]
952 pub encounter: Option<Reference>,
953 }
954 impl From<Input> for Resource {
955 fn from(value: Input) -> Self {
956 let parameters: Vec<ParametersParameter> = value.into();
957 Resource::Parameters(Parameters {
958 parameter: Some(parameters),
959 ..Default::default()
960 })
961 }
962 }
963 #[derive(Debug, FromParameters, ToParameters)]
964 pub struct Output {
965 #[doc = "The opaque launch value the app passes back at authorization. It expires five minutes after it is"]
966 #[doc = "created."]
967 pub launch: FHIRString,
968 #[doc = "The FHIR base URL the app is launched against."]
969 pub iss: FHIRUri,
970 #[doc = "The client's launchUri with iss and launch added to its query. Open it to start the app."]
971 pub url: FHIRUri,
972 }
973 impl From<Output> for Resource {
974 fn from(value: Output) -> Self {
975 let parameters: Vec<ParametersParameter> = value.into();
976 Resource::Parameters(Parameters {
977 parameter: Some(parameters),
978 ..Default::default()
979 })
980 }
981 }
982}
983#[doc = "Set display customization for the current tenant, such as its display name and logo."]
984pub mod HasteHealthTenantCustomization {
985 use haste_fhir_model::r4::generated::resources::{
986 OperationDefinition, Parameters, ParametersParameter, Resource,
987 };
988 use haste_fhir_model::r4::generated::types::{Attachment, FHIRString};
989 use haste_fhir_operation_error::OperationOutcomeError;
990 use haste_fhir_ops::derive::{FromParameters, ToParameters};
991 use std::sync::LazyLock;
992 pub const CODE: &str = "tenant-customization";
993 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-tenant-customization","url":"https://haste.health/OperationDefinition/tenant-customization","version":"4.0.1","name":"Tenant Customization","status":"draft","kind":"operation","date":"2026-08-20T22:29:23+00:00","publisher":"HasteHealth","description":"Set display customization for the current tenant, such as its display name and logo.","affectsState":true,"code":"tenant-customization","system":true,"type":false,"instance":false,"parameter":[{"name":"name","use":"in","min":0,"max":"1","documentation":"Display name for the tenant. Omit to clear the tenant's display name.","type":"string"},{"name":"logo","use":"in","min":0,"max":"1","documentation":"Logo for the tenant. Omit to clear the tenant's logo.","type":"Attachment"}]}"#;
994 #[doc = "The `OperationDefinition` this module was generated from."]
995 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
996 serde_json::from_str(OPERATION_DEFINITION_JSON)
997 .expect("Generated OperationDefinition JSON must deserialize.")
998 });
999 #[derive(Debug, FromParameters, ToParameters)]
1000 pub struct Input {
1001 #[doc = "Display name for the tenant. Omit to clear the tenant's display name."]
1002 pub name: Option<FHIRString>,
1003 #[doc = "Logo for the tenant. Omit to clear the tenant's logo."]
1004 pub logo: Option<Attachment>,
1005 }
1006 impl From<Input> for Resource {
1007 fn from(value: Input) -> Self {
1008 let parameters: Vec<ParametersParameter> = value.into();
1009 Resource::Parameters(Parameters {
1010 parameter: Some(parameters),
1011 ..Default::default()
1012 })
1013 }
1014 }
1015 #[derive(Debug, FromParameters, ToParameters)]
1016 pub struct Output {}
1017 impl From<Output> for Resource {
1018 fn from(value: Output) -> Self {
1019 let parameters: Vec<ParametersParameter> = value.into();
1020 Resource::Parameters(Parameters {
1021 parameter: Some(parameters),
1022 ..Default::default()
1023 })
1024 }
1025 }
1026}
1027#[doc = "Get the current tenant's display name and logo, if set."]
1028pub mod HasteHealthTenantBranding {
1029 use haste_fhir_model::r4::generated::resources::{
1030 OperationDefinition, Parameters, ParametersParameter, Resource,
1031 };
1032 use haste_fhir_model::r4::generated::types::{Attachment, FHIRString};
1033 use haste_fhir_operation_error::OperationOutcomeError;
1034 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1035 use std::sync::LazyLock;
1036 pub const CODE: &str = "tenant-branding";
1037 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"haste-health-tenant-branding","url":"https://haste.health/OperationDefinition/tenant-branding","version":"4.0.1","name":"Tenant Branding","status":"draft","kind":"operation","date":"2026-08-22T00:00:00+00:00","publisher":"HasteHealth","description":"Get the current tenant's display name and logo, if set.","code":"tenant-branding","system":true,"type":false,"instance":false,"parameter":[{"name":"name","use":"out","min":0,"max":"1","documentation":"Display name for the tenant, if one has been set.","type":"string"},{"name":"logo","use":"out","min":0,"max":"1","documentation":"Logo for the tenant, if one has been set.","type":"Attachment"}]}"#;
1038 #[doc = "The `OperationDefinition` this module was generated from."]
1039 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1040 serde_json::from_str(OPERATION_DEFINITION_JSON)
1041 .expect("Generated OperationDefinition JSON must deserialize.")
1042 });
1043 #[derive(Debug, FromParameters, ToParameters)]
1044 pub struct Input {}
1045 impl From<Input> for Resource {
1046 fn from(value: Input) -> Self {
1047 let parameters: Vec<ParametersParameter> = value.into();
1048 Resource::Parameters(Parameters {
1049 parameter: Some(parameters),
1050 ..Default::default()
1051 })
1052 }
1053 }
1054 #[derive(Debug, FromParameters, ToParameters)]
1055 pub struct Output {
1056 #[doc = "Display name for the tenant, if one has been set."]
1057 pub name: Option<FHIRString>,
1058 #[doc = "Logo for the tenant, if one has been set."]
1059 pub logo: Option<Attachment>,
1060 }
1061 impl From<Output> for Resource {
1062 fn from(value: Output) -> Self {
1063 let parameters: Vec<ParametersParameter> = value.into();
1064 Resource::Parameters(Parameters {
1065 parameter: Some(parameters),
1066 ..Default::default()
1067 })
1068 }
1069 }
1070}
1071#[doc = "The apply operation applies a definition in a specific context"]
1072pub mod ActivityDefinitionApply {
1073 use haste_fhir_model::r4::generated::resources::{
1074 ActivityDefinition, OperationDefinition, Parameters, ParametersParameter, Resource,
1075 };
1076 use haste_fhir_model::r4::generated::types::{CodeableConcept, FHIRString};
1077 use haste_fhir_operation_error::OperationOutcomeError;
1078 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1079 use std::sync::LazyLock;
1080 pub const CODE: &str = "apply";
1081 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ActivityDefinition-apply","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Apply</h2><p>OPERATION: Apply</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply</pre><div><p>The apply operation applies a definition in a specific context</p>\n</div><p>URL: [base]/ActivityDefinition/$apply</p><p>URL: [base]/ActivityDefinition/[id]/$apply</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>activityDefinition</td><td>0..1</td><td><a href=\"activitydefinition.html\">ActivityDefinition</a></td><td/><td><div><p>The activity definition to apply. If the operation is invoked on an instance, this parameter is not allowed. If the operation is invoked at the type level, this parameter is required</p>\n</div></td></tr><tr><td>IN</td><td>subject</td><td>1..*</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The subject(s) that is/are the target of the activity definition to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the PlanDefinition based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined</p>\n</div></td></tr><tr><td>IN</td><td>encounter</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The encounter in context, if any</p>\n</div></td></tr><tr><td>IN</td><td>practitioner</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The practitioner in context</p>\n</div></td></tr><tr><td>IN</td><td>organization</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The organization in context</p>\n</div></td></tr><tr><td>IN</td><td>userType</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>userLanguage</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Preferred language of the person using the system</p>\n</div></td></tr><tr><td>IN</td><td>userTaskContext</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources</p>\n</div></td></tr><tr><td>IN</td><td>setting</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The current setting of the request (inpatient, outpatient, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>settingContext</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Additional detail about the setting of the request, if any</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td>Any</td><td/><td><div><p>The resource that is the result of applying the definition</p>\n</div></td></tr></table><div><p>The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource. If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the ActivityDefinition resource</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply","version":"4.0.1","name":"Apply","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The apply operation applies a definition in a specific context","code":"apply","comment":"The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource. If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the ActivityDefinition resource","resource":["ActivityDefinition"],"system":false,"type":true,"instance":true,"parameter":[{"name":"activityDefinition","use":"in","min":0,"max":"1","documentation":"The activity definition to apply. If the operation is invoked on an instance, this parameter is not allowed. If the operation is invoked at the type level, this parameter is required","type":"ActivityDefinition"},{"name":"subject","use":"in","min":1,"max":"*","documentation":"The subject(s) that is/are the target of the activity definition to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the `PlanDefinition` based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined","type":"string","searchType":"reference"},{"name":"encounter","use":"in","min":0,"max":"1","documentation":"The encounter in context, if any","type":"string","searchType":"reference"},{"name":"practitioner","use":"in","min":0,"max":"1","documentation":"The practitioner in context","type":"string","searchType":"reference"},{"name":"organization","use":"in","min":0,"max":"1","documentation":"The organization in context","type":"string","searchType":"reference"},{"name":"userType","use":"in","min":0,"max":"1","documentation":"The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)","type":"CodeableConcept"},{"name":"userLanguage","use":"in","min":0,"max":"1","documentation":"Preferred language of the person using the system","type":"CodeableConcept"},{"name":"userTaskContext","use":"in","min":0,"max":"1","documentation":"The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources","type":"CodeableConcept"},{"name":"setting","use":"in","min":0,"max":"1","documentation":"The current setting of the request (inpatient, outpatient, etc.)","type":"CodeableConcept"},{"name":"settingContext","use":"in","min":0,"max":"1","documentation":"Additional detail about the setting of the request, if any","type":"CodeableConcept"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The resource that is the result of applying the definition","type":"Any"}]}"#;
1082 #[doc = "The `OperationDefinition` this module was generated from."]
1083 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1084 serde_json::from_str(OPERATION_DEFINITION_JSON)
1085 .expect("Generated OperationDefinition JSON must deserialize.")
1086 });
1087 #[derive(Debug, FromParameters, ToParameters)]
1088 pub struct Input {
1089 #[doc = "The activity definition to apply. If the operation is invoked on an instance, this parameter is not"]
1090 #[doc = "allowed. If the operation is invoked at the type level, this parameter is required"]
1091 pub activityDefinition: Option<ActivityDefinition>,
1092 #[doc = "The subject(s) that is/are the target of the activity definition to be applied. The subject may be a"]
1093 #[doc = "Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter"]
1094 #[doc = "will be resolved as the subject of the `PlanDefinition` based on the type of the subject. If"]
1095 #[doc = "multiple subjects of the same type are provided, the behavior is implementation-defined"]
1096 pub subject: Vec<FHIRString>,
1097 #[doc = "The encounter in context, if any"]
1098 pub encounter: Option<FHIRString>,
1099 #[doc = "The practitioner in context"]
1100 pub practitioner: Option<FHIRString>,
1101 #[doc = "The organization in context"]
1102 pub organization: Option<FHIRString>,
1103 #[doc = "The type of user initiating the request, e.g. patient, healthcare provider, or specific type of"]
1104 #[doc = "healthcare provider (physician, nurse, etc.)"]
1105 pub userType: Option<CodeableConcept>,
1106 #[doc = "Preferred language of the person using the system"]
1107 pub userLanguage: Option<CodeableConcept>,
1108 #[doc = "The task the system user is performing, e.g. laboratory results review, medication list review, etc."]
1109 #[doc = "This information can be used to tailor decision support outputs, such as recommended information"]
1110 #[doc = "resources"]
1111 pub userTaskContext: Option<CodeableConcept>,
1112 #[doc = "The current setting of the request (inpatient, outpatient, etc.)"]
1113 pub setting: Option<CodeableConcept>,
1114 #[doc = "Additional detail about the setting of the request, if any"]
1115 pub settingContext: Option<CodeableConcept>,
1116 }
1117 impl From<Input> for Resource {
1118 fn from(value: Input) -> Self {
1119 let parameters: Vec<ParametersParameter> = value.into();
1120 Resource::Parameters(Parameters {
1121 parameter: Some(parameters),
1122 ..Default::default()
1123 })
1124 }
1125 }
1126 #[derive(Debug, FromParameters)]
1127 pub struct Output {
1128 #[doc = "The resource that is the result of applying the definition"]
1129 #[parameter_rename = "return"]
1130 pub return_: Resource,
1131 }
1132 impl From<Output> for Resource {
1133 fn from(value: Output) -> Self {
1134 value.return_
1135 }
1136 }
1137}
1138#[doc = "The data-requirements operation aggregates and returns the parameters and data requirements for the"]
1139#[doc = "activity definition and all its dependencies as a single module definition library"]
1140pub mod ActivityDefinitionDataRequirements {
1141 use haste_fhir_model::r4::generated::resources::{
1142 Library, OperationDefinition, Parameters, ParametersParameter, Resource,
1143 };
1144 use haste_fhir_operation_error::OperationOutcomeError;
1145 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1146 use std::sync::LazyLock;
1147 pub const CODE: &str = "data-requirements";
1148 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ActivityDefinition-data-requirements","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Data Requirements</h2><p>OPERATION: Data Requirements</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ActivityDefinition-data-requirements</pre><div><p>The data-requirements operation aggregates and returns the parameters and data requirements for the activity definition and all its dependencies as a single module definition library</p>\n</div><p>URL: [base]/ActivityDefinition/[id]/$data-requirements</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"library.html\">Library</a></td><td/><td><div><p>The result of the requirements gathering represented as a module-definition Library that describes the aggregate parameters, data requirements, and dependencies of the activity definition</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for the activity definition. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the activity definition and any libraries referenced by it. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements)</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/ActivityDefinition-data-requirements","version":"4.0.1","name":"Data Requirements","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The data-requirements operation aggregates and returns the parameters and data requirements for the activity definition and all its dependencies as a single module definition library","code":"data-requirements","comment":"The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for the activity definition. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the activity definition and any libraries referenced by it. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements)","resource":["ActivityDefinition"],"system":false,"type":false,"instance":true,"parameter":[{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the requirements gathering represented as a module-definition Library that describes the aggregate parameters, data requirements, and dependencies of the activity definition","type":"Library"}]}"#;
1149 #[doc = "The `OperationDefinition` this module was generated from."]
1150 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1151 serde_json::from_str(OPERATION_DEFINITION_JSON)
1152 .expect("Generated OperationDefinition JSON must deserialize.")
1153 });
1154 #[derive(Debug, FromParameters, ToParameters)]
1155 pub struct Input {}
1156 impl From<Input> for Resource {
1157 fn from(value: Input) -> Self {
1158 let parameters: Vec<ParametersParameter> = value.into();
1159 Resource::Parameters(Parameters {
1160 parameter: Some(parameters),
1161 ..Default::default()
1162 })
1163 }
1164 }
1165 #[derive(Debug, FromParameters)]
1166 pub struct Output {
1167 #[doc = "The result of the requirements gathering represented as a module-definition Library that describes"]
1168 #[doc = "the aggregate parameters, data requirements, and dependencies of the activity definition"]
1169 #[parameter_rename = "return"]
1170 pub return_: Library,
1171 }
1172 impl From<Output> for Resource {
1173 fn from(value: Output) -> Self {
1174 Resource::Library(value.return_)
1175 }
1176 }
1177}
1178#[doc = "This operation asks the server to check that it implements all the resources, interactions, search"]
1179#[doc = "parameters, and operations that the client provides in its capability statement. The client provides"]
1180#[doc = "both capability statements by reference, and must ensure that all the referenced resources are"]
1181#[doc = "available to the conformance server"]
1182pub mod CapabilityStatementConforms {
1183 use haste_fhir_model::r4::generated::resources::{
1184 CapabilityStatement, OperationDefinition, OperationOutcome, Parameters,
1185 ParametersParameter, Resource,
1186 };
1187 use haste_fhir_model::r4::generated::types::{FHIRCanonical, FHIRCode};
1188 use haste_fhir_operation_error::OperationOutcomeError;
1189 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1190 use std::sync::LazyLock;
1191 pub const CODE: &str = "conforms";
1192 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CapabilityStatement-conforms","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Test if a server implements a client's required operations</h2><p>OPERATION: Test if a server implements a client's required operations</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CapabilityStatement-conforms</pre><div><p>This operation asks the server to check that it implements all the resources, interactions, search parameters, and operations that the client provides in its capability statement. The client provides both capability statements by reference, and must ensure that all the referenced resources are available to the conformance server</p>\n</div><p>URL: [base]/CapabilityStatement/$conforms</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>left</td><td>0..1</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>A canonical reference to the left-hand system's capability statement</p>\n</div></td></tr><tr><td>IN</td><td>right</td><td>0..1</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>A canonical reference to the right-hand system's capability statement</p>\n</div></td></tr><tr><td>IN</td><td>mode</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>What kind of comparison to perform - server to server, or client to server (use the codes 'server/server' or 'client/server')</p>\n</div></td></tr><tr><td>OUT</td><td>issues</td><td>1..1</td><td><a href=\"operationoutcome.html\">OperationOutcome</a></td><td/><td><div><p>Outcome of the CapabilityStatement test</p>\n</div></td></tr><tr><td>OUT</td><td>union</td><td>0..1</td><td><a href=\"capabilitystatement.html\">CapabilityStatement</a></td><td/><td><div><p>The intersection of the functionality described by the CapabilityStatement resources</p>\n</div></td></tr><tr><td>OUT</td><td>intersection</td><td>0..1</td><td><a href=\"capabilitystatement.html\">CapabilityStatement</a></td><td/><td><div><p>The union of the functionality described by the CapabilityStatement resources</p>\n</div></td></tr></table><div><p>The operation performs a full comparison of the functionality described by the two capability statements, including the profiles and value sets they reference, and also including concept maps and structure maps.</p>\n<p>The full execution of this operation is still a matter of research, but it is intended to support comparison of systems to see if they will interoperate</p>\n<p>If the capability statements can be successfully compared, then the return value is a 200 OK with an OperationOutcome along with intersection and union capability statements. The operation outcome can contain errors relating to differences between the capability statements. If the capability statements cannot be compared, because dependencies cannot be located, the return value is a 4xx error, with an OperationOutcome with at least one issue with severity >= error</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/CapabilityStatement-conforms","version":"4.0.1","name":"Test if a server implements a client's required operations","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation asks the server to check that it implements all the resources, interactions, search parameters, and operations that the client provides in its capability statement. The client provides both capability statements by reference, and must ensure that all the referenced resources are available to the conformance server","code":"conforms","comment":"The operation performs a full comparison of the functionality described by the two capability statements, including the profiles and value sets they reference, and also including concept maps and structure maps. \n\nThe full execution of this operation is still a matter of research, but it is intended to support comparison of systems to see if they will interoperate \n\nIf the capability statements can be successfully compared, then the return value is a 200 OK with an OperationOutcome along with intersection and union capability statements. The operation outcome can contain errors relating to differences between the capability statements. If the capability statements cannot be compared, because dependencies cannot be located, the return value is a 4xx error, with an OperationOutcome with at least one issue with severity >= error","resource":["CapabilityStatement"],"system":false,"type":true,"instance":false,"parameter":[{"name":"left","use":"in","min":0,"max":"1","documentation":"A canonical reference to the left-hand system's capability statement","type":"canonical"},{"name":"right","use":"in","min":0,"max":"1","documentation":"A canonical reference to the right-hand system's capability statement","type":"canonical"},{"name":"mode","use":"in","min":0,"max":"1","documentation":"What kind of comparison to perform - server to server, or client to server (use the codes 'server/server' or 'client/server')","type":"code"},{"name":"issues","use":"out","min":1,"max":"1","documentation":"Outcome of the `CapabilityStatement` test","type":"OperationOutcome"},{"name":"union","use":"out","min":0,"max":"1","documentation":"The intersection of the functionality described by the `CapabilityStatement` resources","type":"CapabilityStatement"},{"name":"intersection","use":"out","min":0,"max":"1","documentation":"The union of the functionality described by the `CapabilityStatement` resources","type":"CapabilityStatement"}]}"#;
1193 #[doc = "The `OperationDefinition` this module was generated from."]
1194 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1195 serde_json::from_str(OPERATION_DEFINITION_JSON)
1196 .expect("Generated OperationDefinition JSON must deserialize.")
1197 });
1198 #[derive(Debug, FromParameters, ToParameters)]
1199 pub struct Input {
1200 #[doc = "A canonical reference to the left-hand system's capability statement"]
1201 pub left: Option<FHIRCanonical>,
1202 #[doc = "A canonical reference to the right-hand system's capability statement"]
1203 pub right: Option<FHIRCanonical>,
1204 #[doc = "What kind of comparison to perform - server to server, or client to server (use the codes"]
1205 #[doc = "'server/server' or 'client/server')"]
1206 pub mode: Option<FHIRCode>,
1207 }
1208 impl From<Input> for Resource {
1209 fn from(value: Input) -> Self {
1210 let parameters: Vec<ParametersParameter> = value.into();
1211 Resource::Parameters(Parameters {
1212 parameter: Some(parameters),
1213 ..Default::default()
1214 })
1215 }
1216 }
1217 #[derive(Debug, FromParameters, ToParameters)]
1218 pub struct Output {
1219 #[doc = "Outcome of the `CapabilityStatement` test"]
1220 pub issues: OperationOutcome,
1221 #[doc = "The intersection of the functionality described by the `CapabilityStatement` resources"]
1222 #[parameter_rename = "union"]
1223 pub union_: Option<CapabilityStatement>,
1224 #[doc = "The union of the functionality described by the `CapabilityStatement` resources"]
1225 pub intersection: Option<CapabilityStatement>,
1226 }
1227 impl From<Output> for Resource {
1228 fn from(value: Output) -> Self {
1229 let parameters: Vec<ParametersParameter> = value.into();
1230 Resource::Parameters(Parameters {
1231 parameter: Some(parameters),
1232 ..Default::default()
1233 })
1234 }
1235 }
1236}
1237#[doc = "This operation asks the server to check that it implements all the resources, interactions, search"]
1238#[doc = "parameters, and operations that the client provides in its capability statement. The client provides"]
1239#[doc = "its capability statement inline, or by referring the server to the canonical URL of its capability"]
1240#[doc = "statement"]
1241pub mod CapabilityStatementImplements {
1242 use haste_fhir_model::r4::generated::resources::{
1243 CapabilityStatement, OperationDefinition, OperationOutcome, Parameters,
1244 ParametersParameter, Resource,
1245 };
1246 use haste_fhir_model::r4::generated::types::FHIRCanonical;
1247 use haste_fhir_operation_error::OperationOutcomeError;
1248 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1249 use std::sync::LazyLock;
1250 pub const CODE: &str = "implements";
1251 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CapabilityStatement-implements","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Test if a server implements a client's required operations</h2><p>OPERATION: Test if a server implements a client's required operations</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CapabilityStatement-implements</pre><div><p>This operation asks the server to check that it implements all the resources, interactions, search parameters, and operations that the client provides in its capability statement. The client provides its capability statement inline, or by referring the server to the canonical URL of its capability statement</p>\n</div><p>URL: [base]/CapabilityStatement/$implements</p><p>URL: [base]/CapabilityStatement/[id]/$implements</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>server</td><td>0..1</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>A canonical reference to the server capability statement - use this if the implements is not invoked on an instance (or on the /metadata end-point)</p>\n</div></td></tr><tr><td>IN</td><td>client</td><td>0..1</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>A canonical reference to the client capability statement - use this if the implements is not invoked on an instance (or on the /metadata end-point)</p>\n</div></td></tr><tr><td>IN</td><td>resource</td><td>0..1</td><td><a href=\"capabilitystatement.html\">CapabilityStatement</a></td><td/><td><div><p>The client capability statement, provided inline</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"operationoutcome.html\">OperationOutcome</a></td><td/><td><div><p>Outcome of the CapabilityStatement test</p>\n</div></td></tr></table><div><p>The operation does not perform a full conformance check; in particular it does not check that the profiles align. It merely checks that the behaviors the client wishes to use are provided Technically, this operation is implemented as follows:</p>\n<ul>\n<li>The server's capability statement must have an entry for each resource in the client's capability statement</li>\n<li>The server's resource support must have matching flags for updateCreate, conditionalCreate, conditionalRead, conditionalUpdate, conditionalDelete, searchInclude, searchRevInclude</li>\n<li>The server's capability statement must have a matching interaction for each interaction in the client capability statement (whether or not it is on a resource)</li>\n<li>The server's capability statement must have a search parameter with matching name and definition for any search parameters in the client capability statement</li>\n<li>The server must have an operation definition with a matching reference for any operations in the client capability statement</li>\n</ul>\n<p>If the capability statements match by these rules, then the return value is a 200 OK with an operation outcome that contains no issues with severity >= error. If the capability statement doesn't match, the return value is a 4xx error, with an OperationOutcome with at least one issue with severity >= error</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/CapabilityStatement-implements","version":"4.0.1","name":"Test if a server implements a client's required operations","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation asks the server to check that it implements all the resources, interactions, search parameters, and operations that the client provides in its capability statement. The client provides its capability statement inline, or by referring the server to the canonical URL of its capability statement","code":"implements","comment":"The operation does not perform a full conformance check; in particular it does not check that the profiles align. It merely checks that the behaviors the client wishes to use are provided Technically, this operation is implemented as follows: \n\n* The server's capability statement must have an entry for each resource in the client's capability statement \n* The server's resource support must have matching flags for updateCreate, conditionalCreate, conditionalRead, conditionalUpdate, conditionalDelete, searchInclude, searchRevInclude \n* The server's capability statement must have a matching interaction for each interaction in the client capability statement (whether or not it is on a resource) \n* The server's capability statement must have a search parameter with matching name and definition for any search parameters in the client capability statement \n* The server must have an operation definition with a matching reference for any operations in the client capability statement \n\nIf the capability statements match by these rules, then the return value is a 200 OK with an operation outcome that contains no issues with severity >= error. If the capability statement doesn't match, the return value is a 4xx error, with an OperationOutcome with at least one issue with severity >= error","resource":["CapabilityStatement"],"system":false,"type":true,"instance":true,"parameter":[{"name":"server","use":"in","min":0,"max":"1","documentation":"A canonical reference to the server capability statement - use this if the implements is not invoked on an instance (or on the /metadata end-point)","type":"canonical"},{"name":"client","use":"in","min":0,"max":"1","documentation":"A canonical reference to the client capability statement - use this if the implements is not invoked on an instance (or on the /metadata end-point)","type":"canonical"},{"name":"resource","use":"in","min":0,"max":"1","documentation":"The client capability statement, provided inline","type":"CapabilityStatement"},{"name":"return","use":"out","min":1,"max":"1","documentation":"Outcome of the `CapabilityStatement` test","type":"OperationOutcome"}]}"#;
1252 #[doc = "The `OperationDefinition` this module was generated from."]
1253 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1254 serde_json::from_str(OPERATION_DEFINITION_JSON)
1255 .expect("Generated OperationDefinition JSON must deserialize.")
1256 });
1257 #[derive(Debug, FromParameters, ToParameters)]
1258 pub struct Input {
1259 #[doc = "A canonical reference to the server capability statement - use this if the implements is not invoked"]
1260 #[doc = "on an instance (or on the /metadata end-point)"]
1261 pub server: Option<FHIRCanonical>,
1262 #[doc = "A canonical reference to the client capability statement - use this if the implements is not invoked"]
1263 #[doc = "on an instance (or on the /metadata end-point)"]
1264 pub client: Option<FHIRCanonical>,
1265 #[doc = "The client capability statement, provided inline"]
1266 pub resource: Option<CapabilityStatement>,
1267 }
1268 impl From<Input> for Resource {
1269 fn from(value: Input) -> Self {
1270 let parameters: Vec<ParametersParameter> = value.into();
1271 Resource::Parameters(Parameters {
1272 parameter: Some(parameters),
1273 ..Default::default()
1274 })
1275 }
1276 }
1277 #[derive(Debug, FromParameters)]
1278 pub struct Output {
1279 #[doc = "Outcome of the `CapabilityStatement` test"]
1280 #[parameter_rename = "return"]
1281 pub return_: OperationOutcome,
1282 }
1283 impl From<Output> for Resource {
1284 fn from(value: Output) -> Self {
1285 Resource::OperationOutcome(value.return_)
1286 }
1287 }
1288}
1289#[doc = "This operation asks the server to return a subset of the `CapabilityStatement` resource - just the"]
1290#[doc = "REST parts that relate to a set of nominated resources - the resources that the client is interested"]
1291#[doc = "in"]
1292pub mod CapabilityStatementSubset {
1293 use haste_fhir_model::r4::generated::resources::{
1294 CapabilityStatement, OperationDefinition, Parameters, ParametersParameter, Resource,
1295 };
1296 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRUri};
1297 use haste_fhir_operation_error::OperationOutcomeError;
1298 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1299 use std::sync::LazyLock;
1300 pub const CODE: &str = "subset";
1301 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CapabilityStatement-subset","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Fetch a subset of the CapabilityStatement resource</h2><p>OPERATION: Fetch a subset of the CapabilityStatement resource</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CapabilityStatement-subset</pre><div><p>This operation asks the server to return a subset of the CapabilityStatement resource - just the REST parts that relate to a set of nominated resources - the resources that the client is interested in</p>\n</div><p>URL: [base]/CapabilityStatement/$subset</p><p>URL: [base]/CapabilityStatement/[id]/$subset</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>server</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The canonical URL - use this if the subset is not invoked on an instance (or on the /metadata end-point)</p>\n</div></td></tr><tr><td>IN</td><td>resource</td><td>1..*</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>A resource that the client would like to include in the return</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"capabilitystatement.html\">CapabilityStatement</a></td><td/><td><div><p>The subsetted CapabilityStatement resource that is returned. This should be tagged with the SUBSETTED code</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/CapabilityStatement-subset","version":"4.0.1","name":"Fetch a subset of the CapabilityStatement resource","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation asks the server to return a subset of the `CapabilityStatement` resource - just the REST parts that relate to a set of nominated resources - the resources that the client is interested in","code":"subset","resource":["CapabilityStatement"],"system":false,"type":true,"instance":true,"parameter":[{"name":"server","use":"in","min":0,"max":"1","documentation":"The canonical URL - use this if the subset is not invoked on an instance (or on the /metadata end-point)","type":"uri"},{"name":"resource","use":"in","min":1,"max":"*","documentation":"A resource that the client would like to include in the return","type":"code"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The subsetted `CapabilityStatement` resource that is returned. This should be tagged with the SUBSETTED code","type":"CapabilityStatement"}]}"#;
1302 #[doc = "The `OperationDefinition` this module was generated from."]
1303 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1304 serde_json::from_str(OPERATION_DEFINITION_JSON)
1305 .expect("Generated OperationDefinition JSON must deserialize.")
1306 });
1307 #[derive(Debug, FromParameters, ToParameters)]
1308 pub struct Input {
1309 #[doc = "The canonical URL - use this if the subset is not invoked on an instance (or on the /metadata"]
1310 #[doc = "end-point)"]
1311 pub server: Option<FHIRUri>,
1312 #[doc = "A resource that the client would like to include in the return"]
1313 pub resource: Vec<FHIRCode>,
1314 }
1315 impl From<Input> for Resource {
1316 fn from(value: Input) -> Self {
1317 let parameters: Vec<ParametersParameter> = value.into();
1318 Resource::Parameters(Parameters {
1319 parameter: Some(parameters),
1320 ..Default::default()
1321 })
1322 }
1323 }
1324 #[derive(Debug, FromParameters)]
1325 pub struct Output {
1326 #[doc = "The subsetted `CapabilityStatement` resource that is returned. This should be tagged with the"]
1327 #[doc = "SUBSETTED code"]
1328 #[parameter_rename = "return"]
1329 pub return_: CapabilityStatement,
1330 }
1331 impl From<Output> for Resource {
1332 fn from(value: Output) -> Self {
1333 Resource::CapabilityStatement(value.return_)
1334 }
1335 }
1336}
1337#[doc = "Using the [`FHIR Version Mime Type Parameter`](http.html#version-parameter), a server can support"]
1338#[doc = "[`multiple versions on the same end-point`](versioning.html#mt-version). The only way for client to"]
1339#[doc = "find out what versions a server supports in this fashion is the $versions operation. The client"]
1340#[doc = "invokes the operation with no parameters. and the server returns the list of supported versions,"]
1341#[doc = "along with the default version it will use if no fhirVersion parameter is present"]
1342pub mod CapabilityStatementVersions {
1343 use haste_fhir_model::r4::generated::resources::{
1344 OperationDefinition, Parameters, ParametersParameter, Resource,
1345 };
1346 use haste_fhir_model::r4::generated::types::FHIRCode;
1347 use haste_fhir_operation_error::OperationOutcomeError;
1348 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1349 use std::sync::LazyLock;
1350 pub const CODE: &str = "versions";
1351 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CapabilityStatement-versions","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Discover what versions a server supports</h2><p>OPERATION: Discover what versions a server supports</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CapabilityStatement-versions</pre><div><p>Using the <a href=\"http.html#version-parameter\">FHIR Version Mime Type Parameter</a>, a server can support <a href=\"versioning.html#mt-version\">multiple versions on the same end-point</a>. The only way for client to find out what versions a server supports in this fashion is the $versions operation. The client invokes the operation with no parameters. and the server returns the list of supported versions, along with the default version it will use if no fhirVersion parameter is present</p>\n</div><p>URL: [base]/$versions</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>OUT</td><td>version</td><td>1..*</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>A version supported by the server. Use the major.minor version like 3.0</p>\n</div></td></tr><tr><td>OUT</td><td>default</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The default version for the server. Use the major.minor version like 3.0</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/CapabilityStatement-versions","version":"4.0.1","name":"Discover what versions a server supports","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Using the [FHIR Version Mime Type Parameter](http.html#version-parameter), a server can support [multiple versions on the same end-point](versioning.html#mt-version). The only way for client to find out what versions a server supports in this fashion is the $versions operation. The client invokes the operation with no parameters. and the server returns the list of supported versions, along with the default version it will use if no fhirVersion parameter is present","code":"versions","resource":["CapabilityStatement"],"system":true,"type":false,"instance":false,"parameter":[{"name":"version","use":"out","min":1,"max":"*","documentation":"A version supported by the server. Use the major.minor version like 3.0","type":"code"},{"name":"default","use":"out","min":1,"max":"1","documentation":"The default version for the server. Use the major.minor version like 3.0","type":"code"}]}"#;
1352 #[doc = "The `OperationDefinition` this module was generated from."]
1353 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1354 serde_json::from_str(OPERATION_DEFINITION_JSON)
1355 .expect("Generated OperationDefinition JSON must deserialize.")
1356 });
1357 #[derive(Debug, FromParameters, ToParameters)]
1358 pub struct Input {}
1359 impl From<Input> for Resource {
1360 fn from(value: Input) -> Self {
1361 let parameters: Vec<ParametersParameter> = value.into();
1362 Resource::Parameters(Parameters {
1363 parameter: Some(parameters),
1364 ..Default::default()
1365 })
1366 }
1367 }
1368 #[derive(Debug, FromParameters, ToParameters)]
1369 pub struct Output {
1370 #[doc = "A version supported by the server. Use the major.minor version like 3.0"]
1371 pub version: Vec<FHIRCode>,
1372 #[doc = "The default version for the server. Use the major.minor version like 3.0"]
1373 pub default: FHIRCode,
1374 }
1375 impl From<Output> for Resource {
1376 fn from(value: Output) -> Self {
1377 let parameters: Vec<ParametersParameter> = value.into();
1378 Resource::Parameters(Parameters {
1379 parameter: Some(parameters),
1380 ..Default::default()
1381 })
1382 }
1383 }
1384}
1385#[doc = "The apply operation applies a definition in a specific context"]
1386pub mod ChargeItemDefinitionApply {
1387 use haste_fhir_model::r4::generated::resources::{
1388 OperationDefinition, Parameters, ParametersParameter, Resource,
1389 };
1390 use haste_fhir_model::r4::generated::types::Reference;
1391 use haste_fhir_operation_error::OperationOutcomeError;
1392 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1393 use std::sync::LazyLock;
1394 pub const CODE: &str = "apply";
1395 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ChargeItemDefinition-apply","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Apply</h2><p>OPERATION: Apply</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ChargeItemDefinition-apply</pre><div><p>The apply operation applies a definition in a specific context</p>\n</div><p>URL: [base]/ChargeItemDefinition/[id]/$apply</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>chargeItem</td><td>1..1</td><td><a href=\"references.html#Reference\">Reference</a></td><td/><td><div><p>The ChargeItem on which the definition is to ba applies</p>\n</div></td></tr><tr><td>IN</td><td>account</td><td>0..1</td><td><a href=\"references.html#Reference\">Reference</a></td><td/><td><div><p>The account in context, if any</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td>Any</td><td/><td><div><p>The resource that is the result of applying the definition</p>\n</div></td></tr></table><div><p>The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource. If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. For a more detailed description, refer to the ActivityDefinition resource</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":0},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/ChargeItemDefinition-apply","version":"4.0.1","name":"Apply","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The apply operation applies a definition in a specific context","code":"apply","comment":"The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource. If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. For a more detailed description, refer to the ActivityDefinition resource","resource":["ChargeItemDefinition"],"system":false,"type":false,"instance":true,"parameter":[{"name":"chargeItem","use":"in","min":1,"max":"1","documentation":"The `ChargeItem` on which the definition is to ba applies","type":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/ChargeItem"]},{"name":"account","use":"in","min":0,"max":"1","documentation":"The account in context, if any","type":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Account"]},{"name":"return","use":"out","min":1,"max":"1","documentation":"The resource that is the result of applying the definition","type":"Any"}]}"#;
1396 #[doc = "The `OperationDefinition` this module was generated from."]
1397 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1398 serde_json::from_str(OPERATION_DEFINITION_JSON)
1399 .expect("Generated OperationDefinition JSON must deserialize.")
1400 });
1401 #[derive(Debug, FromParameters, ToParameters)]
1402 pub struct Input {
1403 #[doc = "The `ChargeItem` on which the definition is to ba applies"]
1404 pub chargeItem: Reference,
1405 #[doc = "The account in context, if any"]
1406 pub account: Option<Reference>,
1407 }
1408 impl From<Input> for Resource {
1409 fn from(value: Input) -> Self {
1410 let parameters: Vec<ParametersParameter> = value.into();
1411 Resource::Parameters(Parameters {
1412 parameter: Some(parameters),
1413 ..Default::default()
1414 })
1415 }
1416 }
1417 #[derive(Debug, FromParameters)]
1418 pub struct Output {
1419 #[doc = "The resource that is the result of applying the definition"]
1420 #[parameter_rename = "return"]
1421 pub return_: Resource,
1422 }
1423 impl From<Output> for Resource {
1424 fn from(value: Output) -> Self {
1425 value.return_
1426 }
1427 }
1428}
1429#[doc = "This operation is used to submit a Claim, `Pre-Authorization` or `Pre-Determination` (all instances"]
1430#[doc = "of Claim resources) for adjudication either as a single Claim resource instance or as a Bundle"]
1431#[doc = "containing the Claim and other referenced resources, or Bundle containing a batch of Claim"]
1432#[doc = "resources, either as single Claims resources or Bundle resources, for processing. The only input"]
1433#[doc = "parameter is the single Claim or Bundle resource and the only output is a single `ClaimResponse`,"]
1434#[doc = "Bundle of `ClaimResponses` or an `OperationOutcome` resource."]
1435pub mod ClaimSubmit {
1436 use haste_fhir_model::r4::generated::resources::{
1437 OperationDefinition, Parameters, ParametersParameter, Resource,
1438 };
1439 use haste_fhir_operation_error::OperationOutcomeError;
1440 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1441 use std::sync::LazyLock;
1442 pub const CODE: &str = "submit";
1443 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Claim-submit","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Submit a Claim resource for adjudication</h2><p>OPERATION: Submit a Claim resource for adjudication</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Claim-submit</pre><div><p>This operation is used to submit a Claim, Pre-Authorization or Pre-Determination (all instances of Claim resources) for adjudication either as a single Claim resource instance or as a Bundle containing the Claim and other referenced resources, or Bundle containing a batch of Claim resources, either as single Claims resources or Bundle resources, for processing. The only input parameter is the single Claim or Bundle resource and the only output is a single ClaimResponse, Bundle of ClaimResponses or an OperationOutcome resource.</p>\n</div><p>URL: [base]/Claim/$submit</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>resource</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>A Claim resource or Bundle of claims, either as individual Claim resources or as Bundles each containing a single Claim plus referenced resources.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>A ClaimResponse resource or Bundle of claim responses, either as individual ClaimResponse resources or as Bundles each containing a single ClaimResponse plus referenced resources.</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Claim-submit","version":"4.0.1","name":"Submit a Claim resource for adjudication","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation is used to submit a Claim, Pre-Authorization or Pre-Determination (all instances of Claim resources) for adjudication either as a single Claim resource instance or as a Bundle containing the Claim and other referenced resources, or Bundle containing a batch of Claim resources, either as single Claims resources or Bundle resources, for processing. The only input parameter is the single Claim or Bundle resource and the only output is a single `ClaimResponse`, Bundle of `ClaimResponses` or an `OperationOutcome` resource.","code":"submit","resource":["Claim"],"system":false,"type":true,"instance":false,"parameter":[{"name":"resource","use":"in","min":1,"max":"1","documentation":"A Claim resource or Bundle of claims, either as individual Claim resources or as Bundles each containing a single Claim plus referenced resources.","type":"Resource"},{"name":"return","use":"out","min":1,"max":"1","documentation":"A `ClaimResponse` resource or Bundle of claim responses, either as individual `ClaimResponse` resources or as Bundles each containing a single `ClaimResponse` plus referenced resources.","type":"Resource"}]}"#;
1444 #[doc = "The `OperationDefinition` this module was generated from."]
1445 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1446 serde_json::from_str(OPERATION_DEFINITION_JSON)
1447 .expect("Generated OperationDefinition JSON must deserialize.")
1448 });
1449 #[derive(Debug, FromParameters, ToParameters)]
1450 pub struct Input {
1451 #[doc = "A Claim resource or Bundle of claims, either as individual Claim resources or as Bundles each"]
1452 #[doc = "containing a single Claim plus referenced resources."]
1453 pub resource: Resource,
1454 }
1455 impl From<Input> for Resource {
1456 fn from(value: Input) -> Self {
1457 let parameters: Vec<ParametersParameter> = value.into();
1458 Resource::Parameters(Parameters {
1459 parameter: Some(parameters),
1460 ..Default::default()
1461 })
1462 }
1463 }
1464 #[derive(Debug, FromParameters, ToParameters)]
1465 pub struct Output {
1466 #[doc = "A `ClaimResponse` resource or Bundle of claim responses, either as individual `ClaimResponse`"]
1467 #[doc = "resources or as Bundles each containing a single `ClaimResponse` plus referenced resources."]
1468 #[parameter_rename = "return"]
1469 pub return_: Resource,
1470 }
1471 impl From<Output> for Resource {
1472 fn from(value: Output) -> Self {
1473 let parameters: Vec<ParametersParameter> = value.into();
1474 Resource::Parameters(Parameters {
1475 parameter: Some(parameters),
1476 ..Default::default()
1477 })
1478 }
1479 }
1480}
1481#[doc = "Given a set of properties (and text), return one or more possible matching codes"]
1482#[doc = ""]
1483#[doc = "This operation takes a set of properties, and examines the code system looking for codes in the code"]
1484#[doc = "system that match a set of known properties."]
1485#[doc = ""]
1486#[doc = "When looking for matches, there are 3 possible types of match:"]
1487#[doc = "* a complete match - a code that represents all the provided properties correctly"]
1488#[doc = "* a partial match - a code that represents some of the provided properties correctly, and not others"]
1489#[doc = "* a possible match - a code that may represent the provided properties closely, but may capture less"]
1490#[doc = "or more precise information for some of the properties"]
1491#[doc = ""]
1492#[doc = "The $find-matches operation can be called in one of 2 modes:"]
1493#[doc = "* By a human, looking for the best match for a set of properties. In this mode, the server returns a"]
1494#[doc = "list of complete, possible or partial matches (possibly with comments), so that the user can choose"]
1495#[doc = "(or not) the most appropriate code"]
1496#[doc = "* By a machine (typically in a system interface performing a transformation). In this mode, the"]
1497#[doc = "server returns only a list of complete and partial matches, but no possible matches. The machine can"]
1498#[doc = "choose a code from the list (or not) based on what properties are not coded"]
1499#[doc = ""]
1500#[doc = "These modes are differentiated by the `exact` parameter, so the client can indicate whether it only"]
1501#[doc = "wants exact matches (including partial matches) or whether potential matches based on text matching"]
1502#[doc = "are desired"]
1503#[doc = "The find-matches operation is still preliminary. The interface can be expected to change as more"]
1504#[doc = "experience is gained from implementations."]
1505pub mod CodeSystemFindMatches {
1506 use haste_fhir_model::r4::generated::resources::{
1507 OperationDefinition, Parameters, ParametersParameter, ParametersParameterValueTypeChoice,
1508 Resource,
1509 };
1510 use haste_fhir_model::r4::generated::types::{
1511 Coding, FHIRBoolean, FHIRCode, FHIRString, FHIRUri,
1512 };
1513 use haste_fhir_operation_error::OperationOutcomeError;
1514 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1515 use std::sync::LazyLock;
1516 pub const CODE: &str = "find-matches";
1517 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CodeSystem-find-matches","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Finding codes based on supplied properties</h2><p>OPERATION: Finding codes based on supplied properties</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CodeSystem-find-matches</pre><div><p>Given a set of properties (and text), return one or more possible matching codes</p>\n<p>This operation takes a set of properties, and examines the code system looking for codes in the code system that match a set of known properties.</p>\n<p>When looking for matches, there are 3 possible types of match:</p>\n<ul>\n<li>a complete match - a code that represents all the provided properties correctly</li>\n<li>a partial match - a code that represents some of the provided properties correctly, and not others</li>\n<li>a possible match - a code that may represent the provided properties closely, but may capture less or more precise information for some of the properties</li>\n</ul>\n<p>The $find-matches operation can be called in one of 2 modes:</p>\n<ul>\n<li>By a human, looking for the best match for a set of properties. In this mode, the server returns a list of complete, possible or partial matches (possibly with comments), so that the user can choose (or not) the most appropriate code</li>\n<li>By a machine (typically in a system interface performing a transformation). In this mode, the server returns only a list of complete and partial matches, but no possible matches. The machine can choose a code from the list (or not) based on what properties are not coded</li>\n</ul>\n<p>These modes are differentiated by the 'exact' parameter, so the client can indicate whether it only wants exact matches (including partial matches) or whether potential matches based on text matching are desired</p>\n<p>The find-matches operation is still preliminary. The interface can be expected to change as more experience is gained from implementations.</p>\n</div><p>URL: [base]/CodeSystem/$find-matches</p><p>URL: [base]/CodeSystem/[id]/$find-matches</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>system</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The system in which composition is to be performed. This must be provided unless the operation is invoked on a code system instance</p>\n</div></td></tr><tr><td>IN</td><td>version</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The version of the system for the inferencing to be performed</p>\n</div></td></tr><tr><td>IN</td><td>property</td><td>0..*</td><td></td><td/><td><div><p>One or more properties that contain information to be composed into the code</p>\n</div></td></tr><tr><td>IN</td><td>property.code</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Identifies the property provided</p>\n</div></td></tr><tr><td>IN</td><td>property.value</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a> | <a href=\"datatypes.html#Coding\">Coding</a> | <a href=\"datatypes.html#string\">string</a> | <a href=\"datatypes.html#integer\">integer</a> | <a href=\"datatypes.html#boolean\">boolean</a> | <a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The value of the property provided</p>\n</div></td></tr><tr><td>IN</td><td>property.subproperty</td><td>0..*</td><td></td><td/><td><div><p>Nested Properties (mainly used for SNOMED CT composition, for relationship Groups)</p>\n</div></td></tr><tr><td>IN</td><td>property.subproperty.code</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Identifies the sub-property provided</p>\n</div></td></tr><tr><td>IN</td><td>property.subproperty.value</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a> | <a href=\"datatypes.html#Coding\">Coding</a> | <a href=\"datatypes.html#string\">string</a> | <a href=\"datatypes.html#integer\">integer</a> | <a href=\"datatypes.html#boolean\">boolean</a> | <a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The value of the sub-property provided</p>\n</div></td></tr><tr><td>IN</td><td>exact</td><td>1..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Whether the operation is being used by a human ('false'), or a machine ('true'). If the operation is being used by a human, the terminology server can return a list of possible matches, with commentary. For a machine, the server returns complete or partial matches, not possible matches. The default value is 'false'</p>\n</div></td></tr><tr><td>IN</td><td>compositional</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Post-coordinated expressions are allowed to be returned in the matching codes (mainly for SNOMED CT). Default = false</p>\n</div></td></tr><tr><td>OUT</td><td>match</td><td>0..*</td><td></td><td/><td><div><p>Concepts returned by the server as a result of the inferencing operation</p>\n</div></td></tr><tr><td>OUT</td><td>match.code</td><td>1..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>A code that matches the properties provided</p>\n</div></td></tr><tr><td>OUT</td><td>match.unmatched</td><td>0..*</td><td></td><td/><td><div><p>One or more properties that contain properties that could not be matched into the code</p>\n</div></td></tr><tr><td>OUT</td><td>match.unmatched.code</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Identifies the property provided</p>\n</div></td></tr><tr><td>OUT</td><td>match.unmatched.value</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a> | <a href=\"datatypes.html#Coding\">Coding</a> | <a href=\"datatypes.html#string\">string</a> | <a href=\"datatypes.html#integer\">integer</a> | <a href=\"datatypes.html#boolean\">boolean</a> | <a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The value of the property provided</p>\n</div></td></tr><tr><td>OUT</td><td>match.unmatched.property</td><td>0..*</td><td></td><td/><td><div><p>Nested Properties (mainly used for SNOMED CT composition, for relationship Groups)</p>\n</div></td></tr><tr><td>OUT</td><td>match.unmatched.property.code</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Identifies the sub-property provided</p>\n</div></td></tr><tr><td>OUT</td><td>match.unmatched.property.value</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a> | <a href=\"datatypes.html#Coding\">Coding</a> | <a href=\"datatypes.html#string\">string</a> | <a href=\"datatypes.html#integer\">integer</a> | <a href=\"datatypes.html#boolean\">boolean</a> | <a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The value of the sub-property provided</p>\n</div></td></tr><tr><td>OUT</td><td>match.comment</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>Information about the quality of the match, if operation is for a human</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":0},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/CodeSystem-find-matches","version":"4.0.1","name":"Finding codes based on supplied properties","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Given a set of properties (and text), return one or more possible matching codes\n\nThis operation takes a set of properties, and examines the code system looking for codes in the code system that match a set of known properties. \n\nWhen looking for matches, there are 3 possible types of match:\n* a complete match - a code that represents all the provided properties correctly\n* a partial match - a code that represents some of the provided properties correctly, and not others \n* a possible match - a code that may represent the provided properties closely, but may capture less or more precise information for some of the properties\n\nThe $find-matches operation can be called in one of 2 modes:\n* By a human, looking for the best match for a set of properties. In this mode, the server returns a list of complete, possible or partial matches (possibly with comments), so that the user can choose (or not) the most appropriate code\n* By a machine (typically in a system interface performing a transformation). In this mode, the server returns only a list of complete and partial matches, but no possible matches. The machine can choose a code from the list (or not) based on what properties are not coded\n\nThese modes are differentiated by the 'exact' parameter, so the client can indicate whether it only wants exact matches (including partial matches) or whether potential matches based on text matching are desired\n \nThe find-matches operation is still preliminary. The interface can be expected to change as more experience is gained from implementations.","code":"find-matches","resource":["CodeSystem"],"system":false,"type":true,"instance":true,"parameter":[{"name":"system","use":"in","min":0,"max":"1","documentation":"The system in which composition is to be performed. This must be provided unless the operation is invoked on a code system instance","type":"uri"},{"name":"version","use":"in","min":0,"max":"1","documentation":"The version of the system for the inferencing to be performed","type":"string"},{"name":"property","use":"in","min":0,"max":"*","documentation":"One or more properties that contain information to be composed into the code","part":[{"name":"code","use":"in","min":1,"max":"1","documentation":"Identifies the property provided","type":"code"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"code"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"Coding"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"integer"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"boolean"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"dateTime"}],"name":"value","use":"in","min":0,"max":"1","documentation":"The value of the property provided","type":"Element"},{"name":"subproperty","use":"in","min":0,"max":"*","documentation":"Nested Properties (mainly used for SNOMED CT composition, for relationship Groups)","part":[{"name":"code","use":"in","min":1,"max":"1","documentation":"Identifies the sub-property provided","type":"code"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"code"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"Coding"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"integer"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"boolean"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"dateTime"}],"name":"value","use":"in","min":1,"max":"1","documentation":"The value of the sub-property provided","type":"Element"}]}]},{"name":"exact","use":"in","min":1,"max":"1","documentation":"Whether the operation is being used by a human ('false'), or a machine ('true'). If the operation is being used by a human, the terminology server can return a list of possible matches, with commentary. For a machine, the server returns complete or partial matches, not possible matches. The default value is 'false'","type":"boolean"},{"name":"compositional","use":"in","min":0,"max":"1","documentation":"Post-coordinated expressions are allowed to be returned in the matching codes (mainly for SNOMED CT). Default = false","type":"boolean"},{"name":"match","use":"out","min":0,"max":"*","documentation":"Concepts returned by the server as a result of the inferencing operation","part":[{"name":"code","use":"out","min":1,"max":"1","documentation":"A code that matches the properties provided","type":"Coding"},{"name":"unmatched","use":"out","min":0,"max":"*","documentation":"One or more properties that contain properties that could not be matched into the code","part":[{"name":"code","use":"out","min":1,"max":"1","documentation":"Identifies the property provided","type":"code"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"code"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"Coding"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"integer"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"boolean"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"dateTime"}],"name":"value","use":"out","min":1,"max":"1","documentation":"The value of the property provided","type":"Element"},{"name":"property","use":"out","min":0,"max":"*","documentation":"Nested Properties (mainly used for SNOMED CT composition, for relationship Groups)","part":[{"name":"code","use":"out","min":1,"max":"1","documentation":"Identifies the sub-property provided","type":"code"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"code"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"Coding"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"integer"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"boolean"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"dateTime"}],"name":"value","use":"out","min":1,"max":"1","documentation":"The value of the sub-property provided","type":"Element"}]}]},{"name":"comment","use":"out","min":0,"max":"1","documentation":"Information about the quality of the match, if operation is for a human","type":"string"}]}]}"#;
1518 #[doc = "The `OperationDefinition` this module was generated from."]
1519 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1520 serde_json::from_str(OPERATION_DEFINITION_JSON)
1521 .expect("Generated OperationDefinition JSON must deserialize.")
1522 });
1523 #[derive(Debug, FromParameters, ToParameters)]
1524 pub struct InputPropertySubproperty {
1525 #[doc = "Identifies the sub-property provided"]
1526 pub code: FHIRCode,
1527 #[doc = "The value of the sub-property provided"]
1528 pub value: ParametersParameterValueTypeChoice,
1529 }
1530 impl From<InputPropertySubproperty> for Resource {
1531 fn from(value: InputPropertySubproperty) -> Self {
1532 let parameters: Vec<ParametersParameter> = value.into();
1533 Resource::Parameters(Parameters {
1534 parameter: Some(parameters),
1535 ..Default::default()
1536 })
1537 }
1538 }
1539 #[derive(Debug, FromParameters, ToParameters)]
1540 pub struct InputProperty {
1541 #[doc = "Identifies the property provided"]
1542 pub code: FHIRCode,
1543 #[doc = "The value of the property provided"]
1544 pub value: Option<ParametersParameterValueTypeChoice>,
1545 #[doc = "Nested Properties (mainly used for SNOMED CT composition, for relationship Groups)"]
1546 #[parameter_nested]
1547 pub subproperty: Option<Vec<InputPropertySubproperty>>,
1548 }
1549 impl From<InputProperty> for Resource {
1550 fn from(value: InputProperty) -> Self {
1551 let parameters: Vec<ParametersParameter> = value.into();
1552 Resource::Parameters(Parameters {
1553 parameter: Some(parameters),
1554 ..Default::default()
1555 })
1556 }
1557 }
1558 #[derive(Debug, FromParameters, ToParameters)]
1559 pub struct Input {
1560 #[doc = "The system in which composition is to be performed. This must be provided unless the operation is"]
1561 #[doc = "invoked on a code system instance"]
1562 pub system: Option<FHIRUri>,
1563 #[doc = "The version of the system for the inferencing to be performed"]
1564 pub version: Option<FHIRString>,
1565 #[doc = "One or more properties that contain information to be composed into the code"]
1566 #[parameter_nested]
1567 pub property: Option<Vec<InputProperty>>,
1568 #[doc = "Whether the operation is being used by a human (`false`), or a machine (`true`). If the operation is"]
1569 #[doc = "being used by a human, the terminology server can return a list of possible matches, with"]
1570 #[doc = "commentary. For a machine, the server returns complete or partial matches, not possible matches. The"]
1571 #[doc = "default value is `false`"]
1572 pub exact: FHIRBoolean,
1573 #[doc = "Post-coordinated expressions are allowed to be returned in the matching codes (mainly for SNOMED"]
1574 #[doc = "CT). Default = false"]
1575 pub compositional: Option<FHIRBoolean>,
1576 }
1577 impl From<Input> for Resource {
1578 fn from(value: Input) -> Self {
1579 let parameters: Vec<ParametersParameter> = value.into();
1580 Resource::Parameters(Parameters {
1581 parameter: Some(parameters),
1582 ..Default::default()
1583 })
1584 }
1585 }
1586 #[derive(Debug, FromParameters, ToParameters)]
1587 pub struct OutputMatchUnmatchedProperty {
1588 #[doc = "Identifies the sub-property provided"]
1589 pub code: FHIRCode,
1590 #[doc = "The value of the sub-property provided"]
1591 pub value: ParametersParameterValueTypeChoice,
1592 }
1593 impl From<OutputMatchUnmatchedProperty> for Resource {
1594 fn from(value: OutputMatchUnmatchedProperty) -> Self {
1595 let parameters: Vec<ParametersParameter> = value.into();
1596 Resource::Parameters(Parameters {
1597 parameter: Some(parameters),
1598 ..Default::default()
1599 })
1600 }
1601 }
1602 #[derive(Debug, FromParameters, ToParameters)]
1603 pub struct OutputMatchUnmatched {
1604 #[doc = "Identifies the property provided"]
1605 pub code: FHIRCode,
1606 #[doc = "The value of the property provided"]
1607 pub value: ParametersParameterValueTypeChoice,
1608 #[doc = "Nested Properties (mainly used for SNOMED CT composition, for relationship Groups)"]
1609 #[parameter_nested]
1610 pub property: Option<Vec<OutputMatchUnmatchedProperty>>,
1611 }
1612 impl From<OutputMatchUnmatched> for Resource {
1613 fn from(value: OutputMatchUnmatched) -> Self {
1614 let parameters: Vec<ParametersParameter> = value.into();
1615 Resource::Parameters(Parameters {
1616 parameter: Some(parameters),
1617 ..Default::default()
1618 })
1619 }
1620 }
1621 #[derive(Debug, FromParameters, ToParameters)]
1622 pub struct OutputMatch {
1623 #[doc = "A code that matches the properties provided"]
1624 pub code: Coding,
1625 #[doc = "One or more properties that contain properties that could not be matched into the code"]
1626 #[parameter_nested]
1627 pub unmatched: Option<Vec<OutputMatchUnmatched>>,
1628 #[doc = "Information about the quality of the match, if operation is for a human"]
1629 pub comment: Option<FHIRString>,
1630 }
1631 impl From<OutputMatch> for Resource {
1632 fn from(value: OutputMatch) -> Self {
1633 let parameters: Vec<ParametersParameter> = value.into();
1634 Resource::Parameters(Parameters {
1635 parameter: Some(parameters),
1636 ..Default::default()
1637 })
1638 }
1639 }
1640 #[derive(Debug, FromParameters, ToParameters)]
1641 pub struct Output {
1642 #[doc = "Concepts returned by the server as a result of the inferencing operation"]
1643 #[parameter_rename = "match"]
1644 #[parameter_nested]
1645 pub match_: Option<Vec<OutputMatch>>,
1646 }
1647 impl From<Output> for Resource {
1648 fn from(value: Output) -> Self {
1649 let parameters: Vec<ParametersParameter> = value.into();
1650 Resource::Parameters(Parameters {
1651 parameter: Some(parameters),
1652 ..Default::default()
1653 })
1654 }
1655 }
1656}
1657#[doc = "Given a code/system, or a Coding, get additional details about the concept, including definition,"]
1658#[doc = "status, designations, and properties. One of the products of this operation is a full decomposition"]
1659#[doc = "of a code from a structured terminology."]
1660#[doc = ""]
1661#[doc = "When invoking this operation, a client SHALL provide both a system and a code, either using the"]
1662#[doc = "system+code parameters, or in the coding parameter. Other parameters are optional"]
1663pub mod CodeSystemLookup {
1664 use haste_fhir_model::r4::generated::resources::{
1665 OperationDefinition, Parameters, ParametersParameter, ParametersParameterValueTypeChoice,
1666 Resource,
1667 };
1668 use haste_fhir_model::r4::generated::types::{
1669 Coding, FHIRCode, FHIRDateTime, FHIRString, FHIRUri,
1670 };
1671 use haste_fhir_operation_error::OperationOutcomeError;
1672 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1673 use std::sync::LazyLock;
1674 pub const CODE: &str = "lookup";
1675 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CodeSystem-lookup","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Concept Look Up & Decomposition</h2><p>OPERATION: Concept Look Up & Decomposition</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CodeSystem-lookup</pre><div><p>Given a code/system, or a Coding, get additional details about the concept, including definition, status, designations, and properties. One of the products of this operation is a full decomposition of a code from a structured terminology.</p>\n<p>When invoking this operation, a client SHALL provide both a system and a code, either using the system+code parameters, or in the coding parameter. Other parameters are optional</p>\n</div><p>URL: [base]/CodeSystem/$lookup</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>code</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The code that is to be located. If a code is provided, a system must be provided</p>\n</div></td></tr><tr><td>IN</td><td>system</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The system for the code that is to be located</p>\n</div></td></tr><tr><td>IN</td><td>version</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The version of the system, if one was provided in the source data</p>\n</div></td></tr><tr><td>IN</td><td>coding</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>A coding to look up</p>\n</div></td></tr><tr><td>IN</td><td>date</td><td>0..1</td><td><a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The date for which the information should be returned. Normally, this is the current conditions (which is the default value) but under some circumstances, systems need to acccess this information as it would have been in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.</p>\n</div></td></tr><tr><td>IN</td><td>displayLanguage</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The requested language for display (see $expand.displayLanguage)</p>\n</div></td></tr><tr><td>IN</td><td>property</td><td>0..*</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>A property that the client wishes to be returned in the output. If no properties are specified, the server chooses what to return. The following properties are defined for all code systems: url, name, version (code system info) and code information: display, definition, designation, parent and child, and for designations, lang.X where X is a designation language code. Some of the properties are returned explicit in named parameters (when the names match), and the rest (except for lang.X) in the property parameter group</p>\n</div></td></tr><tr><td>OUT</td><td>name</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>A display name for the code system</p>\n</div></td></tr><tr><td>OUT</td><td>version</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The version that these details are based on</p>\n</div></td></tr><tr><td>OUT</td><td>display</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The preferred display for this concept</p>\n</div></td></tr><tr><td>OUT</td><td>designation</td><td>0..*</td><td></td><td/><td><div><p>Additional representations for this concept</p>\n</div></td></tr><tr><td>OUT</td><td>designation.language</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The language this designation is defined for</p>\n</div></td></tr><tr><td>OUT</td><td>designation.use</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>A code that details how this designation would be used</p>\n</div></td></tr><tr><td>OUT</td><td>designation.value</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The text value for this designation</p>\n</div></td></tr><tr><td>OUT</td><td>property</td><td>0..*</td><td></td><td/><td><div><p>One or more properties that contain additional information about the code, including status. For complex terminologies (e.g. SNOMED CT, LOINC, medications), these properties serve to decompose the code</p>\n</div></td></tr><tr><td>OUT</td><td>property.code</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Identifies the property returned</p>\n</div></td></tr><tr><td>OUT</td><td>property.value</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a> | <a href=\"datatypes.html#Coding\">Coding</a> | <a href=\"datatypes.html#string\">string</a> | <a href=\"datatypes.html#integer\">integer</a> | <a href=\"datatypes.html#boolean\">boolean</a> | <a href=\"datatypes.html#dateTime\">dateTime</a> | <a href=\"datatypes.html#decimal\">decimal</a></td><td/><td><div><p>The value of the property returned</p>\n</div></td></tr><tr><td>OUT</td><td>property.description</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>Human Readable representation of the property value (e.g. display for a code)</p>\n</div></td></tr><tr><td>OUT</td><td>property.subproperty</td><td>0..*</td><td></td><td/><td><div><p>Nested Properties (mainly used for SNOMED CT decomposition, for relationship Groups)</p>\n</div></td></tr><tr><td>OUT</td><td>property.subproperty.code</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Identifies the sub-property returned</p>\n</div></td></tr><tr><td>OUT</td><td>property.subproperty.value</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a> | <a href=\"datatypes.html#Coding\">Coding</a> | <a href=\"datatypes.html#string\">string</a> | <a href=\"datatypes.html#integer\">integer</a> | <a href=\"datatypes.html#boolean\">boolean</a> | <a href=\"datatypes.html#dateTime\">dateTime</a> | <a href=\"datatypes.html#decimal\">decimal</a></td><td/><td><div><p>The value of the sub-property returned</p>\n</div></td></tr><tr><td>OUT</td><td>property.subproperty.description</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>Human Readable representation of the property value (e.g. display for a code)</p>\n</div></td></tr></table><div><p>Note that the $lookup operation is more than just a code system search - the server finds the concept, and gathers the return information from the underlying code system definitions.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"normative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version","valueCode":"4.0.1"}],"url":"http://hl7.org/fhir/OperationDefinition/CodeSystem-lookup","version":"4.0.1","name":"Concept Look Up & Decomposition","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Given a code/system, or a Coding, get additional details about the concept, including definition, status, designations, and properties. One of the products of this operation is a full decomposition of a code from a structured terminology.\n\nWhen invoking this operation, a client SHALL provide both a system and a code, either using the system+code parameters, or in the coding parameter. Other parameters are optional","code":"lookup","comment":"Note that the $lookup operation is more than just a code system search - the server finds the concept, and gathers the return information from the underlying code system definitions.","resource":["CodeSystem"],"system":false,"type":true,"instance":false,"parameter":[{"name":"code","use":"in","min":0,"max":"1","documentation":"The code that is to be located. If a code is provided, a system must be provided","type":"code"},{"name":"system","use":"in","min":0,"max":"1","documentation":"The system for the code that is to be located","type":"uri"},{"name":"version","use":"in","min":0,"max":"1","documentation":"The version of the system, if one was provided in the source data","type":"string"},{"name":"coding","use":"in","min":0,"max":"1","documentation":"A coding to look up","type":"Coding"},{"name":"date","use":"in","min":0,"max":"1","documentation":"The date for which the information should be returned. Normally, this is the current conditions (which is the default value) but under some circumstances, systems need to acccess this information as it would have been in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.","type":"dateTime"},{"name":"displayLanguage","use":"in","min":0,"max":"1","documentation":"The requested language for display (see $expand.displayLanguage)","type":"code"},{"name":"property","use":"in","min":0,"max":"*","documentation":"A property that the client wishes to be returned in the output. If no properties are specified, the server chooses what to return. The following properties are defined for all code systems: url, name, version (code system info) and code information: display, definition, designation, parent and child, and for designations, lang.X where X is a designation language code. Some of the properties are returned explicit in named parameters (when the names match), and the rest (except for lang.X) in the property parameter group","type":"code"},{"name":"name","use":"out","min":1,"max":"1","documentation":"A display name for the code system","type":"string"},{"name":"version","use":"out","min":0,"max":"1","documentation":"The version that these details are based on","type":"string"},{"name":"display","use":"out","min":1,"max":"1","documentation":"The preferred display for this concept","type":"string"},{"name":"designation","use":"out","min":0,"max":"*","documentation":"Additional representations for this concept","part":[{"name":"language","use":"out","min":0,"max":"1","documentation":"The language this designation is defined for","type":"code"},{"name":"use","use":"out","min":0,"max":"1","documentation":"A code that details how this designation would be used","type":"Coding"},{"name":"value","use":"out","min":1,"max":"1","documentation":"The text value for this designation","type":"string"}]},{"name":"property","use":"out","min":0,"max":"*","documentation":"One or more properties that contain additional information about the code, including status. For complex terminologies (e.g. SNOMED CT, LOINC, medications), these properties serve to decompose the code","part":[{"name":"code","use":"out","min":1,"max":"1","documentation":"Identifies the property returned","type":"code"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"code"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"Coding"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"integer"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"boolean"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"dateTime"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"decimal"}],"name":"value","use":"out","min":0,"max":"1","documentation":"The value of the property returned","type":"Element"},{"name":"description","use":"out","min":0,"max":"1","documentation":"Human Readable representation of the property value (e.g. display for a code)","type":"string"},{"name":"subproperty","use":"out","min":0,"max":"*","documentation":"Nested Properties (mainly used for SNOMED CT decomposition, for relationship Groups)","part":[{"name":"code","use":"out","min":1,"max":"1","documentation":"Identifies the sub-property returned","type":"code"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"code"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"Coding"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"integer"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"boolean"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"dateTime"},{"url":"http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type","valueUri":"decimal"}],"name":"value","use":"out","min":1,"max":"1","documentation":"The value of the sub-property returned","type":"Element"},{"name":"description","use":"out","min":0,"max":"1","documentation":"Human Readable representation of the property value (e.g. display for a code)","type":"string"}]}]}]}"#;
1676 #[doc = "The `OperationDefinition` this module was generated from."]
1677 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1678 serde_json::from_str(OPERATION_DEFINITION_JSON)
1679 .expect("Generated OperationDefinition JSON must deserialize.")
1680 });
1681 #[derive(Debug, FromParameters, ToParameters)]
1682 pub struct Input {
1683 #[doc = "The code that is to be located. If a code is provided, a system must be provided"]
1684 pub code: Option<FHIRCode>,
1685 #[doc = "The system for the code that is to be located"]
1686 pub system: Option<FHIRUri>,
1687 #[doc = "The version of the system, if one was provided in the source data"]
1688 pub version: Option<FHIRString>,
1689 #[doc = "A coding to look up"]
1690 pub coding: Option<Coding>,
1691 #[doc = "The date for which the information should be returned. Normally, this is the current conditions"]
1692 #[doc = "(which is the default value) but under some circumstances, systems need to acccess this information"]
1693 #[doc = "as it would have been in the past. A typical example of this would be where code selection is"]
1694 #[doc = "constrained to the set of codes that were available when the patient was treated, not when the"]
1695 #[doc = "record is being edited. Note that which date is appropriate is a matter for implementation policy."]
1696 pub date: Option<FHIRDateTime>,
1697 #[doc = "The requested language for display (see $expand.displayLanguage)"]
1698 pub displayLanguage: Option<FHIRCode>,
1699 #[doc = "A property that the client wishes to be returned in the output. If no properties are specified, the"]
1700 #[doc = "server chooses what to return. The following properties are defined for all code systems: url, name,"]
1701 #[doc = "version (code system info) and code information: display, definition, designation, parent and child,"]
1702 #[doc = "and for designations, lang.X where X is a designation language code. Some of the properties are"]
1703 #[doc = "returned explicit in named parameters (when the names match), and the rest (except for lang.X) in"]
1704 #[doc = "the property parameter group"]
1705 pub property: Option<Vec<FHIRCode>>,
1706 }
1707 impl From<Input> for Resource {
1708 fn from(value: Input) -> Self {
1709 let parameters: Vec<ParametersParameter> = value.into();
1710 Resource::Parameters(Parameters {
1711 parameter: Some(parameters),
1712 ..Default::default()
1713 })
1714 }
1715 }
1716 #[derive(Debug, FromParameters, ToParameters)]
1717 pub struct OutputDesignation {
1718 #[doc = "The language this designation is defined for"]
1719 pub language: Option<FHIRCode>,
1720 #[doc = "A code that details how this designation would be used"]
1721 #[parameter_rename = "use"]
1722 pub use_: Option<Coding>,
1723 #[doc = "The text value for this designation"]
1724 pub value: FHIRString,
1725 }
1726 impl From<OutputDesignation> for Resource {
1727 fn from(value: OutputDesignation) -> Self {
1728 let parameters: Vec<ParametersParameter> = value.into();
1729 Resource::Parameters(Parameters {
1730 parameter: Some(parameters),
1731 ..Default::default()
1732 })
1733 }
1734 }
1735 #[derive(Debug, FromParameters, ToParameters)]
1736 pub struct OutputPropertySubproperty {
1737 #[doc = "Identifies the sub-property returned"]
1738 pub code: FHIRCode,
1739 #[doc = "The value of the sub-property returned"]
1740 pub value: ParametersParameterValueTypeChoice,
1741 #[doc = "Human Readable representation of the property value (e.g. display for a code)"]
1742 pub description: Option<FHIRString>,
1743 }
1744 impl From<OutputPropertySubproperty> for Resource {
1745 fn from(value: OutputPropertySubproperty) -> Self {
1746 let parameters: Vec<ParametersParameter> = value.into();
1747 Resource::Parameters(Parameters {
1748 parameter: Some(parameters),
1749 ..Default::default()
1750 })
1751 }
1752 }
1753 #[derive(Debug, FromParameters, ToParameters)]
1754 pub struct OutputProperty {
1755 #[doc = "Identifies the property returned"]
1756 pub code: FHIRCode,
1757 #[doc = "The value of the property returned"]
1758 pub value: Option<ParametersParameterValueTypeChoice>,
1759 #[doc = "Human Readable representation of the property value (e.g. display for a code)"]
1760 pub description: Option<FHIRString>,
1761 #[doc = "Nested Properties (mainly used for SNOMED CT decomposition, for relationship Groups)"]
1762 #[parameter_nested]
1763 pub subproperty: Option<Vec<OutputPropertySubproperty>>,
1764 }
1765 impl From<OutputProperty> for Resource {
1766 fn from(value: OutputProperty) -> Self {
1767 let parameters: Vec<ParametersParameter> = value.into();
1768 Resource::Parameters(Parameters {
1769 parameter: Some(parameters),
1770 ..Default::default()
1771 })
1772 }
1773 }
1774 #[derive(Debug, FromParameters, ToParameters)]
1775 pub struct Output {
1776 #[doc = "A display name for the code system"]
1777 pub name: FHIRString,
1778 #[doc = "The version that these details are based on"]
1779 pub version: Option<FHIRString>,
1780 #[doc = "The preferred display for this concept"]
1781 pub display: FHIRString,
1782 #[doc = "Additional representations for this concept"]
1783 #[parameter_nested]
1784 pub designation: Option<Vec<OutputDesignation>>,
1785 #[doc = "One or more properties that contain additional information about the code, including status. For"]
1786 #[doc = "complex terminologies (e.g. SNOMED CT, LOINC, medications), these properties serve to decompose the"]
1787 #[doc = "code"]
1788 #[parameter_nested]
1789 pub property: Option<Vec<OutputProperty>>,
1790 }
1791 impl From<Output> for Resource {
1792 fn from(value: Output) -> Self {
1793 let parameters: Vec<ParametersParameter> = value.into();
1794 Resource::Parameters(Parameters {
1795 parameter: Some(parameters),
1796 ..Default::default()
1797 })
1798 }
1799 }
1800}
1801#[doc = "Test the subsumption relationship between code/Coding A and code/Coding B given the semantics of"]
1802#[doc = "subsumption in the underlying code system (see"]
1803#[doc = "[`hierarchyMeaning`](codesystem-definitions.html#CodeSystem.hierarchyMeaning))."]
1804#[doc = ""]
1805#[doc = "When invoking this operation, a client SHALL provide both a and codes, either as code or Coding"]
1806#[doc = "parameters. The system parameter is required unless the operation is invoked on an instance of a"]
1807#[doc = "code system resource. Other parameters are optional"]
1808pub mod CodeSystemSubsumes {
1809 use haste_fhir_model::r4::generated::resources::{
1810 OperationDefinition, Parameters, ParametersParameter, Resource,
1811 };
1812 use haste_fhir_model::r4::generated::types::{Coding, FHIRCode, FHIRString, FHIRUri};
1813 use haste_fhir_operation_error::OperationOutcomeError;
1814 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1815 use std::sync::LazyLock;
1816 pub const CODE: &str = "subsumes";
1817 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CodeSystem-subsumes","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Subsumption Testing</h2><p>OPERATION: Subsumption Testing</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CodeSystem-subsumes</pre><div><p>Test the subsumption relationship between code/Coding A and code/Coding B given the semantics of subsumption in the underlying code system (see <a href=\"codesystem-definitions.html#CodeSystem.hierarchyMeaning\">hierarchyMeaning</a>).</p>\n<p>When invoking this operation, a client SHALL provide both a and codes, either as code or Coding parameters. The system parameter is required unless the operation is invoked on an instance of a code system resource. Other parameters are optional</p>\n</div><p>URL: [base]/CodeSystem/$subsumes</p><p>URL: [base]/CodeSystem/[id]/$subsumes</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>codeA</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The "A" code that is to be tested. If a code is provided, a system must be provided</p>\n</div></td></tr><tr><td>IN</td><td>codeB</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The "B" code that is to be tested. If a code is provided, a system must be provided</p>\n</div></td></tr><tr><td>IN</td><td>system</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The code system in which subsumption testing is to be performed. This must be provided unless the operation is invoked on a code system instance</p>\n</div></td></tr><tr><td>IN</td><td>version</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The version of the code system, if one was provided in the source data</p>\n</div></td></tr><tr><td>IN</td><td>codingA</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>The "A" Coding that is to be tested. The code system does not have to match the specified subsumption code system, but the relationships between the code systems must be well established</p>\n</div></td></tr><tr><td>IN</td><td>codingB</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>The "B" Coding that is to be tested. The code system does not have to match the specified subsumption code system, but the relationships between the code systems must be well established</p>\n</div></td></tr><tr><td>OUT</td><td>outcome</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td><a href=\"valueset-concept-subsumption-outcome.html\">http://hl7.org/fhir/ValueSet/concept-subsumption-outcome|4.0.1</a> (Required)</td><td><div><p>The subsumption relationship between code/Coding "A" and code/Coding "B". There are 4 possible codes to be returned (equivalent, subsumes, subsumed-by, and not-subsumed) as defined in the concept-subsumption-outcome value set. If the server is unable to determine the relationship between the codes/Codings, then it returns an error response with an OperationOutcome.</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"normative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version","valueCode":"4.0.1"}],"url":"http://hl7.org/fhir/OperationDefinition/CodeSystem-subsumes","version":"4.0.1","name":"Subsumption Testing","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Test the subsumption relationship between code/Coding A and code/Coding B given the semantics of subsumption in the underlying code system (see [hierarchyMeaning](codesystem-definitions.html#CodeSystem.hierarchyMeaning)).\n\nWhen invoking this operation, a client SHALL provide both a and codes, either as code or Coding parameters. The system parameter is required unless the operation is invoked on an instance of a code system resource. Other parameters are optional","code":"subsumes","resource":["CodeSystem"],"system":false,"type":true,"instance":true,"parameter":[{"name":"codeA","use":"in","min":0,"max":"1","documentation":"The \"A\" code that is to be tested. If a code is provided, a system must be provided","type":"code"},{"name":"codeB","use":"in","min":0,"max":"1","documentation":"The \"B\" code that is to be tested. If a code is provided, a system must be provided","type":"code"},{"name":"system","use":"in","min":0,"max":"1","documentation":"The code system in which subsumption testing is to be performed. This must be provided unless the operation is invoked on a code system instance","type":"uri"},{"name":"version","use":"in","min":0,"max":"1","documentation":"The version of the code system, if one was provided in the source data","type":"string"},{"name":"codingA","use":"in","min":0,"max":"1","documentation":"The \"A\" Coding that is to be tested. The code system does not have to match the specified subsumption code system, but the relationships between the code systems must be well established","type":"Coding"},{"name":"codingB","use":"in","min":0,"max":"1","documentation":"The \"B\" Coding that is to be tested. The code system does not have to match the specified subsumption code system, but the relationships between the code systems must be well established","type":"Coding"},{"name":"outcome","use":"out","min":1,"max":"1","documentation":"The subsumption relationship between code/Coding \"A\" and code/Coding \"B\". There are 4 possible codes to be returned (equivalent, subsumes, subsumed-by, and not-subsumed) as defined in the concept-subsumption-outcome value set. If the server is unable to determine the relationship between the codes/Codings, then it returns an error response with an `OperationOutcome`.","type":"code","binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/concept-subsumption-outcome|4.0.1"}}]}"#;
1818 #[doc = "The `OperationDefinition` this module was generated from."]
1819 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1820 serde_json::from_str(OPERATION_DEFINITION_JSON)
1821 .expect("Generated OperationDefinition JSON must deserialize.")
1822 });
1823 #[derive(Debug, FromParameters, ToParameters)]
1824 pub struct Input {
1825 #[doc = "The \"A\" code that is to be tested. If a code is provided, a system must be provided"]
1826 pub codeA: Option<FHIRCode>,
1827 #[doc = "The \"B\" code that is to be tested. If a code is provided, a system must be provided"]
1828 pub codeB: Option<FHIRCode>,
1829 #[doc = "The code system in which subsumption testing is to be performed. This must be provided unless the"]
1830 #[doc = "operation is invoked on a code system instance"]
1831 pub system: Option<FHIRUri>,
1832 #[doc = "The version of the code system, if one was provided in the source data"]
1833 pub version: Option<FHIRString>,
1834 #[doc = "The \"A\" Coding that is to be tested. The code system does not have to match the specified"]
1835 #[doc = "subsumption code system, but the relationships between the code systems must be well established"]
1836 pub codingA: Option<Coding>,
1837 #[doc = "The \"B\" Coding that is to be tested. The code system does not have to match the specified"]
1838 #[doc = "subsumption code system, but the relationships between the code systems must be well established"]
1839 pub codingB: Option<Coding>,
1840 }
1841 impl From<Input> for Resource {
1842 fn from(value: Input) -> Self {
1843 let parameters: Vec<ParametersParameter> = value.into();
1844 Resource::Parameters(Parameters {
1845 parameter: Some(parameters),
1846 ..Default::default()
1847 })
1848 }
1849 }
1850 #[derive(Debug, FromParameters, ToParameters)]
1851 pub struct Output {
1852 #[doc = "The subsumption relationship between code/Coding \"A\" and code/Coding \"B\". There are 4 possible codes"]
1853 #[doc = "to be returned (equivalent, subsumes, subsumed-by, and not-subsumed) as defined in the"]
1854 #[doc = "concept-subsumption-outcome value set. If the server is unable to determine the relationship between"]
1855 #[doc = "the codes/Codings, then it returns an error response with an `OperationOutcome`."]
1856 pub outcome: FHIRCode,
1857 }
1858 impl From<Output> for Resource {
1859 fn from(value: Output) -> Self {
1860 let parameters: Vec<ParametersParameter> = value.into();
1861 Resource::Parameters(Parameters {
1862 parameter: Some(parameters),
1863 ..Default::default()
1864 })
1865 }
1866 }
1867}
1868#[doc = "Validate that a coded value is in the code system. If the operation is not called at the instance"]
1869#[doc = "level, one of the parameters \"url\" or \"codeSystem\" must be provided. The operation returns a result"]
1870#[doc = "(true / false), an error message, and the recommended display for the code."]
1871#[doc = ""]
1872#[doc = "When invoking this operation, a client SHALL provide one (and only one) of the parameters"]
1873#[doc = "(code+system, coding, or codeableConcept). Other parameters (including version and display) are"]
1874#[doc = "optional"]
1875pub mod CodeSystemValidateCode {
1876 use haste_fhir_model::r4::generated::resources::{
1877 CodeSystem, OperationDefinition, Parameters, ParametersParameter, Resource,
1878 };
1879 use haste_fhir_model::r4::generated::types::{
1880 CodeableConcept, Coding, FHIRBoolean, FHIRCode, FHIRDateTime, FHIRString, FHIRUri,
1881 };
1882 use haste_fhir_operation_error::OperationOutcomeError;
1883 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1884 use std::sync::LazyLock;
1885 pub const CODE: &str = "validate-code";
1886 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CodeSystem-validate-code","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Code System based Validation</h2><p>OPERATION: Code System based Validation</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CodeSystem-validate-code</pre><div><p>Validate that a coded value is in the code system. If the operation is not called at the instance level, one of the parameters "url" or "codeSystem" must be provided. The operation returns a result (true / false), an error message, and the recommended display for the code.</p>\n<p>When invoking this operation, a client SHALL provide one (and only one) of the parameters (code+system, coding, or codeableConcept). Other parameters (including version and display) are optional</p>\n</div><p>URL: [base]/CodeSystem/$validate-code</p><p>URL: [base]/CodeSystem/[id]/$validate-code</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>url</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>CodeSystem URL. The server must know the code system (e.g. it is defined explicitly in the server'scode systems, or it is known implicitly by the server</p>\n</div></td></tr><tr><td>IN</td><td>codeSystem</td><td>0..1</td><td><a href=\"codesystem.html\">CodeSystem</a></td><td/><td><div><p>The codeSystem is provided directly as part of the request. Servers may choose not to accept code systems in this fashion. This parameter is used when the client wants the server to check against a code system that is not stored on the server</p>\n</div></td></tr><tr><td>IN</td><td>code</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The code that is to be validated</p>\n</div></td></tr><tr><td>IN</td><td>version</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The version of the code system, if one was provided in the source data</p>\n</div></td></tr><tr><td>IN</td><td>display</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The display associated with the code, if provided. If a display is provided a code must be provided. If no display is provided, the server cannot validate the display value, but may choose to return a recommended display name in an extension in the outcome. Whether displays are case sensitive is code system dependent</p>\n</div></td></tr><tr><td>IN</td><td>coding</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>A coding to validate. The system must match the specified code system</p>\n</div></td></tr><tr><td>IN</td><td>codeableConcept</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>A full codeableConcept to validate. The server returns true if one of the coding values is in the code system, and may also validate that the codings are not in conflict with each other if more than one is present</p>\n</div></td></tr><tr><td>IN</td><td>date</td><td>0..1</td><td><a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The date for which the validation should be checked. Normally, this is the current conditions (which is the default values) but under some circumstances, systems need to validate that a correct code was used at some point in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.</p>\n</div></td></tr><tr><td>IN</td><td>abstract</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If this parameter has a value of true, the client is stating that the validation is being performed in a context where a concept designated as 'abstract' is appropriate/allowed to be used, and the server should regard abstract codes as valid. If this parameter is false, abstract codes are not considered to be valid.</p>\n<p>Note that. 'abstract' is a property defined by many HL7 code systems that indicates that the concept is a logical grouping concept that is not intended to be used asa 'concrete' concept to in an actual patient/care/process record. This language is borrowed from Object Orienated theory where 'asbtract' objects are never instantiated. However in the general record and terminology eco-system, there are many contexts where it is appropraite to use these codes e.g. as decision making criterion, or when editing value sets themselves. This parameter allows a client to indicate to the server that it is working in such a context.</p>\n</div></td></tr><tr><td>IN</td><td>displayLanguage</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Specifies the language to be used for description when validating the display property</p>\n</div></td></tr><tr><td>OUT</td><td>result</td><td>1..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>True if the concept details supplied are valid</p>\n</div></td></tr><tr><td>OUT</td><td>message</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>Error details, if result = false. If this is provided when result = true, the message carries hints and warnings</p>\n</div></td></tr><tr><td>OUT</td><td>display</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>A valid display for the concept if the system wishes to display this to a user</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"normative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version","valueCode":"4.0.1"}],"url":"http://hl7.org/fhir/OperationDefinition/CodeSystem-validate-code","version":"4.0.1","name":"Code System based Validation","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Validate that a coded value is in the code system. If the operation is not called at the instance level, one of the parameters \"url\" or \"codeSystem\" must be provided. The operation returns a result (true / false), an error message, and the recommended display for the code.\n\nWhen invoking this operation, a client SHALL provide one (and only one) of the parameters (code+system, coding, or codeableConcept). Other parameters (including version and display) are optional","code":"validate-code","resource":["CodeSystem"],"system":false,"type":true,"instance":true,"parameter":[{"name":"url","use":"in","min":0,"max":"1","documentation":"`CodeSystem` URL. The server must know the code system (e.g. it is defined explicitly in the server'scode systems, or it is known implicitly by the server","type":"uri"},{"name":"codeSystem","use":"in","min":0,"max":"1","documentation":"The codeSystem is provided directly as part of the request. Servers may choose not to accept code systems in this fashion. This parameter is used when the client wants the server to check against a code system that is not stored on the server","type":"CodeSystem"},{"name":"code","use":"in","min":0,"max":"1","documentation":"The code that is to be validated","type":"code"},{"name":"version","use":"in","min":0,"max":"1","documentation":"The version of the code system, if one was provided in the source data","type":"string"},{"name":"display","use":"in","min":0,"max":"1","documentation":"The display associated with the code, if provided. If a display is provided a code must be provided. If no display is provided, the server cannot validate the display value, but may choose to return a recommended display name in an extension in the outcome. Whether displays are case sensitive is code system dependent","type":"string"},{"name":"coding","use":"in","min":0,"max":"1","documentation":"A coding to validate. The system must match the specified code system","type":"Coding"},{"name":"codeableConcept","use":"in","min":0,"max":"1","documentation":"A full codeableConcept to validate. The server returns true if one of the coding values is in the code system, and may also validate that the codings are not in conflict with each other if more than one is present","type":"CodeableConcept"},{"name":"date","use":"in","min":0,"max":"1","documentation":"The date for which the validation should be checked. Normally, this is the current conditions (which is the default values) but under some circumstances, systems need to validate that a correct code was used at some point in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.","type":"dateTime"},{"name":"abstract","use":"in","min":0,"max":"1","documentation":"If this parameter has a value of true, the client is stating that the validation is being performed in a context where a concept designated as 'abstract' is appropriate/allowed to be used, and the server should regard abstract codes as valid. If this parameter is false, abstract codes are not considered to be valid.\n\nNote that. 'abstract' is a property defined by many HL7 code systems that indicates that the concept is a logical grouping concept that is not intended to be used asa 'concrete' concept to in an actual patient/care/process record. This language is borrowed from Object Orienated theory where 'asbtract' objects are never instantiated. However in the general record and terminology eco-system, there are many contexts where it is appropraite to use these codes e.g. as decision making criterion, or when editing value sets themselves. This parameter allows a client to indicate to the server that it is working in such a context.","type":"boolean"},{"name":"displayLanguage","use":"in","min":0,"max":"1","documentation":"Specifies the language to be used for description when validating the display property","type":"code"},{"name":"result","use":"out","min":1,"max":"1","documentation":"True if the concept details supplied are valid","type":"boolean"},{"name":"message","use":"out","min":0,"max":"1","documentation":"Error details, if result = false. If this is provided when result = true, the message carries hints and warnings","type":"string"},{"name":"display","use":"out","min":0,"max":"1","documentation":"A valid display for the concept if the system wishes to display this to a user","type":"string"}]}"#;
1887 #[doc = "The `OperationDefinition` this module was generated from."]
1888 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1889 serde_json::from_str(OPERATION_DEFINITION_JSON)
1890 .expect("Generated OperationDefinition JSON must deserialize.")
1891 });
1892 #[derive(Debug, FromParameters, ToParameters)]
1893 pub struct Input {
1894 #[doc = "`CodeSystem` URL. The server must know the code system (e.g. it is defined explicitly in the"]
1895 #[doc = "server'scode systems, or it is known implicitly by the server"]
1896 pub url: Option<FHIRUri>,
1897 #[doc = "The codeSystem is provided directly as part of the request. Servers may choose not to accept code"]
1898 #[doc = "systems in this fashion. This parameter is used when the client wants the server to check against a"]
1899 #[doc = "code system that is not stored on the server"]
1900 pub codeSystem: Option<CodeSystem>,
1901 #[doc = "The code that is to be validated"]
1902 pub code: Option<FHIRCode>,
1903 #[doc = "The version of the code system, if one was provided in the source data"]
1904 pub version: Option<FHIRString>,
1905 #[doc = "The display associated with the code, if provided. If a display is provided a code must be provided."]
1906 #[doc = "If no display is provided, the server cannot validate the display value, but may choose to return a"]
1907 #[doc = "recommended display name in an extension in the outcome. Whether displays are case sensitive is code"]
1908 #[doc = "system dependent"]
1909 pub display: Option<FHIRString>,
1910 #[doc = "A coding to validate. The system must match the specified code system"]
1911 pub coding: Option<Coding>,
1912 #[doc = "A full codeableConcept to validate. The server returns true if one of the coding values is in the"]
1913 #[doc = "code system, and may also validate that the codings are not in conflict with each other if more than"]
1914 #[doc = "one is present"]
1915 pub codeableConcept: Option<CodeableConcept>,
1916 #[doc = "The date for which the validation should be checked. Normally, this is the current conditions (which"]
1917 #[doc = "is the default values) but under some circumstances, systems need to validate that a correct code"]
1918 #[doc = "was used at some point in the past. A typical example of this would be where code selection is"]
1919 #[doc = "constrained to the set of codes that were available when the patient was treated, not when the"]
1920 #[doc = "record is being edited. Note that which date is appropriate is a matter for implementation policy."]
1921 pub date: Option<FHIRDateTime>,
1922 #[doc = "If this parameter has a value of true, the client is stating that the validation is being performed"]
1923 #[doc = "in a context where a concept designated as `abstract` is appropriate/allowed to be used, and the"]
1924 #[doc = "server should regard abstract codes as valid. If this parameter is false, abstract codes are not"]
1925 #[doc = "considered to be valid."]
1926 #[doc = ""]
1927 #[doc = "Note that. `abstract` is a property defined by many HL7 code systems that indicates that the concept"]
1928 #[doc = "is a logical grouping concept that is not intended to be used asa `concrete` concept to in an actual"]
1929 #[doc = "patient/care/process record. This language is borrowed from Object Orienated theory where `asbtract`"]
1930 #[doc = "objects are never instantiated. However in the general record and terminology eco-system, there are"]
1931 #[doc = "many contexts where it is appropraite to use these codes e.g. as decision making criterion, or when"]
1932 #[doc = "editing value sets themselves. This parameter allows a client to indicate to the server that it is"]
1933 #[doc = "working in such a context."]
1934 #[parameter_rename = "abstract"]
1935 pub abstract_: Option<FHIRBoolean>,
1936 #[doc = "Specifies the language to be used for description when validating the display property"]
1937 pub displayLanguage: Option<FHIRCode>,
1938 }
1939 impl From<Input> for Resource {
1940 fn from(value: Input) -> Self {
1941 let parameters: Vec<ParametersParameter> = value.into();
1942 Resource::Parameters(Parameters {
1943 parameter: Some(parameters),
1944 ..Default::default()
1945 })
1946 }
1947 }
1948 #[derive(Debug, FromParameters, ToParameters)]
1949 pub struct Output {
1950 #[doc = "True if the concept details supplied are valid"]
1951 pub result: FHIRBoolean,
1952 #[doc = "Error details, if result = false. If this is provided when result = true, the message carries hints"]
1953 #[doc = "and warnings"]
1954 pub message: Option<FHIRString>,
1955 #[doc = "A valid display for the concept if the system wishes to display this to a user"]
1956 pub display: Option<FHIRString>,
1957 }
1958 impl From<Output> for Resource {
1959 fn from(value: Output) -> Self {
1960 let parameters: Vec<ParametersParameter> = value.into();
1961 Resource::Parameters(Parameters {
1962 parameter: Some(parameters),
1963 ..Default::default()
1964 })
1965 }
1966 }
1967}
1968#[doc = "A client can ask a server to generate a fully bundled document from a composition resource. The"]
1969#[doc = "server takes the composition resource, locates all the referenced resources and other additional"]
1970#[doc = "resources as configured or requested and either returns a full document bundle, or returns an error."]
1971#[doc = "Note that since this is a search operation, the document bundle is wrapped inside the search bundle."]
1972#[doc = "If some of the resources are located on other servers, it is at the discretion of the server whether"]
1973#[doc = "to retrieve them or return an error. If the correct version of the document that would be generated"]
1974#[doc = "already exists, then the server can return the existing one."]
1975pub mod CompositionDocument {
1976 use haste_fhir_model::r4::generated::resources::{
1977 OperationDefinition, Parameters, ParametersParameter, Resource,
1978 };
1979 use haste_fhir_model::r4::generated::types::{FHIRBoolean, FHIRUri};
1980 use haste_fhir_operation_error::OperationOutcomeError;
1981 use haste_fhir_ops::derive::{FromParameters, ToParameters};
1982 use std::sync::LazyLock;
1983 pub const CODE: &str = "document";
1984 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Composition-document","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Generate a Document</h2><p>OPERATION: Generate a Document</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Composition-document</pre><div><p>A client can ask a server to generate a fully bundled document from a composition resource. The server takes the composition resource, locates all the referenced resources and other additional resources as configured or requested and either returns a full document bundle, or returns an error. Note that since this is a search operation, the document bundle is wrapped inside the search bundle. If some of the resources are located on other servers, it is at the discretion of the server whether to retrieve them or return an error. If the correct version of the document that would be generated already exists, then the server can return the existing one.</p>\n</div><p>URL: [base]/Composition/$document</p><p>URL: [base]/Composition/[id]/$document</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>id</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>Identifies the composition to use. This can either be a simple id, which identifies a composition, or it can be a full URL, which identifies a composition on another server.</p>\n<p>Notes:</p>\n<ul>\n<li>GET [base]/Composition/[id]/$document is identical in meaning to GET [base]/Composition/$document?id=[id]</li>\n<li>the id parameter SHALL NOT be used if the operation is requested on a particular composition (e.g. GET [base]/Composition/[id]/$document?id=[id] is not allowed)</li>\n<li>Servers are not required to support generating documents on Compositions located on another server</li>\n</ul>\n</div></td></tr><tr><td>IN</td><td>persist</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Whether to store the document at the bundle end-point (/Bundle) or not once it is generated. Value = true or false (default is for the server to decide). If the document is stored, it's location can be inferred from the Bundle.id, but it SHOULD be provided explicitly in the HTTP Location header in the response</p>\n</div></td></tr><tr><td>IN</td><td>graph</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a <a href=\"graphdefinition.html\">GraphDefinition</a> that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources</p>\n</div></td></tr></table><div><p>Note: this operation definition does not resolve the question how document signatures are created. This is an open issue during the period of trial use, and feedback is requested regarding this question</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Composition-document","version":"4.0.1","name":"Generate a Document","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"A client can ask a server to generate a fully bundled document from a composition resource. The server takes the composition resource, locates all the referenced resources and other additional resources as configured or requested and either returns a full document bundle, or returns an error. Note that since this is a search operation, the document bundle is wrapped inside the search bundle. If some of the resources are located on other servers, it is at the discretion of the server whether to retrieve them or return an error. If the correct version of the document that would be generated already exists, then the server can return the existing one.","code":"document","comment":"Note: this operation definition does not resolve the question how document signatures are created. This is an open issue during the period of trial use, and feedback is requested regarding this question","resource":["Composition"],"system":false,"type":true,"instance":true,"parameter":[{"name":"id","use":"in","min":0,"max":"1","documentation":"Identifies the composition to use. This can either be a simple id, which identifies a composition, or it can be a full URL, which identifies a composition on another server. \n\nNotes: \n\n* GET [base]/Composition/[id]/$document is identical in meaning to GET [base]/Composition/$document?id=[id]\n* the id parameter SHALL NOT be used if the operation is requested on a particular composition (e.g. GET [base]/Composition/[id]/$document?id=[id] is not allowed)\n* Servers are not required to support generating documents on Compositions located on another server","type":"uri"},{"name":"persist","use":"in","min":0,"max":"1","documentation":"Whether to store the document at the bundle end-point (/Bundle) or not once it is generated. Value = true or false (default is for the server to decide). If the document is stored, it's location can be inferred from the Bundle.id, but it SHOULD be provided explicitly in the HTTP Location header in the response","type":"boolean"},{"name":"graph","use":"in","min":0,"max":"1","documentation":"Canonical reference to a `GraphDefinition`. If a URL is provided, it is the canonical reference to a [`GraphDefinition`](graphdefinition.html) that it controls what resources are to be added to the bundle when building the document. The `GraphDefinition` can also specify profiles that apply to the various resources","type":"uri"}]}"#;
1985 #[doc = "The `OperationDefinition` this module was generated from."]
1986 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
1987 serde_json::from_str(OPERATION_DEFINITION_JSON)
1988 .expect("Generated OperationDefinition JSON must deserialize.")
1989 });
1990 #[derive(Debug, FromParameters, ToParameters)]
1991 pub struct Input {
1992 #[doc = "Identifies the composition to use. This can either be a simple id, which identifies a composition,"]
1993 #[doc = "or it can be a full URL, which identifies a composition on another server."]
1994 #[doc = ""]
1995 #[doc = "Notes:"]
1996 #[doc = ""]
1997 #[doc = "* `GET [base]/Composition/[id]/$document` is identical in meaning to `GET"]
1998 #[doc = "[base]/Composition/$document?id=[id]`"]
1999 #[doc = "* the id parameter SHALL NOT be used if the operation is requested on a particular composition (e.g."]
2000 #[doc = "`GET [base]/Composition/[id]/$document?id=[id]` is not allowed)"]
2001 #[doc = "* Servers are not required to support generating documents on Compositions located on another server"]
2002 pub id: Option<FHIRUri>,
2003 #[doc = "Whether to store the document at the bundle end-point (/Bundle) or not once it is generated. Value ="]
2004 #[doc = "true or false (default is for the server to decide). If the document is stored, it's location can be"]
2005 #[doc = "inferred from the `Bundle.id`, but it SHOULD be provided explicitly in the HTTP Location header in"]
2006 #[doc = "the response"]
2007 pub persist: Option<FHIRBoolean>,
2008 #[doc = "Canonical reference to a `GraphDefinition`. If a URL is provided, it is the canonical reference to a"]
2009 #[doc = "[`GraphDefinition`](graphdefinition.html) that it controls what resources are to be added to the"]
2010 #[doc = "bundle when building the document. The `GraphDefinition` can also specify profiles that apply to the"]
2011 #[doc = "various resources"]
2012 pub graph: Option<FHIRUri>,
2013 }
2014 impl From<Input> for Resource {
2015 fn from(value: Input) -> Self {
2016 let parameters: Vec<ParametersParameter> = value.into();
2017 Resource::Parameters(Parameters {
2018 parameter: Some(parameters),
2019 ..Default::default()
2020 })
2021 }
2022 }
2023 #[derive(Debug, FromParameters, ToParameters)]
2024 pub struct Output {}
2025 impl From<Output> for Resource {
2026 fn from(value: Output) -> Self {
2027 let parameters: Vec<ParametersParameter> = value.into();
2028 Resource::Parameters(Parameters {
2029 parameter: Some(parameters),
2030 ..Default::default()
2031 })
2032 }
2033 }
2034}
2035#[doc = "This operation provides support for ongoing maintenance of a client-side [transitive closure"]
2036#[doc = "table](https://en.wikipedia.org/wiki/Transitive_closure#In_graph_theory) based on server-side"]
2037#[doc = "terminological logic. For details of how this is used, see [`Maintaining a Closure"]
2038#[doc = "Table`](terminology-service.html#closure)"]
2039pub mod ConceptMapClosure {
2040 use haste_fhir_model::r4::generated::resources::{
2041 ConceptMap, OperationDefinition, Parameters, ParametersParameter, Resource,
2042 };
2043 use haste_fhir_model::r4::generated::types::{Coding, FHIRString};
2044 use haste_fhir_operation_error::OperationOutcomeError;
2045 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2046 use std::sync::LazyLock;
2047 pub const CODE: &str = "closure";
2048 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ConceptMap-closure","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Closure Table Maintenance</h2><p>OPERATION: Closure Table Maintenance</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ConceptMap-closure</pre><div><p>This operation provides support for ongoing maintenance of a client-side <a href=\"https://en.wikipedia.org/wiki/Transitive_closure#In_graph_theory\">transitive closure table</a> based on server-side terminological logic. For details of how this is used, see <a href=\"terminology-service.html#closure\">Maintaining a Closure Table</a></p>\n</div><p>URL: [base]/$closure</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>name</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The name that defines the particular context for the subsumption based closure table</p>\n</div></td></tr><tr><td>IN</td><td>concept</td><td>0..*</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>Concepts to add to the closure table</p>\n</div></td></tr><tr><td>IN</td><td>version</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>A request to resynchronise - request to send all new entries since the nominated version was sent by the server</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"conceptmap.html\">ConceptMap</a></td><td/><td><div><p>A list of new entries (code / system --> code/system) that the client should add to its closure table. The only kind of entry mapping equivalences that can be returned are equal, specializes, subsumes and unmatched</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":3},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/ConceptMap-closure","version":"4.0.1","name":"Closure Table Maintenance","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation provides support for ongoing maintenance of a client-side [transitive closure table](https://en.wikipedia.org/wiki/Transitive_closure#In_graph_theory) based on server-side terminological logic. For details of how this is used, see [Maintaining a Closure Table](terminology-service.html#closure)","code":"closure","resource":["ConceptMap"],"system":true,"type":false,"instance":false,"parameter":[{"name":"name","use":"in","min":1,"max":"1","documentation":"The name that defines the particular context for the subsumption based closure table","type":"string"},{"name":"concept","use":"in","min":0,"max":"*","documentation":"Concepts to add to the closure table","type":"Coding"},{"name":"version","use":"in","min":0,"max":"1","documentation":"A request to resynchronise - request to send all new entries since the nominated version was sent by the server","type":"string"},{"name":"return","use":"out","min":1,"max":"1","documentation":"A list of new entries (code / system --> code/system) that the client should add to its closure table. The only kind of entry mapping equivalences that can be returned are equal, specializes, subsumes and unmatched","type":"ConceptMap"}]}"#;
2049 #[doc = "The `OperationDefinition` this module was generated from."]
2050 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2051 serde_json::from_str(OPERATION_DEFINITION_JSON)
2052 .expect("Generated OperationDefinition JSON must deserialize.")
2053 });
2054 #[derive(Debug, FromParameters, ToParameters)]
2055 pub struct Input {
2056 #[doc = "The name that defines the particular context for the subsumption based closure table"]
2057 pub name: FHIRString,
2058 #[doc = "Concepts to add to the closure table"]
2059 pub concept: Option<Vec<Coding>>,
2060 #[doc = "A request to resynchronise - request to send all new entries since the nominated version was sent by"]
2061 #[doc = "the server"]
2062 pub version: Option<FHIRString>,
2063 }
2064 impl From<Input> for Resource {
2065 fn from(value: Input) -> Self {
2066 let parameters: Vec<ParametersParameter> = value.into();
2067 Resource::Parameters(Parameters {
2068 parameter: Some(parameters),
2069 ..Default::default()
2070 })
2071 }
2072 }
2073 #[derive(Debug, FromParameters)]
2074 pub struct Output {
2075 #[doc = "A list of new entries (code / system --> code/system) that the client should add to its closure"]
2076 #[doc = "table. The only kind of entry mapping equivalences that can be returned are equal, specializes,"]
2077 #[doc = "subsumes and unmatched"]
2078 #[parameter_rename = "return"]
2079 pub return_: ConceptMap,
2080 }
2081 impl From<Output> for Resource {
2082 fn from(value: Output) -> Self {
2083 Resource::ConceptMap(value.return_)
2084 }
2085 }
2086}
2087#[doc = "Translate a code from one value set to another, based on the existing value set and concept maps"]
2088#[doc = "resources, and/or other additional knowledge available to the server."]
2089#[doc = ""]
2090#[doc = "One (and only one) of the in parameters (code, coding, codeableConcept) must be provided, to"]
2091#[doc = "identify the code that is to be translated."]
2092#[doc = ""]
2093#[doc = "The operation returns a set of parameters including a `result` for whether there is an acceptable"]
2094#[doc = "match, and a list of possible matches. Note that the list of matches may include notes of codes for"]
2095#[doc = "which mapping is specifically excluded, so implementers have to check the match.equivalence for each"]
2096#[doc = "match"]
2097pub mod ConceptMapTranslate {
2098 use haste_fhir_model::r4::generated::resources::{
2099 ConceptMap, OperationDefinition, Parameters, ParametersParameter, Resource,
2100 };
2101 use haste_fhir_model::r4::generated::types::{
2102 CodeableConcept, Coding, FHIRBoolean, FHIRCode, FHIRString, FHIRUri,
2103 };
2104 use haste_fhir_operation_error::OperationOutcomeError;
2105 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2106 use std::sync::LazyLock;
2107 pub const CODE: &str = "translate";
2108 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ConceptMap-translate","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Concept Translation</h2><p>OPERATION: Concept Translation</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ConceptMap-translate</pre><div><p>Translate a code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server.</p>\n<p>One (and only one) of the in parameters (code, coding, codeableConcept) must be provided, to identify the code that is to be translated.</p>\n<p>The operation returns a set of parameters including a 'result' for whether there is an acceptable match, and a list of possible matches. Note that the list of matches may include notes of codes for which mapping is specifically excluded, so implementers have to check the match.equivalence for each match</p>\n</div><p>URL: [base]/ConceptMap/$translate</p><p>URL: [base]/ConceptMap/[id]/$translate</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>url</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>A canonical URL for a concept map. The server must know the concept map (e.g. it is defined explicitly in the server's concept maps, or it is defined implicitly by some code system known to the server.</p>\n</div></td></tr><tr><td>IN</td><td>conceptMap</td><td>0..1</td><td><a href=\"conceptmap.html\">ConceptMap</a></td><td/><td><div><p>The concept map is provided directly as part of the request. Servers may choose not to accept concept maps in this fashion.</p>\n</div></td></tr><tr><td>IN</td><td>conceptMapVersion</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The identifier that is used to identify a specific version of the concept map to be used for the translation. This is an arbitrary value managed by the concept map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.</p>\n</div></td></tr><tr><td>IN</td><td>code</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The code that is to be translated. If a code is provided, a system must be provided</p>\n</div></td></tr><tr><td>IN</td><td>system</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The system for the code that is to be translated</p>\n</div></td></tr><tr><td>IN</td><td>version</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The version of the system, if one was provided in the source data</p>\n</div></td></tr><tr><td>IN</td><td>source</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>Identifies the value set used when the concept (system/code pair) was chosen. May be a logical id, or an absolute or relative location. The source value set is an optional parameter because in some cases, the client cannot know what the source value set is. However, without a source value set, the server may be unable to safely identify an applicable concept map, and would return an error. For this reason, a source value set SHOULD always be provided. Note that servers may be able to identify an appropriate concept map without a source value set if there is a full mapping for the entire code system in the concept map, or by manual intervention</p>\n</div></td></tr><tr><td>IN</td><td>coding</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>A coding to translate</p>\n</div></td></tr><tr><td>IN</td><td>codeableConcept</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>A full codeableConcept to validate. The server can translate any of the coding values (e.g. existing translations) as it chooses</p>\n</div></td></tr><tr><td>IN</td><td>target</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>Identifies the value set in which a translation is sought. May be a logical id, or an absolute or relative location. If there's no target specified, the server should return all known translations, along with their source</p>\n</div></td></tr><tr><td>IN</td><td>targetsystem</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>identifies a target code system in which a mapping is sought. This parameter is an alternative to the target parameter - only one is required. Searching for any translation to a target code system irrespective of the context (e.g. target valueset) may lead to unsafe results, and it is at the discretion of the server to decide when to support this operation</p>\n</div></td></tr><tr><td>IN</td><td>dependency</td><td>0..*</td><td></td><td/><td><div><p>Another element that may help produce the correct mapping</p>\n</div></td></tr><tr><td>IN</td><td>dependency.element</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The element for this dependency</p>\n</div></td></tr><tr><td>IN</td><td>dependency.concept</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The value for this dependency</p>\n</div></td></tr><tr><td>IN</td><td>reverse</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>if this is true, then the operation should return all the codes that might be mapped to this code. This parameter reverses the meaning of the source and target parameters</p>\n</div></td></tr><tr><td>OUT</td><td>result</td><td>1..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>True if the concept could be translated successfully. The value can only be true if at least one returned match has an equivalence which is not unmatched or disjoint</p>\n</div></td></tr><tr><td>OUT</td><td>message</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>Error details, for display to a human. If this is provided when result = true, the message carries hints and warnings (e.g. a note that the matches could be improved by providing additional detail)</p>\n</div></td></tr><tr><td>OUT</td><td>match</td><td>0..*</td><td></td><td/><td><div><p>A concept in the target value set with an equivalence. Note that there may be multiple matches of equal or differing equivalence, and the matches may include equivalence values that mean that there is no match</p>\n</div></td></tr><tr><td>OUT</td><td>match.equivalence</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>A code indicating the equivalence of the translation, using values from <a href=\"valueset-concept-map-equivalence.html\">ConceptMapEquivalence</a></p>\n</div></td></tr><tr><td>OUT</td><td>match.concept</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>The translation outcome. Note that this would never have userSelected = true, since the process of translations implies that the user is not selecting the code (and only the client could know differently)</p>\n</div></td></tr><tr><td>OUT</td><td>match.product</td><td>0..*</td><td></td><td/><td><div><p>Another element that is the product of this mapping</p>\n</div></td></tr><tr><td>OUT</td><td>match.product.element</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The element for this product</p>\n</div></td></tr><tr><td>OUT</td><td>match.product.concept</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>The value for this product</p>\n</div></td></tr><tr><td>OUT</td><td>match.source</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The canonical reference to the concept map from which this mapping comes from</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":3},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/ConceptMap-translate","version":"4.0.1","name":"Concept Translation","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Translate a code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server. \r\n\r\n One (and only one) of the in parameters (code, coding, codeableConcept) must be provided, to identify the code that is to be translated. \r\n\r\n The operation returns a set of parameters including a 'result' for whether there is an acceptable match, and a list of possible matches. Note that the list of matches may include notes of codes for which mapping is specifically excluded, so implementers have to check the match.equivalence for each match","code":"translate","resource":["ConceptMap"],"system":false,"type":true,"instance":true,"parameter":[{"name":"url","use":"in","min":0,"max":"1","documentation":"A canonical URL for a concept map. The server must know the concept map (e.g. it is defined explicitly in the server's concept maps, or it is defined implicitly by some code system known to the server.","type":"uri"},{"name":"conceptMap","use":"in","min":0,"max":"1","documentation":"The concept map is provided directly as part of the request. Servers may choose not to accept concept maps in this fashion.","type":"ConceptMap"},{"name":"conceptMapVersion","use":"in","min":0,"max":"1","documentation":"The identifier that is used to identify a specific version of the concept map to be used for the translation. This is an arbitrary value managed by the concept map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.","type":"string"},{"name":"code","use":"in","min":0,"max":"1","documentation":"The code that is to be translated. If a code is provided, a system must be provided","type":"code"},{"name":"system","use":"in","min":0,"max":"1","documentation":"The system for the code that is to be translated","type":"uri"},{"name":"version","use":"in","min":0,"max":"1","documentation":"The version of the system, if one was provided in the source data","type":"string"},{"name":"source","use":"in","min":0,"max":"1","documentation":"Identifies the value set used when the concept (system/code pair) was chosen. May be a logical id, or an absolute or relative location. The source value set is an optional parameter because in some cases, the client cannot know what the source value set is. However, without a source value set, the server may be unable to safely identify an applicable concept map, and would return an error. For this reason, a source value set SHOULD always be provided. Note that servers may be able to identify an appropriate concept map without a source value set if there is a full mapping for the entire code system in the concept map, or by manual intervention","type":"uri"},{"name":"coding","use":"in","min":0,"max":"1","documentation":"A coding to translate","type":"Coding"},{"name":"codeableConcept","use":"in","min":0,"max":"1","documentation":"A full codeableConcept to validate. The server can translate any of the coding values (e.g. existing translations) as it chooses","type":"CodeableConcept"},{"name":"target","use":"in","min":0,"max":"1","documentation":"Identifies the value set in which a translation is sought. May be a logical id, or an absolute or relative location. If there's no target specified, the server should return all known translations, along with their source","type":"uri"},{"name":"targetsystem","use":"in","min":0,"max":"1","documentation":"identifies a target code system in which a mapping is sought. This parameter is an alternative to the target parameter - only one is required. Searching for any translation to a target code system irrespective of the context (e.g. target valueset) may lead to unsafe results, and it is at the discretion of the server to decide when to support this operation","type":"uri"},{"name":"dependency","use":"in","min":0,"max":"*","documentation":"Another element that may help produce the correct mapping","part":[{"name":"element","use":"in","min":0,"max":"1","documentation":"The element for this dependency","type":"uri"},{"name":"concept","use":"in","min":0,"max":"1","documentation":"The value for this dependency","type":"CodeableConcept"}]},{"name":"reverse","use":"in","min":0,"max":"1","documentation":"if this is true, then the operation should return all the codes that might be mapped to this code. This parameter reverses the meaning of the source and target parameters","type":"boolean"},{"name":"result","use":"out","min":1,"max":"1","documentation":"True if the concept could be translated successfully. The value can only be true if at least one returned match has an equivalence which is not unmatched or disjoint","type":"boolean"},{"name":"message","use":"out","min":0,"max":"1","documentation":"Error details, for display to a human. If this is provided when result = true, the message carries hints and warnings (e.g. a note that the matches could be improved by providing additional detail)","type":"string"},{"name":"match","use":"out","min":0,"max":"*","documentation":"A concept in the target value set with an equivalence. Note that there may be multiple matches of equal or differing equivalence, and the matches may include equivalence values that mean that there is no match","part":[{"name":"equivalence","use":"out","min":0,"max":"1","documentation":"A code indicating the equivalence of the translation, using values from [`ConceptMapEquivalence`](valueset-concept-map-equivalence.html)","type":"code"},{"name":"concept","use":"out","min":0,"max":"1","documentation":"The translation outcome. Note that this would never have userSelected = true, since the process of translations implies that the user is not selecting the code (and only the client could know differently)","type":"Coding"},{"name":"product","use":"out","min":0,"max":"*","documentation":"Another element that is the product of this mapping","part":[{"name":"element","use":"out","min":0,"max":"1","documentation":"The element for this product","type":"uri"},{"name":"concept","use":"out","min":0,"max":"1","documentation":"The value for this product","type":"Coding"}]},{"name":"source","use":"out","min":0,"max":"1","documentation":"The canonical reference to the concept map from which this mapping comes from","type":"uri"}]}]}"#;
2109 #[doc = "The `OperationDefinition` this module was generated from."]
2110 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2111 serde_json::from_str(OPERATION_DEFINITION_JSON)
2112 .expect("Generated OperationDefinition JSON must deserialize.")
2113 });
2114 #[derive(Debug, FromParameters, ToParameters)]
2115 pub struct InputDependency {
2116 #[doc = "The element for this dependency"]
2117 pub element: Option<FHIRUri>,
2118 #[doc = "The value for this dependency"]
2119 pub concept: Option<CodeableConcept>,
2120 }
2121 impl From<InputDependency> for Resource {
2122 fn from(value: InputDependency) -> Self {
2123 let parameters: Vec<ParametersParameter> = value.into();
2124 Resource::Parameters(Parameters {
2125 parameter: Some(parameters),
2126 ..Default::default()
2127 })
2128 }
2129 }
2130 #[derive(Debug, FromParameters, ToParameters)]
2131 pub struct Input {
2132 #[doc = "A canonical URL for a concept map. The server must know the concept map (e.g. it is defined"]
2133 #[doc = "explicitly in the server's concept maps, or it is defined implicitly by some code system known to"]
2134 #[doc = "the server."]
2135 pub url: Option<FHIRUri>,
2136 #[doc = "The concept map is provided directly as part of the request. Servers may choose not to accept"]
2137 #[doc = "concept maps in this fashion."]
2138 pub conceptMap: Option<ConceptMap>,
2139 #[doc = "The identifier that is used to identify a specific version of the concept map to be used for the"]
2140 #[doc = "translation. This is an arbitrary value managed by the concept map author and is not expected to be"]
2141 #[doc = "globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not"]
2142 #[doc = "available."]
2143 pub conceptMapVersion: Option<FHIRString>,
2144 #[doc = "The code that is to be translated. If a code is provided, a system must be provided"]
2145 pub code: Option<FHIRCode>,
2146 #[doc = "The system for the code that is to be translated"]
2147 pub system: Option<FHIRUri>,
2148 #[doc = "The version of the system, if one was provided in the source data"]
2149 pub version: Option<FHIRString>,
2150 #[doc = "Identifies the value set used when the concept (system/code pair) was chosen. May be a logical id,"]
2151 #[doc = "or an absolute or relative location. The source value set is an optional parameter because in some"]
2152 #[doc = "cases, the client cannot know what the source value set is. However, without a source value set, the"]
2153 #[doc = "server may be unable to safely identify an applicable concept map, and would return an error. For"]
2154 #[doc = "this reason, a source value set SHOULD always be provided. Note that servers may be able to identify"]
2155 #[doc = "an appropriate concept map without a source value set if there is a full mapping for the entire code"]
2156 #[doc = "system in the concept map, or by manual intervention"]
2157 pub source: Option<FHIRUri>,
2158 #[doc = "A coding to translate"]
2159 pub coding: Option<Coding>,
2160 #[doc = "A full codeableConcept to validate. The server can translate any of the coding values (e.g. existing"]
2161 #[doc = "translations) as it chooses"]
2162 pub codeableConcept: Option<CodeableConcept>,
2163 #[doc = "Identifies the value set in which a translation is sought. May be a logical id, or an absolute or"]
2164 #[doc = "relative location. If there's no target specified, the server should return all known translations,"]
2165 #[doc = "along with their source"]
2166 pub target: Option<FHIRUri>,
2167 #[doc = "identifies a target code system in which a mapping is sought. This parameter is an alternative to"]
2168 #[doc = "the target parameter - only one is required. Searching for any translation to a target code system"]
2169 #[doc = "irrespective of the context (e.g. target valueset) may lead to unsafe results, and it is at the"]
2170 #[doc = "discretion of the server to decide when to support this operation"]
2171 pub targetsystem: Option<FHIRUri>,
2172 #[doc = "Another element that may help produce the correct mapping"]
2173 #[parameter_nested]
2174 pub dependency: Option<Vec<InputDependency>>,
2175 #[doc = "if this is true, then the operation should return all the codes that might be mapped to this code."]
2176 #[doc = "This parameter reverses the meaning of the source and target parameters"]
2177 pub reverse: Option<FHIRBoolean>,
2178 }
2179 impl From<Input> for Resource {
2180 fn from(value: Input) -> Self {
2181 let parameters: Vec<ParametersParameter> = value.into();
2182 Resource::Parameters(Parameters {
2183 parameter: Some(parameters),
2184 ..Default::default()
2185 })
2186 }
2187 }
2188 #[derive(Debug, FromParameters, ToParameters)]
2189 pub struct OutputMatchProduct {
2190 #[doc = "The element for this product"]
2191 pub element: Option<FHIRUri>,
2192 #[doc = "The value for this product"]
2193 pub concept: Option<Coding>,
2194 }
2195 impl From<OutputMatchProduct> for Resource {
2196 fn from(value: OutputMatchProduct) -> Self {
2197 let parameters: Vec<ParametersParameter> = value.into();
2198 Resource::Parameters(Parameters {
2199 parameter: Some(parameters),
2200 ..Default::default()
2201 })
2202 }
2203 }
2204 #[derive(Debug, FromParameters, ToParameters)]
2205 pub struct OutputMatch {
2206 #[doc = "A code indicating the equivalence of the translation, using values from"]
2207 #[doc = "[`ConceptMapEquivalence`](valueset-concept-map-equivalence.html)"]
2208 pub equivalence: Option<FHIRCode>,
2209 #[doc = "The translation outcome. Note that this would never have userSelected = true, since the process of"]
2210 #[doc = "translations implies that the user is not selecting the code (and only the client could know"]
2211 #[doc = "differently)"]
2212 pub concept: Option<Coding>,
2213 #[doc = "Another element that is the product of this mapping"]
2214 #[parameter_nested]
2215 pub product: Option<Vec<OutputMatchProduct>>,
2216 #[doc = "The canonical reference to the concept map from which this mapping comes from"]
2217 pub source: Option<FHIRUri>,
2218 }
2219 impl From<OutputMatch> for Resource {
2220 fn from(value: OutputMatch) -> Self {
2221 let parameters: Vec<ParametersParameter> = value.into();
2222 Resource::Parameters(Parameters {
2223 parameter: Some(parameters),
2224 ..Default::default()
2225 })
2226 }
2227 }
2228 #[derive(Debug, FromParameters, ToParameters)]
2229 pub struct Output {
2230 #[doc = "True if the concept could be translated successfully. The value can only be true if at least one"]
2231 #[doc = "returned match has an equivalence which is not unmatched or disjoint"]
2232 pub result: FHIRBoolean,
2233 #[doc = "Error details, for display to a human. If this is provided when result = true, the message carries"]
2234 #[doc = "hints and warnings (e.g. a note that the matches could be improved by providing additional detail)"]
2235 pub message: Option<FHIRString>,
2236 #[doc = "A concept in the target value set with an equivalence. Note that there may be multiple matches of"]
2237 #[doc = "equal or differing equivalence, and the matches may include equivalence values that mean that there"]
2238 #[doc = "is no match"]
2239 #[parameter_rename = "match"]
2240 #[parameter_nested]
2241 pub match_: Option<Vec<OutputMatch>>,
2242 }
2243 impl From<Output> for Resource {
2244 fn from(value: Output) -> Self {
2245 let parameters: Vec<ParametersParameter> = value.into();
2246 Resource::Parameters(Parameters {
2247 parameter: Some(parameters),
2248 ..Default::default()
2249 })
2250 }
2251 }
2252}
2253#[doc = "This operation is used to submit an `EligibilityRequest` for assessment either as a single"]
2254#[doc = "`EligibilityRequest` resource instance or as a Bundle containing the `EligibilityRequest` and other"]
2255#[doc = "referenced resources, or Bundle containing a batch of `EligibilityRequest` resources, either as"]
2256#[doc = "single `EligibilityRequests` resources or Bundle resources, for processing. The only input parameter"]
2257#[doc = "is the single `EligibilityRequest` or Bundle resource and the only output is a single"]
2258#[doc = "`EligibilityResponse`, Bundle of `EligibilityResponses` or an `OperationOutcome` resource."]
2259pub mod CoverageEligibilityRequestSubmit {
2260 use haste_fhir_model::r4::generated::resources::{
2261 OperationDefinition, Parameters, ParametersParameter, Resource,
2262 };
2263 use haste_fhir_operation_error::OperationOutcomeError;
2264 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2265 use std::sync::LazyLock;
2266 pub const CODE: &str = "submit";
2267 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"CoverageEligibilityRequest-submit","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Submit an EligibilityRequest resource for assessment</h2><p>OPERATION: Submit an EligibilityRequest resource for assessment</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/CoverageEligibilityRequest-submit</pre><div><p>This operation is used to submit an EligibilityRequest for assessment either as a single EligibilityRequest resource instance or as a Bundle containing the EligibilityRequest and other referenced resources, or Bundle containing a batch of EligibilityRequest resources, either as single EligibilityRequests resources or Bundle resources, for processing. The only input parameter is the single EligibilityRequest or Bundle resource and the only output is a single EligibilityResponse, Bundle of EligibilityResponses or an OperationOutcome resource.</p>\n</div><p>URL: [base]/CoverageEligibilityRequest/$submit</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>resource</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>An EligibilityRequest resource or Bundle of EligibilityRequests, either as individual EligibilityRequest resources or as Bundles each containing a single EligibilityRequest plus referenced resources.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>An EligibilityResponse resource or Bundle of EligibilityResponse responses, either as individual EligibilityResponse resources or as Bundles each containing a single EligibilityResponse plus referenced resources.</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/CoverageEligibilityRequest-submit","version":"4.0.1","name":"Submit an EligibilityRequest resource for assessment","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation is used to submit an `EligibilityRequest` for assessment either as a single `EligibilityRequest` resource instance or as a Bundle containing the `EligibilityRequest` and other referenced resources, or Bundle containing a batch of `EligibilityRequest` resources, either as single `EligibilityRequests` resources or Bundle resources, for processing. The only input parameter is the single `EligibilityRequest` or Bundle resource and the only output is a single `EligibilityResponse`, Bundle of `EligibilityResponses` or an `OperationOutcome` resource.","code":"submit","resource":["CoverageEligibilityRequest"],"system":false,"type":true,"instance":false,"parameter":[{"name":"resource","use":"in","min":1,"max":"1","documentation":"An `EligibilityRequest` resource or Bundle of `EligibilityRequests`, either as individual `EligibilityRequest` resources or as Bundles each containing a single `EligibilityRequest` plus referenced resources.","type":"Resource"},{"name":"return","use":"out","min":1,"max":"1","documentation":"An `EligibilityResponse` resource or Bundle of `EligibilityResponse` responses, either as individual `EligibilityResponse` resources or as Bundles each containing a single `EligibilityResponse` plus referenced resources.","type":"Resource"}]}"#;
2268 #[doc = "The `OperationDefinition` this module was generated from."]
2269 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2270 serde_json::from_str(OPERATION_DEFINITION_JSON)
2271 .expect("Generated OperationDefinition JSON must deserialize.")
2272 });
2273 #[derive(Debug, FromParameters, ToParameters)]
2274 pub struct Input {
2275 #[doc = "An `EligibilityRequest` resource or Bundle of `EligibilityRequests`, either as individual"]
2276 #[doc = "`EligibilityRequest` resources or as Bundles each containing a single `EligibilityRequest` plus"]
2277 #[doc = "referenced resources."]
2278 pub resource: Resource,
2279 }
2280 impl From<Input> for Resource {
2281 fn from(value: Input) -> Self {
2282 let parameters: Vec<ParametersParameter> = value.into();
2283 Resource::Parameters(Parameters {
2284 parameter: Some(parameters),
2285 ..Default::default()
2286 })
2287 }
2288 }
2289 #[derive(Debug, FromParameters, ToParameters)]
2290 pub struct Output {
2291 #[doc = "An `EligibilityResponse` resource or Bundle of `EligibilityResponse` responses, either as individual"]
2292 #[doc = "`EligibilityResponse` resources or as Bundles each containing a single `EligibilityResponse` plus"]
2293 #[doc = "referenced resources."]
2294 #[parameter_rename = "return"]
2295 pub return_: Resource,
2296 }
2297 impl From<Output> for Resource {
2298 fn from(value: Output) -> Self {
2299 let parameters: Vec<ParametersParameter> = value.into();
2300 Resource::Parameters(Parameters {
2301 parameter: Some(parameters),
2302 ..Default::default()
2303 })
2304 }
2305 }
2306}
2307#[doc = "This operation is used to return all the information related to an encounter described in the"]
2308#[doc = "resource on which this operation is invoked. The response is a bundle of type \"searchset\". At a"]
2309#[doc = "minimum, the encounter resource itself is returned, along with any other resources that the server"]
2310#[doc = "has available for the given encounter for the user. The server also returns whatever resources are"]
2311#[doc = "needed to support the records - e.g. linked practitioners, locations, organizations etc. The"]
2312#[doc = "principle intended use for this operation is to provide a patient with access to their record, or to"]
2313#[doc = "allow a client to retrieve everything for an encounter for efficient display). The server SHOULD"]
2314#[doc = "return all resources it has that: * are included in the encounter compartment for the identified"]
2315#[doc = "encounter (have a reference to the encounter) * are referenced by the standard extenstion for"]
2316#[doc = "associating an encounter (where no reference element exists)"]
2317#[doc = "<`http://hl7.org/fhir/StructureDefinition/encounter-associatedEncounter>` * the server believes are"]
2318#[doc = "relevant to the context of the encounter for any other reason (internally defined/decided) * any"]
2319#[doc = "resource referenced by the above, including binaries and attachments (to make a more complete"]
2320#[doc = "package) In the US Realm, at a mimimum, the resources returned SHALL include all the data covered by"]
2321#[doc = "the meaningful use common data elements (see [DAF](http://hl7.org/fhir/us/daf) for further"]
2322#[doc = "guidance). Other applicable implementation guides may make additional rules about the information"]
2323#[doc = "that is returned. Note that for many resources, the exact nature of the link to encounter can be"]
2324#[doc = "ambiguous (e.g. for a `DiagnosticReport`, is it the encounter when it was initiated, or when it was"]
2325#[doc = "reported?)"]
2326pub mod EncounterEverything {
2327 use haste_fhir_model::r4::generated::resources::{
2328 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
2329 };
2330 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRInstant, FHIRInteger};
2331 use haste_fhir_operation_error::OperationOutcomeError;
2332 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2333 use std::sync::LazyLock;
2334 pub const CODE: &str = "everything";
2335 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Encounter-everything","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Fetch Encounter Record</h2><p>OPERATION: Fetch Encounter Record</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Encounter-everything</pre><div><p>This operation is used to return all the information related to an encounter described in the resource on which this operation is invoked. The response is a bundle of type "searchset". At a minimum, the encounter resource itself is returned, along with any other resources that the server has available for the given encounter for the user. The server also returns whatever resources are needed to support the records - e.g. linked practitioners, locations, organizations etc. The principle intended use for this operation is to provide a patient with access to their record, or to allow a client to retrieve everything for an encounter for efficient display).</p>\n<p>The server SHOULD return all resources it has that:</p>\n<ul>\n<li>are included in the encounter compartment for the identified encounter (have a reference to the encounter)</li>\n<li>are referenced by the standard extenstion for associating an encounter (where no reference element exists) http://hl7.org/fhir/StructureDefinition/encounter-associatedEncounter</li>\n<li>the server believes are relevant to the context of the encounter for any other reason (internally defined/decided)</li>\n<li>any resource referenced by the above, including binaries and attachments (to make a more complete package)</li>\n</ul>\n<p>In the US Realm, at a mimimum, the resources returned SHALL include all the data covered by the meaningful use common data elements (see <a href=\"http://hl7.org/fhir/us/daf\">DAF</a> for further guidance). Other applicable implementation guides may make additional rules about the information that is returned. Note that for many resources, the exact nature of the link to encounter can be ambiguous (e.g. for a DiagnosticReport, is it the encounter when it was initiated, or when it was reported?)</p>\n</div><p>URL: [base]/Encounter/[id]/$everything</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>_since</td><td>0..1</td><td><a href=\"datatypes.html#instant\">instant</a></td><td/><td><div><p>Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time</p>\n</div></td></tr><tr><td>IN</td><td>_type</td><td>0..*</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>One or more parameters, each containing one or more comma-delimited FHIR resource types to include in the return resources. In the absense of any specified types, the server returns all resource types</p>\n</div></td></tr><tr><td>IN</td><td>_count</td><td>0..1</td><td><a href=\"datatypes.html#integer\">integer</a></td><td/><td><div><p>See discussion below on the utility of paging through the results of the $everything operation</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The bundle type is "searchset"</p>\n</div></td></tr></table><div><p>The key differences between this operation and simply searching the encounter compartment are:</p>\n<ul>\n<li>unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging)</li>\n<li>the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones)</li>\n</ul>\n<p>This frees the client from needing to determine what it could or should ask for, particularly with regard to included resources. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the patient compartment.</p>\n<p>It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single encounter, or determine whether the context has the rights to the nominated encounter, if there is one, or can determine an appropriate list of encouners to provide data for from the context of the request. If there is no nominated encounter (GET /Encounter/$everything) and the context is not associated with a single encounter record, the actual list of encounters is all encounters that the user associated with the request has access to. In such cases, the server may choose to return an error rather than all the records. Specifying the relationship between the context, a user and encounter records is outside the scope of this specification (though see <a href=\"http://hl7.org/fhir/smart-app-launch\">The Smart App Launch Implementation Guide</a>.</p>\n<p>When this operation is used to access multiple encounter records at once, the return bundle could be rather a lot of data; servers may choose to require that such requests are made <a href=\"async.html\">asynchronously</a>, and associated with <a href=\"formats.html#bulk\">bulk data formats</a>. Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for <a href=\"http.html#paging\">Searching</a>, using the <a href=\"search.html#count\">_count</a> parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the patient compartment.</p>\n<p>The _since parameter is provided to support periodic queries to get additional information that has changed about the encounter since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Encounter-everything","version":"4.0.1","name":"Fetch Encounter Record","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation is used to return all the information related to an encounter described in the resource on which this operation is invoked. The response is a bundle of type \"searchset\". At a minimum, the encounter resource itself is returned, along with any other resources that the server has available for the given encounter for the user. The server also returns whatever resources are needed to support the records - e.g. linked practitioners, locations, organizations etc. The principle intended use for this operation is to provide a patient with access to their record, or to allow a client to retrieve everything for an encounter for efficient display).\r\rThe server SHOULD return all resources it has that:\r\r* are included in the encounter compartment for the identified encounter (have a reference to the encounter)\r* are referenced by the standard extenstion for associating an encounter (where no reference element exists) <http://hl7.org/fhir/StructureDefinition/encounter-associatedEncounter>\r* the server believes are relevant to the context of the encounter for any other reason (internally defined/decided)\r* any resource referenced by the above, including binaries and attachments (to make a more complete package)\r\rIn the US Realm, at a mimimum, the resources returned SHALL include all the data covered by the meaningful use common data elements (see [DAF](http://hl7.org/fhir/us/daf) for further guidance). Other applicable implementation guides may make additional rules about the information that is returned. Note that for many resources, the exact nature of the link to encounter can be ambiguous (e.g. for a `DiagnosticReport`, is it the encounter when it was initiated, or when it was reported?)","code":"everything","comment":"The key differences between this operation and simply searching the encounter compartment are: \n\n* unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging) \n* the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones)\n\nThis frees the client from needing to determine what it could or should ask for, particularly with regard to included resources. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the patient compartment. \n\nIt is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single encounter, or determine whether the context has the rights to the nominated encounter, if there is one, or can determine an appropriate list of encouners to provide data for from the context of the request. If there is no nominated encounter (GET /Encounter/$everything) and the context is not associated with a single encounter record, the actual list of encounters is all encounters that the user associated with the request has access to. In such cases, the server may choose to return an error rather than all the records. Specifying the relationship between the context, a user and encounter records is outside the scope of this specification (though see [The Smart App Launch Implementation Guide](http://hl7.org/fhir/smart-app-launch). \n\nWhen this operation is used to access multiple encounter records at once, the return bundle could be rather a lot of data; servers may choose to require that such requests are made [asynchronously](async.html), and associated with [bulk data formats](formats.html#bulk). Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for [Searching](http.html#paging), using the [_count](search.html#count) parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the patient compartment.\n\nThe _since parameter is provided to support periodic queries to get additional information that has changed about the encounter since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.","resource":["Encounter"],"system":false,"type":false,"instance":true,"parameter":[{"name":"_since","use":"in","min":0,"max":"1","documentation":"Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time","type":"instant"},{"name":"_type","use":"in","min":0,"max":"*","documentation":"One or more parameters, each containing one or more comma-delimited FHIR resource types to include in the return resources. In the absense of any specified types, the server returns all resource types","type":"code"},{"name":"_count","use":"in","min":0,"max":"1","documentation":"See discussion below on the utility of paging through the results of the $everything operation","type":"integer"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The bundle type is \"searchset\"","type":"Bundle"}]}"#;
2336 #[doc = "The `OperationDefinition` this module was generated from."]
2337 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2338 serde_json::from_str(OPERATION_DEFINITION_JSON)
2339 .expect("Generated OperationDefinition JSON must deserialize.")
2340 });
2341 #[derive(Debug, FromParameters, ToParameters)]
2342 pub struct Input {
2343 #[doc = "Resources updated after this period will be included in the response. The intent of this parameter"]
2344 #[doc = "is to allow a client to request only records that have changed since the last request, based on"]
2345 #[doc = "either the return header time, or or (for asynchronous use), the transaction time"]
2346 #[parameter_rename = "_since"]
2347 pub since: Option<FHIRInstant>,
2348 #[doc = "One or more parameters, each containing one or more comma-delimited FHIR resource types to include"]
2349 #[doc = "in the return resources. In the absense of any specified types, the server returns all resource"]
2350 #[doc = "types"]
2351 #[parameter_rename = "_type"]
2352 pub type_: Option<Vec<FHIRCode>>,
2353 #[doc = "See discussion below on the utility of paging through the results of the $everything operation"]
2354 #[parameter_rename = "_count"]
2355 pub count: Option<FHIRInteger>,
2356 }
2357 impl From<Input> for Resource {
2358 fn from(value: Input) -> Self {
2359 let parameters: Vec<ParametersParameter> = value.into();
2360 Resource::Parameters(Parameters {
2361 parameter: Some(parameters),
2362 ..Default::default()
2363 })
2364 }
2365 }
2366 #[derive(Debug, FromParameters)]
2367 pub struct Output {
2368 #[doc = "The bundle type is \"searchset\""]
2369 #[parameter_rename = "return"]
2370 pub return_: Bundle,
2371 }
2372 impl From<Output> for Resource {
2373 fn from(value: Output) -> Self {
2374 Resource::Bundle(value.return_)
2375 }
2376 }
2377}
2378#[doc = "This operation is used to return all the information related to one or more patients that are part"]
2379#[doc = "of the group on which this operation is invoked. The response is a bundle of type \"searchset\". At a"]
2380#[doc = "minimum, the patient resource(s) itself is returned, along with any other resources that the server"]
2381#[doc = "has that are related to the patient(s), and that are available for the given user. The server also"]
2382#[doc = "returns whatever resources are needed to support the records - e.g. linked practitioners,"]
2383#[doc = "medications, locations, organizations etc. The intended use for this operation is for a provider or"]
2384#[doc = "other user to perform a bulk data download. The server SHOULD return at least all resources that it"]
2385#[doc = "has that are in the patient compartment for the identified patient(s), and any resource referenced"]
2386#[doc = "from those, including binaries and attachments. In the US Realm, at a mimimum, the resources"]
2387#[doc = "returned SHALL include all the data covered by the meaningful use common data elements as defined in"]
2388#[doc = "[US-Core](http://hl7.org/fhir/us/coref). Other applicable implementation guides may make additional"]
2389#[doc = "rules about how much information that is returned."]
2390pub mod GroupEverything {
2391 use haste_fhir_model::r4::generated::resources::{
2392 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
2393 };
2394 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRDate, FHIRInstant, FHIRInteger};
2395 use haste_fhir_operation_error::OperationOutcomeError;
2396 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2397 use std::sync::LazyLock;
2398 pub const CODE: &str = "everything";
2399 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Group-everything","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Fetch a group of Patient Records</h2><p>OPERATION: Fetch a group of Patient Records</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Group-everything</pre><div><p>This operation is used to return all the information related to one or more patients that are part of the group on which this operation is invoked. The response is a bundle of type "searchset". At a minimum, the patient resource(s) itself is returned, along with any other resources that the server has that are related to the patient(s), and that are available for the given user. The server also returns whatever resources are needed to support the records - e.g. linked practitioners, medications, locations, organizations etc. The intended use for this operation is for a provider or other user to perform a bulk data download. The server SHOULD return at least all resources that it has that are in the patient compartment for the identified patient(s), and any resource referenced from those, including binaries and attachments. In the US Realm, at a mimimum, the resources returned SHALL include all the data covered by the meaningful use common data elements as defined in <a href=\"http://hl7.org/fhir/us/coref\">US-Core</a>. Other applicable implementation guides may make additional rules about how much information that is returned.</p>\n</div><p>URL: [base]/Group/[id]/$everything</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>start</td><td>0..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no start date is provided, all records prior to the end date are in scope.</p>\n</div></td></tr><tr><td>IN</td><td>end</td><td>0..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no end date is provided, all records subsequent to the start date are in scope.</p>\n</div></td></tr><tr><td>IN</td><td>_since</td><td>0..1</td><td><a href=\"datatypes.html#instant\">instant</a></td><td/><td><div><p>Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time</p>\n</div></td></tr><tr><td>IN</td><td>_type</td><td>0..*</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>One or more parameters, each containing one or more comma-delimited FHIR resource types to include in the return resources. In the absense of any specified types, the server returns all resource types</p>\n</div></td></tr><tr><td>IN</td><td>_count</td><td>0..1</td><td><a href=\"datatypes.html#integer\">integer</a></td><td/><td><div><p>See discussion below on the utility of paging through the results of the $everything operation</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The bundle type is "searchset"</p>\n</div></td></tr></table><div><p>The key differences between this operation and simply searching the group's patients compartment are:</p>\n<ul>\n<li>unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging)</li>\n<li>the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones).</li>\n</ul>\n<p>This frees the client from needing to determine what it could or should ask for, particularly with regard to included resources.</p>\n<p>It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a particular group, or determine whether the context has the rights to the nominated group, if there is one, or can determine an appropriate list of groups to provide data for from the context of the request. If there is no nominated group (GET /Group/$everything) and the context is not associated with a single group record, the actual list of groups is all groups that the user associated with the request has access to. In such cases, the server may choose to return an error rather than all the records (and is likely to do so, but not required to). Specifying the relationship between the context, a user and groups is outside the scope of this specification (though see <a href=\"http://hl7.org/fhir/smart-app-launch\">The Smart App Launch Implementation Guide</a>.</p>\n<p>The return bundle from this operation is usually rather a lot of data; servers typically choose to require that such requests are made <a href=\"async.html\">asynchronously</a>, and associated with <a href=\"formats.html#bulk\">bulk data formats</a>. Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for <a href=\"http.html#paging\">Searching</a>, using the <a href=\"search.html#count\">_count</a> parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so.</p>\n<p>The _since parameter is provided to support periodic queries to get additional information that has changed about the group since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":1},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Group-everything","version":"4.0.1","name":"Fetch a group of Patient Records","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation is used to return all the information related to one or more patients that are part of the group on which this operation is invoked. The response is a bundle of type \"searchset\". At a minimum, the patient resource(s) itself is returned, along with any other resources that the server has that are related to the patient(s), and that are available for the given user. The server also returns whatever resources are needed to support the records - e.g. linked practitioners, medications, locations, organizations etc. The intended use for this operation is for a provider or other user to perform a bulk data download. The server SHOULD return at least all resources that it has that are in the patient compartment for the identified patient(s), and any resource referenced from those, including binaries and attachments. In the US Realm, at a mimimum, the resources returned SHALL include all the data covered by the meaningful use common data elements as defined in [US-Core](http://hl7.org/fhir/us/coref). Other applicable implementation guides may make additional rules about how much information that is returned.","code":"everything","comment":"The key differences between this operation and simply searching the group's patients compartment are: \n\n* unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging) \n* the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones). \n\nThis frees the client from needing to determine what it could or should ask for, particularly with regard to included resources. \n\nIt is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a particular group, or determine whether the context has the rights to the nominated group, if there is one, or can determine an appropriate list of groups to provide data for from the context of the request. If there is no nominated group (GET /Group/$everything) and the context is not associated with a single group record, the actual list of groups is all groups that the user associated with the request has access to. In such cases, the server may choose to return an error rather than all the records (and is likely to do so, but not required to). Specifying the relationship between the context, a user and groups is outside the scope of this specification (though see [The Smart App Launch Implementation Guide](http://hl7.org/fhir/smart-app-launch). \n\nThe return bundle from this operation is usually rather a lot of data; servers typically choose to require that such requests are made [asynchronously](async.html), and associated with [bulk data formats](formats.html#bulk). Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for [Searching](http.html#paging), using the [_count](search.html#count) parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so.\n\nThe _since parameter is provided to support periodic queries to get additional information that has changed about the group since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.","resource":["Group"],"system":false,"type":false,"instance":true,"parameter":[{"name":"start","use":"in","min":0,"max":"1","documentation":"The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no start date is provided, all records prior to the end date are in scope.","type":"date"},{"name":"end","use":"in","min":0,"max":"1","documentation":"The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no end date is provided, all records subsequent to the start date are in scope.","type":"date"},{"name":"_since","use":"in","min":0,"max":"1","documentation":"Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time","type":"instant"},{"name":"_type","use":"in","min":0,"max":"*","documentation":"One or more parameters, each containing one or more comma-delimited FHIR resource types to include in the return resources. In the absense of any specified types, the server returns all resource types","type":"code"},{"name":"_count","use":"in","min":0,"max":"1","documentation":"See discussion below on the utility of paging through the results of the $everything operation","type":"integer"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The bundle type is \"searchset\"","type":"Bundle"}]}"#;
2400 #[doc = "The `OperationDefinition` this module was generated from."]
2401 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2402 serde_json::from_str(OPERATION_DEFINITION_JSON)
2403 .expect("Generated OperationDefinition JSON must deserialize.")
2404 });
2405 #[derive(Debug, FromParameters, ToParameters)]
2406 pub struct Input {
2407 #[doc = "The date range relates to care dates, not record currency dates - e.g. all records relating to care"]
2408 #[doc = "provided in a certain date range. If no start date is provided, all records prior to the end date"]
2409 #[doc = "are in scope."]
2410 pub start: Option<FHIRDate>,
2411 #[doc = "The date range relates to care dates, not record currency dates - e.g. all records relating to care"]
2412 #[doc = "provided in a certain date range. If no end date is provided, all records subsequent to the start"]
2413 #[doc = "date are in scope."]
2414 pub end: Option<FHIRDate>,
2415 #[doc = "Resources updated after this period will be included in the response. The intent of this parameter"]
2416 #[doc = "is to allow a client to request only records that have changed since the last request, based on"]
2417 #[doc = "either the return header time, or or (for asynchronous use), the transaction time"]
2418 #[parameter_rename = "_since"]
2419 pub since: Option<FHIRInstant>,
2420 #[doc = "One or more parameters, each containing one or more comma-delimited FHIR resource types to include"]
2421 #[doc = "in the return resources. In the absense of any specified types, the server returns all resource"]
2422 #[doc = "types"]
2423 #[parameter_rename = "_type"]
2424 pub type_: Option<Vec<FHIRCode>>,
2425 #[doc = "See discussion below on the utility of paging through the results of the $everything operation"]
2426 #[parameter_rename = "_count"]
2427 pub count: Option<FHIRInteger>,
2428 }
2429 impl From<Input> for Resource {
2430 fn from(value: Input) -> Self {
2431 let parameters: Vec<ParametersParameter> = value.into();
2432 Resource::Parameters(Parameters {
2433 parameter: Some(parameters),
2434 ..Default::default()
2435 })
2436 }
2437 }
2438 #[derive(Debug, FromParameters)]
2439 pub struct Output {
2440 #[doc = "The bundle type is \"searchset\""]
2441 #[parameter_rename = "return"]
2442 pub return_: Bundle,
2443 }
2444 impl From<Output> for Resource {
2445 fn from(value: Output) -> Self {
2446 Resource::Bundle(value.return_)
2447 }
2448 }
2449}
2450#[doc = "The data-requirements operation aggregates and returns the parameters and data requirements for a"]
2451#[doc = "resource and all its dependencies as a single module definition"]
2452pub mod LibraryDataRequirements {
2453 use haste_fhir_model::r4::generated::resources::{
2454 Library, OperationDefinition, Parameters, ParametersParameter, Resource,
2455 };
2456 use haste_fhir_model::r4::generated::types::FHIRString;
2457 use haste_fhir_operation_error::OperationOutcomeError;
2458 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2459 use std::sync::LazyLock;
2460 pub const CODE: &str = "data-requirements";
2461 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Library-data-requirements","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Data Requirements</h2><p>OPERATION: Data Requirements</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Library-data-requirements</pre><div><p>The data-requirements operation aggregates and returns the parameters and data requirements for a resource and all its dependencies as a single module definition</p>\n</div><p>URL: [base]/$data-requirements</p><p>URL: [base]/Library/[id]/$data-requirements</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>target</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The target of the data requirements operation</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"library.html\">Library</a></td><td/><td><div><p>The result of the requirements gathering</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for a given target resource. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the target resource and any libraries referenced by it. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements)</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Library-data-requirements","version":"4.0.1","name":"Data Requirements","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The data-requirements operation aggregates and returns the parameters and data requirements for a resource and all its dependencies as a single module definition","code":"data-requirements","comment":"The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for a given target resource. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the target resource and any libraries referenced by it. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements)","resource":["Library"],"system":true,"type":false,"instance":true,"parameter":[{"name":"target","use":"in","min":0,"max":"1","documentation":"The target of the data requirements operation","type":"string"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the requirements gathering","type":"Library"}]}"#;
2462 #[doc = "The `OperationDefinition` this module was generated from."]
2463 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2464 serde_json::from_str(OPERATION_DEFINITION_JSON)
2465 .expect("Generated OperationDefinition JSON must deserialize.")
2466 });
2467 #[derive(Debug, FromParameters, ToParameters)]
2468 pub struct Input {
2469 #[doc = "The target of the data requirements operation"]
2470 pub target: Option<FHIRString>,
2471 }
2472 impl From<Input> for Resource {
2473 fn from(value: Input) -> Self {
2474 let parameters: Vec<ParametersParameter> = value.into();
2475 Resource::Parameters(Parameters {
2476 parameter: Some(parameters),
2477 ..Default::default()
2478 })
2479 }
2480 }
2481 #[derive(Debug, FromParameters)]
2482 pub struct Output {
2483 #[doc = "The result of the requirements gathering"]
2484 #[parameter_rename = "return"]
2485 pub return_: Library,
2486 }
2487 impl From<Output> for Resource {
2488 fn from(value: Output) -> Self {
2489 Resource::Library(value.return_)
2490 }
2491 }
2492}
2493#[doc = "This operation allows a client to find an identified list for a particular function by its function."]
2494#[doc = "The operation takes two parameters, the identity of a patient, and the name of a functional list."]
2495#[doc = "The list of defined functional lists can be found at [`Current Resource"]
2496#[doc = "Lists`](lifecycle.html#lists). Applications are not required to support all the lists, and may"]
2497#[doc = "define additional lists of their own. If the system is able to locate a list that serves the"]
2498#[doc = "identified purpose, it returns it as the body of the response with a 200 OK status. If the resource"]
2499#[doc = "cannot be located, the server returns a 404 not found (optionally with an `OperationOutcome`"]
2500#[doc = "resource)"]
2501pub mod ListFind {
2502 use haste_fhir_model::r4::generated::resources::{
2503 OperationDefinition, Parameters, ParametersParameter, Resource,
2504 };
2505 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRId};
2506 use haste_fhir_operation_error::OperationOutcomeError;
2507 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2508 use std::sync::LazyLock;
2509 pub const CODE: &str = "find";
2510 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"List-find","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Find a functional list</h2><p>OPERATION: Find a functional list</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/List-find</pre><div><p>This operation allows a client to find an identified list for a particular function by its function. The operation takes two parameters, the identity of a patient, and the name of a functional list. The list of defined functional lists can be found at <a href=\"lifecycle.html#lists\">Current Resource Lists</a>. Applications are not required to support all the lists, and may define additional lists of their own. If the system is able to locate a list that serves the identified purpose, it returns it as the body of the response with a 200 OK status. If the resource cannot be located, the server returns a 404 not found (optionally with an OperationOutcome resource)</p>\n</div><p>URL: [base]/List/$find</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>patient</td><td>1..1</td><td><a href=\"datatypes.html#id\">id</a></td><td/><td><div><p>The id of a patient resource located on the server on which this operation is executed</p>\n</div></td></tr><tr><td>IN</td><td>name</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The code for the functional list that is being found</p>\n</div></td></tr></table><div><p>Note that servers may support searching by a functional list, and not support this operation that allows clients to find the list directly</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":1},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/List-find","version":"4.0.1","name":"Find a functional list","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation allows a client to find an identified list for a particular function by its function. The operation takes two parameters, the identity of a patient, and the name of a functional list. The list of defined functional lists can be found at [Current Resource Lists](lifecycle.html#lists). Applications are not required to support all the lists, and may define additional lists of their own. If the system is able to locate a list that serves the identified purpose, it returns it as the body of the response with a 200 OK status. If the resource cannot be located, the server returns a 404 not found (optionally with an `OperationOutcome` resource)","code":"find","comment":"Note that servers may support searching by a functional list, and not support this operation that allows clients to find the list directly","resource":["List"],"system":false,"type":true,"instance":false,"parameter":[{"name":"patient","use":"in","min":1,"max":"1","documentation":"The id of a patient resource located on the server on which this operation is executed","type":"id"},{"name":"name","use":"in","min":1,"max":"1","documentation":"The code for the functional list that is being found","type":"code"}]}"#;
2511 #[doc = "The `OperationDefinition` this module was generated from."]
2512 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2513 serde_json::from_str(OPERATION_DEFINITION_JSON)
2514 .expect("Generated OperationDefinition JSON must deserialize.")
2515 });
2516 #[derive(Debug, FromParameters, ToParameters)]
2517 pub struct Input {
2518 #[doc = "The id of a patient resource located on the server on which this operation is executed"]
2519 pub patient: FHIRId,
2520 #[doc = "The code for the functional list that is being found"]
2521 pub name: FHIRCode,
2522 }
2523 impl From<Input> for Resource {
2524 fn from(value: Input) -> Self {
2525 let parameters: Vec<ParametersParameter> = value.into();
2526 Resource::Parameters(Parameters {
2527 parameter: Some(parameters),
2528 ..Default::default()
2529 })
2530 }
2531 }
2532 #[derive(Debug, FromParameters, ToParameters)]
2533 pub struct Output {}
2534 impl From<Output> for Resource {
2535 fn from(value: Output) -> Self {
2536 let parameters: Vec<ParametersParameter> = value.into();
2537 Resource::Parameters(Parameters {
2538 parameter: Some(parameters),
2539 ..Default::default()
2540 })
2541 }
2542 }
2543}
2544#[doc = "The care-gaps operation is used to determine gaps-in-care based on the results of quality measures"]
2545pub mod MeasureCareGaps {
2546 use haste_fhir_model::r4::generated::resources::{
2547 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
2548 };
2549 use haste_fhir_model::r4::generated::types::{FHIRDate, FHIRString};
2550 use haste_fhir_operation_error::OperationOutcomeError;
2551 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2552 use std::sync::LazyLock;
2553 pub const CODE: &str = "care-gaps";
2554 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Measure-care-gaps","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Care Gaps</h2><p>OPERATION: Care Gaps</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Measure-care-gaps</pre><div><p>The care-gaps operation is used to determine gaps-in-care based on the results of quality measures</p>\n</div><p>URL: [base]/Measure/$care-gaps</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>periodStart</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period s</p>\n</div></td></tr><tr><td>IN</td><td>periodEnd</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive</p>\n</div></td></tr><tr><td>IN</td><td>topic</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The topic to be used to determine which measures are considered for the care gaps report. Any measure with the given topic will be included in the report</p>\n</div></td></tr><tr><td>IN</td><td>subject</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>Subject for which the care gaps report will be produced</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The result of the care gaps report will be returned as a document bundle with a MeasureReport entry for each included measure</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is to calculate a set of measures for a particular topic (e.g. Preventive Care and Screening) and return a document describing the results of each measure for the given subject. Note that it is up to the server to determine whether or not the generated care gaps report is persisted. If the server does not persist the results, the operation does not affect state and can be invoked with a GET</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Measure-care-gaps","version":"4.0.1","name":"Care Gaps","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The care-gaps operation is used to determine gaps-in-care based on the results of quality measures","code":"care-gaps","comment":"The effect of invoking this operation is to calculate a set of measures for a particular topic (e.g. Preventive Care and Screening) and return a document describing the results of each measure for the given subject. Note that it is up to the server to determine whether or not the generated care gaps report is persisted. If the server does not persist the results, the operation does not affect state and can be invoked with a GET","resource":["Measure"],"system":false,"type":true,"instance":false,"parameter":[{"name":"periodStart","use":"in","min":1,"max":"1","documentation":"The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period s","type":"date"},{"name":"periodEnd","use":"in","min":1,"max":"1","documentation":"The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive","type":"date"},{"name":"topic","use":"in","min":1,"max":"1","documentation":"The topic to be used to determine which measures are considered for the care gaps report. Any measure with the given topic will be included in the report","type":"string"},{"name":"subject","use":"in","min":1,"max":"1","documentation":"Subject for which the care gaps report will be produced","type":"string","searchType":"reference"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the care gaps report will be returned as a document bundle with a `MeasureReport` entry for each included measure","type":"Bundle"}]}"#;
2555 #[doc = "The `OperationDefinition` this module was generated from."]
2556 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2557 serde_json::from_str(OPERATION_DEFINITION_JSON)
2558 .expect("Generated OperationDefinition JSON must deserialize.")
2559 });
2560 #[derive(Debug, FromParameters, ToParameters)]
2561 pub struct Input {
2562 #[doc = "The start of the measurement period. In keeping with the semantics of the date parameter used in the"]
2563 #[doc = "FHIR search operation, the period will start at the beginning of the period implied by the supplied"]
2564 #[doc = "timestamp. E.g. a value of 2014 would set the period s"]
2565 pub periodStart: FHIRDate,
2566 #[doc = "The end of the measurement period. The period will end at the end of the period implied by the"]
2567 #[doc = "supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59"]
2568 #[doc = "inclusive"]
2569 pub periodEnd: FHIRDate,
2570 #[doc = "The topic to be used to determine which measures are considered for the care gaps report. Any"]
2571 #[doc = "measure with the given topic will be included in the report"]
2572 pub topic: FHIRString,
2573 #[doc = "Subject for which the care gaps report will be produced"]
2574 pub subject: FHIRString,
2575 }
2576 impl From<Input> for Resource {
2577 fn from(value: Input) -> Self {
2578 let parameters: Vec<ParametersParameter> = value.into();
2579 Resource::Parameters(Parameters {
2580 parameter: Some(parameters),
2581 ..Default::default()
2582 })
2583 }
2584 }
2585 #[derive(Debug, FromParameters)]
2586 pub struct Output {
2587 #[doc = "The result of the care gaps report will be returned as a document bundle with a `MeasureReport`"]
2588 #[doc = "entry for each included measure"]
2589 #[parameter_rename = "return"]
2590 pub return_: Bundle,
2591 }
2592 impl From<Output> for Resource {
2593 fn from(value: Output) -> Self {
2594 Resource::Bundle(value.return_)
2595 }
2596 }
2597}
2598#[doc = "The collect-data operation is used to collect the data-of-interest for the given measure."]
2599pub mod MeasureCollectData {
2600 use haste_fhir_model::r4::generated::resources::{
2601 MeasureReport, OperationDefinition, Parameters, ParametersParameter, Resource,
2602 };
2603 use haste_fhir_model::r4::generated::types::{FHIRDate, FHIRDateTime, FHIRString};
2604 use haste_fhir_operation_error::OperationOutcomeError;
2605 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2606 use std::sync::LazyLock;
2607 pub const CODE: &str = "collect-data";
2608 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Measure-collect-data","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Collect Data</h2><p>OPERATION: Collect Data</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Measure-collect-data</pre><div><p>The collect-data operation is used to collect the data-of-interest for the given measure.</p>\n</div><p>URL: [base]/Measure/$collect-data</p><p>URL: [base]/Measure/[id]/$collect-data</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>periodStart</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period s</p>\n</div></td></tr><tr><td>IN</td><td>periodEnd</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive</p>\n</div></td></tr><tr><td>IN</td><td>measure</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The measure to evaluate. This parameter is only required when the operation is invoked on the resource type, it is not used when invoking the operation on a Measure instance</p>\n</div></td></tr><tr><td>IN</td><td>subject</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>Subject for which the measure will be collected. If not specified, measure data will be collected for all subjects that meet the requirements of the measure. If specified, the measure will only be calculated for the referenced subject(s)</p>\n</div></td></tr><tr><td>IN</td><td>practitioner</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>Practitioner for which the measure will be collected. If specified, measure data will be collected only for subjects that have a primary relationship to the identified practitioner</p>\n</div></td></tr><tr><td>IN</td><td>lastReceivedOn</td><td>0..1</td><td><a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The date the results of this measure were last received. This parameter used to indicate when the last time data for this measure was collected. This information is used to support incremental data collection scenarios</p>\n</div></td></tr><tr><td>OUT</td><td>measureReport</td><td>1..1</td><td><a href=\"measurereport.html\">MeasureReport</a></td><td/><td><div><p>A MeasureReport of type data-collection detailing the results of the operation</p>\n</div></td></tr><tr><td>OUT</td><td>resource</td><td>0..*</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The result resources that make up the data-of-interest for the measure</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is to gather the data required to perform an evaluation of the measure. If the lastReceivedOn parameter is supplied, only data that is new or has been changed since the lastReceivedOn date is included in the response. Note that the resulting MeasureReport is a transient resource</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Measure-collect-data","version":"4.0.1","name":"Collect Data","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The collect-data operation is used to collect the data-of-interest for the given measure.","code":"collect-data","comment":"The effect of invoking this operation is to gather the data required to perform an evaluation of the measure. If the lastReceivedOn parameter is supplied, only data that is new or has been changed since the lastReceivedOn date is included in the response. Note that the resulting MeasureReport is a transient resource","resource":["Measure"],"system":false,"type":true,"instance":true,"parameter":[{"name":"periodStart","use":"in","min":1,"max":"1","documentation":"The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period s","type":"date"},{"name":"periodEnd","use":"in","min":1,"max":"1","documentation":"The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive","type":"date"},{"name":"measure","use":"in","min":0,"max":"1","documentation":"The measure to evaluate. This parameter is only required when the operation is invoked on the resource type, it is not used when invoking the operation on a Measure instance","type":"string","searchType":"reference"},{"name":"subject","use":"in","min":0,"max":"1","documentation":"Subject for which the measure will be collected. If not specified, measure data will be collected for all subjects that meet the requirements of the measure. If specified, the measure will only be calculated for the referenced subject(s)","type":"string","searchType":"reference"},{"name":"practitioner","use":"in","min":0,"max":"1","documentation":"Practitioner for which the measure will be collected. If specified, measure data will be collected only for subjects that have a primary relationship to the identified practitioner","type":"string","searchType":"reference"},{"name":"lastReceivedOn","use":"in","min":0,"max":"1","documentation":"The date the results of this measure were last received. This parameter used to indicate when the last time data for this measure was collected. This information is used to support incremental data collection scenarios","type":"dateTime"},{"name":"measureReport","use":"out","min":1,"max":"1","documentation":"A `MeasureReport` of type data-collection detailing the results of the operation","type":"MeasureReport"},{"name":"resource","use":"out","min":0,"max":"*","documentation":"The result resources that make up the data-of-interest for the measure","type":"Resource"}]}"#;
2609 #[doc = "The `OperationDefinition` this module was generated from."]
2610 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2611 serde_json::from_str(OPERATION_DEFINITION_JSON)
2612 .expect("Generated OperationDefinition JSON must deserialize.")
2613 });
2614 #[derive(Debug, FromParameters, ToParameters)]
2615 pub struct Input {
2616 #[doc = "The start of the measurement period. In keeping with the semantics of the date parameter used in the"]
2617 #[doc = "FHIR search operation, the period will start at the beginning of the period implied by the supplied"]
2618 #[doc = "timestamp. E.g. a value of 2014 would set the period s"]
2619 pub periodStart: FHIRDate,
2620 #[doc = "The end of the measurement period. The period will end at the end of the period implied by the"]
2621 #[doc = "supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59"]
2622 #[doc = "inclusive"]
2623 pub periodEnd: FHIRDate,
2624 #[doc = "The measure to evaluate. This parameter is only required when the operation is invoked on the"]
2625 #[doc = "resource type, it is not used when invoking the operation on a Measure instance"]
2626 pub measure: Option<FHIRString>,
2627 #[doc = "Subject for which the measure will be collected. If not specified, measure data will be collected"]
2628 #[doc = "for all subjects that meet the requirements of the measure. If specified, the measure will only be"]
2629 #[doc = "calculated for the referenced subject(s)"]
2630 pub subject: Option<FHIRString>,
2631 #[doc = "Practitioner for which the measure will be collected. If specified, measure data will be collected"]
2632 #[doc = "only for subjects that have a primary relationship to the identified practitioner"]
2633 pub practitioner: Option<FHIRString>,
2634 #[doc = "The date the results of this measure were last received. This parameter used to indicate when the"]
2635 #[doc = "last time data for this measure was collected. This information is used to support incremental data"]
2636 #[doc = "collection scenarios"]
2637 pub lastReceivedOn: Option<FHIRDateTime>,
2638 }
2639 impl From<Input> for Resource {
2640 fn from(value: Input) -> Self {
2641 let parameters: Vec<ParametersParameter> = value.into();
2642 Resource::Parameters(Parameters {
2643 parameter: Some(parameters),
2644 ..Default::default()
2645 })
2646 }
2647 }
2648 #[derive(Debug, FromParameters, ToParameters)]
2649 pub struct Output {
2650 #[doc = "A `MeasureReport` of type data-collection detailing the results of the operation"]
2651 pub measureReport: MeasureReport,
2652 #[doc = "The result resources that make up the data-of-interest for the measure"]
2653 pub resource: Option<Vec<Resource>>,
2654 }
2655 impl From<Output> for Resource {
2656 fn from(value: Output) -> Self {
2657 let parameters: Vec<ParametersParameter> = value.into();
2658 Resource::Parameters(Parameters {
2659 parameter: Some(parameters),
2660 ..Default::default()
2661 })
2662 }
2663 }
2664}
2665#[doc = "The data-requirements operation aggregates and returns the parameters and data requirements for the"]
2666#[doc = "measure and all its dependencies as a single module definition"]
2667pub mod MeasureDataRequirements {
2668 use haste_fhir_model::r4::generated::resources::{
2669 Library, OperationDefinition, Parameters, ParametersParameter, Resource,
2670 };
2671 use haste_fhir_model::r4::generated::types::FHIRDate;
2672 use haste_fhir_operation_error::OperationOutcomeError;
2673 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2674 use std::sync::LazyLock;
2675 pub const CODE: &str = "data-requirements";
2676 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Measure-data-requirements","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Data Requirements</h2><p>OPERATION: Data Requirements</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Measure-data-requirements</pre><div><p>The data-requirements operation aggregates and returns the parameters and data requirements for the measure and all its dependencies as a single module definition</p>\n</div><p>URL: [base]/Measure/[id]/$data-requirements</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>periodStart</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period start to be 2014-01-01T00:00:00 inclusive</p>\n</div></td></tr><tr><td>IN</td><td>periodEnd</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"library.html\">Library</a></td><td/><td><div><p>The result of the requirements gathering is a module-definition Library that describes the aggregate parameters, data requirements, and dependencies of the measure</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for the measure. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the libraries referenced by the measures. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements). This operation defines what resources are subsequently referenced in the evaluatedResources element of the MeasureReport when submitting measure data</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Measure-data-requirements","version":"4.0.1","name":"Data Requirements","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The data-requirements operation aggregates and returns the parameters and data requirements for the measure and all its dependencies as a single module definition","code":"data-requirements","comment":"The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for the measure. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the libraries referenced by the measures. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements). This operation defines what resources are subsequently referenced in the evaluatedResources element of the MeasureReport when submitting measure data","resource":["Measure"],"system":false,"type":false,"instance":true,"parameter":[{"name":"periodStart","use":"in","min":1,"max":"1","documentation":"The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period start to be 2014-01-01T00:00:00 inclusive","type":"date"},{"name":"periodEnd","use":"in","min":1,"max":"1","documentation":"The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive","type":"date"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the requirements gathering is a module-definition Library that describes the aggregate parameters, data requirements, and dependencies of the measure","type":"Library"}]}"#;
2677 #[doc = "The `OperationDefinition` this module was generated from."]
2678 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2679 serde_json::from_str(OPERATION_DEFINITION_JSON)
2680 .expect("Generated OperationDefinition JSON must deserialize.")
2681 });
2682 #[derive(Debug, FromParameters, ToParameters)]
2683 pub struct Input {
2684 #[doc = "The start of the measurement period. In keeping with the semantics of the date parameter used in the"]
2685 #[doc = "FHIR search operation, the period will start at the beginning of the period implied by the supplied"]
2686 #[doc = "timestamp. E.g. a value of 2014 would set the period start to be 2014-01-01T00:00:00 inclusive"]
2687 pub periodStart: FHIRDate,
2688 #[doc = "The end of the measurement period. The period will end at the end of the period implied by the"]
2689 #[doc = "supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59"]
2690 #[doc = "inclusive"]
2691 pub periodEnd: FHIRDate,
2692 }
2693 impl From<Input> for Resource {
2694 fn from(value: Input) -> Self {
2695 let parameters: Vec<ParametersParameter> = value.into();
2696 Resource::Parameters(Parameters {
2697 parameter: Some(parameters),
2698 ..Default::default()
2699 })
2700 }
2701 }
2702 #[derive(Debug, FromParameters)]
2703 pub struct Output {
2704 #[doc = "The result of the requirements gathering is a module-definition Library that describes the aggregate"]
2705 #[doc = "parameters, data requirements, and dependencies of the measure"]
2706 #[parameter_rename = "return"]
2707 pub return_: Library,
2708 }
2709 impl From<Output> for Resource {
2710 fn from(value: Output) -> Self {
2711 Resource::Library(value.return_)
2712 }
2713 }
2714}
2715#[doc = "The evaluate-measure operation is used to calculate an eMeasure and obtain the results"]
2716pub mod MeasureEvaluateMeasure {
2717 use haste_fhir_model::r4::generated::resources::{
2718 MeasureReport, OperationDefinition, Parameters, ParametersParameter, Resource,
2719 };
2720 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRDate, FHIRDateTime, FHIRString};
2721 use haste_fhir_operation_error::OperationOutcomeError;
2722 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2723 use std::sync::LazyLock;
2724 pub const CODE: &str = "evaluate-measure";
2725 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Measure-evaluate-measure","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Evaluate Measure</h2><p>OPERATION: Evaluate Measure</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Measure-evaluate-measure</pre><div><p>The evaluate-measure operation is used to calculate an eMeasure and obtain the results</p>\n</div><p>URL: [base]/Measure/$evaluate-measure</p><p>URL: [base]/Measure/[id]/$evaluate-measure</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>periodStart</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period start to be 2014-01-01T00:00:00 inclusive</p>\n</div></td></tr><tr><td>IN</td><td>periodEnd</td><td>1..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive</p>\n</div></td></tr><tr><td>IN</td><td>measure</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The measure to evaluate. This parameter is only required when the operation is invoked on the resource type, it is not used when invoking the operation on a Measure instance</p>\n</div></td></tr><tr><td>IN</td><td>reportType</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The type of measure report: subject, subject-list, or population. If not specified, a default value of subject will be used if the subject parameter is supplied, otherwise, population will be used</p>\n</div></td></tr><tr><td>IN</td><td>subject</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>Subject for which the measure will be calculated. If not specified, the measure will be calculated for all subjects that meet the requirements of the measure. If specified, the measure will only be calculated for the referenced subject(s)</p>\n</div></td></tr><tr><td>IN</td><td>practitioner</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>Practitioner for which the measure will be calculated. If specified, the measure will be calculated only for subjects that have a primary relationship to the identified practitioner</p>\n</div></td></tr><tr><td>IN</td><td>lastReceivedOn</td><td>0..1</td><td><a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The date the results of this measure were last received. This parameter is only valid for patient-level reports and is used to indicate when the last time a result for this patient was received. This information can be used to limit the set of resources returned for a patient-level report</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"measurereport.html\">MeasureReport</a></td><td/><td><div><p>The results of the measure calculation. See the MeasureReport resource for a complete description of the output of this operation. Note that implementations may choose to return a MeasureReport with a status of pending to indicate that the report is still being generated. In this case, the client can use a polling method to continually request the MeasureReport until the status is updated to complete</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is to calculate the measure for the given subject, or all subjects if no subject is supplied, and return the results as a MeasureReport resource of the appropriate type. Note that whether or not this operation affects the state of the server depends on whether the server persists the generated MeasureReport. If the MeasureReport is not persisted, this operation can be invoked with GET</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Measure-evaluate-measure","version":"4.0.1","name":"Evaluate Measure","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The evaluate-measure operation is used to calculate an eMeasure and obtain the results","code":"evaluate-measure","comment":"The effect of invoking this operation is to calculate the measure for the given subject, or all subjects if no subject is supplied, and return the results as a MeasureReport resource of the appropriate type. Note that whether or not this operation affects the state of the server depends on whether the server persists the generated MeasureReport. If the MeasureReport is not persisted, this operation can be invoked with GET","resource":["Measure"],"system":false,"type":true,"instance":true,"parameter":[{"name":"periodStart","use":"in","min":1,"max":"1","documentation":"The start of the measurement period. In keeping with the semantics of the date parameter used in the FHIR search operation, the period will start at the beginning of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period start to be 2014-01-01T00:00:00 inclusive","type":"date"},{"name":"periodEnd","use":"in","min":1,"max":"1","documentation":"The end of the measurement period. The period will end at the end of the period implied by the supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59 inclusive","type":"date"},{"name":"measure","use":"in","min":0,"max":"1","documentation":"The measure to evaluate. This parameter is only required when the operation is invoked on the resource type, it is not used when invoking the operation on a Measure instance","type":"string","searchType":"reference"},{"name":"reportType","use":"in","min":0,"max":"1","documentation":"The type of measure report: subject, subject-list, or population. If not specified, a default value of subject will be used if the subject parameter is supplied, otherwise, population will be used","type":"code"},{"name":"subject","use":"in","min":0,"max":"1","documentation":"Subject for which the measure will be calculated. If not specified, the measure will be calculated for all subjects that meet the requirements of the measure. If specified, the measure will only be calculated for the referenced subject(s)","type":"string","searchType":"reference"},{"name":"practitioner","use":"in","min":0,"max":"1","documentation":"Practitioner for which the measure will be calculated. If specified, the measure will be calculated only for subjects that have a primary relationship to the identified practitioner","type":"string","searchType":"reference"},{"name":"lastReceivedOn","use":"in","min":0,"max":"1","documentation":"The date the results of this measure were last received. This parameter is only valid for patient-level reports and is used to indicate when the last time a result for this patient was received. This information can be used to limit the set of resources returned for a patient-level report","type":"dateTime"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The results of the measure calculation. See the `MeasureReport` resource for a complete description of the output of this operation. Note that implementations may choose to return a `MeasureReport` with a status of pending to indicate that the report is still being generated. In this case, the client can use a polling method to continually request the `MeasureReport` until the status is updated to complete","type":"MeasureReport"}]}"#;
2726 #[doc = "The `OperationDefinition` this module was generated from."]
2727 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2728 serde_json::from_str(OPERATION_DEFINITION_JSON)
2729 .expect("Generated OperationDefinition JSON must deserialize.")
2730 });
2731 #[derive(Debug, FromParameters, ToParameters)]
2732 pub struct Input {
2733 #[doc = "The start of the measurement period. In keeping with the semantics of the date parameter used in the"]
2734 #[doc = "FHIR search operation, the period will start at the beginning of the period implied by the supplied"]
2735 #[doc = "timestamp. E.g. a value of 2014 would set the period start to be 2014-01-01T00:00:00 inclusive"]
2736 pub periodStart: FHIRDate,
2737 #[doc = "The end of the measurement period. The period will end at the end of the period implied by the"]
2738 #[doc = "supplied timestamp. E.g. a value of 2014 would set the period end to be 2014-12-31T23:59:59"]
2739 #[doc = "inclusive"]
2740 pub periodEnd: FHIRDate,
2741 #[doc = "The measure to evaluate. This parameter is only required when the operation is invoked on the"]
2742 #[doc = "resource type, it is not used when invoking the operation on a Measure instance"]
2743 pub measure: Option<FHIRString>,
2744 #[doc = "The type of measure report: subject, subject-list, or population. If not specified, a default value"]
2745 #[doc = "of subject will be used if the subject parameter is supplied, otherwise, population will be used"]
2746 pub reportType: Option<FHIRCode>,
2747 #[doc = "Subject for which the measure will be calculated. If not specified, the measure will be calculated"]
2748 #[doc = "for all subjects that meet the requirements of the measure. If specified, the measure will only be"]
2749 #[doc = "calculated for the referenced subject(s)"]
2750 pub subject: Option<FHIRString>,
2751 #[doc = "Practitioner for which the measure will be calculated. If specified, the measure will be calculated"]
2752 #[doc = "only for subjects that have a primary relationship to the identified practitioner"]
2753 pub practitioner: Option<FHIRString>,
2754 #[doc = "The date the results of this measure were last received. This parameter is only valid for"]
2755 #[doc = "patient-level reports and is used to indicate when the last time a result for this patient was"]
2756 #[doc = "received. This information can be used to limit the set of resources returned for a patient-level"]
2757 #[doc = "report"]
2758 pub lastReceivedOn: Option<FHIRDateTime>,
2759 }
2760 impl From<Input> for Resource {
2761 fn from(value: Input) -> Self {
2762 let parameters: Vec<ParametersParameter> = value.into();
2763 Resource::Parameters(Parameters {
2764 parameter: Some(parameters),
2765 ..Default::default()
2766 })
2767 }
2768 }
2769 #[derive(Debug, FromParameters)]
2770 pub struct Output {
2771 #[doc = "The results of the measure calculation. See the `MeasureReport` resource for a complete description"]
2772 #[doc = "of the output of this operation. Note that implementations may choose to return a `MeasureReport`"]
2773 #[doc = "with a status of pending to indicate that the report is still being generated. In this case, the"]
2774 #[doc = "client can use a polling method to continually request the `MeasureReport` until the status is"]
2775 #[doc = "updated to complete"]
2776 #[parameter_rename = "return"]
2777 pub return_: MeasureReport,
2778 }
2779 impl From<Output> for Resource {
2780 fn from(value: Output) -> Self {
2781 Resource::MeasureReport(value.return_)
2782 }
2783 }
2784}
2785#[doc = "The submit-data operation is used to submit data-of-interest for a measure. There is no expectation"]
2786#[doc = "that the submitted data represents all the data-of-interest, only that all the data submitted is"]
2787#[doc = "relevant to the calculation of the measure for a particular subject or population"]
2788pub mod MeasureSubmitData {
2789 use haste_fhir_model::r4::generated::resources::{
2790 MeasureReport, OperationDefinition, Parameters, ParametersParameter, Resource,
2791 };
2792 use haste_fhir_operation_error::OperationOutcomeError;
2793 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2794 use std::sync::LazyLock;
2795 pub const CODE: &str = "submit-data";
2796 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Measure-submit-data","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Submit Data</h2><p>OPERATION: Submit Data</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Measure-submit-data</pre><div><p>The submit-data operation is used to submit data-of-interest for a measure. There is no expectation that the submitted data represents all the data-of-interest, only that all the data submitted is relevant to the calculation of the measure for a particular subject or population</p>\n</div><p>URL: [base]/Measure/$submit-data</p><p>URL: [base]/Measure/[id]/$submit-data</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>measureReport</td><td>1..1</td><td><a href=\"measurereport.html\">MeasureReport</a></td><td/><td><div><p>The measure report being submitted</p>\n</div></td></tr><tr><td>IN</td><td>resource</td><td>0..*</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The individual resources that make up the data-of-interest being submitted</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is that the submitted data is posted to the receiving system and can be used for subsequent calculation of the relevant quality measure. The data-of-interest for a measure can be determined by examining the measure definition, or by invoking the $data-requirements operation</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Measure-submit-data","version":"4.0.1","name":"Submit Data","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The submit-data operation is used to submit data-of-interest for a measure. There is no expectation that the submitted data represents all the data-of-interest, only that all the data submitted is relevant to the calculation of the measure for a particular subject or population","code":"submit-data","comment":"The effect of invoking this operation is that the submitted data is posted to the receiving system and can be used for subsequent calculation of the relevant quality measure. The data-of-interest for a measure can be determined by examining the measure definition, or by invoking the $data-requirements operation","resource":["Measure"],"system":false,"type":true,"instance":true,"parameter":[{"name":"measureReport","use":"in","min":1,"max":"1","documentation":"The measure report being submitted","type":"MeasureReport"},{"name":"resource","use":"in","min":0,"max":"*","documentation":"The individual resources that make up the data-of-interest being submitted","type":"Resource"}]}"#;
2797 #[doc = "The `OperationDefinition` this module was generated from."]
2798 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2799 serde_json::from_str(OPERATION_DEFINITION_JSON)
2800 .expect("Generated OperationDefinition JSON must deserialize.")
2801 });
2802 #[derive(Debug, FromParameters, ToParameters)]
2803 pub struct Input {
2804 #[doc = "The measure report being submitted"]
2805 pub measureReport: MeasureReport,
2806 #[doc = "The individual resources that make up the data-of-interest being submitted"]
2807 pub resource: Option<Vec<Resource>>,
2808 }
2809 impl From<Input> for Resource {
2810 fn from(value: Input) -> Self {
2811 let parameters: Vec<ParametersParameter> = value.into();
2812 Resource::Parameters(Parameters {
2813 parameter: Some(parameters),
2814 ..Default::default()
2815 })
2816 }
2817 }
2818 #[derive(Debug, FromParameters, ToParameters)]
2819 pub struct Output {}
2820 impl From<Output> for Resource {
2821 fn from(value: Output) -> Self {
2822 let parameters: Vec<ParametersParameter> = value.into();
2823 Resource::Parameters(Parameters {
2824 parameter: Some(parameters),
2825 ..Default::default()
2826 })
2827 }
2828 }
2829}
2830#[doc = "This operation is used to return all the information related to one or more products described in"]
2831#[doc = "the resource or context on which this operation is invoked. The response is a bundle of type"]
2832#[doc = "\"searchset\". At a minimum, the product resource(s) itself is returned, along with any other"]
2833#[doc = "resources that the server has that are related to the products(s), and that are available for the"]
2834#[doc = "given user. This is typically the marketing authorisations, ingredients, packages, therapeutic"]
2835#[doc = "indications and so on. The server also returns whatever resources are needed to support the records"]
2836#[doc = "- e.g. linked organizations, document references etc."]
2837pub mod MedicinalProductEverything {
2838 use haste_fhir_model::r4::generated::resources::{
2839 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
2840 };
2841 use haste_fhir_model::r4::generated::types::{FHIRInstant, FHIRInteger};
2842 use haste_fhir_operation_error::OperationOutcomeError;
2843 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2844 use std::sync::LazyLock;
2845 pub const CODE: &str = "everything";
2846 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"MedicinalProduct-everything","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Fetch Product Record</h2><p>OPERATION: Fetch Product Record</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/MedicinalProduct-everything</pre><div><p>This operation is used to return all the information related to one or more products described in the resource or context on which this operation is invoked. The response is a bundle of type "searchset". At a minimum, the product resource(s) itself is returned, along with any other resources that the server has that are related to the products(s), and that are available for the given user. This is typically the marketing authorisations, ingredients, packages, therapeutic indications and so on. The server also returns whatever resources are needed to support the records - e.g. linked organizations, document references etc.</p>\n</div><p>URL: [base]/MedicinalProduct/$everything</p><p>URL: [base]/MedicinalProduct/[id]/$everything</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>_since</td><td>0..1</td><td><a href=\"datatypes.html#instant\">instant</a></td><td/><td><div><p>Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time</p>\n</div></td></tr><tr><td>IN</td><td>_count</td><td>0..1</td><td><a href=\"datatypes.html#integer\">integer</a></td><td/><td><div><p>See discussion below on the utility of paging through the results of the $everything operation</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The bundle type is "searchset"</p>\n</div></td></tr></table><div><p>The key differences between this operation and simply performing a search and using _include and _revinclude are:</p>\n<ul>\n<li>unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging)</li>\n<li>the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones).</li>\n</ul>\n<p>This frees the client from needing to determine what it could or should ask for, particularly with regard to included resources. It also makes for a much shorter and easier to construct query string. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the product data.</p>\n<p>When this operation is used to access multiple product records at once, the return bundle could be rather a lot of data; servers may choose to require that such requests are made <a href=\"async.html\">asynchronously</a>, and associated with <a href=\"formats.html#bulk\">bulk data formats</a>. Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for <a href=\"http.html#paging\">Searching</a>, using the <a href=\"search.html#count\">_count</a> parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so.</p>\n<p>The _since parameter is provided to support periodic queries to get additional information that has changed about the product since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":0},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/MedicinalProduct-everything","version":"4.0.1","name":"Fetch Product Record","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation is used to return all the information related to one or more products described in the resource or context on which this operation is invoked. The response is a bundle of type \"searchset\". At a minimum, the product resource(s) itself is returned, along with any other resources that the server has that are related to the products(s), and that are available for the given user. This is typically the marketing authorisations, ingredients, packages, therapeutic indications and so on. The server also returns whatever resources are needed to support the records - e.g. linked organizations, document references etc.","code":"everything","comment":"The key differences between this operation and simply performing a search and using _include and _revinclude are: \n\n* unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging) \n* the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones). \n\nThis frees the client from needing to determine what it could or should ask for, particularly with regard to included resources. It also makes for a much shorter and easier to construct query string. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the product data. \n\nWhen this operation is used to access multiple product records at once, the return bundle could be rather a lot of data; servers may choose to require that such requests are made [asynchronously](async.html), and associated with [bulk data formats](formats.html#bulk). Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for [Searching](http.html#paging), using the [_count](search.html#count) parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so.\n\nThe _since parameter is provided to support periodic queries to get additional information that has changed about the product since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.","resource":["MedicinalProduct"],"system":false,"type":true,"instance":true,"parameter":[{"name":"_since","use":"in","min":0,"max":"1","documentation":"Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time","type":"instant"},{"name":"_count","use":"in","min":0,"max":"1","documentation":"See discussion below on the utility of paging through the results of the $everything operation","type":"integer"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The bundle type is \"searchset\"","type":"Bundle"}]}"#;
2847 #[doc = "The `OperationDefinition` this module was generated from."]
2848 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2849 serde_json::from_str(OPERATION_DEFINITION_JSON)
2850 .expect("Generated OperationDefinition JSON must deserialize.")
2851 });
2852 #[derive(Debug, FromParameters, ToParameters)]
2853 pub struct Input {
2854 #[doc = "Resources updated after this period will be included in the response. The intent of this parameter"]
2855 #[doc = "is to allow a client to request only records that have changed since the last request, based on"]
2856 #[doc = "either the return header time, or or (for asynchronous use), the transaction time"]
2857 #[parameter_rename = "_since"]
2858 pub since: Option<FHIRInstant>,
2859 #[doc = "See discussion below on the utility of paging through the results of the $everything operation"]
2860 #[parameter_rename = "_count"]
2861 pub count: Option<FHIRInteger>,
2862 }
2863 impl From<Input> for Resource {
2864 fn from(value: Input) -> Self {
2865 let parameters: Vec<ParametersParameter> = value.into();
2866 Resource::Parameters(Parameters {
2867 parameter: Some(parameters),
2868 ..Default::default()
2869 })
2870 }
2871 }
2872 #[derive(Debug, FromParameters)]
2873 pub struct Output {
2874 #[doc = "The bundle type is \"searchset\""]
2875 #[parameter_rename = "return"]
2876 pub return_: Bundle,
2877 }
2878 impl From<Output> for Resource {
2879 fn from(value: Output) -> Self {
2880 Resource::Bundle(value.return_)
2881 }
2882 }
2883}
2884#[doc = "This operation accepts a message, processes it according to the definition of the event in the"]
2885#[doc = "message header, and returns one or more response messages."]
2886#[doc = ""]
2887#[doc = "In addition to processing the message event, a server may choose to retain all or some the resources"]
2888#[doc = "and make them available on a `RESTful` interface, but is not required to do so."]
2889pub mod MessageHeaderProcessMessage {
2890 use haste_fhir_model::r4::generated::resources::{
2891 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
2892 };
2893 use haste_fhir_model::r4::generated::types::{FHIRBoolean, FHIRUrl};
2894 use haste_fhir_operation_error::OperationOutcomeError;
2895 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2896 use std::sync::LazyLock;
2897 pub const CODE: &str = "process-message";
2898 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"MessageHeader-process-message","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Process Message</h2><p>OPERATION: Process Message</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/MessageHeader-process-message</pre><div><p>This operation accepts a message, processes it according to the definition of the event in the message header, and returns one or more response messages.</p>\n<p>In addition to processing the message event, a server may choose to retain all or some the resources and make them available on a RESTful interface, but is not required to do so.</p>\n</div><p>URL: [base]/$process-message</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>content</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The message to process (or, if using asynchronous messaging, it may be a response message to accept)</p>\n</div></td></tr><tr><td>IN</td><td>async</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If 'true' the message is processed using the asynchronous messaging pattern</p>\n</div></td></tr><tr><td>IN</td><td>response-url</td><td>0..1</td><td><a href=\"datatypes.html#url\">url</a></td><td/><td><div><p>A URL to submit response messages to, if asynchronous messaging is being used, and if the MessageHeader.source.endpoint is not the appropriate place to submit responses</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>0..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>A response message, if synchronous messaging is being used (mandatory in this case). For asynchronous messaging, there is no return value</p>\n</div></td></tr></table><div><p>This operation does not use the parameters resource; the parameters "async" and "response-url" always go in the URL, if they are used, and the "content" parameter is always the body of the HTTP message.</p>\n<p>When processing messages, a server may return one of several status codes:</p>\n<ul>\n<li><strong>200 OK</strong>: Indicates that the message has been fully processed. If an application-level response is expected for the submitted message, that response SHALL be returned as the body of the 200 response.</li>\n<li><strong>202 Accepted</strong>: Indicates that the receiving system has accepted custody of the message</li>\n<li><strong>204 No Content</strong>: Indicates that the message has been fully processed and would normally have had an application-level response, but because of instructions from the sender (e.g. the <a href=\"extension-messageheader-response-request.html\">messageheader-response-request</a> extension), no response is being provided</li>\n<li><strong>300+</strong>: Indicates that the message was not successfully processed. The server MAY return an <a href=\"operationoutcome.html\">OperationOutcome</a> with additional information, and SHOULD do so if the response code is 400 or greater.<br/>\nThe client SHALL interpret a 4xx response to indicate that there is no point resubmitting the unaltered message, and a 5xx response to indicate an unexpected error occurred on the part of the server, with the implication that it may be appropriate to resubmit the original message. Doing so SHOULD NOT result in a duplicate message response. Repeated failures indicate either a fatal problem with the submission or a problem with the receiving application.</li>\n</ul>\n<p>The following rules apply when using $process-message:</p>\n<ul>\n<li>The operation only accepts POST transactions - any other HTTP method will result in an HTTP error</li>\n<li>The request content type submitted is always <a href=\"bundle.html\">Bundle</a> with type "message" containing a <a href=\"messageheader.html\">Message Header</a> resource as the first resource</li>\n<li>The response content type returned is always <a href=\"bundle.html\">Bundle</a> with type "message" containing a <a href=\"messageheader.html\">Message Header</a> resource as the first resource, or an HTTP error</li>\n<li>If the response is an error, the body SHOULD be an <a href=\"operationoutcome.html\">Errors &mp; Warning</a> resource with full details</li>\n<li>The mailbox may be authenticated using standard HTTP authentication methods, including OAuth</li>\n</ul>\n<p>The $process-message operation can be used by any HTTP end-point that accepts FHIR messages, not just FHIR RESTful servers.</p>\n<p>In order to ensure consistency of processing, the <a href=\"messaging.html#reliable\">logical rules regarding processing of Bundle.id and message id</a> SHALL be followed when messages are processed using this operation.</p>\n<p>The $process-message operation may be used synchronously, or asynchronously.</p>\n<p>The following rules apply when using the $process-message operation synchronously:</p>\n<ul>\n<li>The URL (http://server/base/$process-message) has no parameters</li>\n<li>It is an error if the sender POSTs a message that requires multiple response messages</li>\n<li>Servers SHALL accept multiple concurrent message submissions and process them correctly (they are allowed to process them sequentially internally, but multiple concurrent submissions is not an error in its own right)</li>\n</ul>\n<p>The following rules apply when using the $process-message operation asynchronously:</p>\n<ul>\n<li>The URL has at least one parameter: http://server/base/$process-message?async=true</li>\n<li>The server acknowledges the message with a 200 OK with no body, or returns an HTTP error if the message cannot be processed</li>\n<li>Accepting the message means that the server has understood the message enough to know where to respond</li>\n<li>An <a href=\"operationoutcome.html\">OperationOutcome</a> SHOULD be returned in either case</li>\n<li>By default, the server responds by invoking the $process-message using the sender's stated end-point in the message: POST [MessageHeader.source.endpoint]/$process-messages]</li>\n<li>Since the source end-point may be manipulated by message transfer engines, an alternative response address may be specified using the parameter "response-url": http://server/base/$process-message?async=true&amp;response-url=http://server2.com/base/anything. The endpoint at the specified URL SHALL implement the signature of the $process-message operation (parameter async=true, accept a Bundle, return a 200 OK or an error)</li>\n<li>The server submits response messages to the appropriate end-point with the parameter async=true. There is no response message for the response messages</li>\n</ul>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":4},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/MessageHeader-process-message","version":"4.0.1","name":"Process Message","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation accepts a message, processes it according to the definition of the event in the message header, and returns one or more response messages. \n\nIn addition to processing the message event, a server may choose to retain all or some the resources and make them available on a `RESTful` interface, but is not required to do so.","code":"process-message","comment":"This operation does not use the parameters resource; the parameters \"async\" and \"response-url\" always go in the URL, if they are used, and the \"content\" parameter is always the body of the HTTP message.\n\nWhen processing messages, a server may return one of several status codes:\n* **200 OK**: Indicates that the message has been fully processed. If an application-level response is expected for the submitted message, that response SHALL be returned as the body of the 200 response.\n* **202 Accepted**: Indicates that the receiving system has accepted custody of the message\n* **204 No Content**: Indicates that the message has been fully processed and would normally have had an application-level response, but because of instructions from the sender (e.g. the [messageheader-response-request](extension-messageheader-response-request.html) extension), no response is being provided\n* **300+**: Indicates that the message was not successfully processed. The server MAY return an [OperationOutcome](operationoutcome.html) with additional information, and SHOULD do so if the response code is 400 or greater.<br/>\n The client SHALL interpret a 4xx response to indicate that there is no point resubmitting the unaltered message, and a 5xx response to indicate an unexpected error occurred on the part of the server, with the implication that it may be appropriate to resubmit the original message. Doing so SHOULD NOT result in a duplicate message response. Repeated failures indicate either a fatal problem with the submission or a problem with the receiving application.\n\nThe following rules apply when using $process-message:\n\n* The operation only accepts POST transactions - any other HTTP method will result in an HTTP error\n* The request content type submitted is always [Bundle](bundle.html) with type \"message\" containing a [Message Header](messageheader.html) resource as the first resource\n* The response content type returned is always [Bundle](bundle.html) with type \"message\" containing a [Message Header](messageheader.html) resource as the first resource, or an HTTP error\n* If the response is an error, the body SHOULD be an [Errors ∓ Warning](operationoutcome.html) resource with full details\n* The mailbox may be authenticated using standard HTTP authentication methods, including OAuth\n\nThe $process-message operation can be used by any HTTP end-point that accepts FHIR messages, not just FHIR RESTful servers.\n\nIn order to ensure consistency of processing, the [logical rules regarding processing of Bundle.id and message id](messaging.html#reliable) SHALL be followed when messages are processed using this operation.\n\nThe $process-message operation may be used synchronously, or asynchronously.\n\nThe following rules apply when using the $process-message operation synchronously:\n\n* The URL (http://server/base/$process-message) has no parameters\n* It is an error if the sender POSTs a message that requires multiple response messages\n* Servers SHALL accept multiple concurrent message submissions and process them correctly (they are allowed to process them sequentially internally, but multiple concurrent submissions is not an error in its own right)\n\nThe following rules apply when using the $process-message operation asynchronously:\n\n* The URL has at least one parameter: http://server/base/$process-message?async=true\n* The server acknowledges the message with a 200 OK with no body, or returns an HTTP error if the message cannot be processed\n* Accepting the message means that the server has understood the message enough to know where to respond\n* An [OperationOutcome](operationoutcome.html) SHOULD be returned in either case\n* By default, the server responds by invoking the $process-message using the sender's stated end-point in the message: POST [MessageHeader.source.endpoint]/$process-messages]\n* Since the source end-point may be manipulated by message transfer engines, an alternative response address may be specified using the parameter \"response-url\": http://server/base/$process-message?async=true&response-url=http://server2.com/base/anything. The endpoint at the specified URL SHALL implement the signature of the $process-message operation (parameter async=true, accept a Bundle, return a 200 OK or an error)\n* The server submits response messages to the appropriate end-point with the parameter async=true. There is no response message for the response messages","resource":["MessageHeader"],"system":true,"type":false,"instance":false,"parameter":[{"name":"content","use":"in","min":1,"max":"1","documentation":"The message to process (or, if using asynchronous messaging, it may be a response message to accept)","type":"Bundle"},{"name":"async","use":"in","min":0,"max":"1","documentation":"If 'true' the message is processed using the asynchronous messaging pattern","type":"boolean"},{"name":"response-url","use":"in","min":0,"max":"1","documentation":"A URL to submit response messages to, if asynchronous messaging is being used, and if the MessageHeader.source.endpoint is not the appropriate place to submit responses","type":"url"},{"name":"return","use":"out","min":0,"max":"1","documentation":"A response message, if synchronous messaging is being used (mandatory in this case). For asynchronous messaging, there is no return value","type":"Bundle"}]}"#;
2899 #[doc = "The `OperationDefinition` this module was generated from."]
2900 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2901 serde_json::from_str(OPERATION_DEFINITION_JSON)
2902 .expect("Generated OperationDefinition JSON must deserialize.")
2903 });
2904 #[derive(Debug, FromParameters, ToParameters)]
2905 pub struct Input {
2906 #[doc = "The message to process (or, if using asynchronous messaging, it may be a response message to accept)"]
2907 pub content: Bundle,
2908 #[doc = "If `true` the message is processed using the asynchronous messaging pattern"]
2909 #[parameter_rename = "async"]
2910 pub async_: Option<FHIRBoolean>,
2911 #[doc = "A URL to submit response messages to, if asynchronous messaging is being used, and if the"]
2912 #[doc = "`MessageHeader.source.endpoint` is not the appropriate place to submit responses"]
2913 #[parameter_rename = "response-url"]
2914 pub response_url: Option<FHIRUrl>,
2915 }
2916 impl From<Input> for Resource {
2917 fn from(value: Input) -> Self {
2918 let parameters: Vec<ParametersParameter> = value.into();
2919 Resource::Parameters(Parameters {
2920 parameter: Some(parameters),
2921 ..Default::default()
2922 })
2923 }
2924 }
2925 #[derive(Debug, FromParameters)]
2926 pub struct Output {
2927 #[doc = "A response message, if synchronous messaging is being used (mandatory in this case). For"]
2928 #[doc = "asynchronous messaging, there is no return value"]
2929 #[parameter_rename = "return"]
2930 pub return_: Option<Bundle>,
2931 }
2932 impl From<Output> for Resource {
2933 fn from(value: Output) -> Self {
2934 Resource::Bundle(value.return_.unwrap_or_default())
2935 }
2936 }
2937}
2938#[doc = "This operation returns the preferred identifiers for identifiers, and terminologies. The operation"]
2939#[doc = "takes 2 parameters:"]
2940#[doc = ""]
2941#[doc = "* a system identifier - either a URI, an OID, or a v2 table 0396 (other) code"]
2942#[doc = "* a code for what kind of identifier is desired (URI, OID, v2 table 0396 identifier)"]
2943#[doc = ""]
2944#[doc = "and returns either the requested identifier, or an HTTP errors response with an `OperationOutcome`"]
2945#[doc = "because either the provided identifier was not recognized, or the requested identiifer type is not"]
2946#[doc = "known."]
2947#[doc = ""]
2948#[doc = "The principle use of this operation is when converting between v2, CDA and FHIR `Identifier/CX/II`"]
2949#[doc = "and `CodeableConcepts/C`(N/W)E/CD but the operation may also find use when converting metadata such"]
2950#[doc = "as profiles."]
2951pub mod NamingSystemPreferredId {
2952 use haste_fhir_model::r4::generated::resources::{
2953 OperationDefinition, Parameters, ParametersParameter, Resource,
2954 };
2955 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRString};
2956 use haste_fhir_operation_error::OperationOutcomeError;
2957 use haste_fhir_ops::derive::{FromParameters, ToParameters};
2958 use std::sync::LazyLock;
2959 pub const CODE: &str = "preferred-id";
2960 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"NamingSystem-preferred-id","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Fetch Preferred it</h2><p>OPERATION: Fetch Preferred it</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/NamingSystem-preferred-id</pre><div><p>This operation returns the preferred identifiers for identifiers, and terminologies. The operation takes 2 parameters:</p>\n<ul>\n<li>a system identifier - either a URI, an OID, or a v2 table 0396 (other) code</li>\n<li>a code for what kind of identifier is desired (URI, OID, v2 table 0396 identifier)</li>\n</ul>\n<p>and returns either the requested identifier, or an HTTP errors response with an OperationOutcome because either the provided identifier was not recognized, or the requested identiifer type is not known.</p>\n<p>The principle use of this operation is when converting between v2, CDA and FHIR Identifier/CX/II and CodeableConcepts/C(N/W)E/CD but the operation may also find use when converting metadata such as profiles.</p>\n</div><p>URL: [base]/NamingSystem/$preferred-id</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>id</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The server parses the provided id to see what type it is (mary a URI, an OID as a URI, a plain OID, or a v2 table 0396 code). If the server can't tell what type of identifier it is, it can try it as multiple types. It is an error if more than one system matches the provided identifier</p>\n</div></td></tr><tr><td>IN</td><td>type</td><td>1..1</td><td><a href=\"datatypes.html#code\">code</a></td><td><a href=\"valueset-namingsystem-identifier-type.html\">http://hl7.org/fhir/ValueSet/namingsystem-identifier-type|4.0.1</a> (Required)</td><td/></tr><tr><td>OUT</td><td>result</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>OIDs are return as plain OIDs (not the URI form).</p>\n</div></td></tr></table><div><p>Servers handle this request by finding the provided identifier in their known naming systems, and returning the requested identifier type (<a href=\"namingsystem-definitions.html#NamingSystem.uniqueId.type\">NamingSystem.uniqueId.type</a>). If there are multiple possible identifiers of the specified type (e.g. multiple OIDs) the server returns an error.</p>\n<p>If the server wishes, it can also look through all code systems and value sets it knows about when attempting to find the requested identifier</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":1},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/NamingSystem-preferred-id","version":"4.0.1","name":"Fetch Preferred it","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation returns the preferred identifiers for identifiers, and terminologies. The operation takes 2 parameters: \n\n* a system identifier - either a URI, an OID, or a v2 table 0396 (other) code \n* a code for what kind of identifier is desired (URI, OID, v2 table 0396 identifier) \n\nand returns either the requested identifier, or an HTTP errors response with an `OperationOutcome` because either the provided identifier was not recognized, or the requested identiifer type is not known. \n\nThe principle use of this operation is when converting between v2, CDA and FHIR Identifier/CX/II and CodeableConcepts/C(N/W)E/CD but the operation may also find use when converting metadata such as profiles.","code":"preferred-id","comment":"Servers handle this request by finding the provided identifier in their known naming systems, and returning the requested identifier type ([NamingSystem.uniqueId.type](namingsystem-definitions.html#NamingSystem.uniqueId.type)). If there are multiple possible identifiers of the specified type (e.g. multiple OIDs) the server returns an error. \n\nIf the server wishes, it can also look through all code systems and value sets it knows about when attempting to find the requested identifier","resource":["NamingSystem"],"system":false,"type":true,"instance":false,"parameter":[{"name":"id","use":"in","min":1,"max":"1","documentation":"The server parses the provided id to see what type it is (mary a URI, an OID as a URI, a plain OID, or a v2 table 0396 code). If the server can't tell what type of identifier it is, it can try it as multiple types. It is an error if more than one system matches the provided identifier","type":"string"},{"name":"type","use":"in","min":1,"max":"1","type":"code","binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/namingsystem-identifier-type|4.0.1"}},{"name":"result","use":"out","min":1,"max":"1","documentation":"OIDs are return as plain OIDs (not the URI form).","type":"string"}]}"#;
2961 #[doc = "The `OperationDefinition` this module was generated from."]
2962 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
2963 serde_json::from_str(OPERATION_DEFINITION_JSON)
2964 .expect("Generated OperationDefinition JSON must deserialize.")
2965 });
2966 #[derive(Debug, FromParameters, ToParameters)]
2967 pub struct Input {
2968 #[doc = "The server parses the provided id to see what type it is (mary a URI, an OID as a URI, a plain OID,"]
2969 #[doc = "or a v2 table 0396 code). If the server can't tell what type of identifier it is, it can try it as"]
2970 #[doc = "multiple types. It is an error if more than one system matches the provided identifier"]
2971 pub id: FHIRString,
2972 #[doc = "type_"]
2973 #[parameter_rename = "type"]
2974 pub type_: FHIRCode,
2975 }
2976 impl From<Input> for Resource {
2977 fn from(value: Input) -> Self {
2978 let parameters: Vec<ParametersParameter> = value.into();
2979 Resource::Parameters(Parameters {
2980 parameter: Some(parameters),
2981 ..Default::default()
2982 })
2983 }
2984 }
2985 #[derive(Debug, FromParameters, ToParameters)]
2986 pub struct Output {
2987 #[doc = "`OIDs` are return as plain `OIDs` (not the URI form)."]
2988 pub result: FHIRString,
2989 }
2990 impl From<Output> for Resource {
2991 fn from(value: Output) -> Self {
2992 let parameters: Vec<ParametersParameter> = value.into();
2993 Resource::Parameters(Parameters {
2994 parameter: Some(parameters),
2995 ..Default::default()
2996 })
2997 }
2998 }
2999}
3000#[doc = "The *lastn query* meets the common need for searching for the most recent or last n=number of"]
3001#[doc = "observations for a subject. For example, retrieving the last 5 temperatures for a patient to view"]
3002#[doc = "trends or fetching the most recent laboratory results or vitals signs. To ask a server to return the"]
3003#[doc = "last n=number of observations, the *lastn* query uses the [`normal search"]
3004#[doc = "parameters`](observation.html#search) defined for the Observation resource. However, rather than"]
3005#[doc = "their normal use, they are interpreted as inputs - i.e.. instead of requiring that the resources"]
3006#[doc = "literally contain the search parameters, they are passed to a server algorithm of some kind that"]
3007#[doc = "uses them to determine the most appropriate matches."]
3008#[doc = ""]
3009#[doc = "The request for a lastn query SHALL include:"]
3010#[doc = ""]
3011#[doc = "* A `$lastn` operation parameter"]
3012#[doc = "* A subject using either the `patient` or `subject` search parameter"]
3013#[doc = "* A `category` parameter and/or a search parameter that contains a code element in its `FHIRpath`"]
3014#[doc = "expression. ( e.g., `code` or `code-value-concept`)"]
3015#[doc = ""]
3016#[doc = "The request for a lastn query MAY include:"]
3017#[doc = ""]
3018#[doc = "* Other Observation search parameters and modifiers"]
3019#[doc = ""]
3020#[doc = "The response from a lastn query is a set of observations:"]
3021#[doc = ""]
3022#[doc = "* Filtered by additional parameters"]
3023#[doc = "* If not explicitly filtered by status then will include statuses of `entered-in-error`"]
3024#[doc = "* 'GROUP BY' `Observation.code`"]
3025#[doc = "* Codes SHALL be considered equivalent if the `coding.value` *and* `coding.system` are the same."]
3026#[doc = "* Text only codes SHALL be treated and grouped based on the text."]
3027#[doc = "* For codes with translations (multiple codings), the code translations are assumed to be equal and"]
3028#[doc = "the grouping by code SHALL follow the transitive property of equality."]
3029#[doc = ""]
3030#[doc = "for example:"]
3031#[doc = ""]
3032#[doc = "|`Observation.code for observation a`|`Observation.code for observation b`|`Observation.code for observation c`|`number of groups [codes/text in each group]`|"]
3033#[doc = "|---|---|---|---|"]
3034#[doc = "|`a`|`b`|`c`|`3 [a],[b],[c]`|"]
3035#[doc = "|`a`|`b`|`a,c`|`2 [a.c],[b]`|"]
3036#[doc = "|`a`|`b`|`a,b`|`1 [a,b]`|"]
3037#[doc = "|`textM`|`Text`|`t e x t`|`3 [text],[Text],[t e x t]`|"]
3038#[doc = ""]
3039#[doc = "* Sorted from most recent to the oldest"]
3040#[doc = "* Limited to the number of requested responses per group specified by the optional *max* query"]
3041#[doc = "parameter"]
3042#[doc = "* In case of a tie - when the effective times for >1 Observations are equal - both will be returned."]
3043#[doc = "Therefore, more Observations may be returned than is specified in *max*. For example, 4 Observations"]
3044#[doc = "instead of 3 if the 3rd and 4th most recent observation had the same effective time."]
3045#[doc = "* If no maximum number is given then only the most recent Observation in each group is returned."]
3046#[doc = ""]
3047#[doc = "The set of returned observations should represent distinct real world observations and not the same"]
3048#[doc = "observation with changes in status or versions. If there are no matches, the *lastn* query SHALL"]
3049#[doc = "return an empty search set with no error, but may include an operation outcome with further advice."]
3050pub mod ObservationLastn {
3051 use haste_fhir_model::r4::generated::resources::{
3052 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
3053 };
3054 use haste_fhir_model::r4::generated::types::FHIRPositiveInt;
3055 use haste_fhir_operation_error::OperationOutcomeError;
3056 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3057 use std::sync::LazyLock;
3058 pub const CODE: &str = "lastn";
3059 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Observation-lastn","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Last N Observations Query</h2><p>OPERATION: Last N Observations Query</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Observation-lastn</pre><div><p>The <em>lastn query</em> meets the common need for searching for the most recent or last n=number of observations for a subject. For example, retrieving the last 5 temperatures for a patient to view trends or fetching the most recent laboratory results or vitals signs. To ask a server to return the last n=number of observations, the <em>lastn</em> query uses the <a href=\"observation.html#search\">normal search parameters</a> defined for the Observation resource. However, rather than their normal use, they are interpreted as inputs - i.e.. instead of requiring that the resources literally contain the search parameters, they are passed to a server algorithm of some kind that uses them to determine the most appropriate matches.</p>\n<p>The request for a lastn query SHALL include:</p>\n<ul>\n<li>A <code>$lastn</code> operation parameter</li>\n<li>A subject using either the <code>patient</code> or <code>subject</code> search parameter</li>\n<li>A <code>category</code> parameter and/or a search parameter that contains a code element in its FHIRpath expression. ( e.g., <code>code</code> or <code>code-value-concept</code>)</li>\n</ul>\n<p>The request for a lastn query MAY include:</p>\n<ul>\n<li>Other Observation search parameters and modifiers</li>\n</ul>\n<p>The response from a lastn query is a set of observations:</p>\n<ul>\n<li>Filtered by additional parameters\n<ul>\n<li>If not explicitly filtered by status then will include statuses of 'entered-in-error'</li>\n</ul>\n</li>\n<li>'GROUP BY' <code>Observation.code</code>\n<ul>\n<li>Codes SHALL be considered equivalent if the <code>coding.value</code> <em>and</em> <code>coding.system</code> are the same.</li>\n<li>Text only codes SHALL be treated and grouped based on the text.</li>\n<li>For codes with translations (multiple codings), the code translations are assumed to be equal and the grouping by code SHALL follow the transitive property of equality.</li>\n</ul>\n</li>\n</ul>\n<p>for example:</p>\n<table class=\"grid\">\n<thead>\n<tr><th>Observation.code for observation a</th><th>Observation.code for observation b</th><th>Observation.code for observation c</th><th>number of groups [codes/text in each group]</th></tr>\n</thead>\n<tbody>\n<tr><td>a</td><td>b</td><td>c</td><td>3 [a],[b],[c]</td></tr>\n<tr><td>a</td><td>b</td><td>a,c</td><td>2 [a.c],[b]</td></tr>\n<tr><td>a</td><td>b</td><td>a,b</td><td>1 [a,b]</td></tr>\n<tr><td>'textM'</td><td>'Text'</td><td>'t e x t'</td><td>3 ['text'],['Text'],['t e x t']</td></tr>\n</tbody>\n</table>\n<ul>\n<li>Sorted from most recent to the oldest</li>\n<li>Limited to the number of requested responses per group specified by the optional <em>max</em> query parameter\n<ul>\n<li>In case of a tie - when the effective times for >1 Observations are equal - both will be returned. Therefore, more Observations may be returned than is specified in <em>max</em>. For example, 4 Observations instead of 3 if the 3rd and 4th most recent observation had the same effective time.</li>\n</ul>\n</li>\n<li>If no maximum number is given then only the most recent Observation in each group is returned.</li>\n</ul>\n<p>The set of returned observations should represent distinct real world observations and not the same observation with changes in status or versions. If there are no matches, the <em>lastn</em> query SHALL return an empty search set with no error, but may include an operation outcome with further advice.</p>\n</div><p>URL: [base]/Observation/$lastn</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>max</td><td>0..1</td><td><a href=\"datatypes.html#positiveInt\">positiveInt</a></td><td/><td><div><p><code>max</code> is an optional input parameter to the <em>lastn</em> query operation. It is used to specify the maximum number of Observations to return from each group. For example for the query "Fetch the last 3 results for all vitals for a patient" <code>max</code> = 3.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The set of most recent N Observations that match the <em>lastn</em> query search criteria.</p>\n</div></td></tr></table><div><p>The key differences between this query operation and simply searching Observation using the combination of <code>_count</code> and <code>_sort</code> parameters are:</p>\n<ul>\n<li>The <em>lastn</em> query returns <strong>only</strong> the last N resource grouped by code. Using the _count query method doesn't restrict the total matches so you may need to page through several "A" Observations before getting to Observation "B".</li>\n<li>The server is responsible for grouping the observations by codes. This frees the client from needing to determine which codes she should ask for.</li>\n</ul>\n<p>This operation cannot be performed on observations that the user is not authorized to see. It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one. If there is no nominated patient (e.g. the operation is invoked at the system level) and the context is not associated with a single patient record, then the server should return an error. Specifying the relationship between the context, a user and patient records is outside the scope of this specification.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":3},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Observation-lastn","version":"4.0.1","name":"Last N Observations Query","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The *lastn query* meets the common need for searching for the most recent or last n=number of observations for a subject. For example, retrieving the last 5 temperatures for a patient to view trends or fetching the most recent laboratory results or vitals signs. To ask a server to return the last n=number of observations, the *lastn* query uses the [normal search parameters](observation.html#search) defined for the Observation resource. However, rather than their normal use, they are interpreted as inputs - i.e.. instead of requiring that the resources literally contain the search parameters, they are passed to a server algorithm of some kind that uses them to determine the most appropriate matches.\n\nThe request for a lastn query SHALL include:\n\n* A `$lastn` operation parameter\n* A subject using either the `patient` or `subject` search parameter\n* A `category` parameter and/or a search parameter that contains a code element in its `FHIRpath` expression. ( e.g., `code` or `code-value-concept`)\n\nThe request for a lastn query MAY include:\n\n* Other Observation search parameters and modifiers\n\nThe response from a lastn query is a set of observations:\n\n* Filtered by additional parameters\n * If not explicitly filtered by status then will include statuses of 'entered-in-error'\n* 'GROUP BY' `Observation.code`\n * Codes SHALL be considered equivalent if the `coding.value` *and* `coding.system` are the same.\n * Text only codes SHALL be treated and grouped based on the text.\n * For codes with translations (multiple codings), the code translations are assumed to be equal and the grouping by code SHALL follow the transitive property of equality.\n\nfor example:\n\n|Observation.code for observation a|Observation.code for observation b|Observation.code for observation c|number of groups [codes/text in each group]| \n|---|---|---|---| \n|a|b|c | 3 [a],[b],[c]| \n|a|b|a,c | 2 [a.c],[b]| \n|a|b|a,b | 1 [a,b]| \n|'textM'|'Text'|'t e x t'|3 ['text'],['Text'],['t e x t']|\n\n* Sorted from most recent to the oldest\n* Limited to the number of requested responses per group specified by the optional *max* query parameter\n * In case of a tie - when the effective times for >1 Observations are equal - both will be returned. Therefore, more Observations may be returned than is specified in *max*. For example, 4 Observations instead of 3 if the 3rd and 4th most recent observation had the same effective time.\n* If no maximum number is given then only the most recent Observation in each group is returned.\n\nThe set of returned observations should represent distinct real world observations and not the same observation with changes in status or versions. If there are no matches, the *lastn* query SHALL return an empty search set with no error, but may include an operation outcome with further advice.","code":"lastn","comment":"The key differences between this query operation and simply searching Observation using the combination of `_count` and `_sort` parameters are:\r\r* The *lastn* query returns **only** the last N resource grouped by code. Using the _count query method doesn't restrict the total matches so you may need to page through several \"A\" Observations before getting to Observation \"B\".\r* The server is responsible for grouping the observations by codes. This frees the client from needing to determine which codes she should ask for.\r\rThis operation cannot be performed on observations that the user is not authorized to see. It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one. If there is no nominated patient (e.g. the operation is invoked at the system level) and the context is not associated with a single patient record, then the server should return an error. Specifying the relationship between the context, a user and patient records is outside the scope of this specification.","resource":["Observation"],"system":false,"type":true,"instance":false,"parameter":[{"name":"max","use":"in","min":0,"max":"1","documentation":"`max` is an optional input parameter to the *lastn* query operation. It is used to specify the maximum number of Observations to return from each group. For example for the query \"Fetch the last 3 results for all vitals for a patient\" `max` = 3.","type":"positiveInt"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The set of most recent N Observations that match the *lastn* query search criteria.","type":"Bundle"}]}"#;
3060 #[doc = "The `OperationDefinition` this module was generated from."]
3061 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3062 serde_json::from_str(OPERATION_DEFINITION_JSON)
3063 .expect("Generated OperationDefinition JSON must deserialize.")
3064 });
3065 #[derive(Debug, FromParameters, ToParameters)]
3066 pub struct Input {
3067 #[doc = "`max` is an optional input parameter to the *lastn* query operation. It is used to specify the"]
3068 #[doc = "maximum number of Observations to return from each group. For example for the query \"Fetch the last"]
3069 #[doc = "3 results for all vitals for a patient\" `max` = 3."]
3070 pub max: Option<FHIRPositiveInt>,
3071 }
3072 impl From<Input> for Resource {
3073 fn from(value: Input) -> Self {
3074 let parameters: Vec<ParametersParameter> = value.into();
3075 Resource::Parameters(Parameters {
3076 parameter: Some(parameters),
3077 ..Default::default()
3078 })
3079 }
3080 }
3081 #[derive(Debug, FromParameters)]
3082 pub struct Output {
3083 #[doc = "The set of most recent N Observations that match the *lastn* query search criteria."]
3084 #[parameter_rename = "return"]
3085 pub return_: Bundle,
3086 }
3087 impl From<Output> for Resource {
3088 fn from(value: Output) -> Self {
3089 Resource::Bundle(value.return_)
3090 }
3091 }
3092}
3093#[doc = "The Statistics operation performs a set of statistical calculations on a set of clinical"]
3094#[doc = "measurements such as a blood pressure as stored on the server. This operation evaluates"]
3095#[doc = "[`Observation`](observation.html) resources having valueQuantity elements that have UCUM unit codes."]
3096#[doc = "Observations with a status of `entered-in-error` will be excluded from the calculations. The set of"]
3097#[doc = "Observations is defined by 4 parameters: * the subject of the observations for which the statistics"]
3098#[doc = "are being generated (`subject`) * which observations to generate statistics for (`code` and"]
3099#[doc = "`system`, or `coding`) * the time period over which to generate statistics 'duration` or `period`) *"]
3100#[doc = "the set of statistical analyses to return (`statistic`) Possible statistical analyses (see"]
3101#[doc = "[``StatisticsCode``](valueset-observation-statistics.html)): - **average** (\"Average\"): The"]
3102#[doc = "[mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period."]
3103#[doc = "- **maximum** (\"Maximum\"): The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N"]
3104#[doc = "measurements over the stated period."]
3105#[doc = "- **minimum** (\"Minimum\"): The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N"]
3106#[doc = "measurements over the stated period."]
3107#[doc = "- **count** (\"Count\"): The [number] of valid measurements over the stated period that contributed to"]
3108#[doc = "the other statistical outputs."]
3109#[doc = "- **total-count** (\"Total Count\"): The total [number] of valid measurements over the stated period,"]
3110#[doc = "including observations that were ignored because they did not contain valid result values."]
3111#[doc = "- **median** (\"Median\"): The [median](https://en.wikipedia.org/wiki/Median) of N measurements over"]
3112#[doc = "the stated period."]
3113#[doc = "- **std-dev** (\"Standard Deviation\"): The [standard"]
3114#[doc = "deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated"]
3115#[doc = "period."]
3116#[doc = "- **sum** (\"Sum\"): The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the"]
3117#[doc = "stated period."]
3118#[doc = "- **variance** (\"Variance\"): The [variance](https://en.wikipedia.org/wiki/Variance) of N"]
3119#[doc = "measurements over the stated period."]
3120#[doc = "- **20-percent** (\"20th Percentile\"): The 20th"]
3121#[doc = "[Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period."]
3122#[doc = "- **80-percent** (\"80th Percentile\"): The 80th"]
3123#[doc = "[Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period."]
3124#[doc = "- **4-lower** (\"Lower Quartile\"): The lower [Quartile](https://en.wikipedia.org/wiki/Quartile)"]
3125#[doc = "Boundary of N measurements over the stated period."]
3126#[doc = "- **4-upper** (\"Upper Quartile\"): The upper [Quartile](https://en.wikipedia.org/wiki/Quartile)"]
3127#[doc = "Boundary of N measurements over the stated period."]
3128#[doc = "- **4-dev** (\"Quartile Deviation\"): The difference between the upper and lower"]
3129#[doc = "[Quartiles](https://en.wikipedia.org/wiki/Quartile) is called the Interquartile range. (IQR = Q3-Q1)"]
3130#[doc = "Quartile deviation or Semi-interquartile range is one-half the difference between the first and the"]
3131#[doc = "third quartiles."]
3132#[doc = "- **5-1** (\"1st Quintile\"): The lowest of four values that divide the N measurements into a"]
3133#[doc = "frequency distribution of five classes with each containing one fifth of the total population."]
3134#[doc = "- **5-2** (\"2nd Quintile\"): The second of four values that divide the N measurements into a"]
3135#[doc = "frequency distribution of five classes with each containing one fifth of the total population."]
3136#[doc = "- **5-3** (\"3rd Quintile\"): The third of four values that divide the N measurements into a frequency"]
3137#[doc = "distribution of five classes with each containing one fifth of the total population."]
3138#[doc = "- **5-4** (\"4th Quintile\"): The fourth of four values that divide the N measurements into a"]
3139#[doc = "frequency distribution of five classes with each containing one fifth of the total population."]
3140#[doc = "- **skew** (\"Skew\"): Skewness is a measure of the asymmetry of the probability distribution of a"]
3141#[doc = "real-valued random variable about its mean. The skewness value can be positive or negative, or even"]
3142#[doc = "undefined. Source: [Wikipedia](https://en.wikipedia.org/wiki/Skewness)."]
3143#[doc = "- **kurtosis** (\"Kurtosis\"): Kurtosis is a measure of the \"tailedness\" of the probability"]
3144#[doc = "distribution of a real-valued random variable. Source:"]
3145#[doc = "[Wikipedia](https://en.wikipedia.org/wiki/Kurtosis)."]
3146#[doc = "- **regression** (\"Regression\"): Linear regression is an approach for modeling two-dimensional"]
3147#[doc = "sample points with one independent variable and one dependent variable (conventionally, the x and y"]
3148#[doc = "coordinates in a Cartesian coordinate system) and finds a linear function (a non-vertical straight"]
3149#[doc = "line) that, as accurately as possible, predicts the dependent variable values as a function of the"]
3150#[doc = "independent variables. Source: [Wikipedia](https://en.wikipedia.org/wiki/Simple_linear_regression)"]
3151#[doc = "This Statistic code will return both a gradient and an intercept value."]
3152#[doc = "If successful, the operation returns an Observation resource for each code with the results of the"]
3153#[doc = "statistical calculations as component value pairs where the component code = the statistical code."]
3154#[doc = "The Observation also contains the input parameters `patient`,`code` and `duration` parameters. If"]
3155#[doc = "unsuccessful, an [``OperationOutcome``](operationoutcome.html) with an error message will be"]
3156#[doc = "returned. The client can request that all the observations on which the statistics are based be"]
3157#[doc = "returned as well, using the include parameter. If an include parameter is specified, a limit may"]
3158#[doc = "also be specified; the sources observations are subsetted at the server's discretion if count >"]
3159#[doc = "limit. This functionality is included with the intent of supporting graphical presentation"]
3160pub mod ObservationStats {
3161 use haste_fhir_model::r4::generated::resources::{
3162 Observation, OperationDefinition, Parameters, ParametersParameter, Resource,
3163 };
3164 use haste_fhir_model::r4::generated::types::{
3165 Coding, FHIRBoolean, FHIRCode, FHIRDecimal, FHIRPositiveInt, FHIRString, FHIRUri, Period,
3166 };
3167 use haste_fhir_operation_error::OperationOutcomeError;
3168 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3169 use std::sync::LazyLock;
3170 pub const CODE: &str = "stats";
3171 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Observation-stats","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Observation Statistics</h2><p>OPERATION: Observation Statistics</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Observation-stats</pre><div><p>The Statistics operation performs a set of statistical calculations on a set of clinical measurements such as a blood pressure as stored on the server. This operation evaluates <a href=\"observation.html\">Observation</a> resources having valueQuantity elements that have UCUM unit codes. Observations with a status of 'entered-in-error' will be excluded from the calculations.</p>\n<p>The set of Observations is defined by 4 parameters:</p>\n<ul>\n<li>the subject of the observations for which the statistics are being generated (<code>subject</code>)</li>\n<li>which observations to generate statistics for (<code>code</code> and <code>system</code>, or <code>coding</code>)</li>\n<li>the time period over which to generate statistics 'duration<code>or</code>period`)</li>\n<li>the set of statistical analyses to return (<code>statistic</code>)</li>\n</ul>\n<p>Possible statistical analyses (see <a href=\"valueset-observation-statistics.html\">StatisticsCode</a>):</p>\n<ul>\n<li><strong>average</strong> ("Average"): The <a href=\"https://en.wikipedia.org/wiki/Arithmetic_mean\">mean</a> of N measurements over the stated period.</li>\n<li><strong>maximum</strong> ("Maximum"): The <a href=\"https://en.wikipedia.org/wiki/Maximal_element\">maximum</a> value of N measurements over the stated period.</li>\n<li><strong>minimum</strong> ("Minimum"): The <a href=\"https://en.wikipedia.org/wiki/Minimal_element\">minimum</a> value of N measurements over the stated period.</li>\n<li><strong>count</strong> ("Count"): The [number] of valid measurements over the stated period that contributed to the other statistical outputs.</li>\n<li><strong>total-count</strong> ("Total Count"): The total [number] of valid measurements over the stated period, including observations that were ignored because they did not contain valid result values.</li>\n<li><strong>median</strong> ("Median"): The <a href=\"https://en.wikipedia.org/wiki/Median\">median</a> of N measurements over the stated period.</li>\n<li><strong>std-dev</strong> ("Standard Deviation"): The <a href=\"https://en.wikipedia.org/wiki/Standard_deviation\">standard deviation</a> of N measurements over the stated period.</li>\n<li><strong>sum</strong> ("Sum"): The <a href=\"https://en.wikipedia.org/wiki/Summation\">sum</a> of N measurements over the stated period.</li>\n<li><strong>variance</strong> ("Variance"): The <a href=\"https://en.wikipedia.org/wiki/Variance\">variance</a> of N measurements over the stated period.</li>\n<li><strong>20-percent</strong> ("20th Percentile"): The 20th <a href=\"https://en.wikipedia.org/wiki/Percentile\">Percentile</a> of N measurements over the stated period.</li>\n<li><strong>80-percent</strong> ("80th Percentile"): The 80th <a href=\"https://en.wikipedia.org/wiki/Percentile\">Percentile</a> of N measurements over the stated period.</li>\n<li><strong>4-lower</strong> ("Lower Quartile"): The lower <a href=\"https://en.wikipedia.org/wiki/Quartile\">Quartile</a> Boundary of N measurements over the stated period.</li>\n<li><strong>4-upper</strong> ("Upper Quartile"): The upper <a href=\"https://en.wikipedia.org/wiki/Quartile\">Quartile</a> Boundary of N measurements over the stated period.</li>\n<li><strong>4-dev</strong> ("Quartile Deviation"): The difference between the upper and lower <a href=\"https://en.wikipedia.org/wiki/Quartile\">Quartiles</a> is called the Interquartile range. (IQR = Q3-Q1) Quartile deviation or Semi-interquartile range is one-half the difference between the first and the third quartiles.</li>\n<li><strong>5-1</strong> ("1st Quintile"): The lowest of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.</li>\n<li><strong>5-2</strong> ("2nd Quintile"): The second of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.</li>\n<li><strong>5-3</strong> ("3rd Quintile"): The third of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.</li>\n<li><strong>5-4</strong> ("4th Quintile"): The fourth of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.</li>\n<li><strong>skew</strong> ("Skew"): Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. The skewness value can be positive or negative, or even undefined. Source: <a href=\"https://en.wikipedia.org/wiki/Skewness\">Wikipedia</a>.</li>\n<li><strong>kurtosis</strong> ("Kurtosis"): Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. Source: <a href=\"https://en.wikipedia.org/wiki/Kurtosis\">Wikipedia</a>.</li>\n<li><strong>regression</strong> ("Regression"): Linear regression is an approach for modeling two-dimensional sample points with one independent variable and one dependent variable (conventionally, the x and y coordinates in a Cartesian coordinate system) and finds a linear function (a non-vertical straight line) that, as accurately as possible, predicts the dependent variable values as a function of the independent variables. Source: <a href=\"https://en.wikipedia.org/wiki/Simple_linear_regression\">Wikipedia</a> This Statistic code will return both a gradient and an intercept value.</li>\n</ul>\n<p>If successful, the operation returns an Observation resource for each code with the results of the statistical calculations as component value pairs where the component code = the statistical code. The Observation also contains the input parameters <code>patient</code>,<code>code</code> and <code>duration</code> parameters. If unsuccessful, an <a href=\"operationoutcome.html\">OperationOutcome</a> with an error message will be returned.</p>\n<p>The client can request that all the observations on which the statistics are based be returned as well, using the include parameter. If an include parameter is specified, a limit may also be specified; the sources observations are subsetted at the server's discretion if count > limit. This functionality is included with the intent of supporting graphical presentation</p>\n</div><p>URL: [base]/Observation/$stats</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>subject</td><td>1..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The subject of the relevant Observations, which has the value of the Observation.subject.reference. E.g. 'Patient/123'. Reference can be to an absolute URL, but servers only perform stats on their own observations</p>\n</div></td></tr><tr><td>IN</td><td>code</td><td>0..*</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The test code(s) upon which the statistics are being performed. Provide along with a system, or as a coding. For example, the LOINC code =\n2339-0 (Glucose [Mass/\u200bvolume] in Blood) will evaluate all relevant Observations with this code in <code>Observation.code</code> and <code>Observation.component.code</code>. For LOINC codes that are panels, e.g., 85354-9(Blood pressure panel with all children optional), the stats operation returns statistics for each of the individual panel measurements. That means it will include and evaluate all values grouped by code for all the individual observations that are: 1) referenced in <code>.related</code> for <code>.related.type</code> = 'has-member' and 2) component observations in <code>Observation.component</code>.</p>\n</div></td></tr><tr><td>IN</td><td>system</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The system for the code(s). Or provide a coding instead</p>\n</div></td></tr><tr><td>IN</td><td>coding</td><td>0..*</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>The test code upon which the statistics are being performed, as a Coding</p>\n</div></td></tr><tr><td>IN</td><td>duration</td><td>0..1</td><td><a href=\"datatypes.html#decimal\">decimal</a></td><td/><td><div><p>The time period of interest given as hours. For example, the duration = "1" represents the last hour - the time period from on hour ago to now</p>\n</div></td></tr><tr><td>IN</td><td>period</td><td>0..1</td><td><a href=\"datatypes.html#Period\">Period</a></td><td/><td><div><p>The time period over which the calculations to be performed, if a duration is not provided</p>\n</div></td></tr><tr><td>IN</td><td>statistic</td><td>1..*</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>average|max|min|count The statistical operations to be performed on the relevant operations. Multiple statistics operations can be specified. These codes are defined <a href=\"valueset-observation-statistics.html\">here</a></p>\n</div></td></tr><tr><td>IN</td><td>include</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Whether to return the observations on which the statistics are based</p>\n</div></td></tr><tr><td>IN</td><td>limit</td><td>0..1</td><td><a href=\"datatypes.html#positiveInt\">positiveInt</a></td><td/><td><div><p>If an include parameter is specified, a limit may also be specified to limit the number of source Observations returned. If the include paramter is absent or equal to "false" the limit parameter SHALL be ignored by the server</p>\n</div></td></tr><tr><td>OUT</td><td>statistics</td><td>1..*</td><td><a href=\"observation.html\">Observation</a></td><td/><td><div><p>A set of observations, one observation for each code, each containing one component for each statistic. The Observation.component.code contains the statistic, and is relative to the Observation.code and cannot be interpreted independently. The Observation will also contain a subject, effectivePeriod, and code reflecting the input parameters. The status is fixed to <code>final</code>.</p>\n</div></td></tr><tr><td>OUT</td><td>source</td><td>0..*</td><td><a href=\"observation.html\">Observation</a></td><td/><td><div><p>Source observations on which the statistics are based</p>\n</div></td></tr></table><div><p>If <a href=\"extensibility.html#modifierExtension\">modifier extensions</a> are present in the Observation, they must be accounted for by implementers. A modifier extension may affect the observation.value in a way that it should be excluded from the from the calculations.</p>\n<p>This operation cannot be performed on observations that the user is not authorized to see. It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one. If there is no nominated patient (e.g. the operation is invoked at the system level) and the context is not associated with a single patient record, then the server should return an error. Specifying the relationship between the context, a user and patient records is outside the scope of this specification.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":3},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Observation-stats","version":"4.0.1","name":"Observation Statistics","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The Statistics operation performs a set of statistical calculations on a set of clinical measurements such as a blood pressure as stored on the server. This operation evaluates [Observation](observation.html) resources having valueQuantity elements that have UCUM unit codes. Observations with a status of 'entered-in-error' will be excluded from the calculations. \r\rThe set of Observations is defined by 4 parameters:\r\r* the subject of the observations for which the statistics are being generated (`subject`)\r* which observations to generate statistics for (`code` and `system`, or `coding`)\r* the time period over which to generate statistics 'duration` or `period`)\r* the set of statistical analyses to return (`statistic`)\r\rPossible statistical analyses (see [`StatisticsCode`](valueset-observation-statistics.html)):\r\r - **average** (\"Average\"): The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period.\r\n - **maximum** (\"Maximum\"): The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period.\r\n - **minimum** (\"Minimum\"): The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period.\r\n - **count** (\"Count\"): The [number] of valid measurements over the stated period that contributed to the other statistical outputs.\r\n - **total-count** (\"Total Count\"): The total [number] of valid measurements over the stated period, including observations that were ignored because they did not contain valid result values.\r\n - **median** (\"Median\"): The [median](https://en.wikipedia.org/wiki/Median) of N measurements over the stated period.\r\n - **std-dev** (\"Standard Deviation\"): The [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated period.\r\n - **sum** (\"Sum\"): The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the stated period.\r\n - **variance** (\"Variance\"): The [variance](https://en.wikipedia.org/wiki/Variance) of N measurements over the stated period.\r\n - **20-percent** (\"20th Percentile\"): The 20th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period.\r\n - **80-percent** (\"80th Percentile\"): The 80th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period.\r\n - **4-lower** (\"Lower Quartile\"): The lower [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period.\r\n - **4-upper** (\"Upper Quartile\"): The upper [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period.\r\n - **4-dev** (\"Quartile Deviation\"): The difference between the upper and lower [Quartiles](https://en.wikipedia.org/wiki/Quartile) is called the Interquartile range. (IQR = Q3-Q1) Quartile deviation or Semi-interquartile range is one-half the difference between the first and the third quartiles.\r\n - **5-1** (\"1st Quintile\"): The lowest of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.\r\n - **5-2** (\"2nd Quintile\"): The second of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.\r\n - **5-3** (\"3rd Quintile\"): The third of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.\r\n - **5-4** (\"4th Quintile\"): The fourth of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population.\r\n - **skew** (\"Skew\"): Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. The skewness value can be positive or negative, or even undefined. Source: [Wikipedia](https://en.wikipedia.org/wiki/Skewness).\r\n - **kurtosis** (\"Kurtosis\"): Kurtosis is a measure of the \"tailedness\" of the probability distribution of a real-valued random variable. Source: [Wikipedia](https://en.wikipedia.org/wiki/Kurtosis).\r\n - **regression** (\"Regression\"): Linear regression is an approach for modeling two-dimensional sample points with one independent variable and one dependent variable (conventionally, the x and y coordinates in a Cartesian coordinate system) and finds a linear function (a non-vertical straight line) that, as accurately as possible, predicts the dependent variable values as a function of the independent variables. Source: [Wikipedia](https://en.wikipedia.org/wiki/Simple_linear_regression) This Statistic code will return both a gradient and an intercept value.\r\n\r\rIf successful, the operation returns an Observation resource for each code with the results of the statistical calculations as component value pairs where the component code = the statistical code. The Observation also contains the input parameters `patient`,`code` and `duration` parameters. If unsuccessful, an [`OperationOutcome`](operationoutcome.html) with an error message will be returned.\r\rThe client can request that all the observations on which the statistics are based be returned as well, using the include parameter. If an include parameter is specified, a limit may also be specified; the sources observations are subsetted at the server's discretion if count > limit. This functionality is included with the intent of supporting graphical presentation","code":"stats","comment":"If [modifier extensions](extensibility.html#modifierExtension) are present in the Observation, they must be accounted for by implementers. A modifier extension may affect the observation.value in a way that it should be excluded from the from the calculations.\r\rThis operation cannot be performed on observations that the user is not authorized to see. It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one. If there is no nominated patient (e.g. the operation is invoked at the system level) and the context is not associated with a single patient record, then the server should return an error. Specifying the relationship between the context, a user and patient records is outside the scope of this specification.","resource":["Observation"],"system":false,"type":true,"instance":false,"parameter":[{"name":"subject","use":"in","min":1,"max":"1","documentation":"The subject of the relevant Observations, which has the value of the Observation.subject.reference. E.g. 'Patient/123'. Reference can be to an absolute URL, but servers only perform stats on their own observations","type":"uri"},{"name":"code","use":"in","min":0,"max":"*","documentation":"The test code(s) upon which the statistics are being performed. Provide along with a system, or as a coding. For example, the LOINC code = \r2339-0 (Glucose [Mass/\u200bvolume] in Blood) will evaluate all relevant Observations with this code in `Observation.code` and `Observation.component.code`. For LOINC codes that are panels, e.g., 85354-9(Blood pressure panel with all children optional), the stats operation returns statistics for each of the individual panel measurements. That means it will include and evaluate all values grouped by code for all the individual observations that are: 1) referenced in `.related` for `.related.type` = 'has-member' and 2) component observations in `Observation.component`.","type":"string"},{"name":"system","use":"in","min":0,"max":"1","documentation":"The system for the code(s). Or provide a coding instead","type":"uri"},{"name":"coding","use":"in","min":0,"max":"*","documentation":"The test code upon which the statistics are being performed, as a Coding","type":"Coding"},{"name":"duration","use":"in","min":0,"max":"1","documentation":"The time period of interest given as hours. For example, the duration = \"1\" represents the last hour - the time period from on hour ago to now","type":"decimal"},{"name":"period","use":"in","min":0,"max":"1","documentation":"The time period over which the calculations to be performed, if a duration is not provided","type":"Period"},{"name":"statistic","use":"in","min":1,"max":"*","documentation":"average|max|min|count The statistical operations to be performed on the relevant operations. Multiple statistics operations can be specified. These codes are defined [here](valueset-observation-statistics.html)","type":"code"},{"name":"include","use":"in","min":0,"max":"1","documentation":"Whether to return the observations on which the statistics are based","type":"boolean"},{"name":"limit","use":"in","min":0,"max":"1","documentation":"If an include parameter is specified, a limit may also be specified to limit the number of source Observations returned. If the include paramter is absent or equal to \"false\" the limit parameter SHALL be ignored by the server","type":"positiveInt"},{"name":"statistics","use":"out","min":1,"max":"*","documentation":"A set of observations, one observation for each code, each containing one component for each statistic. The Observation.component.code contains the statistic, and is relative to the Observation.code and cannot be interpreted independently. The Observation will also contain a subject, effectivePeriod, and code reflecting the input parameters. The status is fixed to `final`.","type":"Observation"},{"name":"source","use":"out","min":0,"max":"*","documentation":"Source observations on which the statistics are based","type":"Observation"}]}"#;
3172 #[doc = "The `OperationDefinition` this module was generated from."]
3173 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3174 serde_json::from_str(OPERATION_DEFINITION_JSON)
3175 .expect("Generated OperationDefinition JSON must deserialize.")
3176 });
3177 #[derive(Debug, FromParameters, ToParameters)]
3178 pub struct Input {
3179 #[doc = "The subject of the relevant Observations, which has the value of the"]
3180 #[doc = "`Observation.subject.reference.` E.g. 'Patient/123'. Reference can be to an absolute URL, but"]
3181 #[doc = "servers only perform stats on their own observations"]
3182 pub subject: FHIRUri,
3183 #[doc = "The test code(s) upon which the statistics are being performed. Provide along with a system, or as a"]
3184 #[doc = "coding. For example, the LOINC code = 2339-0 (Glucose [Mass/\u{200b}volume] in Blood) will evaluate all"]
3185 #[doc = "relevant Observations with this code in `Observation.code` and `Observation.component.code`. For"]
3186 #[doc = "LOINC codes that are panels, e.g., 85354-9(Blood pressure panel with all children optional), the"]
3187 #[doc = "stats operation returns statistics for each of the individual panel measurements. That means it will"]
3188 #[doc = "include and evaluate all values grouped by code for all the individual observations that are: 1)"]
3189 #[doc = "referenced in `.related` for `.related.type` = `has-member` and 2) component observations in"]
3190 #[doc = "`Observation.component`."]
3191 pub code: Option<Vec<FHIRString>>,
3192 #[doc = "The system for the code(s). Or provide a coding instead"]
3193 pub system: Option<FHIRUri>,
3194 #[doc = "The test code upon which the statistics are being performed, as a Coding"]
3195 pub coding: Option<Vec<Coding>>,
3196 #[doc = "The time period of interest given as hours. For example, the duration = \"1\" represents the last hour"]
3197 #[doc = "- the time period from on hour ago to now"]
3198 pub duration: Option<FHIRDecimal>,
3199 #[doc = "The time period over which the calculations to be performed, if a duration is not provided"]
3200 pub period: Option<Period>,
3201 #[doc = "average|max|min|count The statistical operations to be performed on the relevant operations."]
3202 #[doc = "Multiple statistics operations can be specified. These codes are defined"]
3203 #[doc = "[`here`](valueset-observation-statistics.html)"]
3204 pub statistic: Vec<FHIRCode>,
3205 #[doc = "Whether to return the observations on which the statistics are based"]
3206 pub include: Option<FHIRBoolean>,
3207 #[doc = "If an include parameter is specified, a limit may also be specified to limit the number of source"]
3208 #[doc = "Observations returned. If the include paramter is absent or equal to \"false\" the limit parameter"]
3209 #[doc = "SHALL be ignored by the server"]
3210 pub limit: Option<FHIRPositiveInt>,
3211 }
3212 impl From<Input> for Resource {
3213 fn from(value: Input) -> Self {
3214 let parameters: Vec<ParametersParameter> = value.into();
3215 Resource::Parameters(Parameters {
3216 parameter: Some(parameters),
3217 ..Default::default()
3218 })
3219 }
3220 }
3221 #[derive(Debug, FromParameters, ToParameters)]
3222 pub struct Output {
3223 #[doc = "A set of observations, one observation for each code, each containing one component for each"]
3224 #[doc = "statistic. The `Observation.component.code` contains the statistic, and is relative to the"]
3225 #[doc = "`Observation.code` and cannot be interpreted independently. The Observation will also contain a"]
3226 #[doc = "subject, effectivePeriod, and code reflecting the input parameters. The status is fixed to `final`."]
3227 pub statistics: Vec<Observation>,
3228 #[doc = "Source observations on which the statistics are based"]
3229 pub source: Option<Vec<Observation>>,
3230 }
3231 impl From<Output> for Resource {
3232 fn from(value: Output) -> Self {
3233 let parameters: Vec<ParametersParameter> = value.into();
3234 Resource::Parameters(Parameters {
3235 parameter: Some(parameters),
3236 ..Default::default()
3237 })
3238 }
3239 }
3240}
3241#[doc = "This operation is used to return all the information related to one or more patients described in"]
3242#[doc = "the resource or context on which this operation is invoked. The response is a bundle of type"]
3243#[doc = "\"searchset\". At a minimum, the patient resource(s) itself is returned, along with any other"]
3244#[doc = "resources that the server has that are related to the patient(s), and that are available for the"]
3245#[doc = "given user. The server also returns whatever resources are needed to support the records - e.g."]
3246#[doc = "linked practitioners, medications, locations, organizations etc."]
3247#[doc = ""]
3248#[doc = "The intended use for this operation is to provide a patient with access to their entire record (e.g."]
3249#[doc = "\"Blue Button\"), or for provider or other user to perform a bulk data download. The server SHOULD"]
3250#[doc = "return at least all resources that it has that are in the patient compartment for the identified"]
3251#[doc = "patient(s), and any resource referenced from those, including binaries and attachments. In the US"]
3252#[doc = "Realm, at a minimum, the resources returned SHALL include all the data covered by the meaningful use"]
3253#[doc = "common data elements as defined in the US Core Implementation Guide. Other applicable implementation"]
3254#[doc = "guides may make additional rules about how much information that is returned."]
3255pub mod PatientEverything {
3256 use haste_fhir_model::r4::generated::resources::{
3257 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
3258 };
3259 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRDate, FHIRInstant, FHIRInteger};
3260 use haste_fhir_operation_error::OperationOutcomeError;
3261 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3262 use std::sync::LazyLock;
3263 pub const CODE: &str = "everything";
3264 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Patient-everything","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Fetch Patient Record</h2><p>OPERATION: Fetch Patient Record</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Patient-everything</pre><div><p>This operation is used to return all the information related to one or more patients described in the resource or context on which this operation is invoked. The response is a bundle of type "searchset". At a minimum, the patient resource(s) itself is returned, along with any other resources that the server has that are related to the patient(s), and that are available for the given user. The server also returns whatever resources are needed to support the records - e.g. linked practitioners, medications, locations, organizations etc.</p>\n<p>The intended use for this operation is to provide a patient with access to their entire record (e.g. "Blue Button"), or for provider or other user to perform a bulk data download. The server SHOULD return at least all resources that it has that are in the patient compartment for the identified patient(s), and any resource referenced from those, including binaries and attachments. In the US Realm, at a minimum, the resources returned SHALL include all the data covered by the meaningful use common data elements as defined in the US Core Implementation Guide. Other applicable implementation guides may make additional rules about how much information that is returned.</p>\n</div><p>URL: [base]/Patient/$everything</p><p>URL: [base]/Patient/[id]/$everything</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>start</td><td>0..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no start date is provided, all records prior to the end date are in scope.</p>\n</div></td></tr><tr><td>IN</td><td>end</td><td>0..1</td><td><a href=\"datatypes.html#date\">date</a></td><td/><td><div><p>The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no end date is provided, all records subsequent to the start date are in scope.</p>\n</div></td></tr><tr><td>IN</td><td>_since</td><td>0..1</td><td><a href=\"datatypes.html#instant\">instant</a></td><td/><td><div><p>Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time</p>\n</div></td></tr><tr><td>IN</td><td>_type</td><td>0..*</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>One or more parameters, each containing one or more comma-delimited FHIR resource types to include in the return resources. In the absence of any specified types, the server returns all resource types</p>\n</div></td></tr><tr><td>IN</td><td>_count</td><td>0..1</td><td><a href=\"datatypes.html#integer\">integer</a></td><td/><td><div><p>See discussion below on the utility of paging through the results of the $everything operation</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The bundle type is "searchset"</p>\n</div></td></tr></table><div><p>The key differences between this operation and simply searching the patient compartment are:</p>\n<ul>\n<li>unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging)</li>\n<li>the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones).</li>\n</ul>\n<p>This frees the client from needing to determine what it could or should ask for, particularly with regard to included resources. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the patient compartment.</p>\n<p>It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one, or can determine an appropriate list of patients to provide data for from the context of the request. If there is no nominated patient (GET /Patient/$everything) and the context is not associated with a single patient record, the actual list of patients is all patients that the user associated with the request has access to. This may be all patients in the family that the patient has access to, or it may be all patients that a care provider has access to, or all patients on the entire record system. In such cases, the server may choose to return an error rather than all the records. Specifying the relationship between the context, a user and patient records is outside the scope of this specification (though see <a href=\"http://hl7.org/fhir/smart-app-launch\">The Smart App Launch Implementation Guide</a>.</p>\n<p>When this operation is used to access multiple patient records at once, the return bundle could be rather a lot of data; servers may choose to require that such requests are made <a href=\"async.html\">asynchronously</a>, and associated with <a href=\"formats.html#bulk\">bulk data formats</a>. Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for <a href=\"http.html#paging\">Searching</a>, using the <a href=\"search.html#count\">_count</a> parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so.</p>\n<p>The _since parameter is provided to support periodic queries to get additional information that has changed about the patient since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Patient-everything","version":"4.0.1","name":"Fetch Patient Record","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation is used to return all the information related to one or more patients described in the resource or context on which this operation is invoked. The response is a bundle of type \"searchset\". At a minimum, the patient resource(s) itself is returned, along with any other resources that the server has that are related to the patient(s), and that are available for the given user. The server also returns whatever resources are needed to support the records - e.g. linked practitioners, medications, locations, organizations etc. \n\nThe intended use for this operation is to provide a patient with access to their entire record (e.g. \"Blue Button\"), or for provider or other user to perform a bulk data download. The server SHOULD return at least all resources that it has that are in the patient compartment for the identified patient(s), and any resource referenced from those, including binaries and attachments. In the US Realm, at a minimum, the resources returned SHALL include all the data covered by the meaningful use common data elements as defined in the US Core Implementation Guide. Other applicable implementation guides may make additional rules about how much information that is returned.","code":"everything","comment":"The key differences between this operation and simply searching the patient compartment are: \n\n* unless the client requests otherwise, the server returns the entire result set in a single bundle (rather than using paging) \n* the server is responsible for determining what resources to return as included resources (rather than the client specifying which ones). \n\nThis frees the client from needing to determine what it could or should ask for, particularly with regard to included resources. Servers should consider returning appropriate Provenance and AuditTrail on the returned resources, even though these are not directly part of the patient compartment. \n\nIt is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one, or can determine an appropriate list of patients to provide data for from the context of the request. If there is no nominated patient (GET /Patient/$everything) and the context is not associated with a single patient record, the actual list of patients is all patients that the user associated with the request has access to. This may be all patients in the family that the patient has access to, or it may be all patients that a care provider has access to, or all patients on the entire record system. In such cases, the server may choose to return an error rather than all the records. Specifying the relationship between the context, a user and patient records is outside the scope of this specification (though see [The Smart App Launch Implementation Guide](http://hl7.org/fhir/smart-app-launch). \n\nWhen this operation is used to access multiple patient records at once, the return bundle could be rather a lot of data; servers may choose to require that such requests are made [asynchronously](async.html), and associated with [bulk data formats](formats.html#bulk). Alternatively, clients may choose to page through the result set (or servers may require this). Paging through the results is done the same as for [Searching](http.html#paging), using the [_count](search.html#count) parameter, and Bundle links. Implementers should note that paging will be slower than simply returning all the results at once (more network traffic, multiple latency delays) but may be required in order not to exhaust available memory reading or writing the whole response in a single package. Unlike searching, there is no inherent user-display order for the $everything operation. Servers might consider sorting the returned resources in descending order of last record update, but are not required to do so.\n\nThe _since parameter is provided to support periodic queries to get additional information that has changed about the patient since the last query. This means that the _since parameter is based on record time. The value of the _since parameter should be set to the time from the server. If using direct response, this is the timestamp in the response header. If using the async interface, this is the transaction timestamp in the json response. Servers should ensure that the timestamps a managed such that the client does not miss any changes. Clients should be able to handle getting the same response more than once in the case that the transaction falls on a time boundary. Clients should ensure that the other query parameters are constant to ensure a coherent set of records when doing periodic queries.","resource":["Patient"],"system":false,"type":true,"instance":true,"parameter":[{"name":"start","use":"in","min":0,"max":"1","documentation":"The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no start date is provided, all records prior to the end date are in scope.","type":"date"},{"name":"end","use":"in","min":0,"max":"1","documentation":"The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no end date is provided, all records subsequent to the start date are in scope.","type":"date"},{"name":"_since","use":"in","min":0,"max":"1","documentation":"Resources updated after this period will be included in the response. The intent of this parameter is to allow a client to request only records that have changed since the last request, based on either the return header time, or or (for asynchronous use), the transaction time","type":"instant"},{"name":"_type","use":"in","min":0,"max":"*","documentation":"One or more parameters, each containing one or more comma-delimited FHIR resource types to include in the return resources. In the absence of any specified types, the server returns all resource types","type":"code"},{"name":"_count","use":"in","min":0,"max":"1","documentation":"See discussion below on the utility of paging through the results of the $everything operation","type":"integer"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The bundle type is \"searchset\"","type":"Bundle"}]}"#;
3265 #[doc = "The `OperationDefinition` this module was generated from."]
3266 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3267 serde_json::from_str(OPERATION_DEFINITION_JSON)
3268 .expect("Generated OperationDefinition JSON must deserialize.")
3269 });
3270 #[derive(Debug, FromParameters, ToParameters)]
3271 pub struct Input {
3272 #[doc = "The date range relates to care dates, not record currency dates - e.g. all records relating to care"]
3273 #[doc = "provided in a certain date range. If no start date is provided, all records prior to the end date"]
3274 #[doc = "are in scope."]
3275 pub start: Option<FHIRDate>,
3276 #[doc = "The date range relates to care dates, not record currency dates - e.g. all records relating to care"]
3277 #[doc = "provided in a certain date range. If no end date is provided, all records subsequent to the start"]
3278 #[doc = "date are in scope."]
3279 pub end: Option<FHIRDate>,
3280 #[doc = "Resources updated after this period will be included in the response. The intent of this parameter"]
3281 #[doc = "is to allow a client to request only records that have changed since the last request, based on"]
3282 #[doc = "either the return header time, or or (for asynchronous use), the transaction time"]
3283 #[parameter_rename = "_since"]
3284 pub since: Option<FHIRInstant>,
3285 #[doc = "One or more parameters, each containing one or more comma-delimited FHIR resource types to include"]
3286 #[doc = "in the return resources. In the absence of any specified types, the server returns all resource"]
3287 #[doc = "types"]
3288 #[parameter_rename = "_type"]
3289 pub type_: Option<Vec<FHIRCode>>,
3290 #[doc = "See discussion below on the utility of paging through the results of the $everything operation"]
3291 #[parameter_rename = "_count"]
3292 pub count: Option<FHIRInteger>,
3293 }
3294 impl From<Input> for Resource {
3295 fn from(value: Input) -> Self {
3296 let parameters: Vec<ParametersParameter> = value.into();
3297 Resource::Parameters(Parameters {
3298 parameter: Some(parameters),
3299 ..Default::default()
3300 })
3301 }
3302 }
3303 #[derive(Debug, FromParameters)]
3304 pub struct Output {
3305 #[doc = "The bundle type is \"searchset\""]
3306 #[parameter_rename = "return"]
3307 pub return_: Bundle,
3308 }
3309 impl From<Output> for Resource {
3310 fn from(value: Output) -> Self {
3311 Resource::Bundle(value.return_)
3312 }
3313 }
3314}
3315#[doc = "A Master Patient Index ([MPI](http://en.wikipedia.org/wiki/Enterprise_master_patient_index) ) is a"]
3316#[doc = "service used to manage patient identification in a context where multiple patient databases exist."]
3317#[doc = "Healthcare applications and middleware use the MPI to match patients between the databases, and to"]
3318#[doc = "store new patient details as they are encountered. `MPIs` are highly specialized applications, often"]
3319#[doc = "tailored extensively to the institution's particular mix of patients. `MPIs` can also be run on a"]
3320#[doc = "regional and national basis."]
3321#[doc = ""]
3322#[doc = "To ask an MPI to match a patient, clients use the \"$match\" operation, which accepts a patient"]
3323#[doc = "resource which may be only partially complete. The data provided is interpreted as an MPI input and"]
3324#[doc = "processed by an algorithm of some kind that uses the data to determine the most appropriate matches"]
3325#[doc = "in the patient set. Note that different MPI matching algorithms have different required inputs. The"]
3326#[doc = "generic $match operation does not specify any particular algorithm, nor a minimum set of information"]
3327#[doc = "that must be provided when asking for an MPI match operation to be performed, but many"]
3328#[doc = "implementations will have a set of minimum information, which may be declared in their definition of"]
3329#[doc = "the $match operation by specifying a profile on the resource parameter, indicating which properties"]
3330#[doc = "are required in the search. The patient resource submitted to the operation does not have to be"]
3331#[doc = "complete, nor does it need to pass validation (i.e. mandatory fields don't need to be populated),"]
3332#[doc = "but it does have to be a valid instance, as it is used as the reference data to match against."]
3333pub mod PatientMatch {
3334 use haste_fhir_model::r4::generated::resources::{
3335 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
3336 };
3337 use haste_fhir_model::r4::generated::types::{FHIRBoolean, FHIRInteger};
3338 use haste_fhir_operation_error::OperationOutcomeError;
3339 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3340 use std::sync::LazyLock;
3341 pub const CODE: &str = "match";
3342 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Patient-match","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Find patient matches using MPI based logic</h2><p>OPERATION: Find patient matches using MPI based logic</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Patient-match</pre><div><p>A Master Patient Index (<a href=\"http://en.wikipedia.org/wiki/Enterprise_master_patient_index\">MPI</a> ) is a service used to manage patient identification in a context where multiple patient databases exist. Healthcare applications and middleware use the MPI to match patients between the databases, and to store new patient details as they are encountered. MPIs are highly specialized applications, often tailored extensively to the institution's particular mix of patients. MPIs can also be run on a regional and national basis.</p>\n<p>To ask an MPI to match a patient, clients use the "$match" operation, which accepts a patient resource which may be only partially complete. The data provided is interpreted as an MPI input and processed by an algorithm of some kind that uses the data to determine the most appropriate matches in the patient set. Note that different MPI matching algorithms have different required inputs. The generic $match operation does not specify any particular algorithm, nor a minimum set of information that must be provided when asking for an MPI match operation to be performed, but many implementations will have a set of minimum information, which may be declared in their definition of the $match operation by specifying a profile on the resource parameter, indicating which properties are required in the search. The patient resource submitted to the operation does not have to be complete, nor does it need to pass validation (i.e. mandatory fields don't need to be populated), but it does have to be a valid instance, as it is used as the reference data to match against.</p>\n</div><p>URL: [base]/Patient/$match</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>resource</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>Use this to provide an entire set of patient details for the MPI to match against (e.g. POST a patient record to Patient/$match).</p>\n</div></td></tr><tr><td>IN</td><td>onlyCertainMatches</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If there are multiple potential matches, then the match should not return the results with this flag set to true. When false, the server may return multiple results with each result graded accordingly.</p>\n</div></td></tr><tr><td>IN</td><td>count</td><td>0..1</td><td><a href=\"datatypes.html#integer\">integer</a></td><td/><td><div><p>The maximum number of records to return. If no value is provided, the server decides how many matches to return. Note that clients should be careful when using this, as it may prevent probable - and valid - matches from being returned</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>A bundle contain a set of Patient records that represent possible matches, optionally it may also contain an OperationOutcome with further information about the search results (such as warnings or information messages, such as a count of records that were close but eliminated) If the operation was unsuccessful, then an OperationOutcome may be returned along with a BadRequest status Code (e.g. security issue, or insufficient properties in patient fragment - check against profile)</p>\n</div></td></tr></table><div><p>The response from an "mpi" query is a bundle containing patient records, ordered from most likely to least likely. If there are no patient matches, the MPI SHALL return an empty search set with no error, but may include an operation outcome with further advice regarding patient selection. All patient records SHALL have a search score from 0 to 1, where 1 is the most certain match, along with an extension "<a href=\"extension-match-grade.html\">match-grade</a>" that indicates the MPI's position on the match quality.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Patient-match","version":"4.0.1","name":"Find patient matches using MPI based logic","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"A Master Patient Index ([MPI](http://en.wikipedia.org/wiki/Enterprise_master_patient_index) ) is a service used to manage patient identification in a context where multiple patient databases exist. Healthcare applications and middleware use the MPI to match patients between the databases, and to store new patient details as they are encountered. MPIs are highly specialized applications, often tailored extensively to the institution's particular mix of patients. MPIs can also be run on a regional and national basis. \n\nTo ask an MPI to match a patient, clients use the \"$match\" operation, which accepts a patient resource which may be only partially complete. The data provided is interpreted as an MPI input and processed by an algorithm of some kind that uses the data to determine the most appropriate matches in the patient set. Note that different MPI matching algorithms have different required inputs. The generic $match operation does not specify any particular algorithm, nor a minimum set of information that must be provided when asking for an MPI match operation to be performed, but many implementations will have a set of minimum information, which may be declared in their definition of the $match operation by specifying a profile on the resource parameter, indicating which properties are required in the search. The patient resource submitted to the operation does not have to be complete, nor does it need to pass validation (i.e. mandatory fields don't need to be populated), but it does have to be a valid instance, as it is used as the reference data to match against.","code":"match","comment":"The response from an \"mpi\" query is a bundle containing patient records, ordered from most likely to least likely. If there are no patient matches, the MPI SHALL return an empty search set with no error, but may include an operation outcome with further advice regarding patient selection. All patient records SHALL have a search score from 0 to 1, where 1 is the most certain match, along with an extension \"[match-grade](extension-match-grade.html)\" that indicates the MPI's position on the match quality.","resource":["Patient"],"system":false,"type":true,"instance":false,"parameter":[{"name":"resource","use":"in","min":1,"max":"1","documentation":"Use this to provide an entire set of patient details for the MPI to match against (e.g. POST a patient record to Patient/$match).","type":"Resource"},{"name":"onlyCertainMatches","use":"in","min":0,"max":"1","documentation":"If there are multiple potential matches, then the match should not return the results with this flag set to true. When false, the server may return multiple results with each result graded accordingly.","type":"boolean"},{"name":"count","use":"in","min":0,"max":"1","documentation":"The maximum number of records to return. If no value is provided, the server decides how many matches to return. Note that clients should be careful when using this, as it may prevent probable - and valid - matches from being returned","type":"integer"},{"name":"return","use":"out","min":1,"max":"1","documentation":"A bundle contain a set of Patient records that represent possible matches, optionally it may also contain an `OperationOutcome` with further information about the search results (such as warnings or information messages, such as a count of records that were close but eliminated) If the operation was unsuccessful, then an `OperationOutcome` may be returned along with a `BadRequest` status Code (e.g. security issue, or insufficient properties in patient fragment - check against profile)","type":"Bundle"}]}"#;
3343 #[doc = "The `OperationDefinition` this module was generated from."]
3344 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3345 serde_json::from_str(OPERATION_DEFINITION_JSON)
3346 .expect("Generated OperationDefinition JSON must deserialize.")
3347 });
3348 #[derive(Debug, FromParameters, ToParameters)]
3349 pub struct Input {
3350 #[doc = "Use this to provide an entire set of patient details for the MPI to match against (e.g. POST a"]
3351 #[doc = "patient record to Patient/$match)."]
3352 pub resource: Resource,
3353 #[doc = "If there are multiple potential matches, then the match should not return the results with this flag"]
3354 #[doc = "set to true. When false, the server may return multiple results with each result graded accordingly."]
3355 pub onlyCertainMatches: Option<FHIRBoolean>,
3356 #[doc = "The maximum number of records to return. If no value is provided, the server decides how many"]
3357 #[doc = "matches to return. Note that clients should be careful when using this, as it may prevent probable -"]
3358 #[doc = "and valid - matches from being returned"]
3359 pub count: Option<FHIRInteger>,
3360 }
3361 impl From<Input> for Resource {
3362 fn from(value: Input) -> Self {
3363 let parameters: Vec<ParametersParameter> = value.into();
3364 Resource::Parameters(Parameters {
3365 parameter: Some(parameters),
3366 ..Default::default()
3367 })
3368 }
3369 }
3370 #[derive(Debug, FromParameters)]
3371 pub struct Output {
3372 #[doc = "A bundle contain a set of Patient records that represent possible matches, optionally it may also"]
3373 #[doc = "contain an `OperationOutcome` with further information about the search results (such as warnings or"]
3374 #[doc = "information messages, such as a count of records that were close but eliminated) If the operation"]
3375 #[doc = "was unsuccessful, then an `OperationOutcome` may be returned along with a `BadRequest` status Code"]
3376 #[doc = "(e.g. security issue, or insufficient properties in patient fragment - check against profile)"]
3377 #[parameter_rename = "return"]
3378 pub return_: Bundle,
3379 }
3380 impl From<Output> for Resource {
3381 fn from(value: Output) -> Self {
3382 Resource::Bundle(value.return_)
3383 }
3384 }
3385}
3386#[doc = "The apply operation applies a `PlanDefinition` to a given context"]
3387pub mod PlanDefinitionApply {
3388 use haste_fhir_model::r4::generated::resources::{
3389 CarePlan, OperationDefinition, Parameters, ParametersParameter, PlanDefinition, Resource,
3390 };
3391 use haste_fhir_model::r4::generated::types::{CodeableConcept, FHIRString};
3392 use haste_fhir_operation_error::OperationOutcomeError;
3393 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3394 use std::sync::LazyLock;
3395 pub const CODE: &str = "apply";
3396 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"PlanDefinition-apply","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Apply</h2><p>OPERATION: Apply</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/PlanDefinition-apply</pre><div><p>The apply operation applies a PlanDefinition to a given context</p>\n</div><p>URL: [base]/PlanDefinition/$apply</p><p>URL: [base]/PlanDefinition/[id]/$apply</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>planDefinition</td><td>0..1</td><td><a href=\"plandefinition.html\">PlanDefinition</a></td><td/><td><div><p>The plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter is required</p>\n</div></td></tr><tr><td>IN</td><td>subject</td><td>1..*</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The subject(s) that is/are the target of the plan to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the PlanDefinition based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined</p>\n</div></td></tr><tr><td>IN</td><td>encounter</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The encounter in context, if any</p>\n</div></td></tr><tr><td>IN</td><td>practitioner</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The practitioner applying the plan definition</p>\n</div></td></tr><tr><td>IN</td><td>organization</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The organization applying the plan definition</p>\n</div></td></tr><tr><td>IN</td><td>userType</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>userLanguage</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Preferred language of the person using the system</p>\n</div></td></tr><tr><td>IN</td><td>userTaskContext</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources</p>\n</div></td></tr><tr><td>IN</td><td>setting</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The current setting of the request (inpatient, outpatient, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>settingContext</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Additional detail about the setting of the request, if any</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"careplan.html\">CarePlan</a></td><td/><td><div><p>The CarePlan that is the result of applying the plan definition</p>\n</div></td></tr></table><div><p>The result of this operation is a CarePlan resource with a single activity represented by a RequestGroup. The RequestGroup will have actions for each of the applicable actions in the plan based on evaluating the applicability condition in context. For each applicable action, the definition is applied as described in the $apply operation of the ActivityDefinition resource, and the resulting resource is added as an activity to the CarePlan. If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the PlanDefinition and ActivityDefinition resource documentation</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/PlanDefinition-apply","version":"4.0.1","name":"Apply","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The apply operation applies a `PlanDefinition` to a given context","code":"apply","comment":"The result of this operation is a CarePlan resource with a single activity represented by a RequestGroup. The RequestGroup will have actions for each of the applicable actions in the plan based on evaluating the applicability condition in context. For each applicable action, the definition is applied as described in the $apply operation of the ActivityDefinition resource, and the resulting resource is added as an activity to the CarePlan. If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the PlanDefinition and ActivityDefinition resource documentation","resource":["PlanDefinition"],"system":false,"type":true,"instance":true,"parameter":[{"name":"planDefinition","use":"in","min":0,"max":"1","documentation":"The plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter is required","type":"PlanDefinition"},{"name":"subject","use":"in","min":1,"max":"*","documentation":"The subject(s) that is/are the target of the plan to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the `PlanDefinition` based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined","type":"string","searchType":"reference"},{"name":"encounter","use":"in","min":0,"max":"1","documentation":"The encounter in context, if any","type":"string","searchType":"reference"},{"name":"practitioner","use":"in","min":0,"max":"1","documentation":"The practitioner applying the plan definition","type":"string","searchType":"reference"},{"name":"organization","use":"in","min":0,"max":"1","documentation":"The organization applying the plan definition","type":"string","searchType":"reference"},{"name":"userType","use":"in","min":0,"max":"1","documentation":"The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)","type":"CodeableConcept"},{"name":"userLanguage","use":"in","min":0,"max":"1","documentation":"Preferred language of the person using the system","type":"CodeableConcept"},{"name":"userTaskContext","use":"in","min":0,"max":"1","documentation":"The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources","type":"CodeableConcept"},{"name":"setting","use":"in","min":0,"max":"1","documentation":"The current setting of the request (inpatient, outpatient, etc.)","type":"CodeableConcept"},{"name":"settingContext","use":"in","min":0,"max":"1","documentation":"Additional detail about the setting of the request, if any","type":"CodeableConcept"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The `CarePlan` that is the result of applying the plan definition","type":"CarePlan"}]}"#;
3397 #[doc = "The `OperationDefinition` this module was generated from."]
3398 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3399 serde_json::from_str(OPERATION_DEFINITION_JSON)
3400 .expect("Generated OperationDefinition JSON must deserialize.")
3401 });
3402 #[derive(Debug, FromParameters, ToParameters)]
3403 pub struct Input {
3404 #[doc = "The plan definition to be applied. If the operation is invoked at the instance level, this parameter"]
3405 #[doc = "is not allowed; if the operation is invoked at the type level, this parameter is required"]
3406 pub planDefinition: Option<PlanDefinition>,
3407 #[doc = "The subject(s) that is/are the target of the plan to be applied. The subject may be a Patient,"]
3408 #[doc = "Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be"]
3409 #[doc = "resolved as the subject of the `PlanDefinition` based on the type of the subject. If multiple"]
3410 #[doc = "subjects of the same type are provided, the behavior is implementation-defined"]
3411 pub subject: Vec<FHIRString>,
3412 #[doc = "The encounter in context, if any"]
3413 pub encounter: Option<FHIRString>,
3414 #[doc = "The practitioner applying the plan definition"]
3415 pub practitioner: Option<FHIRString>,
3416 #[doc = "The organization applying the plan definition"]
3417 pub organization: Option<FHIRString>,
3418 #[doc = "The type of user initiating the request, e.g. patient, healthcare provider, or specific type of"]
3419 #[doc = "healthcare provider (physician, nurse, etc.)"]
3420 pub userType: Option<CodeableConcept>,
3421 #[doc = "Preferred language of the person using the system"]
3422 pub userLanguage: Option<CodeableConcept>,
3423 #[doc = "The task the system user is performing, e.g. laboratory results review, medication list review, etc."]
3424 #[doc = "This information can be used to tailor decision support outputs, such as recommended information"]
3425 #[doc = "resources"]
3426 pub userTaskContext: Option<CodeableConcept>,
3427 #[doc = "The current setting of the request (inpatient, outpatient, etc.)"]
3428 pub setting: Option<CodeableConcept>,
3429 #[doc = "Additional detail about the setting of the request, if any"]
3430 pub settingContext: Option<CodeableConcept>,
3431 }
3432 impl From<Input> for Resource {
3433 fn from(value: Input) -> Self {
3434 let parameters: Vec<ParametersParameter> = value.into();
3435 Resource::Parameters(Parameters {
3436 parameter: Some(parameters),
3437 ..Default::default()
3438 })
3439 }
3440 }
3441 #[derive(Debug, FromParameters)]
3442 pub struct Output {
3443 #[doc = "The `CarePlan` that is the result of applying the plan definition"]
3444 #[parameter_rename = "return"]
3445 pub return_: CarePlan,
3446 }
3447 impl From<Output> for Resource {
3448 fn from(value: Output) -> Self {
3449 Resource::CarePlan(value.return_)
3450 }
3451 }
3452}
3453#[doc = "The data-requirements operation aggregates and returns the parameters and data requirements for the"]
3454#[doc = "plan definition and all its dependencies as a single module definition library"]
3455pub mod PlanDefinitionDataRequirements {
3456 use haste_fhir_model::r4::generated::resources::{
3457 Library, OperationDefinition, Parameters, ParametersParameter, Resource,
3458 };
3459 use haste_fhir_operation_error::OperationOutcomeError;
3460 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3461 use std::sync::LazyLock;
3462 pub const CODE: &str = "data-requirements";
3463 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"PlanDefinition-data-requirements","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Data Requirements</h2><p>OPERATION: Data Requirements</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/PlanDefinition-data-requirements</pre><div><p>The data-requirements operation aggregates and returns the parameters and data requirements for the plan definition and all its dependencies as a single module definition library</p>\n</div><p>URL: [base]/PlanDefinition/[id]/$data-requirements</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"library.html\">Library</a></td><td/><td><div><p>The result of the requirements gathering is a module-definition Library that describes the aggregate parameters, data requirements, and dependencies of the plan definition</p>\n</div></td></tr></table><div><p>The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for the plan definition. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the plan definition and any libraries referenced by it. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements)</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/PlanDefinition-data-requirements","version":"4.0.1","name":"Data Requirements","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The data-requirements operation aggregates and returns the parameters and data requirements for the plan definition and all its dependencies as a single module definition library","code":"data-requirements","comment":"The effect of invoking this operation is to determine the aggregate set of data requirements and dependencies for the plan definition. The result is a Library resource with a type of module-definition that contains all the parameter definitions and data requirements of the plan definition and any libraries referenced by it. Implementations SHOULD aggregate data requirements intelligently (i.e. by collapsing overlapping data requirements)","resource":["PlanDefinition"],"system":false,"type":false,"instance":true,"parameter":[{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the requirements gathering is a module-definition Library that describes the aggregate parameters, data requirements, and dependencies of the plan definition","type":"Library"}]}"#;
3464 #[doc = "The `OperationDefinition` this module was generated from."]
3465 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3466 serde_json::from_str(OPERATION_DEFINITION_JSON)
3467 .expect("Generated OperationDefinition JSON must deserialize.")
3468 });
3469 #[derive(Debug, FromParameters, ToParameters)]
3470 pub struct Input {}
3471 impl From<Input> for Resource {
3472 fn from(value: Input) -> Self {
3473 let parameters: Vec<ParametersParameter> = value.into();
3474 Resource::Parameters(Parameters {
3475 parameter: Some(parameters),
3476 ..Default::default()
3477 })
3478 }
3479 }
3480 #[derive(Debug, FromParameters)]
3481 pub struct Output {
3482 #[doc = "The result of the requirements gathering is a module-definition Library that describes the aggregate"]
3483 #[doc = "parameters, data requirements, and dependencies of the plan definition"]
3484 #[parameter_rename = "return"]
3485 pub return_: Library,
3486 }
3487 impl From<Output> for Resource {
3488 fn from(value: Output) -> Self {
3489 Resource::Library(value.return_)
3490 }
3491 }
3492}
3493#[doc = "This operation takes a resource in one form, and returns to in another form. Both input and output"]
3494#[doc = "are a single resource. The primary use of this operation is to convert between formats (e.g. (XML ->"]
3495#[doc = "JSON or vice versa)"]
3496pub mod ResourceConvert {
3497 use haste_fhir_model::r4::generated::resources::{
3498 OperationDefinition, Parameters, ParametersParameter, Resource,
3499 };
3500 use haste_fhir_operation_error::OperationOutcomeError;
3501 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3502 use std::sync::LazyLock;
3503 pub const CODE: &str = "convert";
3504 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Resource-convert","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Convert from one form to another</h2><p>OPERATION: Convert from one form to another</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Resource-convert</pre><div><p>This operation takes a resource in one form, and returns to in another form. Both input and output are a single resource. The primary use of this operation is to convert between formats (e.g. (XML -> JSON or vice versa)</p>\n</div><p>URL: [base]/$convert</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>input</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The resource that is to be converted</p>\n</div></td></tr><tr><td>OUT</td><td>output</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The resource after conversion</p>\n</div></td></tr></table><div><p>While the primary use of this operation is simple - converting a resource from one format to another, there are many potential uses including:</p>\n<ul>\n<li>converting resources from one version to another</li>\n<li>restructuring information in a resource (e.g. moving method into/out of Observation.code)</li>\n<li>extracting data from a questionnaire</li>\n<li>converting CDA documents or v2 messages (as a binary resource) to a bundle (or vice versa) (or even openEHR or openMHealth).</li>\n</ul>\n<p>These variants would all be associated with parameters that define and control these kind of conversions, though such parameters are not defined at this time. In the absence of any parameters, simple format conversion is all that will occur.</p>\n<p>For this reason, implementers should be aware that:</p>\n<ul>\n<li>the output resource type may be different from the input resource (particularly, it might be a bundle)</li>\n<li>binary resources may be represented directly using some other content-type (i.e. just post the content directly)</li>\n</ul>\n<p>Implementers are encouraged to provide feedback to HL7 about their use of this operation</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":1},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.org/fhir/OperationDefinition/Resource-convert","version":"4.0.1","name":"Convert from one form to another","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation takes a resource in one form, and returns to in another form. Both input and output are a single resource. The primary use of this operation is to convert between formats (e.g. (XML -> JSON or vice versa)","code":"convert","comment":"While the primary use of this operation is simple - converting a resource from one format to another, there are many potential uses including:\n\n* converting resources from one version to another\n* restructuring information in a resource (e.g. moving method into/out of Observation.code)\n* extracting data from a questionnaire\n* converting CDA documents or v2 messages (as a binary resource) to a bundle (or vice versa) (or even openEHR or openMHealth). \n\nThese variants would all be associated with parameters that define and control these kind of conversions, though such parameters are not defined at this time. In the absence of any parameters, simple format conversion is all that will occur.\n\nFor this reason, implementers should be aware that:\n\n* the output resource type may be different from the input resource (particularly, it might be a bundle)\n* binary resources may be represented directly using some other content-type (i.e. just post the content directly)\n\nImplementers are encouraged to provide feedback to HL7 about their use of this operation","resource":["Resource"],"system":true,"type":false,"instance":false,"parameter":[{"name":"input","use":"in","min":1,"max":"1","documentation":"The resource that is to be converted","type":"Resource"},{"name":"output","use":"out","min":1,"max":"1","documentation":"The resource after conversion","type":"Resource"}]}"#;
3505 #[doc = "The `OperationDefinition` this module was generated from."]
3506 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3507 serde_json::from_str(OPERATION_DEFINITION_JSON)
3508 .expect("Generated OperationDefinition JSON must deserialize.")
3509 });
3510 #[derive(Debug, FromParameters, ToParameters)]
3511 pub struct Input {
3512 #[doc = "The resource that is to be converted"]
3513 pub input: Resource,
3514 }
3515 impl From<Input> for Resource {
3516 fn from(value: Input) -> Self {
3517 let parameters: Vec<ParametersParameter> = value.into();
3518 Resource::Parameters(Parameters {
3519 parameter: Some(parameters),
3520 ..Default::default()
3521 })
3522 }
3523 }
3524 #[derive(Debug, FromParameters, ToParameters)]
3525 pub struct Output {
3526 #[doc = "The resource after conversion"]
3527 pub output: Resource,
3528 }
3529 impl From<Output> for Resource {
3530 fn from(value: Output) -> Self {
3531 let parameters: Vec<ParametersParameter> = value.into();
3532 Resource::Parameters(Parameters {
3533 parameter: Some(parameters),
3534 ..Default::default()
3535 })
3536 }
3537 }
3538}
3539#[doc = "Return an entire graph of resources based on a [`GraphDefinition`](graphdefinition.html). The"]
3540#[doc = "operation is invoked on a specific instance of a resource, and the graph definition tells the server"]
3541#[doc = "what other resources to return in the same packaage"]
3542pub mod ResourceGraph {
3543 use haste_fhir_model::r4::generated::resources::{
3544 Bundle, OperationDefinition, Parameters, ParametersParameter, Resource,
3545 };
3546 use haste_fhir_model::r4::generated::types::FHIRUri;
3547 use haste_fhir_operation_error::OperationOutcomeError;
3548 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3549 use std::sync::LazyLock;
3550 pub const CODE: &str = "graph";
3551 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Resource-graph","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Return a graph of resources</h2><p>OPERATION: Return a graph of resources</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Resource-graph</pre><div><p>Return an entire graph of resources based on a <a href=\"graphdefinition.html\">GraphDefinition</a>. The operation is invoked on a specific instance of a resource, and the graph definition tells the server what other resources to return in the same packaage</p>\n</div><p>URL: [base]/Resource/[id]/$graph</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>graph</td><td>1..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>Servers MAY choose to allow any graph definition to be specified, but MAY require that the client choose a graph definition from a specific list of known supported definitions. The server is not required to support a formal definition of the graph on the end point</p>\n</div></td></tr><tr><td>OUT</td><td>result</td><td>1..1</td><td><a href=\"bundle.html\">Bundle</a></td><td/><td><div><p>The set of resources that were in the graph based on the provided definition</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":1},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Resource-graph","version":"4.0.1","name":"Return a graph of resources","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Return an entire graph of resources based on a [`GraphDefinition`](graphdefinition.html). The operation is invoked on a specific instance of a resource, and the graph definition tells the server what other resources to return in the same packaage","code":"graph","resource":["Resource"],"system":false,"type":false,"instance":true,"parameter":[{"name":"graph","use":"in","min":1,"max":"1","documentation":"Servers MAY choose to allow any graph definition to be specified, but MAY require that the client choose a graph definition from a specific list of known supported definitions. The server is not required to support a formal definition of the graph on the end point","type":"uri"},{"name":"result","use":"out","min":1,"max":"1","documentation":"The set of resources that were in the graph based on the provided definition","type":"Bundle"}]}"#;
3552 #[doc = "The `OperationDefinition` this module was generated from."]
3553 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3554 serde_json::from_str(OPERATION_DEFINITION_JSON)
3555 .expect("Generated OperationDefinition JSON must deserialize.")
3556 });
3557 #[derive(Debug, FromParameters, ToParameters)]
3558 pub struct Input {
3559 #[doc = "Servers MAY choose to allow any graph definition to be specified, but MAY require that the client"]
3560 #[doc = "choose a graph definition from a specific list of known supported definitions. The server is not"]
3561 #[doc = "required to support a formal definition of the graph on the end point"]
3562 pub graph: FHIRUri,
3563 }
3564 impl From<Input> for Resource {
3565 fn from(value: Input) -> Self {
3566 let parameters: Vec<ParametersParameter> = value.into();
3567 Resource::Parameters(Parameters {
3568 parameter: Some(parameters),
3569 ..Default::default()
3570 })
3571 }
3572 }
3573 #[derive(Debug, FromParameters, ToParameters)]
3574 pub struct Output {
3575 #[doc = "The set of resources that were in the graph based on the provided definition"]
3576 pub result: Bundle,
3577 }
3578 impl From<Output> for Resource {
3579 fn from(value: Output) -> Self {
3580 let parameters: Vec<ParametersParameter> = value.into();
3581 Resource::Parameters(Parameters {
3582 parameter: Some(parameters),
3583 ..Default::default()
3584 })
3585 }
3586 }
3587}
3588#[doc = "Execute a graphql statement on a since resource or against the entire system. See the [`Using"]
3589#[doc = "GraphQL with FHIR`](graphql.html) page for further details."]
3590#[doc = ""]
3591#[doc = "For the purposes of graphQL compatibility, this operation can also be invoked using a POST with the"]
3592#[doc = "graphQL as the body, or a JSON body (see [graphQL spec](http://graphql.org/) for details)"]
3593pub mod ResourceGraphql {
3594 use haste_fhir_model::r4::generated::resources::{
3595 Binary, OperationDefinition, Parameters, ParametersParameter, Resource,
3596 };
3597 use haste_fhir_model::r4::generated::types::FHIRString;
3598 use haste_fhir_operation_error::OperationOutcomeError;
3599 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3600 use std::sync::LazyLock;
3601 pub const CODE: &str = "graphql";
3602 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Resource-graphql","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Execute a graphql statement</h2><p>OPERATION: Execute a graphql statement</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Resource-graphql</pre><div><p>Execute a graphql statement on a since resource or against the entire system. See the <a href=\"graphql.html\">Using GraphQL with FHIR</a> page for further details.</p>\n<p>For the purposes of graphQL compatibility, this operation can also be invoked using a POST with the graphQL as the body, or a JSON body (see <a href=\"http://graphql.org/\">graphQL spec</a> for details)</p>\n</div><p>URL: [base]/$graphql</p><p>URL: [base]/Resource/[id]/$graphql</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>query</td><td>1..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td/></tr><tr><td>OUT</td><td>result</td><td>1..1</td><td><a href=\"binary.html\">Binary</a></td><td/><td><div><p>The content is always returned as application/json; this SHOULD be specified in the Accept header</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":1},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Resource-graphql","version":"4.0.1","name":"Execute a graphql statement","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Execute a graphql statement on a since resource or against the entire system. See the [Using GraphQL with FHIR](graphql.html) page for further details.\n\nFor the purposes of graphQL compatibility, this operation can also be invoked using a POST with the graphQL as the body, or a JSON body (see [graphQL spec](http://graphql.org/) for details)","code":"graphql","resource":["Resource"],"system":true,"type":false,"instance":true,"parameter":[{"name":"query","use":"in","min":1,"max":"1","type":"string"},{"name":"result","use":"out","min":1,"max":"1","documentation":"The content is always returned as application/json; this SHOULD be specified in the Accept header","type":"Binary"}]}"#;
3603 #[doc = "The `OperationDefinition` this module was generated from."]
3604 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3605 serde_json::from_str(OPERATION_DEFINITION_JSON)
3606 .expect("Generated OperationDefinition JSON must deserialize.")
3607 });
3608 #[derive(Debug, FromParameters, ToParameters)]
3609 pub struct Input {
3610 #[doc = "query"]
3611 pub query: FHIRString,
3612 }
3613 impl From<Input> for Resource {
3614 fn from(value: Input) -> Self {
3615 let parameters: Vec<ParametersParameter> = value.into();
3616 Resource::Parameters(Parameters {
3617 parameter: Some(parameters),
3618 ..Default::default()
3619 })
3620 }
3621 }
3622 #[derive(Debug, FromParameters, ToParameters)]
3623 pub struct Output {
3624 #[doc = "The content is always returned as application/json; this SHOULD be specified in the Accept header"]
3625 pub result: Binary,
3626 }
3627 impl From<Output> for Resource {
3628 fn from(value: Output) -> Self {
3629 let parameters: Vec<ParametersParameter> = value.into();
3630 Resource::Parameters(Parameters {
3631 parameter: Some(parameters),
3632 ..Default::default()
3633 })
3634 }
3635 }
3636}
3637#[doc = "This operation retrieves a summary of the profiles, tags, and security labels for the given scope;"]
3638#[doc = "e.g. for each scope:"]
3639#[doc = ""]
3640#[doc = "* system-wide: a list of all profiles, tags and security labels in use by the system"]
3641#[doc = "* resource-type level: A list of all profiles, tags, and security labels for the resource type"]
3642#[doc = "* individual resource level: A list of all profiles, tags, and security labels for the current"]
3643#[doc = "version of the resource. Also, as a special case, this operation (and other meta operations) can be"]
3644#[doc = "performed on a historical version of a resource)"]
3645pub mod ResourceMeta {
3646 use haste_fhir_model::r4::generated::resources::{
3647 OperationDefinition, Parameters, ParametersParameter, Resource,
3648 };
3649 use haste_fhir_model::r4::generated::types::Meta;
3650 use haste_fhir_operation_error::OperationOutcomeError;
3651 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3652 use std::sync::LazyLock;
3653 pub const CODE: &str = "meta";
3654 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Resource-meta","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Access a list of profiles, tags, and security labels</h2><p>OPERATION: Access a list of profiles, tags, and security labels</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Resource-meta</pre><div><p>This operation retrieves a summary of the profiles, tags, and security labels for the given scope; e.g. for each scope:</p>\n<ul>\n<li>system-wide: a list of all profiles, tags and security labels in use by the system</li>\n<li>resource-type level: A list of all profiles, tags, and security labels for the resource type</li>\n<li>individual resource level: A list of all profiles, tags, and security labels for the current version of the resource. Also, as a special case, this operation (and other meta operations) can be performed on a historical version of a resource)</li>\n</ul>\n</div><p>URL: [base]/$meta</p><p>URL: [base]/Resource/$meta</p><p>URL: [base]/Resource/[id]/$meta</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"resource.html#Meta\">Meta</a></td><td/><td><div><p>The meta returned by the operation</p>\n</div></td></tr></table><div><p>At the system and type levels, the $meta operation is used to get a summary of all the labels that are in use across the system. The principal use for this operation is to support search e.g. what tags can be searched for. At these levels, the meta will not contain versionId, lastUpdated etc. Systems are not obligated to implement the operation at this level (and should return a 4xx error if they don't). At the resource and historical entry level, the $meta operation returns the same meta as would be returned by accessing the resource directly. This can be used to allow a system to get access to the meta-information for the resource without accessing the resource itself, e.g. for security reasons</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":3},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Resource-meta","version":"4.0.1","name":"Access a list of profiles, tags, and security labels","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation retrieves a summary of the profiles, tags, and security labels for the given scope; e.g. for each scope: \n\n* system-wide: a list of all profiles, tags and security labels in use by the system \n* resource-type level: A list of all profiles, tags, and security labels for the resource type \n* individual resource level: A list of all profiles, tags, and security labels for the current version of the resource. Also, as a special case, this operation (and other meta operations) can be performed on a historical version of a resource)","code":"meta","comment":"At the system and type levels, the $meta operation is used to get a summary of all the labels that are in use across the system. The principal use for this operation is to support search e.g. what tags can be searched for. At these levels, the meta will not contain versionId, lastUpdated etc. Systems are not obligated to implement the operation at this level (and should return a 4xx error if they don't). At the resource and historical entry level, the $meta operation returns the same meta as would be returned by accessing the resource directly. This can be used to allow a system to get access to the meta-information for the resource without accessing the resource itself, e.g. for security reasons","resource":["Resource"],"system":true,"type":true,"instance":true,"parameter":[{"name":"return","use":"out","min":1,"max":"1","documentation":"The meta returned by the operation","type":"Meta"}]}"#;
3655 #[doc = "The `OperationDefinition` this module was generated from."]
3656 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3657 serde_json::from_str(OPERATION_DEFINITION_JSON)
3658 .expect("Generated OperationDefinition JSON must deserialize.")
3659 });
3660 #[derive(Debug, FromParameters, ToParameters)]
3661 pub struct Input {}
3662 impl From<Input> for Resource {
3663 fn from(value: Input) -> Self {
3664 let parameters: Vec<ParametersParameter> = value.into();
3665 Resource::Parameters(Parameters {
3666 parameter: Some(parameters),
3667 ..Default::default()
3668 })
3669 }
3670 }
3671 #[derive(Debug, FromParameters, ToParameters)]
3672 pub struct Output {
3673 #[doc = "The meta returned by the operation"]
3674 #[parameter_rename = "return"]
3675 pub return_: Meta,
3676 }
3677 impl From<Output> for Resource {
3678 fn from(value: Output) -> Self {
3679 let parameters: Vec<ParametersParameter> = value.into();
3680 Resource::Parameters(Parameters {
3681 parameter: Some(parameters),
3682 ..Default::default()
3683 })
3684 }
3685 }
3686}
3687#[doc = "This operation takes a meta, and adds the profiles, tags, and security labels found in it to the"]
3688#[doc = "nominated resource"]
3689pub mod ResourceMetaAdd {
3690 use haste_fhir_model::r4::generated::resources::{
3691 OperationDefinition, Parameters, ParametersParameter, Resource,
3692 };
3693 use haste_fhir_model::r4::generated::types::Meta;
3694 use haste_fhir_operation_error::OperationOutcomeError;
3695 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3696 use std::sync::LazyLock;
3697 pub const CODE: &str = "meta-add";
3698 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Resource-meta-add","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Add profiles, tags, and security labels to a resource</h2><p>OPERATION: Add profiles, tags, and security labels to a resource</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Resource-meta-add</pre><div><p>This operation takes a meta, and adds the profiles, tags, and security labels found in it to the nominated resource</p>\n</div><p>URL: [base]/Resource/[id]/$meta-add</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>meta</td><td>1..1</td><td><a href=\"resource.html#Meta\">Meta</a></td><td/><td><div><p>Profiles, tags, and security labels to add to the existing resource. Note that profiles, tags, and security labels are sets, and duplicates are not created. The identity of a tag or security label is the system+code. When matching existing tags during adding, version and display are ignored. For profiles, matching is based on the full URL</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"resource.html#Meta\">Meta</a></td><td/><td><div><p>Resulting meta for the resource</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":3},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Resource-meta-add","version":"4.0.1","name":"Add profiles, tags, and security labels to a resource","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation takes a meta, and adds the profiles, tags, and security labels found in it to the nominated resource","code":"meta-add","resource":["Resource"],"system":false,"type":false,"instance":true,"parameter":[{"name":"meta","use":"in","min":1,"max":"1","documentation":"Profiles, tags, and security labels to add to the existing resource. Note that profiles, tags, and security labels are sets, and duplicates are not created. The identity of a tag or security label is the system+code. When matching existing tags during adding, version and display are ignored. For profiles, matching is based on the full URL","type":"Meta"},{"name":"return","use":"out","min":1,"max":"1","documentation":"Resulting meta for the resource","type":"Meta"}]}"#;
3699 #[doc = "The `OperationDefinition` this module was generated from."]
3700 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3701 serde_json::from_str(OPERATION_DEFINITION_JSON)
3702 .expect("Generated OperationDefinition JSON must deserialize.")
3703 });
3704 #[derive(Debug, FromParameters, ToParameters)]
3705 pub struct Input {
3706 #[doc = "Profiles, tags, and security labels to add to the existing resource. Note that profiles, tags, and"]
3707 #[doc = "security labels are sets, and duplicates are not created. The identity of a tag or security label is"]
3708 #[doc = "the system+code. When matching existing tags during adding, version and display are ignored. For"]
3709 #[doc = "profiles, matching is based on the full URL"]
3710 pub meta: Meta,
3711 }
3712 impl From<Input> for Resource {
3713 fn from(value: Input) -> Self {
3714 let parameters: Vec<ParametersParameter> = value.into();
3715 Resource::Parameters(Parameters {
3716 parameter: Some(parameters),
3717 ..Default::default()
3718 })
3719 }
3720 }
3721 #[derive(Debug, FromParameters, ToParameters)]
3722 pub struct Output {
3723 #[doc = "Resulting meta for the resource"]
3724 #[parameter_rename = "return"]
3725 pub return_: Meta,
3726 }
3727 impl From<Output> for Resource {
3728 fn from(value: Output) -> Self {
3729 let parameters: Vec<ParametersParameter> = value.into();
3730 Resource::Parameters(Parameters {
3731 parameter: Some(parameters),
3732 ..Default::default()
3733 })
3734 }
3735 }
3736}
3737#[doc = "This operation takes a meta, and deletes the profiles, tags, and security labels found in it from"]
3738#[doc = "the nominated resource"]
3739pub mod ResourceMetaDelete {
3740 use haste_fhir_model::r4::generated::resources::{
3741 OperationDefinition, Parameters, ParametersParameter, Resource,
3742 };
3743 use haste_fhir_model::r4::generated::types::Meta;
3744 use haste_fhir_operation_error::OperationOutcomeError;
3745 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3746 use std::sync::LazyLock;
3747 pub const CODE: &str = "meta-delete";
3748 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Resource-meta-delete","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Delete profiles, tags, and security labels for a resource</h2><p>OPERATION: Delete profiles, tags, and security labels for a resource</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Resource-meta-delete</pre><div><p>This operation takes a meta, and deletes the profiles, tags, and security labels found in it from the nominated resource</p>\n</div><p>URL: [base]/Resource/[id]/$meta-delete</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>meta</td><td>1..1</td><td><a href=\"resource.html#Meta\">Meta</a></td><td/><td><div><p>Profiles, tags, and security labels to delete from the existing resource. It is not an error if these tags, profiles, and labels do not exist. The identity of a tag or security label is the system+code. When matching existing tags during deletion, version and display are ignored. For profiles, matching is based on the full URL</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"resource.html#Meta\">Meta</a></td><td/><td><div><p>Resulting meta for the resource</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":3},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/Resource-meta-delete","version":"4.0.1","name":"Delete profiles, tags, and security labels for a resource","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"This operation takes a meta, and deletes the profiles, tags, and security labels found in it from the nominated resource","code":"meta-delete","resource":["Resource"],"system":false,"type":false,"instance":true,"parameter":[{"name":"meta","use":"in","min":1,"max":"1","documentation":"Profiles, tags, and security labels to delete from the existing resource. It is not an error if these tags, profiles, and labels do not exist. The identity of a tag or security label is the system+code. When matching existing tags during deletion, version and display are ignored. For profiles, matching is based on the full URL","type":"Meta"},{"name":"return","use":"out","min":1,"max":"1","documentation":"Resulting meta for the resource","type":"Meta"}]}"#;
3749 #[doc = "The `OperationDefinition` this module was generated from."]
3750 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3751 serde_json::from_str(OPERATION_DEFINITION_JSON)
3752 .expect("Generated OperationDefinition JSON must deserialize.")
3753 });
3754 #[derive(Debug, FromParameters, ToParameters)]
3755 pub struct Input {
3756 #[doc = "Profiles, tags, and security labels to delete from the existing resource. It is not an error if"]
3757 #[doc = "these tags, profiles, and labels do not exist. The identity of a tag or security label is the"]
3758 #[doc = "system+code. When matching existing tags during deletion, version and display are ignored. For"]
3759 #[doc = "profiles, matching is based on the full URL"]
3760 pub meta: Meta,
3761 }
3762 impl From<Input> for Resource {
3763 fn from(value: Input) -> Self {
3764 let parameters: Vec<ParametersParameter> = value.into();
3765 Resource::Parameters(Parameters {
3766 parameter: Some(parameters),
3767 ..Default::default()
3768 })
3769 }
3770 }
3771 #[derive(Debug, FromParameters, ToParameters)]
3772 pub struct Output {
3773 #[doc = "Resulting meta for the resource"]
3774 #[parameter_rename = "return"]
3775 pub return_: Meta,
3776 }
3777 impl From<Output> for Resource {
3778 fn from(value: Output) -> Self {
3779 let parameters: Vec<ParametersParameter> = value.into();
3780 Resource::Parameters(Parameters {
3781 parameter: Some(parameters),
3782 ..Default::default()
3783 })
3784 }
3785 }
3786}
3787#[doc = "The validate operation checks whether the attached content would be acceptable either generally, as"]
3788#[doc = "a create, an update or as a delete to an existing resource. The action the server takes depends on"]
3789#[doc = "the mode parameter:"]
3790#[doc = ""]
3791#[doc = "* [mode not provided]: The server checks the content of the resource against any schema, constraint"]
3792#[doc = "rules, and other general terminology rules"]
3793#[doc = "* create: The server checks the content, and then checks that the content would be acceptable as a"]
3794#[doc = "create (e.g. that the content would not violate any uniqueness constraints)"]
3795#[doc = "* update: The server checks the content, and then checks that it would accept it as an update"]
3796#[doc = "against the nominated specific resource (e.g. that there are no changes to immutable fields the"]
3797#[doc = "server does not allow to change, and checking version integrity if appropriate)"]
3798#[doc = "* delete: The server ignores the content, and checks that the nominated resource is allowed to be"]
3799#[doc = "deleted (e.g. checking referential integrity rules)"]
3800#[doc = ""]
3801#[doc = "Modes update and delete can only be used when the operation is invoked at the resource instance"]
3802#[doc = "level. The return from this operation is an [`OperationOutcome`](operationoutcome.html)"]
3803#[doc = ""]
3804#[doc = "Note that this operation is not the only way to validate resources - see [`Validating"]
3805#[doc = "Resources`](validation.html) for further information."]
3806pub mod ResourceValidate {
3807 use haste_fhir_model::r4::generated::resources::{
3808 OperationDefinition, OperationOutcome, Parameters, ParametersParameter, Resource,
3809 };
3810 use haste_fhir_model::r4::generated::types::{FHIRCode, FHIRUri};
3811 use haste_fhir_operation_error::OperationOutcomeError;
3812 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3813 use std::sync::LazyLock;
3814 pub const CODE: &str = "validate";
3815 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"Resource-validate","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Validate a resource</h2><p>OPERATION: Validate a resource</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/Resource-validate</pre><div><p>The validate operation checks whether the attached content would be acceptable either generally, as a create, an update or as a delete to an existing resource. The action the server takes depends on the mode parameter:</p>\n<ul>\n<li>[mode not provided]: The server checks the content of the resource against any schema, constraint rules, and other general terminology rules</li>\n<li>create: The server checks the content, and then checks that the content would be acceptable as a create (e.g. that the content would not violate any uniqueness constraints)</li>\n<li>update: The server checks the content, and then checks that it would accept it as an update against the nominated specific resource (e.g. that there are no changes to immutable fields the server does not allow to change, and checking version integrity if appropriate)</li>\n<li>delete: The server ignores the content, and checks that the nominated resource is allowed to be deleted (e.g. checking referential integrity rules)</li>\n</ul>\n<p>Modes update and delete can only be used when the operation is invoked at the resource instance level. The return from this operation is an <a href=\"operationoutcome.html\">OperationOutcome</a></p>\n<p>Note that this operation is not the only way to validate resources - see <a href=\"validation.html\">Validating Resources</a> for further information.</p>\n</div><p>URL: [base]/Resource/$validate</p><p>URL: [base]/Resource/[id]/$validate</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>resource</td><td>0..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>Must be present unless the mode is "delete"</p>\n</div></td></tr><tr><td>IN</td><td>mode</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td><a href=\"valueset-resource-validation-mode.html\">http://hl7.org/fhir/ValueSet/resource-validation-mode|4.0.1</a> (Required)</td><td><div><p>Default is 'no action'; (e.g. general validation)</p>\n</div></td></tr><tr><td>IN</td><td>profile</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>If this is nominated, then the resource is validated against this specific profile. If a profile is nominated, and the server cannot validate against the nominated profile, it SHALL return an error</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"operationoutcome.html\">OperationOutcome</a></td><td/><td><div><p>If the operation outcome does not list any errors, and a mode was specified, then this is an indication that the operation would be expected to succeed (excepting for transactional integrity issues, see below)</p>\n</div></td></tr></table><div><p>This operation may be used during design and development to validate application design. It can also be used at run-time. One possible use might be that a client asks the server whether a proposed update is valid as the user is editing a dialog and displays an updated error to the user. The operation can be used as part of a light-weight two phase commit protocol but there is no expectation that the server will hold the content of the resource after this operation is used, or that the server guarantees to successfully perform an actual create, update or delete after the validation operation completes.</p>\n<p>This operation returns a 200 OK whether or not the resource is valid. A 4xx or 5xx error means that the validation itself could not be performed, and it is unknown whether the resource is valid or not.</p>\n<p>Note: the correct behaviour of validation with regard to language (especially for Coding.display) is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases</p>\n<p>Future versions of this specifcation may add additional validation parameters. A candidate list is maintained with the <a href=\"https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator\">FHIR Validator Documentation</a></p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"normative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version","valueCode":"4.0.1"}],"url":"http://hl7.org/fhir/OperationDefinition/Resource-validate","version":"4.0.1","name":"Validate a resource","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The validate operation checks whether the attached content would be acceptable either generally, as a create, an update or as a delete to an existing resource. The action the server takes depends on the mode parameter: \n\n* [mode not provided]: The server checks the content of the resource against any schema, constraint rules, and other general terminology rules \n* create: The server checks the content, and then checks that the content would be acceptable as a create (e.g. that the content would not violate any uniqueness constraints) \n* update: The server checks the content, and then checks that it would accept it as an update against the nominated specific resource (e.g. that there are no changes to immutable fields the server does not allow to change, and checking version integrity if appropriate) \n* delete: The server ignores the content, and checks that the nominated resource is allowed to be deleted (e.g. checking referential integrity rules) \n\nModes update and delete can only be used when the operation is invoked at the resource instance level. The return from this operation is an [`OperationOutcome`](operationoutcome.html)\n\nNote that this operation is not the only way to validate resources - see [Validating Resources](validation.html) for further information.","code":"validate","comment":"This operation may be used during design and development to validate application design. It can also be used at run-time. One possible use might be that a client asks the server whether a proposed update is valid as the user is editing a dialog and displays an updated error to the user. The operation can be used as part of a light-weight two phase commit protocol but there is no expectation that the server will hold the content of the resource after this operation is used, or that the server guarantees to successfully perform an actual create, update or delete after the validation operation completes.\n\nThis operation returns a 200 OK whether or not the resource is valid. A 4xx or 5xx error means that the validation itself could not be performed, and it is unknown whether the resource is valid or not.\n\nNote: the correct behaviour of validation with regard to language (especially for Coding.display) is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases\n\nFuture versions of this specifcation may add additional validation parameters. A candidate list is maintained with the [FHIR Validator Documentation](https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator)","resource":["Resource"],"system":false,"type":true,"instance":true,"parameter":[{"name":"resource","use":"in","min":0,"max":"1","documentation":"Must be present unless the mode is \"delete\"","type":"Resource"},{"name":"mode","use":"in","min":0,"max":"1","documentation":"Default is 'no action'; (e.g. general validation)","type":"code","binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/resource-validation-mode|4.0.1"}},{"name":"profile","use":"in","min":0,"max":"1","documentation":"If this is nominated, then the resource is validated against this specific profile. If a profile is nominated, and the server cannot validate against the nominated profile, it SHALL return an error","type":"uri"},{"name":"return","use":"out","min":1,"max":"1","documentation":"If the operation outcome does not list any errors, and a mode was specified, then this is an indication that the operation would be expected to succeed (excepting for transactional integrity issues, see below)","type":"OperationOutcome"}]}"#;
3816 #[doc = "The `OperationDefinition` this module was generated from."]
3817 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3818 serde_json::from_str(OPERATION_DEFINITION_JSON)
3819 .expect("Generated OperationDefinition JSON must deserialize.")
3820 });
3821 #[derive(Debug, FromParameters, ToParameters)]
3822 pub struct Input {
3823 #[doc = "Must be present unless the mode is \"delete\""]
3824 pub resource: Option<Resource>,
3825 #[doc = "Default is 'no action'; (e.g. general validation)"]
3826 pub mode: Option<FHIRCode>,
3827 #[doc = "If this is nominated, then the resource is validated against this specific profile. If a profile is"]
3828 #[doc = "nominated, and the server cannot validate against the nominated profile, it SHALL return an error"]
3829 pub profile: Option<FHIRUri>,
3830 }
3831 impl From<Input> for Resource {
3832 fn from(value: Input) -> Self {
3833 let parameters: Vec<ParametersParameter> = value.into();
3834 Resource::Parameters(Parameters {
3835 parameter: Some(parameters),
3836 ..Default::default()
3837 })
3838 }
3839 }
3840 #[derive(Debug, FromParameters)]
3841 pub struct Output {
3842 #[doc = "If the operation outcome does not list any errors, and a mode was specified, then this is an"]
3843 #[doc = "indication that the operation would be expected to succeed (excepting for transactional integrity"]
3844 #[doc = "issues, see below)"]
3845 #[parameter_rename = "return"]
3846 pub return_: OperationOutcome,
3847 }
3848 impl From<Output> for Resource {
3849 fn from(value: Output) -> Self {
3850 Resource::OperationOutcome(value.return_)
3851 }
3852 }
3853}
3854#[doc = "Generates a [`Questionnaire`](questionnaire.html) instance based on a specified"]
3855#[doc = "[`StructureDefinition`](structuredefinition.html), creating questions for each core element or"]
3856#[doc = "extension element found in the [`StructureDefinition`](structuredefinition.html)."]
3857#[doc = ""]
3858#[doc = "If the operation is not called at the instance level, one of the *identifier*, *profile* or *url*"]
3859#[doc = "`in` parameters must be provided. If more than one is specified, servers may raise an error or may"]
3860#[doc = "resolve with the parameter of their choice. If called at the instance level, these parameters will"]
3861#[doc = "be ignored. The response will contain a [`Questionnaire`](questionnaire.html) instance based on the"]
3862#[doc = "specified [`StructureDefinition`](structuredefinition.html) and/or an"]
3863#[doc = "[`OperationOutcome`](operationoutcome.html) resource with errors or warnings. Nested groups are used"]
3864#[doc = "to handle complex structures and data types. If the `supportedOnly` parameter is set to true, only"]
3865#[doc = "those elements marked as \"must support\" will be included."]
3866#[doc = ""]
3867#[doc = "This operation is intended to enable auto-generation of simple interfaces for arbitrary profiles."]
3868#[doc = "The `questionnaire` approach to data entry has limitations that will make it less optimal than"]
3869#[doc = "custom-defined interfaces. However, this function may be useful for simple applications or for"]
3870#[doc = "systems that wish to support \"non-core\" resources with minimal development effort."]
3871pub mod StructureDefinitionQuestionnaire {
3872 use haste_fhir_model::r4::generated::resources::{
3873 OperationDefinition, Parameters, ParametersParameter, Questionnaire, Resource,
3874 };
3875 use haste_fhir_model::r4::generated::types::{FHIRBoolean, FHIRCanonical, FHIRString};
3876 use haste_fhir_operation_error::OperationOutcomeError;
3877 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3878 use std::sync::LazyLock;
3879 pub const CODE: &str = "questionnaire";
3880 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"StructureDefinition-questionnaire","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Build Questionnaire</h2><p>OPERATION: Build Questionnaire</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/StructureDefinition-questionnaire</pre><div><p>Generates a <a href=\"questionnaire.html\">Questionnaire</a> instance based on a specified <a href=\"structuredefinition.html\">StructureDefinition</a>, creating questions for each core element or extension element found in the <a href=\"structuredefinition.html\">StructureDefinition</a>.</p>\n<p>If the operation is not called at the instance level, one of the <em>identifier</em>, <em>profile</em> or <em>url</em> 'in' parameters must be provided. If more than one is specified, servers may raise an error or may resolve with the parameter of their choice. If called at the instance level, these parameters will be ignored. The response will contain a <a href=\"questionnaire.html\">Questionnaire</a> instance based on the specified <a href=\"structuredefinition.html\">StructureDefinition</a> and/or an <a href=\"operationoutcome.html\">OperationOutcome</a> resource with errors or warnings. Nested groups are used to handle complex structures and data types. If the 'supportedOnly' parameter is set to true, only those elements marked as "must support" will be included.</p>\n<p>This operation is intended to enable auto-generation of simple interfaces for arbitrary profiles. The 'questionnaire' approach to data entry has limitations that will make it less optimal than custom-defined interfaces. However, this function may be useful for simple applications or for systems that wish to support "non-core" resources with minimal development effort.</p>\n</div><p>URL: [base]/StructureDefinition/$questionnaire</p><p>URL: [base]/StructureDefinition/[id]/$questionnaire</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>identifier</td><td>0..1</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>A logical identifier (i.e. 'StructureDefinition.identifier''). The server must know the StructureDefinition or be able to retrieve it from other known repositories.</p>\n</div></td></tr><tr><td>IN</td><td>profile</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#token\">token</a>)</td><td/><td><div><p>The <a href=\"structuredefinition.html\">StructureDefinition</a> is provided directly as part of the request. Servers may choose not to accept profiles in this fashion</p>\n</div></td></tr><tr><td>IN</td><td>url</td><td>0..1</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>The StructureDefinition's official URL (i.e. 'StructureDefinition.url'). The server must know the StructureDefinition or be able to retrieve it from other known repositories.</p>\n</div></td></tr><tr><td>IN</td><td>supportedOnly</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If true, the questionnaire will only include those elements marked as "mustSupport='true'" in the StructureDefinition.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"questionnaire.html\">Questionnaire</a></td><td/><td><div><p>The questionnaire form generated based on the StructureDefinition.</p>\n</div></td></tr></table><div><p><strong>Open Issue</strong>: Ideally, extensions should be populated in the generated <a href=\"questionnaire.html\">Questionnaire</a> that will support taking <a href=\"questionnaireresponse.html\">QuestionnaireResponse</a> resources generated from the Questionnaire and turning them back into the appropriate resources.</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/StructureDefinition-questionnaire","version":"4.0.1","name":"Build Questionnaire","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Generates a [Questionnaire](questionnaire.html) instance based on a specified [`StructureDefinition`](structuredefinition.html), creating questions for each core element or extension element found in the [`StructureDefinition`](structuredefinition.html). \n\nIf the operation is not called at the instance level, one of the *identifier*, *profile* or *url* 'in' parameters must be provided. If more than one is specified, servers may raise an error or may resolve with the parameter of their choice. If called at the instance level, these parameters will be ignored. The response will contain a [Questionnaire](questionnaire.html) instance based on the specified [`StructureDefinition`](structuredefinition.html) and/or an [`OperationOutcome`](operationoutcome.html) resource with errors or warnings. Nested groups are used to handle complex structures and data types. If the 'supportedOnly' parameter is set to true, only those elements marked as \"must support\" will be included. \n\nThis operation is intended to enable auto-generation of simple interfaces for arbitrary profiles. The 'questionnaire' approach to data entry has limitations that will make it less optimal than custom-defined interfaces. However, this function may be useful for simple applications or for systems that wish to support \"non-core\" resources with minimal development effort.","code":"questionnaire","comment":"**Open Issue**: Ideally, extensions should be populated in the generated [Questionnaire](questionnaire.html) that will support taking [QuestionnaireResponse](questionnaireresponse.html) resources generated from the Questionnaire and turning them back into the appropriate resources.","resource":["StructureDefinition"],"system":false,"type":true,"instance":true,"parameter":[{"name":"identifier","use":"in","min":0,"max":"1","documentation":"A logical identifier (i.e. 'StructureDefinition.identifier''). The server must know the `StructureDefinition` or be able to retrieve it from other known repositories.","type":"canonical","targetProfile":["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]},{"name":"profile","use":"in","min":0,"max":"1","documentation":"The [`StructureDefinition`](structuredefinition.html) is provided directly as part of the request. Servers may choose not to accept profiles in this fashion","type":"string","searchType":"token"},{"name":"url","use":"in","min":0,"max":"1","documentation":"The `StructureDefinition`'s official URL (i.e. 'StructureDefinition.url'). The server must know the `StructureDefinition` or be able to retrieve it from other known repositories.","type":"canonical","targetProfile":["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]},{"name":"supportedOnly","use":"in","min":0,"max":"1","documentation":"If true, the questionnaire will only include those elements marked as \"mustSupport='true'\" in the `StructureDefinition`.","type":"boolean"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The questionnaire form generated based on the `StructureDefinition`.","type":"Questionnaire"}]}"#;
3881 #[doc = "The `OperationDefinition` this module was generated from."]
3882 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3883 serde_json::from_str(OPERATION_DEFINITION_JSON)
3884 .expect("Generated OperationDefinition JSON must deserialize.")
3885 });
3886 #[derive(Debug, FromParameters, ToParameters)]
3887 pub struct Input {
3888 #[doc = "A logical identifier (i.e. '`StructureDefinition.identifier`''). The server must know the"]
3889 #[doc = "`StructureDefinition` or be able to retrieve it from other known repositories."]
3890 #[parameter_rename = "identifier"]
3891 pub identifier_: Option<FHIRCanonical>,
3892 #[doc = "The [`StructureDefinition`](structuredefinition.html) is provided directly as part of the request."]
3893 #[doc = "Servers may choose not to accept profiles in this fashion"]
3894 pub profile: Option<FHIRString>,
3895 #[doc = "The `StructureDefinition`'s official URL (i.e. '`StructureDefinition.url`'). The server must know"]
3896 #[doc = "the `StructureDefinition` or be able to retrieve it from other known repositories."]
3897 pub url: Option<FHIRCanonical>,
3898 #[doc = "If true, the questionnaire will only include those elements marked as \"mustSupport=`true`\" in the"]
3899 #[doc = "`StructureDefinition`."]
3900 pub supportedOnly: Option<FHIRBoolean>,
3901 }
3902 impl From<Input> for Resource {
3903 fn from(value: Input) -> Self {
3904 let parameters: Vec<ParametersParameter> = value.into();
3905 Resource::Parameters(Parameters {
3906 parameter: Some(parameters),
3907 ..Default::default()
3908 })
3909 }
3910 }
3911 #[derive(Debug, FromParameters)]
3912 pub struct Output {
3913 #[doc = "The questionnaire form generated based on the `StructureDefinition`."]
3914 #[parameter_rename = "return"]
3915 pub return_: Questionnaire,
3916 }
3917 impl From<Output> for Resource {
3918 fn from(value: Output) -> Self {
3919 Resource::Questionnaire(value.return_)
3920 }
3921 }
3922}
3923#[doc = "Generates a [`StructureDefinition`](structuredefinition.html) instance with a snapshot, based on a"]
3924#[doc = "differential in a specified [`StructureDefinition`](structuredefinition.html)."]
3925#[doc = ""]
3926#[doc = "If the operation is not called at the instance level, either *definition* or *url* `in` parameters"]
3927#[doc = "must be provided. If more than one is specified, servers may raise an error or may resolve with the"]
3928#[doc = "parameter of their choice. If called at the instance level, these parameters will be ignored."]
3929pub mod StructureDefinitionSnapshot {
3930 use haste_fhir_model::r4::generated::resources::{
3931 OperationDefinition, Parameters, ParametersParameter, Resource, StructureDefinition,
3932 };
3933 use haste_fhir_model::r4::generated::types::FHIRString;
3934 use haste_fhir_operation_error::OperationOutcomeError;
3935 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3936 use std::sync::LazyLock;
3937 pub const CODE: &str = "snapshot";
3938 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"StructureDefinition-snapshot","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Generate Snapshot</h2><p>OPERATION: Generate Snapshot</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/StructureDefinition-snapshot</pre><div><p>Generates a <a href=\"structuredefinition.html\">StructureDefinition</a> instance with a snapshot, based on a differential in a specified <a href=\"structuredefinition.html\">StructureDefinition</a>.</p>\n<p>If the operation is not called at the instance level, either <em>definition</em> or <em>url</em> 'in' parameters must be provided. If more than one is specified, servers may raise an error or may resolve with the parameter of their choice. If called at the instance level, these parameters will be ignored.</p>\n</div><p>URL: [base]/StructureDefinition/$snapshot</p><p>URL: [base]/StructureDefinition/[id]/$snapshot</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>definition</td><td>0..1</td><td><a href=\"structuredefinition.html\">StructureDefinition</a></td><td/><td><div><p>The <a href=\"structuredefinition.html\">StructureDefinition</a> is provided directly as part of the request. Servers may choose not to accept profiles in this fashion</p>\n</div></td></tr><tr><td>IN</td><td>url</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#token\">token</a>)</td><td/><td><div><p>The StructureDefinition's canonical URL (i.e. 'StructureDefinition.url'). The server must know the structure definition, or be able to retrieve it from other known repositories.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"structuredefinition.html\">StructureDefinition</a></td><td/><td><div><p>The structure definition with a snapshot</p>\n</div></td></tr></table><div/></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/StructureDefinition-snapshot","version":"4.0.1","name":"Generate Snapshot","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Generates a [`StructureDefinition`](structuredefinition.html) instance with a snapshot, based on a differential in a specified [`StructureDefinition`](structuredefinition.html). \n\nIf the operation is not called at the instance level, either *definition* or *url* 'in' parameters must be provided. If more than one is specified, servers may raise an error or may resolve with the parameter of their choice. If called at the instance level, these parameters will be ignored.","code":"snapshot","resource":["StructureDefinition"],"system":false,"type":true,"instance":true,"parameter":[{"name":"definition","use":"in","min":0,"max":"1","documentation":"The [`StructureDefinition`](structuredefinition.html) is provided directly as part of the request. Servers may choose not to accept profiles in this fashion","type":"StructureDefinition"},{"name":"url","use":"in","min":0,"max":"1","documentation":"The `StructureDefinition`'s canonical URL (i.e. 'StructureDefinition.url'). The server must know the structure definition, or be able to retrieve it from other known repositories.","type":"string","searchType":"token"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The structure definition with a snapshot","type":"StructureDefinition"}]}"#;
3939 #[doc = "The `OperationDefinition` this module was generated from."]
3940 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3941 serde_json::from_str(OPERATION_DEFINITION_JSON)
3942 .expect("Generated OperationDefinition JSON must deserialize.")
3943 });
3944 #[derive(Debug, FromParameters, ToParameters)]
3945 pub struct Input {
3946 #[doc = "The [`StructureDefinition`](structuredefinition.html) is provided directly as part of the request."]
3947 #[doc = "Servers may choose not to accept profiles in this fashion"]
3948 pub definition: Option<StructureDefinition>,
3949 #[doc = "The `StructureDefinition`'s canonical URL (i.e. '`StructureDefinition.url`'). The server must know"]
3950 #[doc = "the structure definition, or be able to retrieve it from other known repositories."]
3951 pub url: Option<FHIRString>,
3952 }
3953 impl From<Input> for Resource {
3954 fn from(value: Input) -> Self {
3955 let parameters: Vec<ParametersParameter> = value.into();
3956 Resource::Parameters(Parameters {
3957 parameter: Some(parameters),
3958 ..Default::default()
3959 })
3960 }
3961 }
3962 #[derive(Debug, FromParameters)]
3963 pub struct Output {
3964 #[doc = "The structure definition with a snapshot"]
3965 #[parameter_rename = "return"]
3966 pub return_: StructureDefinition,
3967 }
3968 impl From<Output> for Resource {
3969 fn from(value: Output) -> Self {
3970 Resource::StructureDefinition(value.return_)
3971 }
3972 }
3973}
3974#[doc = "The transform operation takes input content, applies a structure map transform, and then returns the"]
3975#[doc = "output."]
3976pub mod StructureMapTransform {
3977 use haste_fhir_model::r4::generated::resources::{
3978 OperationDefinition, Parameters, ParametersParameter, Resource,
3979 };
3980 use haste_fhir_model::r4::generated::types::FHIRUri;
3981 use haste_fhir_operation_error::OperationOutcomeError;
3982 use haste_fhir_ops::derive::{FromParameters, ToParameters};
3983 use std::sync::LazyLock;
3984 pub const CODE: &str = "transform";
3985 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"StructureMap-transform","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Model Instance Transformation</h2><p>OPERATION: Model Instance Transformation</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/StructureMap-transform</pre><div><p>The transform operation takes input content, applies a structure map transform, and then returns the output.</p>\n</div><p>URL: [base]/StructureMap/$transform</p><p>URL: [base]/StructureMap/[id]/$transform</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>source</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The structure map to apply. This is only needed if the operation is invoked at the resource level. If the $transform operation is invoked on a particular structure map, this will be ignored by the server</p>\n</div></td></tr><tr><td>IN</td><td>content</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The logical content to transform</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The result of the transform</p>\n</div></td></tr></table><div><p>The input and return are specified as 'Resources'. In most usage of the $transform operation, either the input or return content is not a valid FHIR resource. In these cases, the return type is actually a <a href=\"binary.html\">Binary</a> resource. For this operation, the Binary resources may be encoded directly, using a mime-type, as shown in the example. Note: this specification does not yet address the means by which the servers may know the correct mime types for the various content involved</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"url":"http://hl7.org/fhir/OperationDefinition/StructureMap-transform","version":"4.0.1","name":"Model Instance Transformation","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The transform operation takes input content, applies a structure map transform, and then returns the output.","code":"transform","comment":"The input and return are specified as 'Resources'. In most usage of the $transform operation, either the input or return content is not a valid FHIR resource. In these cases, the return type is actually a [Binary](binary.html) resource. For this operation, the Binary resources may be encoded directly, using a mime-type, as shown in the example. Note: this specification does not yet address the means by which the servers may know the correct mime types for the various content involved","resource":["StructureMap"],"system":false,"type":true,"instance":true,"parameter":[{"name":"source","use":"in","min":0,"max":"1","documentation":"The structure map to apply. This is only needed if the operation is invoked at the resource level. If the $transform operation is invoked on a particular structure map, this will be ignored by the server","type":"uri"},{"name":"content","use":"in","min":1,"max":"1","documentation":"The logical content to transform","type":"Resource"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the transform","type":"Resource"}]}"#;
3986 #[doc = "The `OperationDefinition` this module was generated from."]
3987 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
3988 serde_json::from_str(OPERATION_DEFINITION_JSON)
3989 .expect("Generated OperationDefinition JSON must deserialize.")
3990 });
3991 #[derive(Debug, FromParameters, ToParameters)]
3992 pub struct Input {
3993 #[doc = "The structure map to apply. This is only needed if the operation is invoked at the resource level."]
3994 #[doc = "If the $transform operation is invoked on a particular structure map, this will be ignored by the"]
3995 #[doc = "server"]
3996 pub source: Option<FHIRUri>,
3997 #[doc = "The logical content to transform"]
3998 pub content: Resource,
3999 }
4000 impl From<Input> for Resource {
4001 fn from(value: Input) -> Self {
4002 let parameters: Vec<ParametersParameter> = value.into();
4003 Resource::Parameters(Parameters {
4004 parameter: Some(parameters),
4005 ..Default::default()
4006 })
4007 }
4008 }
4009 #[derive(Debug, FromParameters, ToParameters)]
4010 pub struct Output {
4011 #[doc = "The result of the transform"]
4012 #[parameter_rename = "return"]
4013 pub return_: Resource,
4014 }
4015 impl From<Output> for Resource {
4016 fn from(value: Output) -> Self {
4017 let parameters: Vec<ParametersParameter> = value.into();
4018 Resource::Parameters(Parameters {
4019 parameter: Some(parameters),
4020 ..Default::default()
4021 })
4022 }
4023 }
4024}
4025#[doc = "The definition of a value set is used to create a simple collection of codes suitable for use for"]
4026#[doc = "data entry or validation."]
4027#[doc = ""]
4028#[doc = "If the operation is not called at the instance level, one of the in parameters url, context or"]
4029#[doc = "valueSet must be provided. An expanded value set will be returned, or an `OperationOutcome` with an"]
4030#[doc = "error message."]
4031pub mod ValueSetExpand {
4032 use haste_fhir_model::r4::generated::resources::{
4033 OperationDefinition, Parameters, ParametersParameter, Resource, ValueSet,
4034 };
4035 use haste_fhir_model::r4::generated::types::{
4036 FHIRBoolean, FHIRCanonical, FHIRCode, FHIRDateTime, FHIRInteger, FHIRString, FHIRUri,
4037 };
4038 use haste_fhir_operation_error::OperationOutcomeError;
4039 use haste_fhir_ops::derive::{FromParameters, ToParameters};
4040 use std::sync::LazyLock;
4041 pub const CODE: &str = "expand";
4042 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ValueSet-expand","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Value Set Expansion</h2><p>OPERATION: Value Set Expansion</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ValueSet-expand</pre><div><p>The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation.</p>\n<p>If the operation is not called at the instance level, one of the in parameters url, context or valueSet must be provided. An expanded value set will be returned, or an OperationOutcome with an error message.</p>\n</div><p>URL: [base]/ValueSet/$expand</p><p>URL: [base]/ValueSet/[id]/$expand</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>url</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>A canonical reference to a value set. The server must know the value set (e.g. it is defined explicitly in the server's value sets, or it is defined implicitly by some code system known to the server</p>\n</div></td></tr><tr><td>IN</td><td>valueSet</td><td>0..1</td><td><a href=\"valueset.html\">ValueSet</a></td><td/><td><div><p>The value set is provided directly as part of the request. Servers may choose not to accept value sets in this fashion</p>\n</div></td></tr><tr><td>IN</td><td>valueSetVersion</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The identifier that is used to identify a specific version of the value set to be used when generating the expansion. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.</p>\n</div></td></tr><tr><td>IN</td><td>context</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The context of the value set, so that the server can resolve this to a value set to expand. The recommended format for this URI is [Structure Definition URL]#[name or path into structure definition] e.g. http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation. Other forms may be used but are not defined. This form is only usable if the terminology server also has access to the conformance registry that the server is using, but can be used to delegate the mapping from an application context to a binding at run-time</p>\n</div></td></tr><tr><td>IN</td><td>contextDirection</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>If a context is provided, a context direction may also be provided. Valid values are:</p>\n<ul>\n<li>'incoming': the codes a client can use for PUT/POST operations, and</li>\n<li>'outgoing', the codes a client might receive from the server.</li>\n</ul>\n<p>The purpose is to inform the server whether to use the value set associated with the context for reading or writing purposes (note: for most elements, this is the same value set, but there are a few elements where the reading and writing value sets are different)</p>\n</div></td></tr><tr><td>IN</td><td>filter</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>A text filter that is applied to restrict the codes that are returned (this is useful in a UI context). The interpretation of this is delegated to the server in order to allow to determine the most optimal search approach for the context. The server can document the way this parameter works in <a href=\"terminologycapabilities.html\">TerminologyCapabilities</a>..expansion.textFilter. Typical usage of this parameter includes functionality like:</p>\n<ul>\n<li>using left matching e.g. "acut ast"</li>\n<li>allowing for wild cards such as %, &, ?</li>\n<li>searching on definition as well as display(s)</li>\n<li>allowing for search conditions (and / or / exclusions)</li>\n</ul>\n<p>Text Search engines such as Lucene or Solr, long with their considerable functionality, might also be used. The optional text search might also be code system specific, and servers might have different implementations for different code systems</p>\n</div></td></tr><tr><td>IN</td><td>date</td><td>0..1</td><td><a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The date for which the expansion should be generated. if a date is provided, it means that the server should use the value set / code system definitions as they were on the given date, or return an error if this is not possible. Normally, the date is the current conditions (which is the default value) but under some circumstances, systems need to generate an expansion as it would have been in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.</p>\n</div></td></tr><tr><td>IN</td><td>offset</td><td>0..1</td><td><a href=\"datatypes.html#integer\">integer</a></td><td/><td><div><p>Paging support - where to start if a subset is desired (default = 0). Offset is number of records (not number of pages)</p>\n</div></td></tr><tr><td>IN</td><td>count</td><td>0..1</td><td><a href=\"datatypes.html#integer\">integer</a></td><td/><td><div><p>Paging support - how many codes should be provided in a partial page view. Paging only applies to flat expansions - servers ignore paging if the expansion is not flat. If count = 0, the client is asking how large the expansion is. Servers SHOULD honor this request for hierarchical expansions as well, and simply return the overall count</p>\n</div></td></tr><tr><td>IN</td><td>includeDesignations</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Controls whether concept designations are to be included or excluded in value set expansions</p>\n</div></td></tr><tr><td>IN</td><td>designation</td><td>0..*</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>A <a href=\"search.html#token\">token</a> that specifies a system+code that is either a use or a language. Designations that match by language or use are included in the expansion. If no designation is specified, it is at the server discretion which designations to return</p>\n</div></td></tr><tr><td>IN</td><td>includeDefinition</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Controls whether the value set definition is included or excluded in value set expansions</p>\n</div></td></tr><tr><td>IN</td><td>activeOnly</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Controls whether inactive concepts are included or excluded in value set expansions. Note that if the value set explicitly specifies that inactive codes are included, this parameter can still remove them from a specific expansion, but this parameter cannot include them if the value set excludes them</p>\n</div></td></tr><tr><td>IN</td><td>excludeNested</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains)</p>\n</div></td></tr><tr><td>IN</td><td>excludeNotForUI</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Controls whether or not the value set expansion is assembled for a user interface use or not. Value sets intended for User Interface might include <a href=\"codesystem.html#status\">'abstract' codes</a> or have nested contains with items with no code or abstract = true, with the sole purpose of helping a user navigate through the list efficiently, where as a value set not generated for UI use might be flat, and only contain the selectable codes in the value set. The exact implications of 'for UI' depend on the code system, and what properties it exposes for a terminology server to use. In the FHIR Specification itself, the value set expansions are generated with excludeNotForUI = false, and the expansions used when generated schema / code etc, or performing validation, are all excludeNotForUI = true.</p>\n</div></td></tr><tr><td>IN</td><td>excludePostCoordinated</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Controls whether or not the value set expansion includes post coordinated codes</p>\n</div></td></tr><tr><td>IN</td><td>displayLanguage</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display</p>\n</div></td></tr><tr><td>IN</td><td>exclude-system</td><td>0..*</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>Code system, or a particular version of a code system to be excluded from the value set expansion. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56</p>\n</div></td></tr><tr><td>IN</td><td>system-version</td><td>0..*</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>Specifies a version to use for a system, if the value set does not specify which one to use. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56</p>\n</div></td></tr><tr><td>IN</td><td>check-system-version</td><td>0..*</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>Edge Case: Specifies a version to use for a system. If a value set specifies a different version, an error is returned instead of the expansion. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56</p>\n</div></td></tr><tr><td>IN</td><td>force-system-version</td><td>0..*</td><td><a href=\"datatypes.html#canonical\">canonical</a></td><td/><td><div><p>Edge Case: Specifies a version to use for a system. This parameter overrides any specified version in the value set (and any it depends on). The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56. Note that this has obvious safety issues, in that it may result in a value set expansion giving a different list of codes that is both wrong and unsafe, and implementers should only use this capability reluctantly. It primarily exists to deal with situations where specifications have fallen into decay as time passes. If the value is override, the version used SHALL explicitly be represented in the expansion parameters</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td><a href=\"valueset.html\">ValueSet</a></td><td/><td><div><p>The result of the expansion. Servers generating expansions SHOULD ensure that all the parameters that affect the contents of the expansion are recorded in the ValueSet.expansion.parameter list</p>\n</div></td></tr></table><div><p>The value set expansion returned by this query should be treated as a transient result that will change over time (whether it does or not depends on how the value set is specified), so applications should repeat the operation each time the value set is used.</p>\n<p>If the expansion is too large (at the discretion of the server), the server MAY return an error (OperationOutcome with code too-costly). Clients can work through large flat expansions in a set of pages (partial views of the full expansion) instead of just getting the full expansion in a single exchange by using offset and count parameters, or use the count parameter to request a subset of the expansion for limited purposes. Servers are not obliged to support paging, but if they do, SHALL support both the offset and count parameters. Hierarchical expansions are not subject to paging and servers simply return the entire expansion.</p>\n<p>Different servers may return different results from expanding a value set for the following reasons:</p>\n<ul>\n<li>The underlying code systems are different (e.g. different versions, possibly with different defined behavior)</li>\n<li>The server optimizes filter includes differently, such as sorting by code frequency</li>\n<li>Servers introduce arbitrary groups to assist a user to navigate the lists based either on extensions in the definition, or additional knowledge available to the server</li>\n</ul>\n<p>When a server cannot correctly expand a value set because it does not fully understand the code systems (e.g. it has the wrong version, or incomplete definitions) then it SHALL return an error. If the value set itself is unbounded due to the inclusion of post-coordinated value sets (e.g. SNOMED CT, UCUM), then the extension <a href=\"extension-valueset-unclosed.html\">http://hl7.org/fhir/StructureDefinition/valueset-unclosed</a> can be used to indicate that the expansion is incomplete</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"normative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version","valueCode":"4.0.1"}],"url":"http://hl7.org/fhir/OperationDefinition/ValueSet-expand","version":"4.0.1","name":"Value Set Expansion","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. \n\nIf the operation is not called at the instance level, one of the in parameters url, context or valueSet must be provided. An expanded value set will be returned, or an `OperationOutcome` with an error message.","code":"expand","comment":"The value set expansion returned by this query should be treated as a transient result that will change over time (whether it does or not depends on how the value set is specified), so applications should repeat the operation each time the value set is used. \n\nIf the expansion is too large (at the discretion of the server), the server MAY return an error (OperationOutcome with code too-costly). Clients can work through large flat expansions in a set of pages (partial views of the full expansion) instead of just getting the full expansion in a single exchange by using offset and count parameters, or use the count parameter to request a subset of the expansion for limited purposes. Servers are not obliged to support paging, but if they do, SHALL support both the offset and count parameters. Hierarchical expansions are not subject to paging and servers simply return the entire expansion. \n\nDifferent servers may return different results from expanding a value set for the following reasons: \n\n* The underlying code systems are different (e.g. different versions, possibly with different defined behavior) \n* The server optimizes filter includes differently, such as sorting by code frequency \n* Servers introduce arbitrary groups to assist a user to navigate the lists based either on extensions in the definition, or additional knowledge available to the server\n\nWhen a server cannot correctly expand a value set because it does not fully understand the code systems (e.g. it has the wrong version, or incomplete definitions) then it SHALL return an error. If the value set itself is unbounded due to the inclusion of post-coordinated value sets (e.g. SNOMED CT, UCUM), then the extension [http://hl7.org/fhir/StructureDefinition/valueset-unclosed](extension-valueset-unclosed.html) can be used to indicate that the expansion is incomplete","resource":["ValueSet"],"system":false,"type":true,"instance":true,"parameter":[{"name":"url","use":"in","min":0,"max":"1","documentation":"A canonical reference to a value set. The server must know the value set (e.g. it is defined explicitly in the server's value sets, or it is defined implicitly by some code system known to the server","type":"uri"},{"name":"valueSet","use":"in","min":0,"max":"1","documentation":"The value set is provided directly as part of the request. Servers may choose not to accept value sets in this fashion","type":"ValueSet"},{"name":"valueSetVersion","use":"in","min":0,"max":"1","documentation":"The identifier that is used to identify a specific version of the value set to be used when generating the expansion. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.","type":"string"},{"name":"context","use":"in","min":0,"max":"1","documentation":"The context of the value set, so that the server can resolve this to a value set to expand. The recommended format for this URI is [Structure Definition URL]#[name or path into structure definition] e.g. <http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation>. Other forms may be used but are not defined. This form is only usable if the terminology server also has access to the conformance registry that the server is using, but can be used to delegate the mapping from an application context to a binding at run-time","type":"uri"},{"name":"contextDirection","use":"in","min":0,"max":"1","documentation":"If a context is provided, a context direction may also be provided. Valid values are: \n\n* 'incoming': the codes a client can use for PUT/POST operations, and \n* 'outgoing', the codes a client might receive from the server.\n\nThe purpose is to inform the server whether to use the value set associated with the context for reading or writing purposes (note: for most elements, this is the same value set, but there are a few elements where the reading and writing value sets are different)","type":"code"},{"name":"filter","use":"in","min":0,"max":"1","documentation":"A text filter that is applied to restrict the codes that are returned (this is useful in a UI context). The interpretation of this is delegated to the server in order to allow to determine the most optimal search approach for the context. The server can document the way this parameter works in [`TerminologyCapabilities`](terminologycapabilities.html)..expansion.textFilter. Typical usage of this parameter includes functionality like:\n\n* using left matching e.g. \"acut ast\"\n* allowing for wild cards such as %, &, ?\n* searching on definition as well as display(s)\n* allowing for search conditions (and / or / exclusions)\n\nText Search engines such as Lucene or Solr, long with their considerable functionality, might also be used. The optional text search might also be code system specific, and servers might have different implementations for different code systems","type":"string"},{"name":"date","use":"in","min":0,"max":"1","documentation":"The date for which the expansion should be generated. if a date is provided, it means that the server should use the value set / code system definitions as they were on the given date, or return an error if this is not possible. Normally, the date is the current conditions (which is the default value) but under some circumstances, systems need to generate an expansion as it would have been in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.","type":"dateTime"},{"name":"offset","use":"in","min":0,"max":"1","documentation":"Paging support - where to start if a subset is desired (default = 0). Offset is number of records (not number of pages)","type":"integer"},{"name":"count","use":"in","min":0,"max":"1","documentation":"Paging support - how many codes should be provided in a partial page view. Paging only applies to flat expansions - servers ignore paging if the expansion is not flat. If count = 0, the client is asking how large the expansion is. Servers SHOULD honor this request for hierarchical expansions as well, and simply return the overall count","type":"integer"},{"name":"includeDesignations","use":"in","min":0,"max":"1","documentation":"Controls whether concept designations are to be included or excluded in value set expansions","type":"boolean"},{"name":"designation","use":"in","min":0,"max":"*","documentation":"A [token](search.html#token) that specifies a system+code that is either a use or a language. Designations that match by language or use are included in the expansion. If no designation is specified, it is at the server discretion which designations to return","type":"string"},{"name":"includeDefinition","use":"in","min":0,"max":"1","documentation":"Controls whether the value set definition is included or excluded in value set expansions","type":"boolean"},{"name":"activeOnly","use":"in","min":0,"max":"1","documentation":"Controls whether inactive concepts are included or excluded in value set expansions. Note that if the value set explicitly specifies that inactive codes are included, this parameter can still remove them from a specific expansion, but this parameter cannot include them if the value set excludes them","type":"boolean"},{"name":"excludeNested","use":"in","min":0,"max":"1","documentation":"Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains)","type":"boolean"},{"name":"excludeNotForUI","use":"in","min":0,"max":"1","documentation":"Controls whether or not the value set expansion is assembled for a user interface use or not. Value sets intended for User Interface might include ['abstract' codes](codesystem.html#status) or have nested contains with items with no code or abstract = true, with the sole purpose of helping a user navigate through the list efficiently, where as a value set not generated for UI use might be flat, and only contain the selectable codes in the value set. The exact implications of 'for UI' depend on the code system, and what properties it exposes for a terminology server to use. In the FHIR Specification itself, the value set expansions are generated with excludeNotForUI = false, and the expansions used when generated schema / code etc, or performing validation, are all excludeNotForUI = true.","type":"boolean"},{"name":"excludePostCoordinated","use":"in","min":0,"max":"1","documentation":"Controls whether or not the value set expansion includes post coordinated codes","type":"boolean"},{"name":"displayLanguage","use":"in","min":0,"max":"1","documentation":"Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display","type":"code"},{"name":"exclude-system","use":"in","min":0,"max":"*","documentation":"Code system, or a particular version of a code system to be excluded from the value set expansion. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56","type":"canonical"},{"name":"system-version","use":"in","min":0,"max":"*","documentation":"Specifies a version to use for a system, if the value set does not specify which one to use. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56","type":"canonical"},{"name":"check-system-version","use":"in","min":0,"max":"*","documentation":"Edge Case: Specifies a version to use for a system. If a value set specifies a different version, an error is returned instead of the expansion. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56","type":"canonical"},{"name":"force-system-version","use":"in","min":0,"max":"*","documentation":"Edge Case: Specifies a version to use for a system. This parameter overrides any specified version in the value set (and any it depends on). The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56. Note that this has obvious safety issues, in that it may result in a value set expansion giving a different list of codes that is both wrong and unsafe, and implementers should only use this capability reluctantly. It primarily exists to deal with situations where specifications have fallen into decay as time passes. If the value is override, the version used SHALL explicitly be represented in the expansion parameters","type":"canonical"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The result of the expansion. Servers generating expansions SHOULD ensure that all the parameters that affect the contents of the expansion are recorded in the ValueSet.expansion.parameter list","type":"ValueSet"}]}"#;
4043 #[doc = "The `OperationDefinition` this module was generated from."]
4044 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
4045 serde_json::from_str(OPERATION_DEFINITION_JSON)
4046 .expect("Generated OperationDefinition JSON must deserialize.")
4047 });
4048 #[derive(Debug, FromParameters, ToParameters)]
4049 pub struct Input {
4050 #[doc = "A canonical reference to a value set. The server must know the value set (e.g. it is defined"]
4051 #[doc = "explicitly in the server's value sets, or it is defined implicitly by some code system known to the"]
4052 #[doc = "server"]
4053 pub url: Option<FHIRUri>,
4054 #[doc = "The value set is provided directly as part of the request. Servers may choose not to accept value"]
4055 #[doc = "sets in this fashion"]
4056 pub valueSet: Option<ValueSet>,
4057 #[doc = "The identifier that is used to identify a specific version of the value set to be used when"]
4058 #[doc = "generating the expansion. This is an arbitrary value managed by the value set author and is not"]
4059 #[doc = "expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed"]
4060 #[doc = "version is not available."]
4061 pub valueSetVersion: Option<FHIRString>,
4062 #[doc = "The context of the value set, so that the server can resolve this to a value set to expand. The"]
4063 #[doc = "recommended format for this URI is [Structure Definition URL]#[name or path into structure"]
4064 #[doc = "definition] e.g."]
4065 #[doc = "<`http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation>`."]
4066 #[doc = "Other forms may be used but are not defined. This form is only usable if the terminology server also"]
4067 #[doc = "has access to the conformance registry that the server is using, but can be used to delegate the"]
4068 #[doc = "mapping from an application context to a binding at run-time"]
4069 pub context: Option<FHIRUri>,
4070 #[doc = "If a context is provided, a context direction may also be provided. Valid values are:"]
4071 #[doc = ""]
4072 #[doc = "* `incoming`: the codes a client can use for PUT/POST operations, and"]
4073 #[doc = "* `outgoing`, the codes a client might receive from the server."]
4074 #[doc = ""]
4075 #[doc = "The purpose is to inform the server whether to use the value set associated with the context for"]
4076 #[doc = "reading or writing purposes (note: for most elements, this is the same value set, but there are a"]
4077 #[doc = "few elements where the reading and writing value sets are different)"]
4078 pub contextDirection: Option<FHIRCode>,
4079 #[doc = "A text filter that is applied to restrict the codes that are returned (this is useful in a UI"]
4080 #[doc = "context). The interpretation of this is delegated to the server in order to allow to determine the"]
4081 #[doc = "most optimal search approach for the context. The server can document the way this parameter works"]
4082 #[doc = "in [`TerminologyCapabilities`](terminologycapabilities.html)..expansion.textFilter. Typical usage of"]
4083 #[doc = "this parameter includes functionality like:"]
4084 #[doc = ""]
4085 #[doc = "* using left matching e.g. \"acut ast\""]
4086 #[doc = "* allowing for wild cards such as %, &, ?"]
4087 #[doc = "* searching on definition as well as display(s)"]
4088 #[doc = "* allowing for search conditions (and / or / exclusions)"]
4089 #[doc = ""]
4090 #[doc = "Text Search engines such as Lucene or Solr, long with their considerable functionality, might also"]
4091 #[doc = "be used. The optional text search might also be code system specific, and servers might have"]
4092 #[doc = "different implementations for different code systems"]
4093 pub filter: Option<FHIRString>,
4094 #[doc = "The date for which the expansion should be generated. if a date is provided, it means that the"]
4095 #[doc = "server should use the value set / code system definitions as they were on the given date, or return"]
4096 #[doc = "an error if this is not possible. Normally, the date is the current conditions (which is the default"]
4097 #[doc = "value) but under some circumstances, systems need to generate an expansion as it would have been in"]
4098 #[doc = "the past. A typical example of this would be where code selection is constrained to the set of codes"]
4099 #[doc = "that were available when the patient was treated, not when the record is being edited. Note that"]
4100 #[doc = "which date is appropriate is a matter for implementation policy."]
4101 pub date: Option<FHIRDateTime>,
4102 #[doc = "Paging support - where to start if a subset is desired (default = 0). Offset is number of records"]
4103 #[doc = "(not number of pages)"]
4104 pub offset: Option<FHIRInteger>,
4105 #[doc = "Paging support - how many codes should be provided in a partial page view. Paging only applies to"]
4106 #[doc = "flat expansions - servers ignore paging if the expansion is not flat. If count = 0, the client is"]
4107 #[doc = "asking how large the expansion is. Servers SHOULD honor this request for hierarchical expansions as"]
4108 #[doc = "well, and simply return the overall count"]
4109 pub count: Option<FHIRInteger>,
4110 #[doc = "Controls whether concept designations are to be included or excluded in value set expansions"]
4111 pub includeDesignations: Option<FHIRBoolean>,
4112 #[doc = "A [`token`](search.html#token) that specifies a system+code that is either a use or a language."]
4113 #[doc = "Designations that match by language or use are included in the expansion. If no designation is"]
4114 #[doc = "specified, it is at the server discretion which designations to return"]
4115 pub designation: Option<Vec<FHIRString>>,
4116 #[doc = "Controls whether the value set definition is included or excluded in value set expansions"]
4117 pub includeDefinition: Option<FHIRBoolean>,
4118 #[doc = "Controls whether inactive concepts are included or excluded in value set expansions. Note that if"]
4119 #[doc = "the value set explicitly specifies that inactive codes are included, this parameter can still remove"]
4120 #[doc = "them from a specific expansion, but this parameter cannot include them if the value set excludes"]
4121 #[doc = "them"]
4122 pub activeOnly: Option<FHIRBoolean>,
4123 #[doc = "Controls whether or not the value set expansion nests codes or not (i.e."]
4124 #[doc = "`ValueSet.expansion.contains.contains`)"]
4125 pub excludeNested: Option<FHIRBoolean>,
4126 #[doc = "Controls whether or not the value set expansion is assembled for a user interface use or not. Value"]
4127 #[doc = "sets intended for User Interface might include [``abstract` codes`](codesystem.html#status) or have"]
4128 #[doc = "nested contains with items with no code or abstract = true, with the sole purpose of helping a user"]
4129 #[doc = "navigate through the list efficiently, where as a value set not generated for UI use might be flat,"]
4130 #[doc = "and only contain the selectable codes in the value set. The exact implications of 'for UI' depend on"]
4131 #[doc = "the code system, and what properties it exposes for a terminology server to use. In the FHIR"]
4132 #[doc = "Specification itself, the value set expansions are generated with exclude`NotForUI` = false, and the"]
4133 #[doc = "expansions used when generated schema / code etc, or performing validation, are all"]
4134 #[doc = "exclude`NotForUI` = true."]
4135 pub excludeNotForUI: Option<FHIRBoolean>,
4136 #[doc = "Controls whether or not the value set expansion includes post coordinated codes"]
4137 pub excludePostCoordinated: Option<FHIRBoolean>,
4138 #[doc = "Specifies the language to be used for description in the expansions i.e. the language to be used for"]
4139 #[doc = "`ValueSet.expansion.contains.display`"]
4140 pub displayLanguage: Option<FHIRCode>,
4141 #[doc = "Code system, or a particular version of a code system to be excluded from the value set expansion."]
4142 #[doc = "The format is the same as a canonical URL: `[system]|[version] - e.g. http://loinc.org|2.56`"]
4143 #[parameter_rename = "exclude-system"]
4144 pub exclude_system: Option<Vec<FHIRCanonical>>,
4145 #[doc = "Specifies a version to use for a system, if the value set does not specify which one to use. The"]
4146 #[doc = "format is the same as a canonical URL: `[system]|[version] - e.g. http://loinc.org|2.56`"]
4147 #[parameter_rename = "system-version"]
4148 pub system_version: Option<Vec<FHIRCanonical>>,
4149 #[doc = "Edge Case: Specifies a version to use for a system. If a value set specifies a different version, an"]
4150 #[doc = "error is returned instead of the expansion. The format is the same as a canonical URL:"]
4151 #[doc = "`[system]|[version] - e.g. http://loinc.org|2.56`"]
4152 #[parameter_rename = "check-system-version"]
4153 pub check_system_version: Option<Vec<FHIRCanonical>>,
4154 #[doc = "Edge Case: Specifies a version to use for a system. This parameter overrides any specified version"]
4155 #[doc = "in the value set (and any it depends on). The format is the same as a canonical URL:"]
4156 #[doc = "`[system]|[version] - e.g. http://loinc.org|2.56`. Note that this has obvious safety issues, in that"]
4157 #[doc = "it may result in a value set expansion giving a different list of codes that is both wrong and"]
4158 #[doc = "unsafe, and implementers should only use this capability reluctantly. It primarily exists to deal"]
4159 #[doc = "with situations where specifications have fallen into decay as time passes. If the value is"]
4160 #[doc = "override, the version used SHALL explicitly be represented in the expansion parameters"]
4161 #[parameter_rename = "force-system-version"]
4162 pub force_system_version: Option<Vec<FHIRCanonical>>,
4163 }
4164 impl From<Input> for Resource {
4165 fn from(value: Input) -> Self {
4166 let parameters: Vec<ParametersParameter> = value.into();
4167 Resource::Parameters(Parameters {
4168 parameter: Some(parameters),
4169 ..Default::default()
4170 })
4171 }
4172 }
4173 #[derive(Debug, FromParameters)]
4174 pub struct Output {
4175 #[doc = "The result of the expansion. Servers generating expansions SHOULD ensure that all the parameters"]
4176 #[doc = "that affect the contents of the expansion are recorded in the `ValueSet.expansion.parameter` list"]
4177 #[parameter_rename = "return"]
4178 pub return_: ValueSet,
4179 }
4180 impl From<Output> for Resource {
4181 fn from(value: Output) -> Self {
4182 Resource::ValueSet(value.return_)
4183 }
4184 }
4185}
4186#[doc = "Validate that a coded value is in the set of codes allowed by a value set."]
4187#[doc = ""]
4188#[doc = "If the operation is not called at the instance level, one of the in parameters url, context or"]
4189#[doc = "valueSet must be provided. One (and only one) of the in parameters code, coding, or codeableConcept"]
4190#[doc = "must be provided. The operation returns a result (true / false), an error message, and the"]
4191#[doc = "recommended display for the code"]
4192pub mod ValueSetValidateCode {
4193 use haste_fhir_model::r4::generated::resources::{
4194 OperationDefinition, Parameters, ParametersParameter, Resource, ValueSet,
4195 };
4196 use haste_fhir_model::r4::generated::types::{
4197 CodeableConcept, Coding, FHIRBoolean, FHIRCode, FHIRDateTime, FHIRString, FHIRUri,
4198 };
4199 use haste_fhir_operation_error::OperationOutcomeError;
4200 use haste_fhir_ops::derive::{FromParameters, ToParameters};
4201 use std::sync::LazyLock;
4202 pub const CODE: &str = "validate-code";
4203 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ValueSet-validate-code","meta":{"lastUpdated":"2019-10-31T22:29:23.356+00:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Value Set based Validation</h2><p>OPERATION: Value Set based Validation</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ValueSet-validate-code</pre><div><p>Validate that a coded value is in the set of codes allowed by a value set.</p>\n<p>If the operation is not called at the instance level, one of the in parameters url, context or valueSet must be provided. One (and only one) of the in parameters code, coding, or codeableConcept must be provided. The operation returns a result (true / false), an error message, and the recommended display for the code</p>\n</div><p>URL: [base]/ValueSet/$validate-code</p><p>URL: [base]/ValueSet/[id]/$validate-code</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>url</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>Value set Canonical URL. The server must know the value set (e.g. it is defined explicitly in the server's value sets, or it is defined implicitly by some code system known to the server</p>\n</div></td></tr><tr><td>IN</td><td>context</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The context of the value set, so that the server can resolve this to a value set to validate against. The recommended format for this URI is [Structure Definition URL]#[name or path into structure definition] e.g. http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation. Other forms may be used but are not defined. This form is only usable if the terminology server also has access to the conformance registry that the server is using, but can be used to delegate the mapping from an application context to a binding at run-time</p>\n</div></td></tr><tr><td>IN</td><td>valueSet</td><td>0..1</td><td><a href=\"valueset.html\">ValueSet</a></td><td/><td><div><p>The value set is provided directly as part of the request. Servers may choose not to accept value sets in this fashion. This parameter is used when the client wants the server to expand a value set that is not stored on the server</p>\n</div></td></tr><tr><td>IN</td><td>valueSetVersion</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The identifier that is used to identify a specific version of the value set to be used when validating the code. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.</p>\n</div></td></tr><tr><td>IN</td><td>code</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>The code that is to be validated. If a code is provided, a system or a context must be provided (if a context is provided, then the server SHALL ensure that the code is not ambiguous without a system)</p>\n</div></td></tr><tr><td>IN</td><td>system</td><td>0..1</td><td><a href=\"datatypes.html#uri\">uri</a></td><td/><td><div><p>The system for the code that is to be validated</p>\n</div></td></tr><tr><td>IN</td><td>systemVersion</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The version of the system, if one was provided in the source data</p>\n</div></td></tr><tr><td>IN</td><td>display</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>The display associated with the code, if provided. If a display is provided a code must be provided. If no display is provided, the server cannot validate the display value, but may choose to return a recommended display name using the display parameter in the outcome. Whether displays are case sensitive is code system dependent</p>\n</div></td></tr><tr><td>IN</td><td>coding</td><td>0..1</td><td><a href=\"datatypes.html#Coding\">Coding</a></td><td/><td><div><p>A coding to validate</p>\n</div></td></tr><tr><td>IN</td><td>codeableConcept</td><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>A full codeableConcept to validate. The server returns true if one of the coding values is in the value set, and may also validate that the codings are not in conflict with each other if more than one is present</p>\n</div></td></tr><tr><td>IN</td><td>date</td><td>0..1</td><td><a href=\"datatypes.html#dateTime\">dateTime</a></td><td/><td><div><p>The date for which the validation should be checked. Normally, this is the current conditions (which is the default values) but under some circumstances, systems need to validate that a correct code was used at some point in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.</p>\n</div></td></tr><tr><td>IN</td><td>abstract</td><td>0..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If this parameter has a value of true, the client is stating that the validation is being performed in a context where a concept designated as 'abstract' is appropriate/allowed to be used, and the server should regard abstract codes as valid. If this parameter is false, abstract codes are not considered to be valid.</p>\n<p>Note that. 'abstract' is a property defined by many HL7 code systems that indicates that the concept is a logical grouping concept that is not intended to be used asa 'concrete' concept to in an actual patient/care/process record. This language is borrowed from Object Orienated theory where 'asbtract' objects are never instantiated. However in the general record and terminology eco-system, there are many contexts where it is appropraite to use these codes e.g. as decision making criterion, or when editing value sets themselves. This parameter allows a client to indicate to the server that it is working in such a context.</p>\n</div></td></tr><tr><td>IN</td><td>displayLanguage</td><td>0..1</td><td><a href=\"datatypes.html#code\">code</a></td><td/><td><div><p>Specifies the language to be used for description when validating the display property</p>\n</div></td></tr><tr><td>OUT</td><td>result</td><td>1..1</td><td><a href=\"datatypes.html#boolean\">boolean</a></td><td/><td><div><p>True if the concept details supplied are valid</p>\n</div></td></tr><tr><td>OUT</td><td>message</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>Error details, if result = false. If this is provided when result = true, the message carries hints and warnings</p>\n</div></td></tr><tr><td>OUT</td><td>display</td><td>0..1</td><td><a href=\"datatypes.html#string\">string</a></td><td/><td><div><p>A valid display for the concept if the system wishes to display this to a user</p>\n</div></td></tr></table><div><p>Note: the correct behaviour of validation with regard to language for Coding.display items is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases</p>\n</div></div>"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":5},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"normative"},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version","valueCode":"4.0.1"}],"url":"http://hl7.org/fhir/OperationDefinition/ValueSet-validate-code","version":"4.0.1","name":"Value Set based Validation","status":"draft","kind":"operation","date":"2019-10-31T22:29:23+00:00","publisher":"HL7 (FHIR Project)","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"Validate that a coded value is in the set of codes allowed by a value set.\n\nIf the operation is not called at the instance level, one of the in parameters url, context or valueSet must be provided. One (and only one) of the in parameters code, coding, or codeableConcept must be provided. The operation returns a result (true / false), an error message, and the recommended display for the code","code":"validate-code","comment":"Note: the correct behaviour of validation with regard to language for Coding.display items is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases","resource":["ValueSet"],"system":false,"type":true,"instance":true,"parameter":[{"name":"url","use":"in","min":0,"max":"1","documentation":"Value set Canonical URL. The server must know the value set (e.g. it is defined explicitly in the server's value sets, or it is defined implicitly by some code system known to the server","type":"uri"},{"name":"context","use":"in","min":0,"max":"1","documentation":"The context of the value set, so that the server can resolve this to a value set to validate against. The recommended format for this URI is [Structure Definition URL]#[name or path into structure definition] e.g. <http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation>. Other forms may be used but are not defined. This form is only usable if the terminology server also has access to the conformance registry that the server is using, but can be used to delegate the mapping from an application context to a binding at run-time","type":"uri"},{"name":"valueSet","use":"in","min":0,"max":"1","documentation":"The value set is provided directly as part of the request. Servers may choose not to accept value sets in this fashion. This parameter is used when the client wants the server to expand a value set that is not stored on the server","type":"ValueSet"},{"name":"valueSetVersion","use":"in","min":0,"max":"1","documentation":"The identifier that is used to identify a specific version of the value set to be used when validating the code. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.","type":"string"},{"name":"code","use":"in","min":0,"max":"1","documentation":"The code that is to be validated. If a code is provided, a system or a context must be provided (if a context is provided, then the server SHALL ensure that the code is not ambiguous without a system)","type":"code"},{"name":"system","use":"in","min":0,"max":"1","documentation":"The system for the code that is to be validated","type":"uri"},{"name":"systemVersion","use":"in","min":0,"max":"1","documentation":"The version of the system, if one was provided in the source data","type":"string"},{"name":"display","use":"in","min":0,"max":"1","documentation":"The display associated with the code, if provided. If a display is provided a code must be provided. If no display is provided, the server cannot validate the display value, but may choose to return a recommended display name using the display parameter in the outcome. Whether displays are case sensitive is code system dependent","type":"string"},{"name":"coding","use":"in","min":0,"max":"1","documentation":"A coding to validate","type":"Coding"},{"name":"codeableConcept","use":"in","min":0,"max":"1","documentation":"A full codeableConcept to validate. The server returns true if one of the coding values is in the value set, and may also validate that the codings are not in conflict with each other if more than one is present","type":"CodeableConcept"},{"name":"date","use":"in","min":0,"max":"1","documentation":"The date for which the validation should be checked. Normally, this is the current conditions (which is the default values) but under some circumstances, systems need to validate that a correct code was used at some point in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.","type":"dateTime"},{"name":"abstract","use":"in","min":0,"max":"1","documentation":"If this parameter has a value of true, the client is stating that the validation is being performed in a context where a concept designated as 'abstract' is appropriate/allowed to be used, and the server should regard abstract codes as valid. If this parameter is false, abstract codes are not considered to be valid.\n\nNote that. 'abstract' is a property defined by many HL7 code systems that indicates that the concept is a logical grouping concept that is not intended to be used asa 'concrete' concept to in an actual patient/care/process record. This language is borrowed from Object Orienated theory where 'asbtract' objects are never instantiated. However in the general record and terminology eco-system, there are many contexts where it is appropraite to use these codes e.g. as decision making criterion, or when editing value sets themselves. This parameter allows a client to indicate to the server that it is working in such a context.","type":"boolean"},{"name":"displayLanguage","use":"in","min":0,"max":"1","documentation":"Specifies the language to be used for description when validating the display property","type":"code"},{"name":"result","use":"out","min":1,"max":"1","documentation":"True if the concept details supplied are valid","type":"boolean"},{"name":"message","use":"out","min":0,"max":"1","documentation":"Error details, if result = false. If this is provided when result = true, the message carries hints and warnings","type":"string"},{"name":"display","use":"out","min":0,"max":"1","documentation":"A valid display for the concept if the system wishes to display this to a user","type":"string"}]}"#;
4204 #[doc = "The `OperationDefinition` this module was generated from."]
4205 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
4206 serde_json::from_str(OPERATION_DEFINITION_JSON)
4207 .expect("Generated OperationDefinition JSON must deserialize.")
4208 });
4209 #[derive(Debug, FromParameters, ToParameters)]
4210 pub struct Input {
4211 #[doc = "Value set Canonical URL. The server must know the value set (e.g. it is defined explicitly in the"]
4212 #[doc = "server's value sets, or it is defined implicitly by some code system known to the server"]
4213 pub url: Option<FHIRUri>,
4214 #[doc = "The context of the value set, so that the server can resolve this to a value set to validate"]
4215 #[doc = "against. The recommended format for this URI is [Structure Definition URL]#[name or path into"]
4216 #[doc = "structure definition] e.g."]
4217 #[doc = "<`http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation>`."]
4218 #[doc = "Other forms may be used but are not defined. This form is only usable if the terminology server also"]
4219 #[doc = "has access to the conformance registry that the server is using, but can be used to delegate the"]
4220 #[doc = "mapping from an application context to a binding at run-time"]
4221 pub context: Option<FHIRUri>,
4222 #[doc = "The value set is provided directly as part of the request. Servers may choose not to accept value"]
4223 #[doc = "sets in this fashion. This parameter is used when the client wants the server to expand a value set"]
4224 #[doc = "that is not stored on the server"]
4225 pub valueSet: Option<ValueSet>,
4226 #[doc = "The identifier that is used to identify a specific version of the value set to be used when"]
4227 #[doc = "validating the code. This is an arbitrary value managed by the value set author and is not expected"]
4228 #[doc = "to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is"]
4229 #[doc = "not available."]
4230 pub valueSetVersion: Option<FHIRString>,
4231 #[doc = "The code that is to be validated. If a code is provided, a system or a context must be provided (if"]
4232 #[doc = "a context is provided, then the server SHALL ensure that the code is not ambiguous without a system)"]
4233 pub code: Option<FHIRCode>,
4234 #[doc = "The system for the code that is to be validated"]
4235 pub system: Option<FHIRUri>,
4236 #[doc = "The version of the system, if one was provided in the source data"]
4237 pub systemVersion: Option<FHIRString>,
4238 #[doc = "The display associated with the code, if provided. If a display is provided a code must be provided."]
4239 #[doc = "If no display is provided, the server cannot validate the display value, but may choose to return a"]
4240 #[doc = "recommended display name using the display parameter in the outcome. Whether displays are case"]
4241 #[doc = "sensitive is code system dependent"]
4242 pub display: Option<FHIRString>,
4243 #[doc = "A coding to validate"]
4244 pub coding: Option<Coding>,
4245 #[doc = "A full codeableConcept to validate. The server returns true if one of the coding values is in the"]
4246 #[doc = "value set, and may also validate that the codings are not in conflict with each other if more than"]
4247 #[doc = "one is present"]
4248 pub codeableConcept: Option<CodeableConcept>,
4249 #[doc = "The date for which the validation should be checked. Normally, this is the current conditions (which"]
4250 #[doc = "is the default values) but under some circumstances, systems need to validate that a correct code"]
4251 #[doc = "was used at some point in the past. A typical example of this would be where code selection is"]
4252 #[doc = "constrained to the set of codes that were available when the patient was treated, not when the"]
4253 #[doc = "record is being edited. Note that which date is appropriate is a matter for implementation policy."]
4254 pub date: Option<FHIRDateTime>,
4255 #[doc = "If this parameter has a value of true, the client is stating that the validation is being performed"]
4256 #[doc = "in a context where a concept designated as `abstract` is appropriate/allowed to be used, and the"]
4257 #[doc = "server should regard abstract codes as valid. If this parameter is false, abstract codes are not"]
4258 #[doc = "considered to be valid."]
4259 #[doc = ""]
4260 #[doc = "Note that. `abstract` is a property defined by many HL7 code systems that indicates that the concept"]
4261 #[doc = "is a logical grouping concept that is not intended to be used asa `concrete` concept to in an actual"]
4262 #[doc = "patient/care/process record. This language is borrowed from Object Orienated theory where `asbtract`"]
4263 #[doc = "objects are never instantiated. However in the general record and terminology eco-system, there are"]
4264 #[doc = "many contexts where it is appropraite to use these codes e.g. as decision making criterion, or when"]
4265 #[doc = "editing value sets themselves. This parameter allows a client to indicate to the server that it is"]
4266 #[doc = "working in such a context."]
4267 #[parameter_rename = "abstract"]
4268 pub abstract_: Option<FHIRBoolean>,
4269 #[doc = "Specifies the language to be used for description when validating the display property"]
4270 pub displayLanguage: Option<FHIRCode>,
4271 }
4272 impl From<Input> for Resource {
4273 fn from(value: Input) -> Self {
4274 let parameters: Vec<ParametersParameter> = value.into();
4275 Resource::Parameters(Parameters {
4276 parameter: Some(parameters),
4277 ..Default::default()
4278 })
4279 }
4280 }
4281 #[derive(Debug, FromParameters, ToParameters)]
4282 pub struct Output {
4283 #[doc = "True if the concept details supplied are valid"]
4284 pub result: FHIRBoolean,
4285 #[doc = "Error details, if result = false. If this is provided when result = true, the message carries hints"]
4286 #[doc = "and warnings"]
4287 pub message: Option<FHIRString>,
4288 #[doc = "A valid display for the concept if the system wishes to display this to a user"]
4289 pub display: Option<FHIRString>,
4290 }
4291 impl From<Output> for Resource {
4292 fn from(value: Output) -> Self {
4293 let parameters: Vec<ParametersParameter> = value.into();
4294 Resource::Parameters(Parameters {
4295 parameter: Some(parameters),
4296 ..Default::default()
4297 })
4298 }
4299 }
4300}
4301#[doc = "Execute a view definition against supplied or server data."]
4302pub mod ViewDefinitionRun {
4303 use haste_fhir_model::r4::generated::resources::{
4304 Binary, OperationDefinition, Parameters, ParametersParameter, Resource, ViewDefinition,
4305 };
4306 use haste_fhir_model::r4::generated::types::{
4307 FHIRBoolean, FHIRCode, FHIRInstant, FHIRInteger, FHIRString, Reference,
4308 };
4309 use haste_fhir_operation_error::OperationOutcomeError;
4310 use haste_fhir_ops::derive::{FromParameters, ToParameters};
4311 use std::sync::LazyLock;
4312 pub const CODE: &str = "viewdefinition-run";
4313 const OPERATION_DEFINITION_JSON: &str = r#"{"resourceType":"OperationDefinition","id":"ViewDefinitionRun","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition ViewDefinitionRun</b></p><a name=\"ViewDefinitionRun\"> </a><a name=\"hcViewDefinitionRun\"> </a><p>URL: [base]/$viewdefinition-run</p><p>URL: [base]/CanonicalResource/$viewdefinition-run</p><p>URL: [base]/CanonicalResource/[id]/$viewdefinition-run</p><h3>Parameters</h3><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>_format</td><td>system, type, instance</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/datatypes.html#code\">code</a></td><td><a href=\"ValueSet-OutputFormatCodes.html\">Output Format Codes</a> (Extensible)</td><td><div><p>Output format for the result (for example json, ndjson, csv, parquet). Optional; if omitted, the server returns ndjson by default.</p>\n</div></td></tr><tr><td>IN</td><td>header</td><td>system, type, instance</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Include CSV headers (default true). Applies only when csv output is requested.</p>\n</div></td></tr><tr><td>IN</td><td>viewReference</td><td>system, type</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/references.html#Reference\">Reference</a></td><td/><td><div><p>Reference to a ViewDefinition stored on the server.</p>\n</div></td></tr><tr><td>IN</td><td>viewResource</td><td>system, type</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/canonicalresource.html\">CanonicalResource</a> (<a href=\"StructureDefinition-ViewDefinition.html\" title=\"https://sql-on-fhir.org/ig/StructureDefinition/ViewDefinition\">View Definition</a>)</td><td/><td><div><p>Inline ViewDefinition resource to execute.</p>\n</div></td></tr><tr><td>IN</td><td>patient</td><td>system, type, instance</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/references.html#Reference\">Reference</a></td><td/><td><div><p>Restrict execution to the specified patient.</p>\n</div></td></tr><tr><td>IN</td><td>group</td><td>system, type, instance</td><td>0..*</td><td><a href=\"http://hl7.org/fhir/R5/references.html#Reference\">Reference</a></td><td/><td><div><p>Restrict execution to members of the given group(s).</p>\n</div></td></tr><tr><td>IN</td><td>source</td><td>system, type, instance</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/datatypes.html#string\">string</a></td><td/><td><div><p>External data source to use (for example a URI or bucket name).</p>\n</div></td></tr><tr><td>IN</td><td>resource</td><td>system, type, instance</td><td>0..*</td><td><a href=\"http://hl7.org/fhir/R5/resource.html\">Resource</a></td><td/><td><div><p>FHIR resources to transform instead of using server data.</p>\n</div></td></tr><tr><td>IN</td><td>_limit</td><td>system, type, instance</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/datatypes.html#integer\">integer</a></td><td/><td><div><p>Maximum number of rows to return.</p>\n</div></td></tr><tr><td>IN</td><td>_since</td><td>system, type, instance</td><td>0..1</td><td><a href=\"http://hl7.org/fhir/R5/datatypes.html#instant\">instant</a></td><td/><td><div><p>Include only resources modified after this instant.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R5/binary.html\">Binary</a></td><td/><td><div><p>Transformed data encoded in the requested output format.</p>\n</div></td></tr></table></div>"},"url":"http://sql-on-fhir.org/OperationDefinition/$viewdefinition-run","version":"2.1.0-pre","name":"ViewDefinitionRun","title":"ViewDefinition Run","status":"active","kind":"operation","date":"2026-05-21T08:53:46+00:00","publisher":"SQL on FHIR Working Group","contact":[{"name":"SQL on FHIR Working Group","telecom":[{"system":"url","value":"https://sql-on-fhir.org"}]}],"description":"Execute a view definition against supplied or server data.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"001","display":"World"}]}],"code":"viewdefinition-run","resource":["ViewDefinition"],"system":true,"type":true,"instance":true,"parameter":[{"name":"_format","use":"in","min":0,"max":"1","documentation":"Output format for the result (for example json, ndjson, csv, parquet). Optional; if omitted, the server returns ndjson by default.","type":"code","binding":{"strength":"extensible","valueSet":"https://sql-on-fhir.org/ig/ValueSet/OutputFormatCodes"}},{"name":"header","use":"in","min":0,"max":"1","documentation":"Include CSV headers (default true). Applies only when csv output is requested.","type":"boolean"},{"name":"viewReference","use":"in","min":0,"max":"1","documentation":"Reference to a ViewDefinition stored on the server.","type":"Reference"},{"name":"viewResource","use":"in","min":0,"max":"1","documentation":"Inline ViewDefinition resource to execute.","type":"ViewDefinition","targetProfile":["https://sql-on-fhir.org/ig/StructureDefinition/ViewDefinition"]},{"name":"patient","use":"in","min":0,"max":"1","documentation":"Restrict execution to the specified patient.","type":"Reference"},{"name":"group","use":"in","min":0,"max":"*","documentation":"Restrict execution to members of the given group(s).","type":"Reference"},{"name":"source","use":"in","min":0,"max":"1","documentation":"External data source to use (for example a URI or bucket name).","type":"string"},{"name":"resource","use":"in","min":0,"max":"*","documentation":"FHIR resources to transform instead of using server data.","type":"Resource"},{"name":"_limit","use":"in","min":0,"max":"1","documentation":"Maximum number of rows to return.","type":"integer"},{"name":"_since","use":"in","min":0,"max":"1","documentation":"Include only resources modified after this instant.","type":"instant"},{"name":"return","use":"out","min":1,"max":"1","documentation":"Transformed data encoded in the requested output format.","type":"Binary"}]}"#;
4314 #[doc = "The `OperationDefinition` this module was generated from."]
4315 pub static OPERATION_DEFINITION: LazyLock<OperationDefinition> = LazyLock::new(|| {
4316 serde_json::from_str(OPERATION_DEFINITION_JSON)
4317 .expect("Generated OperationDefinition JSON must deserialize.")
4318 });
4319 #[derive(Debug, FromParameters, ToParameters)]
4320 pub struct Input {
4321 #[doc = "Output format for the result (for example json, ndjson, csv, parquet). Optional; if omitted, the"]
4322 #[doc = "server returns ndjson by default."]
4323 #[parameter_rename = "_format"]
4324 pub format: Option<FHIRCode>,
4325 #[doc = "Include CSV headers (default true). Applies only when csv output is requested."]
4326 pub header: Option<FHIRBoolean>,
4327 #[doc = "Reference to a `ViewDefinition` stored on the server."]
4328 pub viewReference: Option<Reference>,
4329 #[doc = "Inline `ViewDefinition` resource to execute."]
4330 pub viewResource: Option<ViewDefinition>,
4331 #[doc = "Restrict execution to the specified patient."]
4332 pub patient: Option<Reference>,
4333 #[doc = "Restrict execution to members of the given group(s)."]
4334 pub group: Option<Vec<Reference>>,
4335 #[doc = "External data source to use (for example a URI or bucket name)."]
4336 pub source: Option<FHIRString>,
4337 #[doc = "FHIR resources to transform instead of using server data."]
4338 pub resource: Option<Vec<Resource>>,
4339 #[doc = "Maximum number of rows to return."]
4340 #[parameter_rename = "_limit"]
4341 pub limit: Option<FHIRInteger>,
4342 #[doc = "Include only resources modified after this instant."]
4343 #[parameter_rename = "_since"]
4344 pub since: Option<FHIRInstant>,
4345 }
4346 impl From<Input> for Resource {
4347 fn from(value: Input) -> Self {
4348 let parameters: Vec<ParametersParameter> = value.into();
4349 Resource::Parameters(Parameters {
4350 parameter: Some(parameters),
4351 ..Default::default()
4352 })
4353 }
4354 }
4355 #[derive(Debug, FromParameters)]
4356 pub struct Output {
4357 #[doc = "Transformed data encoded in the requested output format."]
4358 #[parameter_rename = "return"]
4359 pub return_: Binary,
4360 }
4361 impl From<Output> for Resource {
4362 fn from(value: Output) -> Self {
4363 Resource::Binary(value.return_)
4364 }
4365 }
4366}