/** * HL7 FHIR R4 International Patient Summary (IPS) Input Model for ips-summary.wasm. * * Every clinical concept accepts a genuine FHIR CodeableConcept. Any concept whose * (system, code) hits the ~8,200+ embedded official SNOMED CT IPS Free Set, EDQM, * LOINC, or IPS Absent/Unknown tables encodes as a compact 6-14 bit index and * hydrates its official canonical display at zero wire bytes. Concepts outside the * embedded tables fall back seamlessly to lossless inline coding/text. */ /** FHIR date or dateTime: YYYY | YYYY-MM | YYYY-MM-DD | YYYY-MM-DDThh:mm:ssZ */ export type FhirDate = string; export interface Coding { system?: string; code?: string; display?: string; } export interface CodeableConcept { coding?: Coding[]; text?: string; } export interface Quantity { /** Exact finite decimal number (encoded without floating-point arithmetic). */ value: number; /** UCUM unit code (e.g. "mg", "%", "mmol/L", "mm[Hg]", "mL/min/{1.73_m2}"). */ unit: string; } export interface Patient { family: string; given: string[]; birthDate: FhirDate; gender: "male" | "female" | "other" | "unknown"; identifier?: string; } export interface Organization { name: string; country?: string; } export interface Problem { code: CodeableConcept; clinicalStatus?: "active" | "resolved" | "inactive" | "remission"; verificationStatus?: "confirmed" | "provisional" | "refuted"; severity?: "mild" | "moderate" | "severe"; onset?: FhirDate; } export interface Allergy { code: CodeableConcept; clinicalStatus?: "active" | "resolved" | "inactive"; category?: "food" | "medication" | "environment" | "biologic"; criticality?: "low" | "high" | "unable-to-assess"; reaction?: CodeableConcept; severity?: "mild" | "moderate" | "severe"; onset?: FhirDate; } export interface Medication { code: CodeableConcept; status?: "active" | "completed" | "stopped" | "intended"; dose?: Quantity; route?: CodeableConcept; doseForm?: CodeableConcept; frequency?: string; start?: FhirDate; note?: string; } export interface Immunization { vaccine: CodeableConcept; date: FhirDate; status?: "completed" | "not-done"; lotNumber?: string; } export interface Procedure { code: CodeableConcept; date: FhirDate; status?: "completed" | "in-progress"; } export interface Result { code: CodeableConcept; date: FhirDate; valueQuantity?: Quantity; valueCodeableConcept?: CodeableConcept; valueString?: string; interpretation?: "N" | "H" | "L" | "HH" | "LL" | "A"; } export interface MedicalDevice { code: CodeableConcept; status?: "active" | "completed"; start?: FhirDate; } export interface IpsSummaryModel { patient: Patient; author: Organization; custodian?: Organization; date: FhirDate; problems?: Problem[]; allergies?: Allergy[]; medications?: Medication[]; immunizations?: Immunization[]; procedures?: Procedure[]; results?: Result[]; devices?: MedicalDevice[]; }