feat/role-check: wip
This commit is contained in:
No files matched your search
@@ -44,7 +44,8 @@ import {
|
|||||||
export function useEncounterEntry(props: {
|
export function useEncounterEntry(props: {
|
||||||
id: number
|
id: number
|
||||||
classCode?: 'ambulatory' | 'emergency' | 'inpatient' | 'outpatient'
|
classCode?: 'ambulatory' | 'emergency' | 'inpatient' | 'outpatient'
|
||||||
subclassCode?: 'reg' | 'rehab' | 'chemo' | 'emg' | 'eon' | 'op' | 'icu' | 'hcu' | 'vk'
|
subclassCode?: 'regular' | 'rehab' | 'chemo' | 'emg' | 'eon' | 'op' | 'icu' | 'hcu' | 'vk'
|
||||||
|
specialist_Code?: 'regular' | 'rehab' | 'chemo' | 'emg' | 'eon' | 'op' | 'icu' | 'hcu' | 'vk'
|
||||||
}) {
|
}) {
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -207,7 +208,7 @@ export function useEncounterEntry(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getDoctorInfo(value: string) {
|
async function getDoctorInfo(value: string) {
|
||||||
const resp = await getDoctorDetail(value, { includes: 'unit,specialist,subspecialist' })
|
const resp = await getDoctorDetail(value, { includes: 'specialist,subspecialist' })
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
selectedDoctor.value = resp.body.data
|
selectedDoctor.value = resp.body.data
|
||||||
}
|
}
|
||||||
@@ -294,22 +295,22 @@ export function useEncounterEntry(props: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleFetchDoctors(unit?: string, specialist_code?: string, subSpecialist_code?: string) {
|
async function handleFetchDoctors(specialist_code?: string, subSpecialist_code?: string) {
|
||||||
try {
|
try {
|
||||||
const filterParams: Record<string, any> = {
|
const filterParams: Record<string, any> = {
|
||||||
'page-size': 100,
|
'page-size': 100,
|
||||||
includes: 'employee-Person,unit,specialist,subspecialist'
|
includes: 'employee-Person,specialist,subspecialist'
|
||||||
}
|
}
|
||||||
|
|
||||||
// rehab is special
|
// rehab is special
|
||||||
if (unit) {
|
// if (unit) {
|
||||||
if (unit == 'rehab') {
|
// if (unit == 'rehab') {
|
||||||
filterParams['unit-code'] = 'rehab'
|
// filterParams['unit-code'] = 'rehab'
|
||||||
} else {
|
// } else {
|
||||||
filterParams['unit-code'] = 'rehab'
|
// filterParams['unit-code'] = 'rehab'
|
||||||
filterParams['unit-code-opt'] = 'ne'
|
// filterParams['unit-code-opt'] = 'ne'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (specialist_code) {
|
if (specialist_code) {
|
||||||
if (specialist_code == 'rehab') {
|
if (specialist_code == 'rehab') {
|
||||||
filterParams['specialist-code'] = 'rehab'
|
filterParams['specialist-code'] = 'rehab'
|
||||||
@@ -318,7 +319,9 @@ export function useEncounterEntry(props: {
|
|||||||
filterParams['specialist-code-opt'] = 'ne'
|
filterParams['specialist-code-opt'] = 'ne'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (subSpecialist_code) filterParams['subspecialist-code'] = subSpecialist_code
|
if (subSpecialist_code) {
|
||||||
|
filterParams['subspecialist-code'] = subSpecialist_code
|
||||||
|
}
|
||||||
doctorsList.value = await getDoctorValueLabelList(filterParams, true)
|
doctorsList.value = await getDoctorValueLabelList(filterParams, true)
|
||||||
|
|
||||||
// const isSub = getIsSubspecialist(subSpecialistId, specialistsTree.value)
|
// const isSub = getIsSubspecialist(subSpecialistId, specialistsTree.value)
|
||||||
@@ -507,6 +510,8 @@ export function useEncounterEntry(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleSaveEncounter(formValues: any) {
|
async function handleSaveEncounter(formValues: any) {
|
||||||
|
console.log(formValues)
|
||||||
|
return
|
||||||
if (!selectedPatient.value || !selectedPatientObject.value) {
|
if (!selectedPatient.value || !selectedPatientObject.value) {
|
||||||
toast({
|
toast({
|
||||||
title: 'Gagal',
|
title: 'Gagal',
|
||||||
@@ -556,6 +561,7 @@ export function useEncounterEntry(props: {
|
|||||||
appointment_doctor_code: formValues.doctor_code || null,
|
appointment_doctor_code: formValues.doctor_code || null,
|
||||||
class_code: props.classCode || '',
|
class_code: props.classCode || '',
|
||||||
subClass_code: props.subclassCode || '',
|
subClass_code: props.subclassCode || '',
|
||||||
|
specialist_code: selectedDoctor.value?.specialist_code || '',
|
||||||
infra_id: formValues.infra_id ?? null,
|
infra_id: formValues.infra_id ?? null,
|
||||||
unit_code: formValues.unitCode ?? userStore?.user?.unit_code ?? null,
|
unit_code: formValues.unitCode ?? userStore?.user?.unit_code ?? null,
|
||||||
refSource_name: formValues.refSource_name ?? 'RSSA',
|
refSource_name: formValues.refSource_name ?? 'RSSA',
|
||||||
|
|||||||
@@ -18,12 +18,15 @@ const ERROR_MESSAGES = {
|
|||||||
|
|
||||||
const ACCEPTED_UPLOAD_TYPES = ['image/jpeg', 'image/png', 'application/pdf']
|
const ACCEPTED_UPLOAD_TYPES = ['image/jpeg', 'image/png', 'application/pdf']
|
||||||
const isValidationSep = false
|
const isValidationSep = false
|
||||||
|
// const encounterPatientShcema = z.object({
|
||||||
|
// })
|
||||||
|
|
||||||
const IntegrationEncounterSchema = z
|
const IntegrationEncounterSchema = z
|
||||||
.object({
|
.object({
|
||||||
// Patient data (readonly, populated from selected patient)
|
// Patient data (readonly, populated from selected patient)
|
||||||
|
patientSource: z.string().optional(),
|
||||||
patientName: z.string().optional(),
|
patientName: z.string().optional(),
|
||||||
nationalIdentity: z.string().optional(),
|
residentIdentiyNumber: z.string().optional(),
|
||||||
medicalRecordNumber: z.string().optional(),
|
medicalRecordNumber: z.string().optional(),
|
||||||
|
|
||||||
// Visit data
|
// Visit data
|
||||||
|
|||||||
Generated
+7686
-6193
File diff suppressed because it is too large
Load diff
@@ -21,11 +21,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"title": "IGD",
|
|
||||||
"icon": "i-lucide-zap",
|
|
||||||
"link": "/emergency/encounter"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"title": "Rawat Inap",
|
"title": "Rawat Inap",
|
||||||
"icon": "i-lucide-building-2",
|
"icon": "i-lucide-building-2",
|
||||||
|
|||||||
Reference in New Issue
Block a user