#![allow(
clippy::all,
clippy::pedantic,
clippy::nursery,
dead_code,
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"
)]
#![expect(
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, and each adjudicated field's NOTE names its citation"
)]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Error {
pub message: String,
#[serde(rename = "validationErrors")]
#[serde(default)]
pub validation_errors: Vec<String>,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone)]
pub enum AbstractEntry {
Action(openehr_rm::v1_2::composition::content::entry::action::Action),
AdminEntry(openehr_rm::v1_2::composition::content::entry::admin_entry::AdminEntry),
CareEntry(openehr_rm::v1_2::composition::content::entry::care_entry::CareEntry),
Evaluation(openehr_rm::v1_2::composition::content::entry::evaluation::Evaluation),
Instruction(openehr_rm::v1_2::composition::content::entry::instruction::Instruction),
Observation(openehr_rm::v1_2::composition::content::entry::observation::Observation),
}
impl ::serde::Serialize for AbstractEntry {
fn serialize<__S: ::serde::Serializer>(
&self,
__serializer: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
match self {
Self::Action(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::AdminEntry(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::CareEntry(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Evaluation(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Instruction(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Observation(__x) => ::serde::Serialize::serialize(__x, __serializer),
}
}
}
impl<'de> ::serde::Deserialize<'de> for AbstractEntry {
fn deserialize<__D: ::serde::Deserializer<'de>>(
__deserializer: __D,
) -> ::core::result::Result<Self, __D::Error> {
const __TAGS: &[&str] = &[
"ACTION",
"ADMIN_ENTRY",
"CARE_ENTRY",
"EVALUATION",
"INSTRUCTION",
"OBSERVATION",
];
struct __Visitor;
impl<'de> ::serde::de::Visitor<'de> for __Visitor {
type Value = AbstractEntry;
fn expecting(&self, __f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
__f.write_str("an ITS-REST `AbstractEntry` 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 {
"ACTION" => ::core::result::Result::Ok(AbstractEntry::Action(
::serde::Deserialize::deserialize(__rest)?,
)),
"ADMIN_ENTRY" => ::core::result::Result::Ok(AbstractEntry::AdminEntry(
::serde::Deserialize::deserialize(__rest)?,
)),
"CARE_ENTRY" => ::core::result::Result::Ok(AbstractEntry::CareEntry(
::serde::Deserialize::deserialize(__rest)?,
)),
"EVALUATION" => ::core::result::Result::Ok(AbstractEntry::Evaluation(
::serde::Deserialize::deserialize(__rest)?,
)),
"INSTRUCTION" => {
::core::result::Result::Ok(AbstractEntry::Instruction(
::serde::Deserialize::deserialize(__rest)?,
))
}
"OBSERVATION" => {
::core::result::Result::Ok(AbstractEntry::Observation(
::serde::Deserialize::deserialize(__rest)?,
))
}
__other => ::core::result::Result::Err(
::openehr_base::serde_support::unexpected_type(
"AbstractEntry",
__other,
"ACTION, ADMIN_ENTRY, CARE_ENTRY, EVALUATION, INSTRUCTION, OBSERVATION",
),
),
}
}
Some(::openehr_base::serde_support::TagMatch::Unknown(__other)) => {
::core::result::Result::Err(::openehr_base::serde_support::unexpected_type(
"AbstractEntry",
&__other,
"ACTION, ADMIN_ENTRY, CARE_ENTRY, EVALUATION, INSTRUCTION, OBSERVATION",
))
}
None => {
::core::result::Result::Err(::openehr_base::serde_support::missing_type(
"AbstractEntry",
"ACTION, ADMIN_ENTRY, CARE_ENTRY, EVALUATION, INSTRUCTION, OBSERVATION",
))
}
}
}
}
::serde::Deserializer::deserialize_map(__deserializer, __Visitor)
}
}
pub type ListOfPartyIdentity = Vec<openehr_rm::v1_2::demographic::party_identity::PartyIdentity>;
pub type ListOfContact = Vec<openehr_rm::v1_2::demographic::contact::Contact>;
pub type ListOfPartyRelationship =
Vec<openehr_rm::v1_2::demographic::party_relationship::PartyRelationship>;
pub type ListOfCapability = Vec<openehr_rm::v1_2::demographic::capability::Capability>;
pub type QueryName = String;
pub type Aql = String;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct UpdateItemTag {
pub key: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub target_path: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Identifier {
pub uid: String,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpdateAuditData {
#[serde(skip_serializing_if = "Option::is_none")]
pub _type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub system_id: Option<String>,
pub change_type: openehr_rm::v1_2::data_types::text::dv_coded_text::DvCodedText,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, deserialize_with = "crate::rest::tagged::optional")]
pub description: Option<openehr_rm::v1_2::data_types::text::dv_text::DvText>,
pub committer: openehr_rm::v1_2::common::generic::party_proxy::PartyProxy,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone)]
pub enum UpdateAudit {
UpdateAttestation(UpdateAttestation),
UpdateAudit(UpdateAuditData),
}
impl ::serde::Serialize for UpdateAudit {
fn serialize<__S: ::serde::Serializer>(
&self,
__serializer: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
match self {
Self::UpdateAttestation(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::UpdateAudit(__x) => ::serde::Serialize::serialize(__x, __serializer),
}
}
}
impl<'de> ::serde::Deserialize<'de> for UpdateAudit {
fn deserialize<__D: ::serde::Deserializer<'de>>(
__deserializer: __D,
) -> ::core::result::Result<Self, __D::Error> {
const __TAGS: &[&str] = &["UPDATE_ATTESTATION", "UPDATE_AUDIT", "AUDIT_DETAILS"];
struct __Visitor;
impl<'de> ::serde::de::Visitor<'de> for __Visitor {
type Value = UpdateAudit;
fn expecting(&self, __f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
__f.write_str("an ITS-REST `UpdateAudit` 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 {
"UPDATE_ATTESTATION" => {
::core::result::Result::Ok(UpdateAudit::UpdateAttestation(
::serde::Deserialize::deserialize(__rest)?,
))
}
"UPDATE_AUDIT" => ::core::result::Result::Ok(UpdateAudit::UpdateAudit(
::serde::Deserialize::deserialize(__rest)?,
)),
"AUDIT_DETAILS" => {
::core::result::Result::Ok(UpdateAudit::UpdateAudit(
::serde::Deserialize::deserialize(__rest)?,
))
}
__other => ::core::result::Result::Err(
::openehr_base::serde_support::unexpected_type(
"UpdateAudit",
__other,
"UPDATE_ATTESTATION, UPDATE_AUDIT",
),
),
}
}
Some(::openehr_base::serde_support::TagMatch::Unknown(__other)) => {
::core::result::Result::Err(::openehr_base::serde_support::unexpected_type(
"UpdateAudit",
&__other,
"UPDATE_ATTESTATION, UPDATE_AUDIT",
))
}
None => {
let __rest =
::openehr_base::serde_support::TaggedRest::new(None, __buffered, __map);
::core::result::Result::Ok(UpdateAudit::UpdateAudit(
::serde::Deserialize::deserialize(__rest)?,
))
}
}
}
}
::serde::Deserializer::deserialize_map(__deserializer, __Visitor)
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpdateAttestation {
#[serde(skip_serializing_if = "Option::is_none")]
pub _type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub system_id: Option<String>,
pub change_type: openehr_rm::v1_2::data_types::text::dv_coded_text::DvCodedText,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, deserialize_with = "crate::rest::tagged::optional")]
pub description: Option<openehr_rm::v1_2::data_types::text::dv_text::DvText>,
pub committer: openehr_rm::v1_2::common::generic::party_proxy::PartyProxy,
#[serde(skip_serializing_if = "Option::is_none")]
pub attested_view:
Option<openehr_rm::v1_2::data_types::encapsulated::dv_multimedia::DvMultimedia>,
#[serde(skip_serializing_if = "Option::is_none")]
pub proof: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub items: Option<Vec<openehr_rm::v1_2::data_types::uri::dv_ehr_uri::DvEhrUri>>,
#[serde(deserialize_with = "crate::rest::tagged::required")]
pub reason: openehr_rm::v1_2::data_types::text::dv_text::DvText,
pub is_pending: bool,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpdateVersion<T> {
#[serde(skip_serializing_if = "Option::is_none")]
pub preceding_version_uid:
Option<openehr_base::v1_3::base_types::identification::object_version_id::ObjectVersionId>,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
pub lifecycle_state: openehr_rm::v1_2::data_types::text::dv_coded_text::DvCodedText,
#[serde(skip_serializing_if = "Option::is_none")]
pub attestations: Option<Vec<UpdateAttestation>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<T>,
pub commit_audit: UpdateAudit,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}