diff --git a/app/components/app/prescription-item/list-entry.vue b/app/components/app/prescription-item/list-entry.vue
index e5feecba..6629f782 100644
--- a/app/components/app/prescription-item/list-entry.vue
+++ b/app/components/app/prescription-item/list-entry.vue
@@ -15,5 +15,24 @@ defineProps<{
:func-parsed="funcParsed"
:func-html="funcHtml"
:func-component="funcComponent"
+ class="border mb-4 2xl:mb-5"
/>
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/prescription/list-entry.vue b/app/components/app/prescription/list-entry.vue
index 8231dd84..91cf96d5 100644
--- a/app/components/app/prescription/list-entry.vue
+++ b/app/components/app/prescription/list-entry.vue
@@ -1,8 +1,12 @@
-
-
+
+
-
-
-
+
+
+ handleActionRemove(recId, getMyList, toast)"
+ @cancel=""
+ >
+
+
+
ID: {{ record?.id }}
+
Nama: {{ record.name }}
+
Kode: {{ record.code }}
+
+
+
diff --git a/app/components/pub/my-ui/data-table/data-table.vue b/app/components/pub/my-ui/data-table/data-table.vue
index 883273b7..c0df12a9 100644
--- a/app/components/pub/my-ui/data-table/data-table.vue
+++ b/app/components/pub/my-ui/data-table/data-table.vue
@@ -15,6 +15,7 @@ const props = defineProps<{
funcComponent?: RecStrFuncComponent
selectMode?: 'single' | 'multiple'
modelValue?: any[] | any
+ class?: string
}>()
const emit = defineEmits<{
@@ -61,7 +62,7 @@ function handleActionCellClick(event: Event, _cellRef: string) {
-
+
diff --git a/app/composables/usePaginatedList.ts b/app/composables/usePaginatedList.ts
index b7e78dfd..11a044ad 100644
--- a/app/composables/usePaginatedList.ts
+++ b/app/composables/usePaginatedList.ts
@@ -54,6 +54,10 @@ export function usePaginatedList(options: UsePaginatedListOptions) {
initialValue: defaultQuery,
removeFalsyValues: true,
})
+ console.log("SAPI PERAH");
+ console.log(options);
+ console.log(defaultQuery);
+ console.log(queryParams);
const params = computed(() => {
const result = querySchema.safeParse(queryParams)
diff --git a/app/handlers/prescription.handler.ts b/app/handlers/prescription.handler.ts
new file mode 100644
index 00000000..62e1861e
--- /dev/null
+++ b/app/handlers/prescription.handler.ts
@@ -0,0 +1,17 @@
+import { createCrudHandler, genCrudHandler } from '~/handlers/_handler'
+import { create, update, remove } from '~/services/prescription.service'
+
+export const {
+ recId,
+ recAction,
+ recItem,
+ isReadonly,
+ isProcessing,
+ isFormEntryDialogOpen,
+ isRecordConfirmationOpen,
+ onResetState,
+ handleActionSave,
+ handleActionEdit,
+ handleActionRemove,
+ handleCancelForm,
+} = genCrudHandler({ create, update, remove})
diff --git a/app/models/_model.ts b/app/models/_model.ts
index d41c54a7..9fce17b3 100644
--- a/app/models/_model.ts
+++ b/app/models/_model.ts
@@ -2,8 +2,8 @@
export interface ItemMeta {
id: number
createdAt: string | null
- deletedAt: string | null
updatedAt: string | null
+ deletedAt?: string | null
}
// Pagination meta model for API responses
diff --git a/app/models/device.ts b/app/models/device.ts
index ec7f7443..610ff9d2 100644
--- a/app/models/device.ts
+++ b/app/models/device.ts
@@ -1,4 +1,6 @@
-export interface Device {
+import type { ItemMeta } from "./_model"
+
+export interface Device extends ItemMeta {
code: string
name: string
uom_code: string
diff --git a/app/models/division-position.ts b/app/models/division-position.ts
new file mode 100644
index 00000000..3c4a4ab3
--- /dev/null
+++ b/app/models/division-position.ts
@@ -0,0 +1,7 @@
+import type { ItemMeta } from "./_model"
+
+export interface DivisionPosition extends ItemMeta {
+ code: string
+ name: string
+ division_id: number
+}
diff --git a/app/models/division.ts b/app/models/division.ts
index f796134e..8833cdd2 100644
--- a/app/models/division.ts
+++ b/app/models/division.ts
@@ -1,12 +1,13 @@
-export interface Division {
- id?: number
+import type { ItemMeta } from "./_model"
+
+export interface Division extends ItemMeta {
code: string
name: string
parent_id?: number | null
childrens?: Division[] | null
}
-export interface DivisionPosition {
+export interface DivisionPosition extends ItemMeta {
code: string
name: string
division_id: number
diff --git a/app/models/doctor.ts b/app/models/doctor.ts
index 8359d54a..7b5e9434 100644
--- a/app/models/doctor.ts
+++ b/app/models/doctor.ts
@@ -1,18 +1,17 @@
-export interface Doctor {
- id: number
- createdAt: string
- updatedAt: string
- name: string
- frontTitle?: string
- endTitle?: string
- specialist_code?: string
- sip_no: string
+import type { ItemMeta } from "./_model"
+import { genEmployee, type Employee } from "./employee"
+
+export interface Doctor extends ItemMeta {
+ employee_id: number
+ employee: Employee
ihs_number: string
- identity_number: string
- phone?: string
- bpjs_code?: string
- status_code?: number
+ sip_number: string
+ unit_id?: number
+ specialist_id?: number
+ subspecialist_id?: number
+ bpjs_code: string
}
+
// use one dto for both create and update
export interface CreateDto {
name?: string
@@ -53,9 +52,10 @@ export function genDoctor(): Doctor {
id: 0,
createdAt: '',
updatedAt: '',
- name: '',
+ employee_id: 0,
+ employee: genEmployee(),
ihs_number: '',
- identity_number: '',
- sip_no: '',
+ sip_number: '',
+ bpjs_code: '',
}
}
diff --git a/app/models/employee.ts b/app/models/employee.ts
index ea2d1f18..2747aa9b 100644
--- a/app/models/employee.ts
+++ b/app/models/employee.ts
@@ -1,11 +1,13 @@
+import { type Person, genPerson } from "./person"
+
export interface Employee {
- name: string
- number: string
- status_code: string
user_id: number
person_id: number
+ person: Person
position_code: string
division_code: string
+ number: string
+ status_code: string
}
export interface CreateDto extends Employee {}
@@ -26,12 +28,12 @@ export interface GetListDto extends Employee {
export function genEmployee(): Employee {
return {
- name: '',
- number: '',
- status_code: '',
user_id: 0,
person_id: 0,
+ person: genPerson(),
position_code: '',
division_code: '',
+ number: '',
+ status_code: '',
}
}
diff --git a/app/models/encounter.ts b/app/models/encounter.ts
new file mode 100644
index 00000000..1cd7485c
--- /dev/null
+++ b/app/models/encounter.ts
@@ -0,0 +1,39 @@
+import { type Doctor, genDoctor } from "./doctor"
+
+export interface Encounter {
+ id: number
+ patient_id: number
+ registeredAt: string
+ class_code: string
+ unit_id: number
+ specialist_id?: number
+ subspecialist_id?: number
+ visitdate: string
+ appointment_doctor_id: number
+ appointment_doctor: Doctor
+ responsible_doctor_id?: number
+ responsible_doctor?: Doctor
+ refSource_name?: string
+ appointment_id?: number
+ earlyEducation?: string
+ medicalDischargeEducation: string
+ admDischargeEducation?: string
+ dischargeMethod_code?: string
+ discharge_reason?: string
+ status_code: string
+}
+
+export function genEncounter(): Encounter {
+ return {
+ id: 0,
+ patient_id: 0,
+ registeredAt: '',
+ class_code: '',
+ unit_id: 0,
+ visitdate: '',
+ appointment_doctor_id: 0,
+ appointment_doctor: genDoctor(),
+ medicalDischargeEducation: '',
+ status_code: ''
+ }
+}
\ No newline at end of file
diff --git a/app/models/person.ts b/app/models/person.ts
new file mode 100644
index 00000000..b40a21bc
--- /dev/null
+++ b/app/models/person.ts
@@ -0,0 +1,34 @@
+import type { ItemMeta } from '~/models/_model'
+
+export interface Person extends ItemMeta {
+ id: number
+ name: string
+ alias?: string
+ frontTitle?: string
+ endTitle?: string
+ birthDate?: Date | string
+ birthRegency_code?: string
+ gender_code?: string
+ residentIdentityNumber?: string
+ passportNumber?: string
+ drivingLicenseNumber?: string
+ religion_code?: string
+ education_code?: string
+ occupation_code?: string
+ occupation_name?: string
+ ethnic_code?: string
+ language_code?: string
+ residentIdentityFileUrl?: string
+ passportFileUrl?: string
+ drivingLicenseFileUrl?: string
+ familyIdentityFileUrl?: string
+}
+
+export function genPerson(): Person {
+ return {
+ id: 0,
+ createdAt: '',
+ updatedAt: '',
+ name: '',
+ }
+}
diff --git a/app/models/prescription-item.ts b/app/models/prescription-item.ts
index 979d64c8..6f0d3716 100644
--- a/app/models/prescription-item.ts
+++ b/app/models/prescription-item.ts
@@ -1,7 +1,7 @@
import { genMedicine, type Medicine } from "./medicine";
import { genMedicinemix, type Medicinemix } from "./medicinemix";
-interface PrescriptionItem {
+export interface PrescriptionItem {
id: number;
prescription_id: number;
isMix: boolean;
diff --git a/app/models/prescription.ts b/app/models/prescription.ts
new file mode 100644
index 00000000..ceb51bf9
--- /dev/null
+++ b/app/models/prescription.ts
@@ -0,0 +1,57 @@
+import { type Encounter, genEncounter } from "./encounter";
+import { type Doctor, genDoctor } from "./doctor";
+import { type PrescriptionItem } from "./prescription-item";
+import type { SpecialistIntern } from "./specialist-intern";
+
+export interface Prescription {
+ id: number
+ encounter_id: number
+ encounter: Encounter
+ doctor_id: number
+ doctor: Doctor
+ specialistIntern_id?: number
+ specialistIntern?: SpecialistIntern
+ issuedAt: string
+ status_code: string
+ items: PrescriptionItem[]
+}
+
+export interface CreateDto {
+ encounter_id: number
+ doctor_id: number
+ issuedAt: string
+ status_code: string
+}
+
+export interface GetListDto {
+ encounter_id: number
+ doctor_id: number
+ issuedAt: string
+ status_code: string
+}
+
+export interface GetDetailDto {
+ id?: string
+}
+
+export interface UpdateDto extends CreateDto {
+ id?: number
+}
+
+export interface DeleteDto {
+ id?: string
+}
+
+export function genPresciption(): Prescription {
+ return {
+ id: 0,
+ encounter_id: 0,
+ encounter: genEncounter(),
+ doctor_id: 0,
+ doctor: genDoctor(),
+ issuedAt: '',
+ status_code: '',
+ items: [],
+ }
+}
+
\ No newline at end of file
diff --git a/app/models/specialist-intern.ts b/app/models/specialist-intern.ts
new file mode 100644
index 00000000..4840e15b
--- /dev/null
+++ b/app/models/specialist-intern.ts
@@ -0,0 +1,29 @@
+import type { ItemMeta } from "./_model";
+import { type Person, genPerson } from "./person";
+import { type Specialist, genSpecialist } from "./specialist";
+import { type Subspecialist, genSubspecialist } from "./subspecialist";
+
+export interface SpecialistIntern extends ItemMeta {
+ person_id: number
+ person: Person
+ specialist_id: number
+ specialist: Specialist
+ subspecialist_id: number
+ subspecialist: Subspecialist
+ user_id: number
+}
+
+export function genSpecialistIntern(): SpecialistIntern {
+ return {
+ id: 0,
+ createdAt: '',
+ updatedAt: '',
+ person_id: 0,
+ person: genPerson(),
+ specialist_id: 0,
+ specialist: genSpecialist(),
+ subspecialist_id: 0,
+ subspecialist: genSubspecialist(),
+ user_id: 0,
+ }
+}
\ No newline at end of file
diff --git a/app/models/specialist.ts b/app/models/specialist.ts
index 39b23390..1e3051c5 100644
--- a/app/models/specialist.ts
+++ b/app/models/specialist.ts
@@ -1,6 +1,18 @@
-export interface Specialist {
- id?: number
+import type { ItemMeta } from "./_model"
+
+export interface Specialist extends ItemMeta {
code: string
name: string
unit_id: number | string
}
+
+export function genSpecialist(): Specialist {
+ return {
+ id: 0,
+ createdAt: '',
+ updatedAt: '',
+ code: '',
+ name: '',
+ unit_id: 0
+ }
+}
\ No newline at end of file
diff --git a/app/models/subspecialist.ts b/app/models/subspecialist.ts
index 911603ae..95e9d97b 100644
--- a/app/models/subspecialist.ts
+++ b/app/models/subspecialist.ts
@@ -1,6 +1,18 @@
-export interface Subspecialist {
- id?: number
+import type { ItemMeta } from "./_model"
+
+export interface Subspecialist extends ItemMeta {
code: string
name: string
specialist_id: number | string
}
+
+export function genSubspecialist(): Subspecialist {
+ return {
+ id: 0,
+ createdAt: '',
+ updatedAt: '',
+ code: '',
+ name: '',
+ specialist_id: 0
+ }
+}
\ No newline at end of file
diff --git a/app/schemas/prescription-item.schema.ts b/app/schemas/prescription-item.schema.ts
new file mode 100644
index 00000000..7c3ca7d3
--- /dev/null
+++ b/app/schemas/prescription-item.schema.ts
@@ -0,0 +1,10 @@
+import { z } from 'zod'
+import type { PrescriptionItem } from '~/models/prescription-item'
+
+const PrescriptionItemSchema = z.object({
+})
+
+type PrescriptionItemFormData = z.infer & PrescriptionItem
+
+export { PrescriptionItemSchema }
+export type { PrescriptionItemFormData }
diff --git a/app/schemas/prescription.schema.ts b/app/schemas/prescription.schema.ts
new file mode 100644
index 00000000..1e23f642
--- /dev/null
+++ b/app/schemas/prescription.schema.ts
@@ -0,0 +1,11 @@
+import { z } from 'zod'
+import type { Prescription } from '~/models/prescription'
+
+const PrescriptionSchema = z.object({
+ 'encounter-id': z.number().nullable().optional(),
+})
+
+type PrescriptionFormData = z.infer & Prescription
+
+export { PrescriptionSchema }
+export type { PrescriptionFormData }