use std::fmt;
use ferrobridge_fhirpath::model::Model;
use fhir_types::codec::Json;
use fhir_types::definition::CodeSystemRead;
use fhir_types::definition::ElementDefinitionRead;
use fhir_types::definition::StructureDefinitionRead;
use fhir_types::definition::ValueSetRead;
use fhir_types::schema::Schemas;
mod sealed {
pub trait Sealed {}
}
pub trait Release:
sealed::Sealed + fmt::Debug + Clone + Copy + Default + Send + Sync + 'static
{
type StructureDefinition: StructureDefinitionRead<Element = Self::ElementDefinition>
+ Json
+ fmt::Debug
+ Send
+ Sync;
type ElementDefinition: ElementDefinitionRead + fmt::Debug + Send + Sync;
type ValueSet: ValueSetRead + Json + fmt::Debug + Send + Sync;
type CodeSystem: CodeSystemRead + Json + fmt::Debug + Send + Sync;
const NAME: &'static str;
const CONTEXT_TYPES: &'static [&'static str];
fn schemas() -> &'static Schemas;
fn model() -> &'static dyn Model;
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct R4;
impl sealed::Sealed for R4 {}
impl Release for R4 {
type StructureDefinition = fhir_types::r4::structure_definition::StructureDefinition;
type ElementDefinition = fhir_types::r4::element_definition::ElementDefinition;
type ValueSet = fhir_types::r4::value_set::ValueSet;
type CodeSystem = fhir_types::r4::code_system::CodeSystem;
const NAME: &'static str = "R4";
const CONTEXT_TYPES: &'static [&'static str] = &["fhirpath", "element", "extension"];
fn schemas() -> &'static Schemas {
&fhir_types::r4::schema::SCHEMAS
}
fn model() -> &'static dyn Model {
&ferrobridge_fhirpath::model::r4::R4
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct Stu3;
impl sealed::Sealed for Stu3 {}
impl Release for Stu3 {
type StructureDefinition = fhir_types::stu3::structure_definition::StructureDefinition;
type ElementDefinition = fhir_types::stu3::element_definition::ElementDefinition;
type ValueSet = fhir_types::stu3::value_set::ValueSet;
type CodeSystem = fhir_types::stu3::code_system::CodeSystem;
const NAME: &'static str = "STU3";
const CONTEXT_TYPES: &'static [&'static str] = &["resource", "datatype", "extension"];
fn schemas() -> &'static Schemas {
&fhir_types::stu3::schema::SCHEMAS
}
fn model() -> &'static dyn Model {
&ferrobridge_fhirpath::model::stu3::Stu3
}
}