#![allow(
clippy::all,
clippy::pedantic,
clippy::nursery,
dead_code,
unused_imports,
unused_variables,
reason = "mechanically generated contract text: the OAS is emitted in full (every DTO, param struct and route, whether or not this workspace consumes it yet), so style and dead-code lints do not apply — the hand-written runtime and the implementing adapter carry the lint bar"
)]
#![allow(
clippy::disallowed_types,
reason = "adjudicated free-form JSON slots: serde_json::Value is workspace-banned (#1694); a generated carrier exists only where the spec leaves the slot open — `allow`, not `expect`, because a carrier may sit inside a feature-gated region and fire only under that feature"
)]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionOfComposition {
#[serde(skip_serializing_if = "Option::is_none")]
pub _type: Option<String>,
pub contribution: openehr_base::prelude::ObjectRef,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
pub commit_audit: openehr_rm::v1_2::common::generic::audit_details::AuditDetails,
pub data: openehr_rm::v1_2::composition::composition::Composition,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionOfEhrStatus {
#[serde(skip_serializing_if = "Option::is_none")]
pub _type: Option<String>,
pub contribution: openehr_base::prelude::ObjectRef,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
pub commit_audit: openehr_rm::v1_2::common::generic::audit_details::AuditDetails,
pub data: openehr_rm::v1_2::ehr::ehr_status::EhrStatus,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone)]
pub enum Versionable {
Composition(openehr_rm::v1_2::composition::composition::Composition),
EhrStatus(openehr_rm::v1_2::ehr::ehr_status::EhrStatus),
Folder(openehr_rm::v1_2::common::directory::folder::Folder),
}
impl ::serde::Serialize for Versionable {
fn serialize<__S: ::serde::Serializer>(
&self,
__serializer: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
match self {
Self::Composition(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::EhrStatus(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Folder(__x) => ::serde::Serialize::serialize(__x, __serializer),
}
}
}
impl<'de> ::serde::Deserialize<'de> for Versionable {
fn deserialize<__D: ::serde::Deserializer<'de>>(
__deserializer: __D,
) -> ::core::result::Result<Self, __D::Error> {
const __TAGS: &[&str] = &["COMPOSITION", "EHR_STATUS", "FOLDER"];
struct __Visitor;
impl<'de> ::serde::de::Visitor<'de> for __Visitor {
type Value = Versionable;
fn expecting(&self, __f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
__f.write_str("an ITS-REST `Versionable` object")
}
fn visit_map<__A: ::serde::de::MapAccess<'de>>(
self,
mut __map: __A,
) -> ::core::result::Result<Self::Value, __A::Error> {
let (__tag, __buffered) =
::openehr_base::serde_support::read_slot_tag(&mut __map, __TAGS)?;
match __tag {
Some(::openehr_base::serde_support::TagMatch::Known(__t)) => {
let __rest = ::openehr_base::serde_support::TaggedRest::new(
Some(__t),
__buffered,
__map,
);
match __t {
"COMPOSITION" => ::core::result::Result::Ok(Versionable::Composition(
::serde::Deserialize::deserialize(__rest)?,
)),
"EHR_STATUS" => ::core::result::Result::Ok(Versionable::EhrStatus(
::serde::Deserialize::deserialize(__rest)?,
)),
"FOLDER" => ::core::result::Result::Ok(Versionable::Folder(
::serde::Deserialize::deserialize(__rest)?,
)),
__other => ::core::result::Result::Err(
::openehr_base::serde_support::unexpected_type(
"Versionable",
__other,
"COMPOSITION, EHR_STATUS, FOLDER",
),
),
}
}
Some(::openehr_base::serde_support::TagMatch::Unknown(__other)) => {
::core::result::Result::Err(::openehr_base::serde_support::unexpected_type(
"Versionable",
&__other,
"COMPOSITION, EHR_STATUS, FOLDER",
))
}
None => {
::core::result::Result::Err(::openehr_base::serde_support::missing_type(
"Versionable",
"COMPOSITION, EHR_STATUS, FOLDER",
))
}
}
}
}
::serde::Deserializer::deserialize_map(__deserializer, __Visitor)
}
}
pub type UpdateVersion = super::common::UpdateVersion<Versionable>;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NewContribution {
#[serde(skip_serializing_if = "Option::is_none")]
pub uid: Option<openehr_base::v1_3::base_types::identification::hier_object_id::HierObjectId>,
pub versions: Vec<UpdateVersion>,
pub audit: super::common::UpdateAudit,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
pub type ItemTagOfComposition = openehr_rm::v1_2::common::tags::item_tag::ItemTag;
pub type ItemTagOfEhrStatus = openehr_rm::v1_2::common::tags::item_tag::ItemTag;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrGetBySubjectParams {
pub subject_id: String,
pub subject_namespace: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl EhrGetBySubjectParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "subject_id",
location: crate::rest::routes::ParamLocation::Query,
required: true,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "subject_namespace",
location: crate::rest::routes::ParamLocation::Query,
required: true,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrCreateParams {
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl EhrCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrGetByIdParams {
pub ehr_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl EhrGetByIdParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrCreateWithIdParams {
pub ehr_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl EhrCreateWithIdParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrStatusGetByVersionIdParams {
pub ehr_id: String,
pub version_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl EhrStatusGetByVersionIdParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrStatusGetAtTimeParams {
pub ehr_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl EhrStatusGetAtTimeParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrStatusUpdateParams {
pub ehr_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl EhrStatusUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedEhrStatusGetParams {
pub ehr_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedEhrStatusGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedEhrStatusRevisionHistoryParams {
pub ehr_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedEhrStatusRevisionHistoryParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedEhrStatusVersionGetAtTimeParams {
pub ehr_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedEhrStatusVersionGetAtTimeParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedEhrStatusVersionGetByIdParams {
pub ehr_id: String,
pub version_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedEhrStatusVersionGetByIdParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompositionCreateParams {
pub ehr_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
#[serde(rename = "openehr-template-id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_template_id: Option<String>,
}
impl CompositionCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
crate::rest::routes::Param {
name: "openehr-template-id",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompositionGetParams {
pub ehr_id: String,
pub uid_based_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl CompositionGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompositionUpdateParams {
pub ehr_id: String,
pub uid_based_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
#[serde(rename = "openehr-template-id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_template_id: Option<String>,
}
impl CompositionUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
crate::rest::routes::Param {
name: "openehr-template-id",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompositionDeleteParams {
pub ehr_id: String,
pub uid_based_id: String,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl CompositionDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedCompositionGetParams {
pub ehr_id: String,
pub versioned_object_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedCompositionGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedCompositionRevisionHistoryParams {
pub ehr_id: String,
pub versioned_object_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedCompositionRevisionHistoryParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedCompositionVersionGetAtTimeParams {
pub ehr_id: String,
pub versioned_object_uid: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedCompositionVersionGetAtTimeParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedCompositionVersionGetByIdParams {
pub ehr_id: String,
pub versioned_object_uid: String,
pub version_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedCompositionVersionGetByIdParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DirectoryGetAtTimeParams {
pub ehr_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl DirectoryGetAtTimeParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
},
crate::rest::routes::Param {
name: "path",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DirectoryUpdateParams {
pub ehr_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl DirectoryUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DirectoryCreateParams {
pub ehr_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl DirectoryCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DirectoryDeleteParams {
pub ehr_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl DirectoryDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DirectoryGetByVersionIdParams {
pub ehr_id: String,
pub version_uid: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl DirectoryGetByVersionIdParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "version_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "path",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ContributionCreateParams {
pub ehr_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-template-id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_template_id: Option<String>,
}
impl ContributionCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
crate::rest::routes::Param {
name: "openehr-template-id",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ContributionGetParams {
pub ehr_id: String,
pub contribution_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl ContributionGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "contribution_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrTagsGetParams {
pub ehr_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_key: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_value: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_target_path: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl EhrTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "tag_key",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "tag_value",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "tag_target_path",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompositionTagsGetParams {
pub ehr_id: String,
pub uid_based_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl CompositionTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompositionTagsUpdateParams {
pub ehr_id: String,
pub uid_based_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl CompositionTagsUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompositionTagsDeleteParams {
pub ehr_id: String,
pub uid_based_id: String,
pub key: String,
}
impl CompositionTagsDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "key",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrStatusTagsGetParams {
pub ehr_id: String,
pub uid_based_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl EhrStatusTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrStatusTagsUpdateParams {
pub ehr_id: String,
pub uid_based_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl EhrStatusTagsUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
},
];
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EhrStatusTagsDeleteParams {
pub ehr_id: String,
pub uid_based_id: String,
pub key: String,
}
impl EhrStatusTagsDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "ehr_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
},
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
crate::rest::routes::Param {
name: "key",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
},
];
}
#[derive(Debug, Clone, Default)]
pub struct EhrGetBySubjectOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrGetBySubjectOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrGetByIdOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrGetByIdOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrCreateWithIdCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrCreateWithIdCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrCreateWithIdNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrCreateWithIdNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrStatusGetByVersionIdOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrStatusGetByVersionIdOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrStatusGetAtTimeOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrStatusGetAtTimeOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrStatusUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrStatusUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrStatusUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrStatusUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrStatusUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrStatusUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedEhrStatusGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedEhrStatusGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedEhrStatusRevisionHistoryOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedEhrStatusRevisionHistoryOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedEhrStatusVersionGetAtTimeOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedEhrStatusVersionGetAtTimeOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedEhrStatusVersionGetByIdOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedEhrStatusVersionGetByIdOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionGetOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionDeleteNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionDeleteNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionDeleteConflictHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionDeleteConflictHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedCompositionGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedCompositionGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedCompositionRevisionHistoryOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedCompositionRevisionHistoryOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedCompositionVersionGetAtTimeOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedCompositionVersionGetAtTimeOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedCompositionVersionGetByIdOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedCompositionVersionGetByIdOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryGetAtTimeOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryGetAtTimeOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryDeletePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryDeletePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DirectoryGetByVersionIdOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DirectoryGetByVersionIdOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct ContributionCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for ContributionCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct ContributionCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for ContributionCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct ContributionGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for ContributionGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct CompositionTagsUpdateOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for CompositionTagsUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrStatusTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrStatusTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct EhrStatusTagsUpdateOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for EhrStatusTagsUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[cfg(feature = "rest-server")]
pub mod server {
use super::*;
#[derive(Debug, Clone)]
pub enum EhrGetBySubjectResponse {
Ok {
body: openehr_rm::v1_2::ehr::ehr::Ehr,
headers: EhrGetBySubjectOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrCreateResponse {
Created {
body: Option<serde_json::Value>,
headers: EhrCreateCreatedHeaders,
},
NoContent {
headers: EhrCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrGetByIdResponse {
Ok {
body: openehr_rm::v1_2::ehr::ehr::Ehr,
headers: EhrGetByIdOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrCreateWithIdResponse {
Created {
body: Option<serde_json::Value>,
headers: EhrCreateWithIdCreatedHeaders,
},
NoContent {
headers: EhrCreateWithIdNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusGetByVersionIdResponse {
Ok {
body: openehr_rm::v1_2::ehr::ehr_status::EhrStatus,
headers: EhrStatusGetByVersionIdOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusGetAtTimeResponse {
Ok {
body: openehr_rm::v1_2::ehr::ehr_status::EhrStatus,
headers: EhrStatusGetAtTimeOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusUpdateResponse {
Ok {
body: serde_json::Value,
headers: EhrStatusUpdateOkHeaders,
},
NoContent {
headers: EhrStatusUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusGetResponse {
Ok {
body: openehr_rm::v1_2::ehr::versioned_ehr_status::VersionedEhrStatus,
headers: VersionedEhrStatusGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusRevisionHistoryResponse {
Ok {
body: openehr_rm::v1_2::common::generic::revision_history::RevisionHistory,
headers: VersionedEhrStatusRevisionHistoryOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusVersionGetAtTimeResponse {
Ok {
body: VersionOfEhrStatus,
headers: VersionedEhrStatusVersionGetAtTimeOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusVersionGetByIdResponse {
Ok {
body: VersionOfEhrStatus,
headers: VersionedEhrStatusVersionGetByIdOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum CompositionCreateResponse {
Created {
body: Option<serde_json::Value>,
headers: CompositionCreateCreatedHeaders,
},
NoContent {
headers: CompositionCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum CompositionGetResponse {
Ok {
body: openehr_rm::v1_2::composition::composition::Composition,
headers: CompositionGetOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum CompositionUpdateResponse {
Ok {
body: serde_json::Value,
headers: CompositionUpdateOkHeaders,
},
NoContent {
headers: CompositionUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum CompositionDeleteResponse {
NoContent {
headers: CompositionDeleteNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionGetResponse {
Ok {
body: openehr_rm::v1_2::ehr::versioned_composition::VersionedComposition,
headers: VersionedCompositionGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionRevisionHistoryResponse {
Ok {
body: openehr_rm::v1_2::common::generic::revision_history::RevisionHistory,
headers: VersionedCompositionRevisionHistoryOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionVersionGetAtTimeResponse {
Ok {
body: VersionOfComposition,
headers: VersionedCompositionVersionGetAtTimeOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionVersionGetByIdResponse {
Ok {
body: VersionOfComposition,
headers: VersionedCompositionVersionGetByIdOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryGetAtTimeResponse {
Ok {
body: openehr_rm::v1_2::common::directory::folder::Folder,
headers: DirectoryGetAtTimeOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum DirectoryUpdateResponse {
Ok {
body: serde_json::Value,
headers: DirectoryUpdateOkHeaders,
},
NoContent {
headers: DirectoryUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryCreateResponse {
Created {
body: Option<serde_json::Value>,
headers: DirectoryCreateCreatedHeaders,
},
NoContent {
headers: DirectoryCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryDeleteResponse {
NoContent,
}
#[derive(Debug, Clone)]
pub enum DirectoryGetByVersionIdResponse {
Ok {
body: openehr_rm::v1_2::common::directory::folder::Folder,
headers: DirectoryGetByVersionIdOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum ContributionCreateResponse {
Created {
body: Option<serde_json::Value>,
headers: ContributionCreateCreatedHeaders,
},
NoContent {
headers: ContributionCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum ContributionGetResponse {
Ok {
body: openehr_rm::v1_2::common::change_control::contribution::Contribution,
headers: ContributionGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrTagsGetResponse {
Ok {
body: Vec<ItemTagOfComposition>,
headers: EhrTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum CompositionTagsGetResponse {
Ok {
body: Vec<ItemTagOfComposition>,
headers: CompositionTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum CompositionTagsUpdateResponse {
Ok {
body: Vec<ItemTagOfComposition>,
headers: CompositionTagsUpdateOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum CompositionTagsDeleteResponse {
NoContent,
}
#[derive(Debug, Clone)]
pub enum EhrStatusTagsGetResponse {
Ok {
body: Vec<ItemTagOfEhrStatus>,
headers: EhrStatusTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusTagsUpdateResponse {
Ok {
body: Vec<ItemTagOfEhrStatus>,
headers: EhrStatusTagsUpdateOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum EhrStatusTagsDeleteResponse {
NoContent,
}
#[async_trait::async_trait]
pub trait EhrApi {
async fn ehr_get_by_subject(
&self,
params: EhrGetBySubjectParams,
) -> Result<EhrGetBySubjectResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_create(
&self,
params: EhrCreateParams,
body: Option<openehr_rm::v1_2::ehr::ehr_status::EhrStatus>,
) -> Result<EhrCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_get_by_id(
&self,
params: EhrGetByIdParams,
) -> Result<EhrGetByIdResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_create_with_id(
&self,
params: EhrCreateWithIdParams,
body: Option<openehr_rm::v1_2::ehr::ehr_status::EhrStatus>,
) -> Result<EhrCreateWithIdResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_status_get_by_version_id(
&self,
params: EhrStatusGetByVersionIdParams,
) -> Result<EhrStatusGetByVersionIdResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_status_get_at_time(
&self,
params: EhrStatusGetAtTimeParams,
) -> Result<EhrStatusGetAtTimeResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_status_update(
&self,
params: EhrStatusUpdateParams,
body: openehr_rm::v1_2::ehr::ehr_status::EhrStatus,
) -> Result<EhrStatusUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_ehr_status_get(
&self,
params: VersionedEhrStatusGetParams,
) -> Result<VersionedEhrStatusGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_ehr_status_revision_history(
&self,
params: VersionedEhrStatusRevisionHistoryParams,
) -> Result<VersionedEhrStatusRevisionHistoryResponse, crate::rest::runtime::Refusal>
{
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_ehr_status_version_get_at_time(
&self,
params: VersionedEhrStatusVersionGetAtTimeParams,
) -> Result<VersionedEhrStatusVersionGetAtTimeResponse, crate::rest::runtime::Refusal>
{
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_ehr_status_version_get_by_id(
&self,
params: VersionedEhrStatusVersionGetByIdParams,
) -> Result<VersionedEhrStatusVersionGetByIdResponse, crate::rest::runtime::Refusal>
{
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn composition_create(
&self,
params: CompositionCreateParams,
body: openehr_rm::v1_2::composition::composition::Composition,
) -> Result<CompositionCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn composition_get(
&self,
params: CompositionGetParams,
) -> Result<CompositionGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn composition_update(
&self,
params: CompositionUpdateParams,
body: openehr_rm::v1_2::composition::composition::Composition,
) -> Result<CompositionUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn composition_delete(
&self,
params: CompositionDeleteParams,
) -> Result<CompositionDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_composition_get(
&self,
params: VersionedCompositionGetParams,
) -> Result<VersionedCompositionGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_composition_revision_history(
&self,
params: VersionedCompositionRevisionHistoryParams,
) -> Result<VersionedCompositionRevisionHistoryResponse, crate::rest::runtime::Refusal>
{
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_composition_version_get_at_time(
&self,
params: VersionedCompositionVersionGetAtTimeParams,
) -> Result<VersionedCompositionVersionGetAtTimeResponse, crate::rest::runtime::Refusal>
{
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_composition_version_get_by_id(
&self,
params: VersionedCompositionVersionGetByIdParams,
) -> Result<VersionedCompositionVersionGetByIdResponse, crate::rest::runtime::Refusal>
{
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn directory_get_at_time(
&self,
params: DirectoryGetAtTimeParams,
) -> Result<DirectoryGetAtTimeResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn directory_update(
&self,
params: DirectoryUpdateParams,
body: openehr_rm::v1_2::common::directory::folder::Folder,
) -> Result<DirectoryUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn directory_create(
&self,
params: DirectoryCreateParams,
body: openehr_rm::v1_2::common::directory::folder::Folder,
) -> Result<DirectoryCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn directory_delete(
&self,
params: DirectoryDeleteParams,
) -> Result<DirectoryDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn directory_get_by_version_id(
&self,
params: DirectoryGetByVersionIdParams,
) -> Result<DirectoryGetByVersionIdResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn contribution_create(
&self,
params: ContributionCreateParams,
body: NewContribution,
) -> Result<ContributionCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn contribution_get(
&self,
params: ContributionGetParams,
) -> Result<ContributionGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_tags_get(
&self,
params: EhrTagsGetParams,
) -> Result<EhrTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn composition_tags_get(
&self,
params: CompositionTagsGetParams,
) -> Result<CompositionTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn composition_tags_update(
&self,
params: CompositionTagsUpdateParams,
body: Vec<super::super::common::UpdateItemTag>,
) -> Result<CompositionTagsUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn composition_tags_delete(
&self,
params: CompositionTagsDeleteParams,
) -> Result<CompositionTagsDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_status_tags_get(
&self,
params: EhrStatusTagsGetParams,
) -> Result<EhrStatusTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_status_tags_update(
&self,
params: EhrStatusTagsUpdateParams,
body: Vec<super::super::common::UpdateItemTag>,
) -> Result<EhrStatusTagsUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn ehr_status_tags_delete(
&self,
params: EhrStatusTagsDeleteParams,
) -> Result<EhrStatusTagsDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
}
pub fn router<S>(api: std::sync::Arc<S>) -> axum::Router
where
S: EhrApi + Send + Sync + 'static,
{
axum::Router::new()
.route(
"/ehr",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_ehr_get_by_subject::<S>,
),
)
.route(
"/ehr",
axum::routing::on(axum::routing::MethodFilter::POST, handle_ehr_create::<S>),
)
.route(
"/ehr/{p2}",
axum::routing::on(axum::routing::MethodFilter::GET, handle_ehr_get_by_id::<S>),
)
.route(
"/ehr/{p2}",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_ehr_create_with_id::<S>,
),
)
.route(
"/ehr/{p2}/ehr_status/{p4}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_ehr_status_get_by_version_id::<S>,
),
)
.route(
"/ehr/{p2}/ehr_status",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_ehr_status_get_at_time::<S>,
),
)
.route(
"/ehr/{p2}/ehr_status",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_ehr_status_update::<S>,
),
)
.route(
"/ehr/{p2}/versioned_ehr_status",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_ehr_status_get::<S>,
),
)
.route(
"/ehr/{p2}/versioned_ehr_status/revision_history",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_ehr_status_revision_history::<S>,
),
)
.route(
"/ehr/{p2}/versioned_ehr_status/version",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_ehr_status_version_get_at_time::<S>,
),
)
.route(
"/ehr/{p2}/versioned_ehr_status/version/{p5}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_ehr_status_version_get_by_id::<S>,
),
)
.route(
"/ehr/{p2}/composition",
axum::routing::on(
axum::routing::MethodFilter::POST,
handle_composition_create::<S>,
),
)
.route(
"/ehr/{p2}/composition/{p4}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_composition_get::<S>,
),
)
.route(
"/ehr/{p2}/composition/{p4}",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_composition_update::<S>,
),
)
.route(
"/ehr/{p2}/composition/{p4}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_composition_delete::<S>,
),
)
.route(
"/ehr/{p2}/versioned_composition/{p4}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_composition_get::<S>,
),
)
.route(
"/ehr/{p2}/versioned_composition/{p4}/revision_history",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_composition_revision_history::<S>,
),
)
.route(
"/ehr/{p2}/versioned_composition/{p4}/version",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_composition_version_get_at_time::<S>,
),
)
.route(
"/ehr/{p2}/versioned_composition/{p4}/version/{p6}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_composition_version_get_by_id::<S>,
),
)
.route(
"/ehr/{p2}/directory",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_directory_get_at_time::<S>,
),
)
.route(
"/ehr/{p2}/directory",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_directory_update::<S>,
),
)
.route(
"/ehr/{p2}/directory",
axum::routing::on(
axum::routing::MethodFilter::POST,
handle_directory_create::<S>,
),
)
.route(
"/ehr/{p2}/directory",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_directory_delete::<S>,
),
)
.route(
"/ehr/{p2}/directory/{p4}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_directory_get_by_version_id::<S>,
),
)
.route(
"/ehr/{p2}/contribution",
axum::routing::on(
axum::routing::MethodFilter::POST,
handle_contribution_create::<S>,
),
)
.route(
"/ehr/{p2}/contribution/{p4}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_contribution_get::<S>,
),
)
.route(
"/ehr/{p2}/tags",
axum::routing::on(axum::routing::MethodFilter::GET, handle_ehr_tags_get::<S>),
)
.route(
"/ehr/{p2}/composition/{p4}/tags",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_composition_tags_get::<S>,
),
)
.route(
"/ehr/{p2}/composition/{p4}/tags",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_composition_tags_update::<S>,
),
)
.route(
"/ehr/{p2}/composition/{p4}/tags/{p6}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_composition_tags_delete::<S>,
),
)
.route(
"/ehr/{p2}/ehr_status/{p4}/tags",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_ehr_status_tags_get::<S>,
),
)
.route(
"/ehr/{p2}/ehr_status/{p4}/tags",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_ehr_status_tags_update::<S>,
),
)
.route(
"/ehr/{p2}/ehr_status/{p4}/tags/{p6}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_ehr_status_tags_delete::<S>,
),
)
.with_state(api)
}
async fn handle_ehr_get_by_subject<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = EhrGetBySubjectParams {
subject_id: query.required("subject_id")?,
subject_namespace: query.required("subject_namespace")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.ehr_get_by_subject(params).await? {
EhrGetBySubjectResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let params = EhrCreateParams {
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
};
let body = crate::rest::server::json_body_optional(&headers, &body)?;
let reply: crate::rest::server::Reply = match api.ehr_create(params, body).await? {
EhrCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
EhrCreateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_get_by_id<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = EhrGetByIdParams {
ehr_id: path.value("p2", "ehr_id")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.ehr_get_by_id(params).await? {
EhrGetByIdResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_create_with_id<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = EhrCreateWithIdParams {
ehr_id: path.value("p2", "ehr_id")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
};
let body = crate::rest::server::json_body_optional(&headers, &body)?;
let reply: crate::rest::server::Reply =
match api.ehr_create_with_id(params, body).await? {
EhrCreateWithIdResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
EhrCreateWithIdResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_status_get_by_version_id<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = EhrStatusGetByVersionIdParams {
ehr_id: path.value("p2", "ehr_id")?,
version_uid: path.value("p4", "version_uid")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply =
match api.ehr_status_get_by_version_id(params).await? {
EhrStatusGetByVersionIdResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_status_get_at_time<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = EhrStatusGetAtTimeParams {
ehr_id: path.value("p2", "ehr_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.ehr_status_get_at_time(params).await?
{
EhrStatusGetAtTimeResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_status_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = EhrStatusUpdateParams {
ehr_id: path.value("p2", "ehr_id")?,
if_match: crate::rest::server::header_required(&headers, "If-Match")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_item_tag: crate::rest::server::header_list(&headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::server::header_list(
&headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply =
match api.ehr_status_update(params, body).await? {
EhrStatusUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
EhrStatusUpdateResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_ehr_status_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = VersionedEhrStatusGetParams {
ehr_id: path.value("p2", "ehr_id")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply =
match api.versioned_ehr_status_get(params).await? {
VersionedEhrStatusGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_ehr_status_revision_history<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = VersionedEhrStatusRevisionHistoryParams {
ehr_id: path.value("p2", "ehr_id")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply =
match api.versioned_ehr_status_revision_history(params).await? {
VersionedEhrStatusRevisionHistoryResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_ehr_status_version_get_at_time<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = VersionedEhrStatusVersionGetAtTimeParams {
ehr_id: path.value("p2", "ehr_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply =
match api.versioned_ehr_status_version_get_at_time(params).await? {
VersionedEhrStatusVersionGetAtTimeResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_ehr_status_version_get_by_id<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = VersionedEhrStatusVersionGetByIdParams {
ehr_id: path.value("p2", "ehr_id")?,
version_uid: path.value("p5", "version_uid")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply =
match api.versioned_ehr_status_version_get_by_id(params).await? {
VersionedEhrStatusVersionGetByIdResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_composition_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = CompositionCreateParams {
ehr_id: path.value("p2", "ehr_id")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_item_tag: crate::rest::server::header_list(&headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::server::header_list(
&headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
openehr_template_id: crate::rest::server::header_optional(
&headers,
"openehr-template-id",
)?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply =
match api.composition_create(params, body).await? {
CompositionCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
CompositionCreateResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_composition_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = CompositionGetParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.composition_get(params).await? {
CompositionGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
CompositionGetResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_composition_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = CompositionUpdateParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
if_match: crate::rest::server::header_required(&headers, "If-Match")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_item_tag: crate::rest::server::header_list(&headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::server::header_list(
&headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
openehr_template_id: crate::rest::server::header_optional(
&headers,
"openehr-template-id",
)?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply =
match api.composition_update(params, body).await? {
CompositionUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
CompositionUpdateResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_composition_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = CompositionDeleteParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
};
let reply: crate::rest::server::Reply = match api.composition_delete(params).await? {
CompositionDeleteResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_composition_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = VersionedCompositionGetParams {
ehr_id: path.value("p2", "ehr_id")?,
versioned_object_uid: path.value("p4", "versioned_object_uid")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply =
match api.versioned_composition_get(params).await? {
VersionedCompositionGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_composition_revision_history<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = VersionedCompositionRevisionHistoryParams {
ehr_id: path.value("p2", "ehr_id")?,
versioned_object_uid: path.value("p4", "versioned_object_uid")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply =
match api.versioned_composition_revision_history(params).await? {
VersionedCompositionRevisionHistoryResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_composition_version_get_at_time<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = VersionedCompositionVersionGetAtTimeParams {
ehr_id: path.value("p2", "ehr_id")?,
versioned_object_uid: path.value("p4", "versioned_object_uid")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply = match api
.versioned_composition_version_get_at_time(params)
.await?
{
VersionedCompositionVersionGetAtTimeResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_composition_version_get_by_id<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = VersionedCompositionVersionGetByIdParams {
ehr_id: path.value("p2", "ehr_id")?,
versioned_object_uid: path.value("p4", "versioned_object_uid")?,
version_uid: path.value("p6", "version_uid")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let reply: crate::rest::server::Reply =
match api.versioned_composition_version_get_by_id(params).await? {
VersionedCompositionVersionGetByIdResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_directory_get_at_time<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = DirectoryGetAtTimeParams {
ehr_id: path.value("p2", "ehr_id")?,
version_at_time: query.optional("version_at_time")?,
path: query.optional("path")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.directory_get_at_time(params).await? {
DirectoryGetAtTimeResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
DirectoryGetAtTimeResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_directory_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = DirectoryUpdateParams {
ehr_id: path.value("p2", "ehr_id")?,
if_match: crate::rest::server::header_required(&headers, "If-Match")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply = match api.directory_update(params, body).await?
{
DirectoryUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
DirectoryUpdateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_directory_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = DirectoryCreateParams {
ehr_id: path.value("p2", "ehr_id")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply = match api.directory_create(params, body).await?
{
DirectoryCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
DirectoryCreateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_directory_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = DirectoryDeleteParams {
ehr_id: path.value("p2", "ehr_id")?,
if_match: crate::rest::server::header_required(&headers, "If-Match")?,
openehr_version: crate::rest::server::header_optional(&headers, "openehr-version")?,
openehr_audit_details: crate::rest::server::header_list(
&headers,
"openehr-audit-details",
)?,
};
let reply: crate::rest::server::Reply = match api.directory_delete(params).await? {
DirectoryDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_directory_get_by_version_id<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = DirectoryGetByVersionIdParams {
ehr_id: path.value("p2", "ehr_id")?,
version_uid: path.value("p4", "version_uid")?,
path: query.optional("path")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply =
match api.directory_get_by_version_id(params).await? {
DirectoryGetByVersionIdResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_contribution_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = ContributionCreateParams {
ehr_id: path.value("p2", "ehr_id")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
openehr_template_id: crate::rest::server::header_optional(
&headers,
"openehr-template-id",
)?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply =
match api.contribution_create(params, body).await? {
ContributionCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
ContributionCreateResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_contribution_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = ContributionGetParams {
ehr_id: path.value("p2", "ehr_id")?,
contribution_uid: path.value("p4", "contribution_uid")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.contribution_get(params).await? {
ContributionGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let query = crate::rest::server::QueryPairs::parse(query.as_deref())?;
let params = EhrTagsGetParams {
ehr_id: path.value("p2", "ehr_id")?,
tag_key: query.optional("tag_key")?,
tag_value: query.optional("tag_value")?,
tag_target_path: query.optional("tag_target_path")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.ehr_tags_get(params).await? {
EhrTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_composition_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = CompositionTagsGetParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.composition_tags_get(params).await? {
CompositionTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_composition_tags_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = CompositionTagsUpdateParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply =
match api.composition_tags_update(params, body).await? {
CompositionTagsUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
CompositionTagsUpdateResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_composition_tags_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = CompositionTagsDeleteParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
key: path.value("p6", "key")?,
};
let reply: crate::rest::server::Reply =
match api.composition_tags_delete(params).await? {
CompositionTagsDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_status_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = EhrStatusTagsGetParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
};
let reply: crate::rest::server::Reply = match api.ehr_status_tags_get(params).await? {
EhrStatusTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_status_tags_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = EhrStatusTagsUpdateParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
prefer: crate::rest::server::header_optional(&headers, "Prefer")?,
accept: crate::rest::server::header_optional(&headers, "Accept")?,
content_type: crate::rest::server::header_optional(&headers, "Content-Type")?,
};
let body = crate::rest::server::json_body(&headers, &body)?;
let reply: crate::rest::server::Reply =
match api.ehr_status_tags_update(params, body).await? {
EhrStatusTagsUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
EhrStatusTagsUpdateResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_ehr_status_tags_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: EhrApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::PathCaptures::new(path)?;
let params = EhrStatusTagsDeleteParams {
ehr_id: path.value("p2", "ehr_id")?,
uid_based_id: path.value("p4", "uid_based_id")?,
key: path.value("p6", "key")?,
};
let reply: crate::rest::server::Reply = match api.ehr_status_tags_delete(params).await?
{
EhrStatusTagsDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
}
#[cfg(feature = "rest-client")]
pub mod client {
use super::*;
#[derive(Debug, Clone)]
pub enum EhrGetBySubjectOutcome {
Ok {
body: openehr_rm::v1_2::ehr::ehr::Ehr,
headers: EhrGetBySubjectOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrCreateOutcome {
Created {
body: Option<serde_json::Value>,
headers: EhrCreateCreatedHeaders,
},
NoContent {
headers: EhrCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrGetByIdOutcome {
Ok {
body: openehr_rm::v1_2::ehr::ehr::Ehr,
headers: EhrGetByIdOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrCreateWithIdOutcome {
Created {
body: Option<serde_json::Value>,
headers: EhrCreateWithIdCreatedHeaders,
},
NoContent {
headers: EhrCreateWithIdNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusGetByVersionIdOutcome {
Ok {
body: openehr_rm::v1_2::ehr::ehr_status::EhrStatus,
headers: EhrStatusGetByVersionIdOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusGetAtTimeOutcome {
Ok {
body: openehr_rm::v1_2::ehr::ehr_status::EhrStatus,
headers: EhrStatusGetAtTimeOkHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusUpdateOutcome {
Ok {
body: serde_json::Value,
headers: EhrStatusUpdateOkHeaders,
},
NoContent {
headers: EhrStatusUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: EhrStatusUpdatePreconditionFailedHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusGetOutcome {
Ok {
body: openehr_rm::v1_2::ehr::versioned_ehr_status::VersionedEhrStatus,
headers: VersionedEhrStatusGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusRevisionHistoryOutcome {
Ok {
body: openehr_rm::v1_2::common::generic::revision_history::RevisionHistory,
headers: VersionedEhrStatusRevisionHistoryOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusVersionGetAtTimeOutcome {
Ok {
body: VersionOfEhrStatus,
headers: VersionedEhrStatusVersionGetAtTimeOkHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedEhrStatusVersionGetByIdOutcome {
Ok {
body: VersionOfEhrStatus,
headers: VersionedEhrStatusVersionGetByIdOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum CompositionCreateOutcome {
Created {
body: Option<serde_json::Value>,
headers: CompositionCreateCreatedHeaders,
},
NoContent {
headers: CompositionCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum CompositionGetOutcome {
Ok {
body: openehr_rm::v1_2::composition::composition::Composition,
headers: CompositionGetOkHeaders,
},
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum CompositionUpdateOutcome {
Ok {
body: serde_json::Value,
headers: CompositionUpdateOkHeaders,
},
NoContent {
headers: CompositionUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: CompositionUpdatePreconditionFailedHeaders,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum CompositionDeleteOutcome {
NoContent {
headers: CompositionDeleteNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
headers: CompositionDeleteConflictHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionGetOutcome {
Ok {
body: openehr_rm::v1_2::ehr::versioned_composition::VersionedComposition,
headers: VersionedCompositionGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionRevisionHistoryOutcome {
Ok {
body: openehr_rm::v1_2::common::generic::revision_history::RevisionHistory,
headers: VersionedCompositionRevisionHistoryOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionVersionGetAtTimeOutcome {
Ok {
body: VersionOfComposition,
headers: VersionedCompositionVersionGetAtTimeOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedCompositionVersionGetByIdOutcome {
Ok {
body: VersionOfComposition,
headers: VersionedCompositionVersionGetByIdOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryGetAtTimeOutcome {
Ok {
body: openehr_rm::v1_2::common::directory::folder::Folder,
headers: DirectoryGetAtTimeOkHeaders,
},
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryUpdateOutcome {
Ok {
body: serde_json::Value,
headers: DirectoryUpdateOkHeaders,
},
NoContent {
headers: DirectoryUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: DirectoryUpdatePreconditionFailedHeaders,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryCreateOutcome {
Created {
body: Option<serde_json::Value>,
headers: DirectoryCreateCreatedHeaders,
},
NoContent {
headers: DirectoryCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryDeleteOutcome {
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: DirectoryDeletePreconditionFailedHeaders,
},
}
#[derive(Debug, Clone)]
pub enum DirectoryGetByVersionIdOutcome {
Ok {
body: openehr_rm::v1_2::common::directory::folder::Folder,
headers: DirectoryGetByVersionIdOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum ContributionCreateOutcome {
Created {
body: Option<serde_json::Value>,
headers: ContributionCreateCreatedHeaders,
},
NoContent {
headers: ContributionCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum ContributionGetOutcome {
Ok {
body: openehr_rm::v1_2::common::change_control::contribution::Contribution,
headers: ContributionGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrTagsGetOutcome {
Ok {
body: Vec<ItemTagOfComposition>,
headers: EhrTagsGetOkHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum CompositionTagsGetOutcome {
Ok {
body: Vec<ItemTagOfComposition>,
headers: CompositionTagsGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum CompositionTagsUpdateOutcome {
Ok {
body: Vec<ItemTagOfComposition>,
headers: CompositionTagsUpdateOkHeaders,
},
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum CompositionTagsDeleteOutcome {
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusTagsGetOutcome {
Ok {
body: Vec<ItemTagOfEhrStatus>,
headers: EhrStatusTagsGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusTagsUpdateOutcome {
Ok {
body: Vec<ItemTagOfEhrStatus>,
headers: EhrStatusTagsUpdateOkHeaders,
},
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum EhrStatusTagsDeleteOutcome {
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub struct EhrClient<'c, T> {
client: &'c crate::rest::client::Client<T>,
options: crate::rest::client::CallOptions,
}
impl<'c, T: crate::rest::client::Transport> EhrClient<'c, T> {
#[must_use]
pub fn new(client: &'c crate::rest::client::Client<T>) -> Self {
Self {
client,
options: crate::rest::client::CallOptions::default(),
}
}
#[must_use]
pub fn with_options(mut self, options: crate::rest::client::CallOptions) -> Self {
self.options = options;
self
}
pub async fn ehr_get_by_subject(
&self,
params: &EhrGetBySubjectParams,
) -> Result<EhrGetBySubjectOutcome, crate::rest::client::ClientError> {
let mut request =
crate::rest::client::Request::new(http::Method::GET, String::from("/ehr"));
{
let value = ¶ms.subject_id;
request.query("subject_id", value);
}
{
let value = ¶ms.subject_namespace;
request.query("subject_namespace", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrGetBySubjectOutcome::Ok {
body: answer.json()?,
headers: EhrGetBySubjectOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(EhrGetBySubjectOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_create(
&self,
params: &EhrCreateParams,
body: Option<&openehr_rm::v1_2::ehr::ehr_status::EhrStatus>,
) -> Result<EhrCreateOutcome, crate::rest::client::ClientError> {
let mut request =
crate::rest::client::Request::new(http::Method::POST, String::from("/ehr"));
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
if let Some(body) = body {
request.json_body(body, params.content_type.as_deref())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(EhrCreateOutcome::Created {
body: answer.optional_json()?,
headers: EhrCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::NO_CONTENT => Ok(EhrCreateOutcome::NoContent {
headers: EhrCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(EhrCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(EhrCreateOutcome::Conflict {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_get_by_id(
&self,
params: &EhrGetByIdParams,
) -> Result<EhrGetByIdOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!("/ehr/{}", crate::rest::client::path_segment(¶ms.ehr_id)),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrGetByIdOutcome::Ok {
body: answer.json()?,
headers: EhrGetByIdOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(EhrGetByIdOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_create_with_id(
&self,
params: &EhrCreateWithIdParams,
body: Option<&openehr_rm::v1_2::ehr::ehr_status::EhrStatus>,
) -> Result<EhrCreateWithIdOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!("/ehr/{}", crate::rest::client::path_segment(¶ms.ehr_id)),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
if let Some(body) = body {
request.json_body(body, params.content_type.as_deref())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(EhrCreateWithIdOutcome::Created {
body: answer.optional_json()?,
headers: EhrCreateWithIdCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::NO_CONTENT => Ok(EhrCreateWithIdOutcome::NoContent {
headers: EhrCreateWithIdNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(EhrCreateWithIdOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(EhrCreateWithIdOutcome::Conflict {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_status_get_by_version_id(
&self,
params: &EhrStatusGetByVersionIdParams,
) -> Result<EhrStatusGetByVersionIdOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/ehr_status/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.version_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrStatusGetByVersionIdOutcome::Ok {
body: answer.json()?,
headers: EhrStatusGetByVersionIdOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NOT_FOUND => Ok(EhrStatusGetByVersionIdOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_status_get_at_time(
&self,
params: &EhrStatusGetAtTimeParams,
) -> Result<EhrStatusGetAtTimeOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/ehr_status",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrStatusGetAtTimeOutcome::Ok {
body: answer.json()?,
headers: EhrStatusGetAtTimeOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(EhrStatusGetAtTimeOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(EhrStatusGetAtTimeOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_status_update(
&self,
params: &EhrStatusUpdateParams,
body: &openehr_rm::v1_2::ehr::ehr_status::EhrStatus,
) -> Result<EhrStatusUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/ehr/{}/ehr_status",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrStatusUpdateOutcome::Ok {
body: answer.json()?,
headers: EhrStatusUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(EhrStatusUpdateOutcome::NoContent {
headers: EhrStatusUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(EhrStatusUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(EhrStatusUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(EhrStatusUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: EhrStatusUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_ehr_status_get(
&self,
params: &VersionedEhrStatusGetParams,
) -> Result<VersionedEhrStatusGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_ehr_status",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedEhrStatusGetOutcome::Ok {
body: answer.json()?,
headers: VersionedEhrStatusGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(VersionedEhrStatusGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_ehr_status_revision_history(
&self,
params: &VersionedEhrStatusRevisionHistoryParams,
) -> Result<VersionedEhrStatusRevisionHistoryOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_ehr_status/revision_history",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedEhrStatusRevisionHistoryOutcome::Ok {
body: answer.json()?,
headers: VersionedEhrStatusRevisionHistoryOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => {
Ok(VersionedEhrStatusRevisionHistoryOutcome::NotFound {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_ehr_status_version_get_at_time(
&self,
params: &VersionedEhrStatusVersionGetAtTimeParams,
) -> Result<VersionedEhrStatusVersionGetAtTimeOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_ehr_status/version",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedEhrStatusVersionGetAtTimeOutcome::Ok {
body: answer.json()?,
headers: VersionedEhrStatusVersionGetAtTimeOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::BAD_REQUEST => {
Ok(VersionedEhrStatusVersionGetAtTimeOutcome::BadRequest {
body: answer.error_body(),
})
}
http::StatusCode::NOT_FOUND => {
Ok(VersionedEhrStatusVersionGetAtTimeOutcome::NotFound {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_ehr_status_version_get_by_id(
&self,
params: &VersionedEhrStatusVersionGetByIdParams,
) -> Result<VersionedEhrStatusVersionGetByIdOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_ehr_status/version/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.version_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedEhrStatusVersionGetByIdOutcome::Ok {
body: answer.json()?,
headers: VersionedEhrStatusVersionGetByIdOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => {
Ok(VersionedEhrStatusVersionGetByIdOutcome::NotFound {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn composition_create(
&self,
params: &CompositionCreateParams,
body: &openehr_rm::v1_2::composition::composition::Composition,
) -> Result<CompositionCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
format!(
"/ehr/{}/composition",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
if let Some(value) = params.openehr_template_id.as_ref() {
request.header("openehr-template-id", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(CompositionCreateOutcome::Created {
body: answer.optional_json()?,
headers: CompositionCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(CompositionCreateOutcome::NoContent {
headers: CompositionCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(CompositionCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(CompositionCreateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(CompositionCreateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn composition_get(
&self,
params: &CompositionGetParams,
) -> Result<CompositionGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/composition/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(CompositionGetOutcome::Ok {
body: answer.json()?,
headers: CompositionGetOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(CompositionGetOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(CompositionGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn composition_update(
&self,
params: &CompositionUpdateParams,
body: &openehr_rm::v1_2::composition::composition::Composition,
) -> Result<CompositionUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/ehr/{}/composition/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
if let Some(value) = params.openehr_template_id.as_ref() {
request.header("openehr-template-id", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(CompositionUpdateOutcome::Ok {
body: answer.json()?,
headers: CompositionUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(CompositionUpdateOutcome::NoContent {
headers: CompositionUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(CompositionUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(CompositionUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(CompositionUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: CompositionUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(CompositionUpdateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn composition_delete(
&self,
params: &CompositionDeleteParams,
) -> Result<CompositionDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/ehr/{}/composition/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(CompositionDeleteOutcome::NoContent {
headers: CompositionDeleteNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(CompositionDeleteOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(CompositionDeleteOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(CompositionDeleteOutcome::Conflict {
body: answer.error_body(),
headers: CompositionDeleteConflictHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_composition_get(
&self,
params: &VersionedCompositionGetParams,
) -> Result<VersionedCompositionGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_composition/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.versioned_object_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedCompositionGetOutcome::Ok {
body: answer.json()?,
headers: VersionedCompositionGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(VersionedCompositionGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_composition_revision_history(
&self,
params: &VersionedCompositionRevisionHistoryParams,
) -> Result<VersionedCompositionRevisionHistoryOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_composition/{}/revision_history",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.versioned_object_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedCompositionRevisionHistoryOutcome::Ok {
body: answer.json()?,
headers: VersionedCompositionRevisionHistoryOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => {
Ok(VersionedCompositionRevisionHistoryOutcome::NotFound {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_composition_version_get_at_time(
&self,
params: &VersionedCompositionVersionGetAtTimeParams,
) -> Result<VersionedCompositionVersionGetAtTimeOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_composition/{}/version",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.versioned_object_uid)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedCompositionVersionGetAtTimeOutcome::Ok {
body: answer.json()?,
headers: VersionedCompositionVersionGetAtTimeOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => {
Ok(VersionedCompositionVersionGetAtTimeOutcome::NotFound {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_composition_version_get_by_id(
&self,
params: &VersionedCompositionVersionGetByIdParams,
) -> Result<VersionedCompositionVersionGetByIdOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/versioned_composition/{}/version/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.versioned_object_uid),
crate::rest::client::path_segment(¶ms.version_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedCompositionVersionGetByIdOutcome::Ok {
body: answer.json()?,
headers: VersionedCompositionVersionGetByIdOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => {
Ok(VersionedCompositionVersionGetByIdOutcome::NotFound {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn directory_get_at_time(
&self,
params: &DirectoryGetAtTimeParams,
) -> Result<DirectoryGetAtTimeOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/directory",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.path.as_ref() {
request.query("path", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(DirectoryGetAtTimeOutcome::Ok {
body: answer.json()?,
headers: DirectoryGetAtTimeOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(DirectoryGetAtTimeOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(DirectoryGetAtTimeOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn directory_update(
&self,
params: &DirectoryUpdateParams,
body: &openehr_rm::v1_2::common::directory::folder::Folder,
) -> Result<DirectoryUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/ehr/{}/directory",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(DirectoryUpdateOutcome::Ok {
body: answer.json()?,
headers: DirectoryUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(DirectoryUpdateOutcome::NoContent {
headers: DirectoryUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(DirectoryUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(DirectoryUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(DirectoryUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: DirectoryUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn directory_create(
&self,
params: &DirectoryCreateParams,
body: &openehr_rm::v1_2::common::directory::folder::Folder,
) -> Result<DirectoryCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
format!(
"/ehr/{}/directory",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(DirectoryCreateOutcome::Created {
body: answer.optional_json()?,
headers: DirectoryCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(DirectoryCreateOutcome::NoContent {
headers: DirectoryCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(DirectoryCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(DirectoryCreateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn directory_delete(
&self,
params: &DirectoryDeleteParams,
) -> Result<DirectoryDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/ehr/{}/directory",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(DirectoryDeleteOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(DirectoryDeleteOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(DirectoryDeleteOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(DirectoryDeleteOutcome::PreconditionFailed {
body: answer.error_body(),
headers: DirectoryDeletePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn directory_get_by_version_id(
&self,
params: &DirectoryGetByVersionIdParams,
) -> Result<DirectoryGetByVersionIdOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/directory/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.version_uid)
),
);
if let Some(value) = params.path.as_ref() {
request.query("path", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(DirectoryGetByVersionIdOutcome::Ok {
body: answer.json()?,
headers: DirectoryGetByVersionIdOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(DirectoryGetByVersionIdOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn contribution_create(
&self,
params: &ContributionCreateParams,
body: &NewContribution,
) -> Result<ContributionCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
format!(
"/ehr/{}/contribution",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_template_id.as_ref() {
request.header("openehr-template-id", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(ContributionCreateOutcome::Created {
body: answer.optional_json()?,
headers: ContributionCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(ContributionCreateOutcome::NoContent {
headers: ContributionCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(ContributionCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(ContributionCreateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(ContributionCreateOutcome::Conflict {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn contribution_get(
&self,
params: &ContributionGetParams,
) -> Result<ContributionGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/contribution/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.contribution_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(ContributionGetOutcome::Ok {
body: answer.json()?,
headers: ContributionGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(ContributionGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_tags_get(
&self,
params: &EhrTagsGetParams,
) -> Result<EhrTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/tags",
crate::rest::client::path_segment(¶ms.ehr_id)
),
);
if let Some(value) = params.tag_key.as_ref() {
request.query("tag_key", value);
}
if let Some(value) = params.tag_value.as_ref() {
request.query("tag_value", value);
}
if let Some(value) = params.tag_target_path.as_ref() {
request.query("tag_target_path", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrTagsGetOutcome::Ok {
body: answer.json()?,
headers: EhrTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(EhrTagsGetOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(EhrTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn composition_tags_get(
&self,
params: &CompositionTagsGetParams,
) -> Result<CompositionTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/composition/{}/tags",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(CompositionTagsGetOutcome::Ok {
body: answer.json()?,
headers: CompositionTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(CompositionTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn composition_tags_update(
&self,
params: &CompositionTagsUpdateParams,
body: &Vec<super::super::common::UpdateItemTag>,
) -> Result<CompositionTagsUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/ehr/{}/composition/{}/tags",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(CompositionTagsUpdateOutcome::Ok {
body: answer.json()?,
headers: CompositionTagsUpdateOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(CompositionTagsUpdateOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(CompositionTagsUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(CompositionTagsUpdateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn composition_tags_delete(
&self,
params: &CompositionTagsDeleteParams,
) -> Result<CompositionTagsDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/ehr/{}/composition/{}/tags/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id),
crate::rest::client::path_segment(¶ms.key)
),
);
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(CompositionTagsDeleteOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(CompositionTagsDeleteOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_status_tags_get(
&self,
params: &EhrStatusTagsGetParams,
) -> Result<EhrStatusTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/ehr/{}/ehr_status/{}/tags",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrStatusTagsGetOutcome::Ok {
body: answer.json()?,
headers: EhrStatusTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(EhrStatusTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_status_tags_update(
&self,
params: &EhrStatusTagsUpdateParams,
body: &Vec<super::super::common::UpdateItemTag>,
) -> Result<EhrStatusTagsUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/ehr/{}/ehr_status/{}/tags",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(EhrStatusTagsUpdateOutcome::Ok {
body: answer.json()?,
headers: EhrStatusTagsUpdateOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(EhrStatusTagsUpdateOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(EhrStatusTagsUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(EhrStatusTagsUpdateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn ehr_status_tags_delete(
&self,
params: &EhrStatusTagsDeleteParams,
) -> Result<EhrStatusTagsDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/ehr/{}/ehr_status/{}/tags/{}",
crate::rest::client::path_segment(¶ms.ehr_id),
crate::rest::client::path_segment(¶ms.uid_based_id),
crate::rest::client::path_segment(¶ms.key)
),
);
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(EhrStatusTagsDeleteOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(EhrStatusTagsDeleteOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
}
}
pub const ROUTES: &[(&str, &str, &str)] = &[
("GET", "/ehr", "ehr_get_by_subject"),
("POST", "/ehr", "ehr_create"),
("GET", "/ehr/{ehr_id}", "ehr_get_by_id"),
("PUT", "/ehr/{ehr_id}", "ehr_create_with_id"),
(
"GET",
"/ehr/{ehr_id}/ehr_status/{version_uid}",
"ehr_status_get_by_version_id",
),
("GET", "/ehr/{ehr_id}/ehr_status", "ehr_status_get_at_time"),
("PUT", "/ehr/{ehr_id}/ehr_status", "ehr_status_update"),
(
"GET",
"/ehr/{ehr_id}/versioned_ehr_status",
"versioned_ehr_status_get",
),
(
"GET",
"/ehr/{ehr_id}/versioned_ehr_status/revision_history",
"versioned_ehr_status_revision_history",
),
(
"GET",
"/ehr/{ehr_id}/versioned_ehr_status/version",
"versioned_ehr_status_version_get_at_time",
),
(
"GET",
"/ehr/{ehr_id}/versioned_ehr_status/version/{version_uid}",
"versioned_ehr_status_version_get_by_id",
),
("POST", "/ehr/{ehr_id}/composition", "composition_create"),
(
"GET",
"/ehr/{ehr_id}/composition/{uid_based_id}",
"composition_get",
),
(
"PUT",
"/ehr/{ehr_id}/composition/{uid_based_id}",
"composition_update",
),
(
"DELETE",
"/ehr/{ehr_id}/composition/{uid_based_id}",
"composition_delete",
),
(
"GET",
"/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}",
"versioned_composition_get",
),
(
"GET",
"/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/revision_history",
"versioned_composition_revision_history",
),
(
"GET",
"/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version",
"versioned_composition_version_get_at_time",
),
(
"GET",
"/ehr/{ehr_id}/versioned_composition/{versioned_object_uid}/version/{version_uid}",
"versioned_composition_version_get_by_id",
),
("GET", "/ehr/{ehr_id}/directory", "directory_get_at_time"),
("PUT", "/ehr/{ehr_id}/directory", "directory_update"),
("POST", "/ehr/{ehr_id}/directory", "directory_create"),
("DELETE", "/ehr/{ehr_id}/directory", "directory_delete"),
(
"GET",
"/ehr/{ehr_id}/directory/{version_uid}",
"directory_get_by_version_id",
),
("POST", "/ehr/{ehr_id}/contribution", "contribution_create"),
(
"GET",
"/ehr/{ehr_id}/contribution/{contribution_uid}",
"contribution_get",
),
("GET", "/ehr/{ehr_id}/tags", "ehr_tags_get"),
(
"GET",
"/ehr/{ehr_id}/composition/{uid_based_id}/tags",
"composition_tags_get",
),
(
"PUT",
"/ehr/{ehr_id}/composition/{uid_based_id}/tags",
"composition_tags_update",
),
(
"DELETE",
"/ehr/{ehr_id}/composition/{uid_based_id}/tags/{key}",
"composition_tags_delete",
),
(
"GET",
"/ehr/{ehr_id}/ehr_status/{uid_based_id}/tags",
"ehr_status_tags_get",
),
(
"PUT",
"/ehr/{ehr_id}/ehr_status/{uid_based_id}/tags",
"ehr_status_tags_update",
),
(
"DELETE",
"/ehr/{ehr_id}/ehr_status/{uid_based_id}/tags/{key}",
"ehr_status_tags_delete",
),
];
pub const ROUTE_PARAMS: &[&[crate::rest::routes::Param]] = &[
EhrGetBySubjectParams::PARAMS,
EhrCreateParams::PARAMS,
EhrGetByIdParams::PARAMS,
EhrCreateWithIdParams::PARAMS,
EhrStatusGetByVersionIdParams::PARAMS,
EhrStatusGetAtTimeParams::PARAMS,
EhrStatusUpdateParams::PARAMS,
VersionedEhrStatusGetParams::PARAMS,
VersionedEhrStatusRevisionHistoryParams::PARAMS,
VersionedEhrStatusVersionGetAtTimeParams::PARAMS,
VersionedEhrStatusVersionGetByIdParams::PARAMS,
CompositionCreateParams::PARAMS,
CompositionGetParams::PARAMS,
CompositionUpdateParams::PARAMS,
CompositionDeleteParams::PARAMS,
VersionedCompositionGetParams::PARAMS,
VersionedCompositionRevisionHistoryParams::PARAMS,
VersionedCompositionVersionGetAtTimeParams::PARAMS,
VersionedCompositionVersionGetByIdParams::PARAMS,
DirectoryGetAtTimeParams::PARAMS,
DirectoryUpdateParams::PARAMS,
DirectoryCreateParams::PARAMS,
DirectoryDeleteParams::PARAMS,
DirectoryGetByVersionIdParams::PARAMS,
ContributionCreateParams::PARAMS,
ContributionGetParams::PARAMS,
EhrTagsGetParams::PARAMS,
CompositionTagsGetParams::PARAMS,
CompositionTagsUpdateParams::PARAMS,
CompositionTagsDeleteParams::PARAMS,
EhrStatusTagsGetParams::PARAMS,
EhrStatusTagsUpdateParams::PARAMS,
EhrStatusTagsDeleteParams::PARAMS,
];
const _: () = assert!(
ROUTE_PARAMS.len() == ROUTES.len(),
"ROUTE_PARAMS carries one row per ROUTES entry"
);