feat(sep): add form support code

This commit is contained in:
riefive
2025-10-22 13:38:17 +07:00
parent d11b22dc05
commit baad005522
5 changed files with 263 additions and 110 deletions

No files matched your search

+54 -8
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute } from "vue-router"
import { useRoute } from 'vue-router'
// Components
import AppViewHistory from '~/components/app/sep/view-history.vue'
@@ -12,7 +12,7 @@ import type { SepHistoryData } from '~/components/app/sep/list-cfg.history'
import type { SepVisitData } from '~/components/app/sep/list-cfg.visit'
// Constants
import { supportCodes } from '~/lib/constants'
import { serviceTypes, serviceAssessments, registerMethods, trafficAccidents, supportCodes, procedureTypes, purposeOfVisits } from '~/lib/constants.vclaim'
// Services
import { getPatientDetail, getPatients } from '~/services/patient.service'
@@ -35,6 +35,7 @@ const selectedPatient = ref('')
const selectedPatientObject = ref<PatientEntity | null>(null)
const selectedLetter = ref('SK22334442')
const selectedObjects = ref<any>({})
const selectedServiceType = ref<string>('')
const histories = ref<Array<SepHistoryData>>([])
const visits = ref<Array<SepVisitData>>([])
const patients = ref<Array<{ id: string; identity: string; number: string; bpjs: string; name: string }>>([])
@@ -42,6 +43,12 @@ const doctors = ref<Array<{ value: string | number; label: string }>>([])
const diagnoses = ref<Array<{ value: string | number; label: string }>>([])
const facilities = ref<Array<{ value: string | number; label: string }>>([])
const supportCodesList = ref<Array<{ value: string; label: string }>>([])
const serviceTypesList = ref<Array<{ value: string; label: string }>>([])
const registerMethodsList = ref<Array<{ value: string; label: string }>>([])
const accidentsList = ref<Array<{ value: string; label: string }>>([])
const purposeOfVisitsList = ref<Array<{ value: string; label: string }>>([])
const proceduresList = ref<Array<{ value: string; label: string }>>([])
const assessmentsList = ref<Array<{ value: string; label: string }>>([])
const isPatientsLoading = ref(false)
const paginationMeta = ref<PaginationMeta>({
recordCount: 0,
@@ -246,18 +253,18 @@ function handleEvent(menu: string, value: any) {
async function handleFetch(params: any) {
const menu = params.menu || ''
const value = params.value || ''
if (menu === 'initialDiagnosis') {
if (menu === 'diagnosis') {
diagnoses.value = await getDiagnoseLabelList({ diagnosa: value })
}
if (menu === 'attendingDoctor') {
if (menu === 'doctor') {
console.log('value:', value)
}
if (menu === 'destinationClinic') {
if (menu === 'clinic') {
facilities.value = await getHealthFacilityLabelList({ faskes: value, 'jenis-faskes': 1 })
}
}
onMounted(async () => {
async function handleInit() {
diagnoses.value = await getDiagnoseLabelList({ diagnosa: 'paru' })
facilities.value = await getHealthFacilityLabelList({ faskes: 'Puskesmas', 'jenis-faskes': 1 })
doctors.value = await getDoctorLabelList({
@@ -265,6 +272,40 @@ onMounted(async () => {
'tgl-pelayanan': new Date().toISOString().substring(0, 10),
'kode-spesialis': 0,
})
serviceTypesList.value = Object.keys(serviceTypes).map((item) => ({
value: item.toString(),
label: serviceTypes[item],
})) as any
registerMethodsList.value = Object.keys(registerMethods)
.filter((item) => !['2', '4'].includes(item))
.map((item) => ({
value: item.toString(),
label: registerMethods[item],
})) as any
accidentsList.value = Object.keys(trafficAccidents).map((item) => ({
value: item.toString(),
label: trafficAccidents[item],
})) as any
purposeOfVisitsList.value = Object.keys(purposeOfVisits).map((item) => ({
value: item.toString(),
label: purposeOfVisits[item],
})) as any
proceduresList.value = Object.keys(procedureTypes).map((item) => ({
value: item.toString(),
label: procedureTypes[item],
})) as any
assessmentsList.value = Object.keys(serviceAssessments).map((item) => ({
value: item.toString(),
label: `${item.toString()} - ${serviceAssessments[item]}`,
})) as any
supportCodesList.value = Object.keys(supportCodes).map((item) => ({
value: item.toString(),
label: `${item.toString()} - ${supportCodes[item]}`,
})) as any
}
onMounted(async () => {
await handleInit()
getProvinceList().then((value) => {
console.log('value:', value)
})
@@ -277,7 +318,6 @@ onMounted(async () => {
getDiagnoseReferralList().then((value) => {
console.log('value:', value)
})
supportCodesList.value = Object.keys(supportCodes).map((item) => ({ value: item.toString(), label: supportCodes[item] })) as any
if (route.query) {
selectedObjects.value = { ...route.query }
}
@@ -298,8 +338,14 @@ onMounted(async () => {
:doctors="doctors"
:diagnoses="diagnoses"
:facilities="facilities"
:patient="selectedPatientObject"
:service-types="serviceTypesList"
:register-methods="registerMethodsList"
:accidents="accidentsList"
:purposes="purposeOfVisitsList"
:procedures="proceduresList"
:assessments="assessmentsList"
:support-codes="supportCodesList"
:patient="selectedPatientObject"
@fetch="handleFetch"
@event="handleEvent"
/>