diff --git a/app/models/item-price.ts b/app/models/item-price.ts index fb474109..17f5b82e 100644 --- a/app/models/item-price.ts +++ b/app/models/item-price.ts @@ -1,5 +1,5 @@ export interface ItemPrice { - id: string + id: number item_id: number price: number insuranceCompany_code: string @@ -30,8 +30,9 @@ export interface DeleteDto { id?: string } -export function genMedicine(): CreateDto { +export function genItemPrice(): ItemPrice { return { + id: 0, item_id: 1, price: 1, insuranceCompany_code: 'test', diff --git a/app/models/item.ts b/app/models/item.ts index 851ff11d..76c47017 100644 --- a/app/models/item.ts +++ b/app/models/item.ts @@ -1,5 +1,5 @@ export interface Item { - id: string + id: number name: string code: string itemGroup_code: string @@ -36,8 +36,9 @@ export interface DeleteDto { id?: string } -export function genMedicine(): CreateDto { +export function genItem(): Item { return { + id: 0, name: 'test', code: 'test', itemGroup_code: 'test', diff --git a/app/models/medicine-group.ts b/app/models/medicine-group.ts index afaa06c6..dc47a814 100644 --- a/app/models/medicine-group.ts +++ b/app/models/medicine-group.ts @@ -1,5 +1,5 @@ export interface MedicineGroup { - id: string + id: number name: string code: string } @@ -28,9 +28,10 @@ export interface DeleteDto { id?: string } -export function genMedicine(): CreateDto { +export function genMedicineGroup(): MedicineGroup { return { - name: 'name', - code: 'code', + id: 0, + name: '', + code: '', } } diff --git a/app/models/medicine-method.ts b/app/models/medicine-method.ts index 78e0a68b..6df6bac6 100644 --- a/app/models/medicine-method.ts +++ b/app/models/medicine-method.ts @@ -1,5 +1,5 @@ export interface MedicineMethod { - id: string + id: number name: string code: string } @@ -28,8 +28,9 @@ export interface DeleteDto { id?: string } -export function genMedicine(): CreateDto { +export function genMedicineMethod(): MedicineMethod { return { + id: 0, name: 'name', code: 'code', } diff --git a/app/models/medicine.ts b/app/models/medicine.ts index 1d01991b..fa84bfc4 100644 --- a/app/models/medicine.ts +++ b/app/models/medicine.ts @@ -4,7 +4,7 @@ export interface MedicineBase { } export interface Medicine { - id: string + id: number name: string code: string medicineGroup_code: string @@ -57,17 +57,18 @@ export interface DeleteDto { id?: string } -export function genMedicine(): CreateDto { +export function genMedicine(): Medicine { return { - name: 'name', - code: 'code', - medicineGroup_code: 'medicineGroup_code', - medicineMethod_code: 'medicineMethod_code', - uom_code: 'uom_code', - type: 'type', - dose: 'dose', - infra_id: 'infra_id', - stock: 'stock', - status: 'status', + id: 0, + name: '', + code: '', + medicineGroup_code: '', + medicineMethod_code: '', + uom_code: '', + type: '', + dose: '', + infra_id: '', + stock: '', + status: '', } } diff --git a/app/models/medicinemix-item.ts b/app/models/medicinemix-item.ts new file mode 100644 index 00000000..4934e88a --- /dev/null +++ b/app/models/medicinemix-item.ts @@ -0,0 +1,46 @@ +import { type Medicine, genMedicine } from "./medicine"; + +interface MedicinemixItem { + id: number + medicineMix_id: number + medicine_id: number + medicine: Medicine + dose: number + uom_code: string +} + +export interface CreateDto { + medicineMix_id: number + medicine_id: number + medicine: Medicine + dose: number + uom_code: string +} + +export interface GetListDto { + page: number + size: number +} + +export interface GetDetailDto { + id: number +} + +export interface UpdateDto extends CreateDto { + id: number +} + +export interface DeleteDto { + id: number +} + +export function MedicinemixItem(): MedicinemixItem { + return { + id: 0, + medicineMix_id: 0, + medicine_id: 0, + medicine: genMedicine(), + dose: 0, + uom_code: '' + } +} diff --git a/app/models/medicinemix.ts b/app/models/medicinemix.ts new file mode 100644 index 00000000..c470b3ac --- /dev/null +++ b/app/models/medicinemix.ts @@ -0,0 +1,36 @@ +export interface Medicinemix { + id: number + name: string + uom_code: string +} + +export interface CreateDto { + name: string + uom_code: string +} + +export interface GetListDto { + page: number + size: number + name?: string +} + +export interface GetDetailDto { + id: number +} + +export interface UpdateDto extends CreateDto { + id: number +} + +export interface DeleteDto { + id: number +} + +export function genMedicinemix(): Medicinemix { + return { + id: 0, + name: '', + uom_code: '', + } +} diff --git a/app/models/prescription-item.ts b/app/models/prescription-item.ts new file mode 100644 index 00000000..979d64c8 --- /dev/null +++ b/app/models/prescription-item.ts @@ -0,0 +1,69 @@ +import { genMedicine, type Medicine } from "./medicine"; +import { genMedicinemix, type Medicinemix } from "./medicinemix"; + +interface PrescriptionItem { + id: number; + prescription_id: number; + isMix: boolean; + medicine_id: number; + medicine: Medicine; + medicineMix_id: number; + medicineMix: Medicinemix + frequency: number; + dose: number; + interval: number; + intervalUnit_code: string; + quantity: number; + usage: string; +} + +export interface CreateDto { + prescription_Id: number; + isMix: boolean; + medicine_Id: number; + medicineMix_id: number; + frequency: number; + multiplier: number; + interval: number; + intervalUnit_code: string; + quantity: number; + usage: string; +} + +export interface GetListDto { + page: number + size: number + name?: string +// code?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genPresciptionItem(): PrescriptionItem { + return { + id: 0, + prescription_id: 0, + isMix: false, + medicine_id: 0, + medicine: genMedicine(), + medicineMix_id: 0, + medicineMix: genMedicinemix(), + frequency: 0, + dose: 0, + interval: 0, + intervalUnit_code: '', + quantity: 0, + usage: '' + } +} + \ No newline at end of file diff --git a/app/models/uom.ts b/app/models/uom.ts index 9e9f5fdf..3f29c0ec 100644 --- a/app/models/uom.ts +++ b/app/models/uom.ts @@ -3,3 +3,11 @@ export interface Uom { name: string erp_id: string } + +export function genUom(): Uom { + return { + code: '', + name: '', + erp_id: '', + } +} \ No newline at end of file