diff --git a/app/components/app/soapi/early-entry.vue b/app/components/app/soapi/early-entry.vue index 146a25d4..4d2367be 100644 --- a/app/components/app/soapi/early-entry.vue +++ b/app/components/app/soapi/early-entry.vue @@ -63,13 +63,13 @@ const validate = async () => { } defineExpose({ validate }) +const icdPreview = inject('icdPreview') const isExcluded = (key: string) => props.excludeFields?.includes(key) diff --git a/app/components/app/soapi/function-entry.vue b/app/components/app/soapi/function-entry.vue index 3e192c47..01276c03 100644 --- a/app/components/app/soapi/function-entry.vue +++ b/app/components/app/soapi/function-entry.vue @@ -86,6 +86,8 @@ const validate = async () => { defineExpose({ validate }) +const icdPreview = inject('icdPreview') + const isExcluded = (key: string) => props.excludeFields?.includes(key) const disorders = ref([]) const therapies = ref([]) @@ -558,33 +560,33 @@ const therapyOptions = ['Terapi Latihan', 'Modalitas Fisik', 'Protesa/Ortosa', ' - + + +
+ Diagnosa Fungsional (ICD-X) + +
Diagnosa Medis (ICD-X) - -
-
- Diagnosa Medis (ICD-X) - - +
diff --git a/app/components/content/encounter/assesment-function/add.vue b/app/components/content/encounter/assesment-function/add.vue deleted file mode 100644 index 128cf74a..00000000 --- a/app/components/content/encounter/assesment-function/add.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/app/components/content/encounter/assesment-function/list.vue b/app/components/content/encounter/assesment-function/list.vue deleted file mode 100644 index 48d50bc9..00000000 --- a/app/components/content/encounter/assesment-function/list.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue index 71c7fe3d..a629fd9c 100644 --- a/app/components/content/encounter/process.vue +++ b/app/components/content/encounter/process.vue @@ -11,7 +11,7 @@ import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue' // PLASE ORDER BY TAB POSITION import Status from '~/components/content/encounter/status.vue' -import AssesmentFunctionList from '~/components/content/assesment-function/list.vue' +import AssesmentFunctionList from '~/components/content/soapi/entry.vue' import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue' import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue' import PrescriptionList from '~/components/content/prescription/list.vue' diff --git a/app/components/content/soapi/form-function.vue b/app/components/content/soapi/form-function.vue index ade9e4d1..7426bad9 100644 --- a/app/components/content/soapi/form-function.vue +++ b/app/components/content/soapi/form-function.vue @@ -2,14 +2,22 @@ import { z } from 'zod' import Entry from '~/components/app/soapi/entry.vue' import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue' +import ActionDialog from '~/components/pub/my-ui/nav-footer/ba-su.vue' import Dialog from '~/components/pub/my-ui/modal/dialog.vue' import { FunctionSoapiSchema } from '~/schemas/soapi.schema' import { toast } from '~/components/pub/ui/toast' import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler' const route = useRoute() -const isOpen = ref(false) -const data = ref([]) +const isOpenProcedure = ref(false) +const isOpenDiagnose = ref(false) +const isOpenFungsional = ref(false) +const procedures = ref([]) +const diagnoses = ref([]) +const fungsional = ref([]) +const selectedProcedure = ref(null) +const selectedDiagnose = ref(null) +const selectedFungsional = ref(null) const schema = FunctionSoapiSchema const payload = ref({ encounter_id: 0, @@ -60,29 +68,52 @@ const isLoading = reactive({ isTableLoading: false, }) -async function getPatientList() { +async function getDiagnoses() { isLoading.isTableLoading = true - const resp = await xfetch('/api/v1/patient') + const resp = await xfetch('/api/v1/diagnose-src') if (resp.success) { - data.value = (resp.body as Record).data + diagnoses.value = (resp.body as Record).data + } + isLoading.isTableLoading = false +} + +async function getProcedures() { + isLoading.isTableLoading = true + const resp = await xfetch('/api/v1/procedure-src') + if (resp.success) { + procedures.value = (resp.body as Record).data } isLoading.isTableLoading = false } onMounted(() => { - getPatientList() + getProcedures() + getDiagnoses() }) -function handleOpen(type: string) { - console.log(type) - isOpen.value = true +function handleClick(type: string) { + if (type === 'prosedur') { + isOpenProcedure.value = true + } else if (type === 'diagnosa') { + isOpenDiagnose.value = true + } else if (type === 'fungsional') { + isOpenDiagnose.value = true + } } - const entryRehabRef = ref() async function actionHandler(type: string) { console.log(type) const result = await entryRehabRef.value?.validate() if (result?.valid) { + if ( + selectedProcedure.value?.length > 0 || + selectedDiagnose.value?.length > 0 || + selectedFungsional.value?.length > 0 + ) { + result.data.procedure = selectedProcedure.value || [] + result.data.diagnose = selectedDiagnose.value || [] + result.data.fungsional = selectedFungsional.value || [] + } console.log('data', result.data) handleActionSave( { @@ -99,7 +130,23 @@ async function actionHandler(type: string) { } } +const icdPreview = ref({ + procedures: [], + diagnoses: [], +}) + +function actionDialogHandler(type: string) { + if (type === 'submit') { + icdPreview.value.procedures = selectedProcedure.value || [] + icdPreview.value.diagnoses = selectedDiagnose.value || [] + icdPreview.value.fungsional = selectedFungsional.value || [] + } + isOpenProcedure.value = false + isOpenDiagnose.value = false +} + provide('table_data_loader', isLoading) +provide('icdPreview', icdPreview) diff --git a/app/components/content/soapi/form-rehab.vue b/app/components/content/soapi/form-rehab.vue index 655063f9..fc667b5d 100644 --- a/app/components/content/soapi/form-rehab.vue +++ b/app/components/content/soapi/form-rehab.vue @@ -2,14 +2,19 @@ import { z } from 'zod' import Entry from '~/components/app/soapi/entry.vue' import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue' +import ActionDialog from '~/components/pub/my-ui/nav-footer/ba-su.vue' import Dialog from '~/components/pub/my-ui/modal/dialog.vue' import { EarlyRehabSchema } from '~/schemas/soapi.schema' import { toast } from '~/components/pub/ui/toast' import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler' const route = useRoute() -const isOpen = ref(false) -const data = ref([]) +const isOpenProcedure = ref(false) +const isOpenDiagnose = ref(false) +const procedures = ref([]) +const diagnoses = ref([]) +const selectedProcedure = ref(null) +const selectedDiagnose = ref(null) const schema = EarlyRehabSchema const payload = ref({ encounter_id: 0, @@ -65,22 +70,33 @@ const isLoading = reactive({ isTableLoading: false, }) -async function getPatientList() { +async function getDiagnoses() { isLoading.isTableLoading = true - const resp = await xfetch('/api/v1/patient') + const resp = await xfetch('/api/v1/diagnose-src') if (resp.success) { - data.value = (resp.body as Record).data + diagnoses.value = (resp.body as Record).data + } + isLoading.isTableLoading = false +} + +async function getProcedures() { + isLoading.isTableLoading = true + const resp = await xfetch('/api/v1/procedure-src') + if (resp.success) { + procedures.value = (resp.body as Record).data } isLoading.isTableLoading = false } onMounted(() => { - getPatientList() + getProcedures() + getDiagnoses() }) function handleOpen(type: string) { - console.log(type) - isOpen.value = true + if (type === 'fungsional') { + isOpenDiagnose.value = true + } } const entryRehabRef = ref() @@ -88,6 +104,9 @@ async function actionHandler(type: string) { console.log(type) const result = await entryRehabRef.value?.validate() if (result?.valid) { + if (selectedDiagnose.value?.length > 0) { + result.data.diagnose = selectedDiagnose.value || [] + } console.log('data', result.data) handleActionSave( { @@ -104,7 +123,22 @@ async function actionHandler(type: string) { } } +const icdPreview = ref({ + procedures: [], + diagnoses: [], +}) + +function actionDialogHandler(type: string) { + if (type === 'submit') { + icdPreview.value.procedures = selectedProcedure.value || [] + icdPreview.value.diagnoses = selectedDiagnose.value || [] + } + isOpenProcedure.value = false + isOpenDiagnose.value = false +} + provide('table_data_loader', isLoading) +provide('icdPreview', icdPreview) diff --git a/app/components/content/soapi/form.vue b/app/components/content/soapi/form.vue index 794daef9..44730197 100644 --- a/app/components/content/soapi/form.vue +++ b/app/components/content/soapi/form.vue @@ -2,14 +2,19 @@ import { z } from 'zod' import Entry from '~/components/app/soapi/entry.vue' import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue' +import ActionDialog from '~/components/pub/my-ui/nav-footer/ba-su.vue' import Dialog from '~/components/pub/my-ui/modal/dialog.vue' import { EarlySchema } from '~/schemas/soapi.schema' import { toast } from '~/components/pub/ui/toast' import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler' const route = useRoute() -const isOpen = ref(false) -const data = ref([]) +const isOpenProcedure = ref(false) +const isOpenDiagnose = ref(false) +const procedures = ref([]) +const diagnoses = ref([]) +const selectedProcedure = ref(null) +const selectedDiagnose = ref(null) const schema = EarlySchema const payload = ref({ encounter_id: 0, @@ -38,22 +43,35 @@ const isLoading = reactive({ isTableLoading: false, }) -async function getPatientList() { +async function getDiagnoses() { isLoading.isTableLoading = true - const resp = await xfetch('/api/v1/patient') + const resp = await xfetch('/api/v1/diagnose-src') if (resp.success) { - data.value = (resp.body as Record).data + diagnoses.value = (resp.body as Record).data + } + isLoading.isTableLoading = false +} + +async function getProcedures() { + isLoading.isTableLoading = true + const resp = await xfetch('/api/v1/procedure-src') + if (resp.success) { + procedures.value = (resp.body as Record).data } isLoading.isTableLoading = false } onMounted(() => { - getPatientList() + getProcedures() + getDiagnoses() }) function handleOpen(type: string) { - console.log(type) - isOpen.value = true + if (type === 'prosedur') { + isOpenProcedure.value = true + } else if (type === 'diagnosa') { + isOpenDiagnose.value = true + } } const entryRef = ref() @@ -61,6 +79,11 @@ async function actionHandler(type: string) { console.log(type) const result = await entryRef.value?.validate() if (result?.valid) { + if (selectedProcedure.value?.length > 0 || selectedDiagnose.value?.length > 0) { + result.data.procedure = selectedProcedure.value || [] + result.data.diagnose = selectedDiagnose.value || [] + } + console.log('data', result.data) handleActionSave( { @@ -77,7 +100,22 @@ async function actionHandler(type: string) { } } +const icdPreview = ref({ + procedures: [], + diagnoses: [], +}) + +function actionDialogHandler(type: string) { + if (type === 'submit') { + icdPreview.value.procedures = selectedProcedure.value || [] + icdPreview.value.diagnoses = selectedDiagnose.value || [] + } + isOpenProcedure.value = false + isOpenDiagnose.value = false +} + provide('table_data_loader', isLoading) +provide('icdPreview', icdPreview)