Merge branch 'dev' into feat/cprj-146

This commit is contained in:
2025-11-21 07:50:08 +07:00
382 changed files with 24065 additions and 2241 deletions
+100 -14
View File
@@ -2,14 +2,23 @@
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 { backToList } = useQueryMode('mode')
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<any>(null)
const selectedDiagnose = ref<any>(null)
const selectedFungsional = ref<any>(null)
const schema = FunctionSoapiSchema
const payload = ref({
encounter_id: 0,
@@ -60,29 +69,55 @@ const isLoading = reactive<DataTableLoader>({
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<string, any>).data
diagnoses.value = (resp.body as Record<string, any>).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<string, any>).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)
if (type === 'back') {
backToList()
return
}
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 +134,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)
</script>
<template>
<Entry
@@ -107,17 +158,52 @@ provide('table_data_loader', isLoading)
v-model="model"
:schema="schema"
type="function"
@modal="handleOpen"
@click="handleClick"
/>
<div class="my-2 flex justify-end py-2">
<Action @click="actionHandler" />
</div>
<Dialog
v-model:open="isOpen"
v-model:open="isOpenProcedure"
title="Pilih Prosedur"
size="xl"
prevent-outside
>
<AppIcdMultiselectPicker :data="data" />
<AppIcdMultiselectPicker
v-model:model-value="selectedProcedure"
:data="procedures"
/>
<div class="my-2 flex justify-end py-2">
<ActionDialog @click="actionDialogHandler" />
</div>
</Dialog>
<Dialog
v-model:open="isOpenDiagnose"
title="Pilih Diagnosa"
size="xl"
prevent-outside
>
<AppIcdMultiselectPicker
v-model:model-value="selectedDiagnose"
:data="diagnoses"
/>
<div class="my-2 flex justify-end py-2">
<ActionDialog @click="actionDialogHandler" />
</div>
</Dialog>
<Dialog
v-model:open="isOpenFungsional"
title="Pilih Fungsional"
size="xl"
prevent-outside
>
<AppIcdMultiselectPicker
v-model:model-value="selectedFungsional"
:data="diagnoses"
/>
<div class="my-2 flex justify-end py-2">
<ActionDialog @click="actionDialogHandler" />
</div>
</Dialog>
</template>
+57 -13
View File
@@ -2,14 +2,20 @@
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 { backToList } = useQueryMode('mode')
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<any>(null)
const selectedDiagnose = ref<any>(null)
const schema = EarlyRehabSchema
const payload = ref({
encounter_id: 0,
@@ -65,29 +71,46 @@ const isLoading = reactive<DataTableLoader>({
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<string, any>).data
diagnoses.value = (resp.body as Record<string, any>).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<string, any>).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()
async function actionHandler(type: string) {
console.log(type)
if (type === 'back') {
backToList()
return
}
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 +127,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)
</script>
<template>
<Entry
@@ -112,17 +150,23 @@ provide('table_data_loader', isLoading)
v-model="model"
:schema="schema"
type="early-rehab"
@modal="handleOpen"
@click="handleOpen"
/>
<div class="my-2 flex justify-end py-2">
<Action @click="actionHandler" />
</div>
<Dialog
v-model:open="isOpen"
title="Pilih Prosedur"
v-model:open="isOpenDiagnose"
title="Pilih Fungsional"
size="xl"
prevent-outside
>
<AppIcdMultiselectPicker :data="data" />
<AppIcdMultiselectPicker
v-model:model-value="selectedDiagnose"
:data="diagnoses"
/>
<div class="my-2 flex justify-end py-2">
<ActionDialog @click="actionDialogHandler" />
</div>
</Dialog>
</template>
+68 -9
View File
@@ -2,6 +2,7 @@
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'
@@ -10,8 +11,12 @@ import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handl
const { goToEntry, backToList } = useQueryCRUDMode('mode')
const { recordId } = useQueryCRUDMode('record-id')
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<any>(null)
const selectedDiagnose = ref<any>(null)
const schema = EarlySchema
const payload = ref({
encounter_id: 0,
@@ -40,22 +45,35 @@ const isLoading = reactive<DataTableLoader>({
isTableLoading: false,
})
async function getPatientList() {
async function getDiagnoses() {
isLoading.isTableLoading = true
const resp = await xfetch(`/api/v1/soapi/${recordId}`)
if (resp.success) {
data.value = (resp.body as Record<string, any>).data
diagnoses.value = (resp.body as Record<string, any>).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<string, any>).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()
@@ -68,6 +86,11 @@ async function actionHandler(type: string) {
}
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(
{
@@ -84,7 +107,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)
</script>
<template>
<Entry
@@ -98,11 +136,32 @@ provide('table_data_loader', isLoading)
<Action @click="actionHandler" />
</div>
<Dialog
v-model:open="isOpen"
v-model:open="isOpenProcedure"
title="Pilih Prosedur"
size="xl"
prevent-outside
>
<AppIcdMultiselectPicker :data="data" />
<AppIcdMultiselectPicker
v-model:model-value="selectedProcedure"
:data="procedures"
/>
<div class="my-2 flex justify-end py-2">
<ActionDialog @click="actionDialogHandler" />
</div>
</Dialog>
<Dialog
v-model:open="isOpenDiagnose"
title="Pilih Diagnosa"
size="xl"
prevent-outside
>
<AppIcdMultiselectPicker
v-model:model-value="selectedDiagnose"
:data="diagnoses"
/>
<div class="my-2 flex justify-end py-2">
<ActionDialog @click="actionDialogHandler" />
</div>
</Dialog>
</template>
+13 -10
View File
@@ -4,15 +4,24 @@ import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types
import List from '~/components/app/soapi/list.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
const props = defineProps<{
label: string
}>()
// Helpers
import { usePaginatedList } from '~/composables/usePaginatedList'
import { toast } from '~/components/pub/ui/toast'
const { goToEntry } = useQueryCRUDMode('mode')
const router = useRouter()
const route = useRoute()
const data = ref([])
const encounterId = ref<number>(props?.encounter?.id || 0)
const title = ref('')
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const isLoading = ref(false)
const isReadonly = ref(false)
const isRecordConfirmationOpen = ref(false)
const paginationMeta = ref<PaginationMeta>(null)
const refSearchNav: RefSearchNav = {
onClick: () => {
@@ -26,13 +35,7 @@ const refSearchNav: RefSearchNav = {
},
}
// Loading state management
const isLoading = reactive<DataTableLoader>({
isTableLoading: false,
})
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const typeCode = ref('')
const hreaderPrep: HeaderPrep = {
title: props.label,