feat(sep): modify schema
This commit is contained in:
No files matched your search
@@ -1,23 +1,28 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// helpers
|
// Components
|
||||||
import { toTypedSchema } from '@vee-validate/zod'
|
|
||||||
import { useForm } from 'vee-validate'
|
|
||||||
import { IntegrationBpjsSchema, type IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
|
||||||
// components (use doc-entry block pattern)
|
|
||||||
import Block from '~/components/pub/my-ui/doc-entry/block.vue'
|
import Block from '~/components/pub/my-ui/doc-entry/block.vue'
|
||||||
import Cell from '~/components/pub/my-ui/doc-entry/cell.vue'
|
import Cell from '~/components/pub/my-ui/doc-entry/cell.vue'
|
||||||
import Field from '~/components/pub/my-ui/doc-entry/field.vue'
|
import Field from '~/components/pub/my-ui/doc-entry/field.vue'
|
||||||
import Label from '~/components/pub/my-ui/doc-entry/label.vue'
|
import Label from '~/components/pub/my-ui/doc-entry/label.vue'
|
||||||
import { Button } from '~/components/pub/ui/button'
|
import { Button } from '~/components/pub/ui/button'
|
||||||
import { Input } from '~/components/pub/ui/input'
|
import { Input } from '~/components/pub/ui/input'
|
||||||
import Select from '~/components/pub/ui/select/Select.vue'
|
|
||||||
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
|
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
|
||||||
import { Textarea } from '~/components/pub/ui/textarea'
|
import { Textarea } from '~/components/pub/ui/textarea'
|
||||||
|
import Select from '~/components/pub/ui/select/Select.vue'
|
||||||
import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-single.vue'
|
import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-single.vue'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import { IntegrationBpjsSchema, type IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
|
||||||
|
import type { PatientEntity } from "~/models/patient"
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { toTypedSchema } from '@vee-validate/zod'
|
||||||
|
import { useForm } from 'vee-validate'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
isLoading?: boolean
|
isLoading?: boolean
|
||||||
isReadonly?: boolean
|
isReadonly?: boolean
|
||||||
|
patient?: PatientEntity | null
|
||||||
values?: any
|
values?: any
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
@@ -40,22 +45,22 @@ const { handleSubmit, errors, defineField, meta } = useForm<IntegrationBpjsFormD
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Bind fields and extract attrs for consistent Field pattern
|
// Bind fields and extract attrs for consistent Field pattern
|
||||||
const [tanggalSep, tanggalSepAttrs] = defineField('tanggalSep')
|
const [sepDate, sepDateAttrs] = defineField('sepDate')
|
||||||
const [jalur, jalurAttrs] = defineField('jalur')
|
const [admissionType, admissionTypeAttrs] = defineField('admissionType')
|
||||||
const [noBpjs, noBpjsAttrs] = defineField('noBpjs')
|
const [bpjsNumber, bpjsNumberAttrs] = defineField('bpjsNumber')
|
||||||
const [noKtp, noKtpAttrs] = defineField('noKtp')
|
const [nationalId, nationalIdAttrs] = defineField('nationalId')
|
||||||
const [noRm, noRmAttrs] = defineField('noRm')
|
const [medicalRecordNumber, medicalRecordNumberAttrs] = defineField('medicalRecordNumber')
|
||||||
const [namaPasien, namaPasienAttrs] = defineField('namaPasien')
|
const [patientName, patientNameAttrs] = defineField('patientName')
|
||||||
const [noTelp, noTelpAttrs] = defineField('noTelp')
|
const [phoneNumber, phoneNumberAttrs] = defineField('phoneNumber')
|
||||||
const [noSuratKontrol, noSuratKontrolAttrs] = defineField('noSuratKontrol')
|
const [referralLetterNumber, referralLetterNumberAttrs] = defineField('referralLetterNumber')
|
||||||
const [tglSuratKontrol, tglSuratKontrolAttrs] = defineField('tglSuratKontrol')
|
const [referralLetterDate, referralLetterDateAttrs] = defineField('referralLetterDate')
|
||||||
const [klinikTujuan, klinikTujuanAttrs] = defineField('klinikTujuan')
|
const [destinationClinic, destinationClinicAttrs] = defineField('destinationClinic')
|
||||||
const [dpjp, dpjpAttrs] = defineField('dpjp')
|
const [attendingDoctor, attendingDoctorAttrs] = defineField('attendingDoctor')
|
||||||
const [diagnosaAwal, diagnosaAwalAttrs] = defineField('diagnosaAwal')
|
const [initialDiagnosis, initialDiagnosisAttrs] = defineField('initialDiagnosis')
|
||||||
const [cob, cobAttrs] = defineField('cob')
|
const [cob, cobAttrs] = defineField('cob')
|
||||||
const [katarak, katarakAttrs] = defineField('katarak')
|
const [cataract, cataractAttrs] = defineField('cataract')
|
||||||
const [jenisProsedur, jenisProsedurAttrs] = defineField('jenisProsedur')
|
const [procedureType, procedureTypeAttrs] = defineField('procedureType')
|
||||||
const [kodePenunjang, kodePenunjangAttrs] = defineField('kodePenunjang')
|
const [supportCode, supportCodeAttrs] = defineField('supportCode')
|
||||||
|
|
||||||
// Submit handler
|
// Submit handler
|
||||||
const onSubmit = handleSubmit((values) => {
|
const onSubmit = handleSubmit((values) => {
|
||||||
@@ -81,11 +86,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Tanggal SEP
|
Tanggal SEP
|
||||||
<span class="ml-1 text-red-500">*</span>
|
<span class="ml-1 text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.tanggalSep">
|
<Field :errMessage="errors.sepDate">
|
||||||
<DatepickerSingle
|
<DatepickerSingle
|
||||||
id="tanggalSep"
|
id="sepDate"
|
||||||
v-model="tanggalSep"
|
v-model="sepDate"
|
||||||
v-bind="tanggalSepAttrs"
|
v-bind="sepDateAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal sep"
|
placeholder="Pilih tanggal sep"
|
||||||
/>
|
/>
|
||||||
@@ -93,12 +98,12 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
<Label height="compact">Jalur</Label>
|
<Label height="compact">Jalur</Label>
|
||||||
<Field :errMessage="errors.jalur">
|
<Field :errMessage="errors.admissionType">
|
||||||
<Select
|
<Select
|
||||||
id="jalur"
|
id="admissionType"
|
||||||
icon-name="i-lucide-chevron-down"
|
icon-name="i-lucide-chevron-down"
|
||||||
v-model="jalur"
|
v-model="admissionType"
|
||||||
v-bind="jalurAttrs"
|
v-bind="admissionTypeAttrs"
|
||||||
:items="items"
|
:items="items"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih jalur"
|
placeholder="Pilih jalur"
|
||||||
@@ -136,11 +141,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
No. Kartu BPJS
|
No. Kartu BPJS
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.noBpjs">
|
<Field :errMessage="errors.bpjsNumber">
|
||||||
<Input
|
<Input
|
||||||
id="noBpjs"
|
id="bpjsNumber"
|
||||||
v-model="noBpjs"
|
v-model="bpjsNumber"
|
||||||
v-bind="noBpjsAttrs"
|
v-bind="bpjsNumberAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -150,11 +155,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
No. KTP
|
No. KTP
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.noKtp">
|
<Field :errMessage="errors.nationalId">
|
||||||
<Input
|
<Input
|
||||||
id="noKtp"
|
id="nationalId"
|
||||||
v-model="noKtp"
|
v-model="nationalId"
|
||||||
v-bind="noKtpAttrs"
|
v-bind="nationalIdAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -164,11 +169,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
No. RM
|
No. RM
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.noRm">
|
<Field :errMessage="errors.medicalRecordNumber">
|
||||||
<Input
|
<Input
|
||||||
id="noRm"
|
id="medicalRecordNumber"
|
||||||
v-model="noRm"
|
v-model="medicalRecordNumber"
|
||||||
v-bind="noRmAttrs"
|
v-bind="medicalRecordNumberAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -178,11 +183,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Nama Pasien
|
Nama Pasien
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.namaPasien">
|
<Field :errMessage="errors.patientName">
|
||||||
<Input
|
<Input
|
||||||
id="namaPasien"
|
id="patientName"
|
||||||
v-model="namaPasien"
|
v-model="patientName"
|
||||||
v-bind="namaPasienAttrs"
|
v-bind="patientNameAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -192,11 +197,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
No. Telepon
|
No. Telepon
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.noTelp">
|
<Field :errMessage="errors.phoneNumber">
|
||||||
<Input
|
<Input
|
||||||
id="noTelp"
|
id="phoneNumber"
|
||||||
v-model="noTelp"
|
v-model="phoneNumber"
|
||||||
v-bind="noTelpAttrs"
|
v-bind="phoneNumberAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -218,13 +223,13 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
No. Surat Kontrol
|
No. Surat Kontrol
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.noSuratKontrol">
|
<Field :errMessage="errors.referralLetterNumber">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<Input
|
<Input
|
||||||
id="noSuratKontrol"
|
id="referralLetterNumber"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
v-model="noSuratKontrol"
|
v-model="referralLetterNumber"
|
||||||
v-bind="noSuratKontrolAttrs"
|
v-bind="referralLetterNumberAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@@ -246,11 +251,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Tanggal Surat Kontrol
|
Tanggal Surat Kontrol
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.tglSuratKontrol">
|
<Field :errMessage="errors.referralLetterDate">
|
||||||
<DatepickerSingle
|
<DatepickerSingle
|
||||||
id="tglSuratKontrol"
|
id="referralLetterDate"
|
||||||
v-model="tglSuratKontrol"
|
v-model="referralLetterDate"
|
||||||
v-bind="tglSuratKontrolAttrs"
|
v-bind="referralLetterDateAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih tanggal surat kontrol"
|
placeholder="Pilih tanggal surat kontrol"
|
||||||
/>
|
/>
|
||||||
@@ -261,12 +266,12 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Klinik Tujuan
|
Klinik Tujuan
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.klinikTujuan">
|
<Field :errMessage="errors.destinationClinic">
|
||||||
<Select
|
<Select
|
||||||
id="klinikTujuan"
|
id="destinationClinic"
|
||||||
icon-name="i-lucide-chevron-down"
|
icon-name="i-lucide-chevron-down"
|
||||||
v-model="klinikTujuan"
|
v-model="destinationClinic"
|
||||||
v-bind="klinikTujuanAttrs"
|
v-bind="destinationClinicAttrs"
|
||||||
:items="items"
|
:items="items"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih klinik"
|
placeholder="Pilih klinik"
|
||||||
@@ -308,12 +313,12 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
DPJP
|
DPJP
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.dpjp">
|
<Field :errMessage="errors.attendingDoctor">
|
||||||
<Select
|
<Select
|
||||||
id="dpjp"
|
id="attendingDoctor"
|
||||||
icon-name="i-lucide-chevron-down"
|
icon-name="i-lucide-chevron-down"
|
||||||
v-model="dpjp"
|
v-model="attendingDoctor"
|
||||||
v-bind="dpjpAttrs"
|
v-bind="attendingDoctorAttrs"
|
||||||
:items="items"
|
:items="items"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih DPJP"
|
placeholder="Pilih DPJP"
|
||||||
@@ -326,11 +331,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Diagnosa Awal
|
Diagnosa Awal
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.diagnosaAwal">
|
<Field :errMessage="errors.initialDiagnosis">
|
||||||
<Input
|
<Input
|
||||||
id="diagnosaAwal"
|
id="initialDiagnosis"
|
||||||
v-model="diagnosaAwal"
|
v-model="initialDiagnosis"
|
||||||
v-bind="diagnosaAwalAttrs"
|
v-bind="initialDiagnosisAttrs"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -347,7 +352,7 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
<Label height="dynamic">Catatan</Label>
|
<Label height="dynamic">Catatan</Label>
|
||||||
<Field>
|
<Field>
|
||||||
<Textarea
|
<Textarea
|
||||||
id="catatan"
|
id="note"
|
||||||
class="h-[200px] w-full border-gray-400 bg-white"
|
class="h-[200px] w-full border-gray-400 bg-white"
|
||||||
placeholder="Masukkan catatan opsional"
|
placeholder="Masukkan catatan opsional"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
@@ -389,25 +394,25 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Katarak
|
Katarak
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.katarak">
|
<Field :errMessage="errors.cataract">
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
v-model="katarak"
|
v-model="cataract"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
v-bind="katarakAttrs"
|
v-bind="cataractAttrs"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
value="Ya"
|
value="Ya"
|
||||||
id="katarak-ya"
|
id="cataract-yes"
|
||||||
/>
|
/>
|
||||||
<Label for="katarak-ya">Ya</Label>
|
<Label for="cataract-yes">Ya</Label>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
value="Tidak"
|
value="Tidak"
|
||||||
id="katarak-tidak"
|
id="cataract-no"
|
||||||
/>
|
/>
|
||||||
<Label for="katarak-tidak">Tidak</Label>
|
<Label for="cataract-no">Tidak</Label>
|
||||||
</div>
|
</div>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</Field>
|
</Field>
|
||||||
@@ -418,11 +423,11 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Jenis Prosedur
|
Jenis Prosedur
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.jenisProsedur">
|
<Field :errMessage="errors.procedureType">
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
v-model="jenisProsedur"
|
v-model="procedureType"
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
v-bind="jenisProsedurAttrs"
|
v-bind="procedureTypeAttrs"
|
||||||
>
|
>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
@@ -454,12 +459,12 @@ const onSubmit = handleSubmit((values) => {
|
|||||||
Kode Penunjang
|
Kode Penunjang
|
||||||
<span class="text-red-500">*</span>
|
<span class="text-red-500">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<Field :errMessage="errors.kodePenunjang">
|
<Field :errMessage="errors.supportCode">
|
||||||
<Select
|
<Select
|
||||||
id="kodePenunjang"
|
id="supportCode"
|
||||||
icon-name="i-lucide-chevron-down"
|
icon-name="i-lucide-chevron-down"
|
||||||
v-model="kodePenunjang"
|
v-model="supportCode"
|
||||||
v-bind="kodePenunjangAttrs"
|
v-bind="supportCodeAttrs"
|
||||||
:items="items"
|
:items="items"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih Kode Penunjang"
|
placeholder="Pilih Kode Penunjang"
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
// Helpers
|
|
||||||
import { refDebounced } from '@vueuse/core'
|
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
@@ -21,15 +18,12 @@ import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vu
|
|||||||
// Types
|
// Types
|
||||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { refDebounced } from '@vueuse/core'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
open: boolean
|
open: boolean
|
||||||
patients: Array<{
|
patients: Array<{ id: string; identity: string; number: string; bpjs: string; name: string }>
|
||||||
id: string
|
|
||||||
identity: string
|
|
||||||
number: string
|
|
||||||
bpjs: string
|
|
||||||
name: string
|
|
||||||
}>
|
|
||||||
selected: string
|
selected: string
|
||||||
paginationMeta: PaginationMeta
|
paginationMeta: PaginationMeta
|
||||||
}>()
|
}>()
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { id } from "date-fns/locale"
|
import { id } from 'date-fns/locale'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||||
|
import type { PatientEntity } from '~/models/patient'
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
import { getPatientDetail, getPatients } from '~/services/patient.service'
|
import { getPatientDetail, getPatients } from '~/services/patient.service'
|
||||||
@@ -12,12 +13,11 @@ const openPatient = ref(false)
|
|||||||
const openLetter = ref(false)
|
const openLetter = ref(false)
|
||||||
const openHistory = ref(false)
|
const openHistory = ref(false)
|
||||||
const selectedPatient = ref('')
|
const selectedPatient = ref('')
|
||||||
|
const selectedPatientObject = ref<PatientEntity | null>(null)
|
||||||
const selectedLetter = ref('SK22334442')
|
const selectedLetter = ref('SK22334442')
|
||||||
|
|
||||||
// patients used by AppSepTableSearchPatient (will be filled from API)
|
// patients used by AppSepTableSearchPatient (will be filled from API)
|
||||||
const patients = ref<Array<{ id: string; identity: string; number: string; bpjs: string; name: string }>>([
|
const patients = ref<Array<{ id: string; identity: string; number: string; bpjs: string; name: string }>>([])
|
||||||
// fallback empty list until fetched
|
|
||||||
])
|
|
||||||
const isPatientsLoading = ref(false)
|
const isPatientsLoading = ref(false)
|
||||||
const paginationMeta = ref<PaginationMeta>({
|
const paginationMeta = ref<PaginationMeta>({
|
||||||
recordCount: 0,
|
recordCount: 0,
|
||||||
@@ -28,12 +28,12 @@ const paginationMeta = ref<PaginationMeta>({
|
|||||||
hasPrev: false,
|
hasPrev: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
function mapPatientToRow(patient: any) {
|
function mapPatientToRow(patient: PatientEntity) {
|
||||||
// Defensive mapping: try common field names that might be returned by the API
|
// Defensive mapping: try common field names that might be returned by the API
|
||||||
const identity = patient?.person?.residentIdentityNumber || '-'
|
const identity = patient?.person?.residentIdentityNumber || '-'
|
||||||
const number = patient?.number || patient?.medicalRecordNo || '-'
|
const number = patient?.number || '-'
|
||||||
const bpjs = patient?.person?.refNumber || '-'
|
const bpjs = '-'
|
||||||
const name = patient.name || patient?.person?.name || '-'
|
const name = patient?.person?.name || '-'
|
||||||
return { id: patient.id ? String(patient.id) : '-', identity, number, bpjs, name }
|
return { id: patient.id ? String(patient.id) : '-', identity, number, bpjs, name }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,13 +117,12 @@ const histories = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
function handleSavePatient() {
|
function handleSavePatient() {
|
||||||
console.log('Pasien dipilih:', selectedPatient.value)
|
|
||||||
const getPatient = async () => {
|
const getPatient = async () => {
|
||||||
try {
|
try {
|
||||||
const result = await getPatientDetail(Number(selectedPatient.value))
|
const result = await getPatientDetail(Number(selectedPatient.value))
|
||||||
if (result && result.success && result.body && result.body.data) {
|
if (result && result.success && result.body && result.body.data) {
|
||||||
const patient = result.body.data
|
const patient = result.body.data || null
|
||||||
console.log('Patient:', patient)
|
selectedPatientObject.value = patient
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to fetch patient:', err)
|
console.error('Failed to fetch patient:', err)
|
||||||
@@ -167,7 +166,7 @@ function handleEvent(value: string) {
|
|||||||
<span class="font-semibold">Tambah</span>
|
<span class="font-semibold">Tambah</span>
|
||||||
SEP
|
SEP
|
||||||
</div>
|
</div>
|
||||||
<AppSepEntryForm @event="handleEvent" />
|
<AppSepEntryForm :patient="selectedPatientObject" @event="handleEvent" />
|
||||||
<AppSepTableSearchPatient
|
<AppSepTableSearchPatient
|
||||||
v-model:open="openPatient"
|
v-model:open="openPatient"
|
||||||
v-model:selected="selectedPatient"
|
v-model:selected="selectedPatient"
|
||||||
|
|||||||
@@ -1,22 +1,69 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
|
|
||||||
|
const ERROR_MESSAGES = {
|
||||||
|
required: {
|
||||||
|
sepDate: 'Tanggal wajib diisi',
|
||||||
|
admissionType: 'Jenis Pendaftaran wajib diisi',
|
||||||
|
bpjsNumber: 'No. Kartu BPJS wajib diisi',
|
||||||
|
nationalId: 'Nomor ID wajib diisi',
|
||||||
|
medicalRecordNumber: 'Nomor Rekam Medis wajib diisi',
|
||||||
|
patientName: 'Nama wajib diisi',
|
||||||
|
phoneNumber: 'Nomor Telepon wajib diisi',
|
||||||
|
referralLetterNumber: 'Nomor Surat Kontrol wajib diisi',
|
||||||
|
referralLetterDate: 'Tanggal Surat Kontrol wajib diisi',
|
||||||
|
destinationClinic: 'Klinik Tujuan wajib diisi',
|
||||||
|
attendingDoctor: 'Dokter wajib diisi',
|
||||||
|
initialDiagnosis: 'Diagnosa Awal wajib diisi',
|
||||||
|
cob: 'COB wajib diisi',
|
||||||
|
cataract: 'Katarak wajib diisi',
|
||||||
|
procedureType: 'Jenis Prosedur wajib diisi',
|
||||||
|
supportCode: 'Kode Penunjang wajib diisi',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
const IntegrationBpjsSchema = z.object({
|
const IntegrationBpjsSchema = z.object({
|
||||||
tanggalSep: z.string().min(1, 'Tanggal SEP wajib diisi'),
|
sepDate: z.string({ required_error: ERROR_MESSAGES.required.sepDate }).min(1, ERROR_MESSAGES.required.sepDate),
|
||||||
jalur: z.string().min(1, 'Pilih jalur'),
|
admissionType: z
|
||||||
noBpjs: z.string({ required_error: 'No. Kartu BPJS wajib diisi' }).min(1, 'No. Kartu BPJS wajib diisi'),
|
.string({ required_error: ERROR_MESSAGES.required.admissionType })
|
||||||
noKtp: z.string().min(1, 'No. KTP wajib diisi'),
|
.min(1, ERROR_MESSAGES.required.admissionType),
|
||||||
noRm: z.string().min(1, 'No. RM wajib diisi'),
|
bpjsNumber: z
|
||||||
namaPasien: z.string().min(1, 'Nama pasien wajib diisi'),
|
.string({ required_error: ERROR_MESSAGES.required.bpjsNumber })
|
||||||
noTelp: z.string().min(1, 'Nomor telepon wajib diisi'),
|
.min(1, ERROR_MESSAGES.required.bpjsNumber),
|
||||||
noSuratKontrol: z.string().min(1, 'No. Surat Kontrol wajib diisi'),
|
nationalId: z
|
||||||
tglSuratKontrol: z.string().min(1, 'Tanggal Surat Kontrol wajib diisi'),
|
.string({ required_error: ERROR_MESSAGES.required.nationalId })
|
||||||
klinikTujuan: z.string().min(1, 'Klinik tujuan wajib diisi'),
|
.min(1, ERROR_MESSAGES.required.nationalId),
|
||||||
dpjp: z.string().min(1, 'DPJP wajib diisi'),
|
medicalRecordNumber: z
|
||||||
diagnosaAwal: z.string().min(1, 'Diagnosa awal wajib diisi'),
|
.string({ required_error: ERROR_MESSAGES.required.medicalRecordNumber })
|
||||||
cob: z.string().min(1, 'COB wajib diisi'),
|
.min(1, ERROR_MESSAGES.required.medicalRecordNumber),
|
||||||
katarak: z.string().min(1, 'Katarak wajib diisi'),
|
patientName: z
|
||||||
jenisProsedur: z.string().min(1, 'Jenis prosedur wajib diisi'),
|
.string({ required_error: ERROR_MESSAGES.required.patientName })
|
||||||
kodePenunjang: z.string().min(1, 'Kode penunjang wajib diisi'),
|
.min(1, ERROR_MESSAGES.required.patientName),
|
||||||
|
phoneNumber: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.phoneNumber })
|
||||||
|
.min(1, ERROR_MESSAGES.required.phoneNumber),
|
||||||
|
referralLetterNumber: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.referralLetterNumber })
|
||||||
|
.min(1, ERROR_MESSAGES.required.referralLetterNumber),
|
||||||
|
referralLetterDate: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.referralLetterDate })
|
||||||
|
.min(1, ERROR_MESSAGES.required.referralLetterDate),
|
||||||
|
destinationClinic: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.destinationClinic })
|
||||||
|
.min(1, ERROR_MESSAGES.required.destinationClinic),
|
||||||
|
attendingDoctor: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.attendingDoctor })
|
||||||
|
.min(1, ERROR_MESSAGES.required.attendingDoctor),
|
||||||
|
initialDiagnosis: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.initialDiagnosis })
|
||||||
|
.min(1, ERROR_MESSAGES.required.initialDiagnosis),
|
||||||
|
cob: z.string({ required_error: ERROR_MESSAGES.required.cob }).min(1, ERROR_MESSAGES.required.cob),
|
||||||
|
cataract: z.string({ required_error: ERROR_MESSAGES.required.cataract }).min(1, ERROR_MESSAGES.required.cataract),
|
||||||
|
procedureType: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.procedureType })
|
||||||
|
.min(1, ERROR_MESSAGES.required.procedureType),
|
||||||
|
supportCode: z
|
||||||
|
.string({ required_error: ERROR_MESSAGES.required.supportCode })
|
||||||
|
.min(1, ERROR_MESSAGES.required.supportCode),
|
||||||
})
|
})
|
||||||
|
|
||||||
type IntegrationBpjsFormData = z.infer<typeof IntegrationBpjsSchema>
|
type IntegrationBpjsFormData = z.infer<typeof IntegrationBpjsSchema>
|
||||||
|
|||||||
Reference in New Issue
Block a user