export enum VisibilityType { Generic = 'Generic', Private = 'Private', Instance = 'Instance', } export type DiagnosisType = VisibilityType export type TreatmentType = VisibilityType export interface DiagnosisRequest { uuid?: string name: string description: string type: DiagnosisType parentUuid?: string language: string tags?: string[] urlMultimedia?: string } export interface Diagnosis extends DiagnosisRequest { uuid: string uuidPractice: string uuidPractitioner?: string createdAt: string } // Type defined to store all consult related data linked to a given treatment export interface TreatmentAssociatedConsultData { uuidConsult: string consultKind: string } export interface TreatmentRequest { uuid?: string uuidDiagnosis?: string uuidParentTreatment?: string uuidPreviousRevision?: string name: string description: string refillable?: boolean noteToPharmacy?: string urlMultimedia?: string type?: TreatmentType } export interface Treatment extends TreatmentRequest { uuid: string uuidDiagnosis: string uuidPractitioner?: string createdAt: string arrAssociatedConsults?: TreatmentAssociatedConsultData[] } export enum DrugType { Generic = 'Generic', Instance = 'Instance', } export interface DrugRequest { name: string // name of the drug description?: string // Description of the drug type: DrugType // Entry type language: string // drug locale posology?: string // drug posology sideEffects?: string // Side effects of the drug imageUrl?: string // Image URL to the drug parentUuid?: string // (optional) parent uuid of the drug. In case of DrugType.Instance uuid?: string // uuid of the drug (will be used as parentUuid in case of creation of new drug) } export interface Drug extends DrugRequest { uuid: string uuidPractice: string uuidPractitioner?: string createdAt: string } /** * Status of the prescription * Right now, it only serves a soft delete flag */ export enum PrescriptionStatus { Existing = 'Existing', Deleted = 'Deleted', } export interface PrescriptionRequest { uuid?: string uuidTreatment?: string uuidDrug?: string quantity: string sig: string renewal: string } export interface Prescription extends PrescriptionRequest { uuid: string uuidTreatment: string status?: PrescriptionStatus createdAt: string } export enum PlanStatus { Pending = 'Pending', Accepted = 'Accepted', Rejected = 'Rejected', PreviouslyAccepted = 'PreviouslyAccepted', } export interface TreatmentPlan { uuid: string uuidConsult: string uuidDiagnosis: string uuidTreatment?: string notes?: string status: PlanStatus decidedAt: string createdAt: string } export interface DrugPrescription { prescription: Prescription drug: Drug } export interface TreatmentAndDrugPrescription { treatmentsHistory?: TreatmentHistory[] notes?: string status: PlanStatus uuidTreatmentPlan: string /** * this field is used to store the datetime when the patient accepted or refused the prescription */ decidedAt?: string createdAt: string } /** * An entry in the history of the treatments of the patient. * The history entry consists of the treatment and the prescriptions and the drugs * that were prescribed to the patient at that point of history */ export interface TreatmentHistory { treatment: Treatment treatmentRevisions: Treatment[] prescriptionsAndDrugs: DrugPrescription[] } export interface TreatmentPlans { uuidConsult: string diagnosis: Diagnosis plans?: TreatmentAndDrugPrescription[] } export interface DrugPrescriptionRequest { prescription: PrescriptionRequest drug: DrugRequest } export interface TreatmentAndDrugPrescriptionRequest { trackingId: string treatment: TreatmentRequest prescriptionsAndDrugs?: DrugPrescriptionRequest[] } export interface TreatmentPlansRequest { uuidConsult: string diagnosis: DiagnosisRequest plans?: TreatmentAndDrugPrescriptionRequest[] } export interface TreatmentAndDrugPrescriptionUpdateRequest { treatment: Treatment prescriptionsAndDrugs?: DrugPrescriptionRequest[] } export interface TreatmentPlanUpdateRequest extends TreatmentPlansRequest { uuidConsult: string diagnosis: DiagnosisRequest plan: TreatmentAndDrugPrescriptionUpdateRequest /** * request to refill the treatment plan */ refill?: boolean } export interface TreatmentPlansResponseEntry { trackingId?: string // can be undefined if treatmentPlan does not contain a treatment treatmentPlan: TreatmentPlan } export interface TreatmentPlansResponse extends Array {} export interface TreatmentAssociatedConsultDataResponse extends Array {}