feat(sep): fix get patient data
This commit is contained in:
No files matched your search
@@ -32,7 +32,6 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
||||||
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
||||||
const patient = props.patient || ({} as PatientEntity)
|
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{ value: 'item-1', label: 'Item 1' },
|
{ value: 'item-1', label: 'Item 1' },
|
||||||
@@ -63,21 +62,21 @@ const [cataract, cataractAttrs] = defineField('cataract')
|
|||||||
const [procedureType, procedureTypeAttrs] = defineField('procedureType')
|
const [procedureType, procedureTypeAttrs] = defineField('procedureType')
|
||||||
const [supportCode, supportCodeAttrs] = defineField('supportCode')
|
const [supportCode, supportCodeAttrs] = defineField('supportCode')
|
||||||
|
|
||||||
if (Object.keys(patient).length > 0) {
|
|
||||||
bpjsNumber.value = '-'
|
|
||||||
nationalId.value = patient?.person?.residentIdentityNumber || '-'
|
|
||||||
medicalRecordNumber.value = patient?.number || '-'
|
|
||||||
patientName.value = patient?.person?.name || '-'
|
|
||||||
phoneNumber.value = '-'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Submit handler
|
// Submit handler
|
||||||
const onSubmit = handleSubmit((values) => {
|
const onSubmit = handleSubmit((values) => {
|
||||||
console.log('✅ Validated form values:', values)
|
console.log('✅ Validated form values:', values)
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(patient, () => {
|
watch(props, (value) => {
|
||||||
console.log('patient changed:', patient)
|
console.log('patient changed:', value)
|
||||||
|
const patient = value.patient || ({} as PatientEntity)
|
||||||
|
if (Object.keys(patient).length > 0) {
|
||||||
|
bpjsNumber.value = '-'
|
||||||
|
nationalId.value = patient?.person?.residentIdentityNumber || '-'
|
||||||
|
medicalRecordNumber.value = patient?.number || '-'
|
||||||
|
patientName.value = patient?.person?.name || '-'
|
||||||
|
phoneNumber.value = '-'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -88,8 +88,6 @@ async function getPatientsList(params: any = { 'page-size': 10 }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getPatientCurrent(id: string) {
|
async function getPatientCurrent(id: string) {
|
||||||
isPatientsLoading.value = true
|
|
||||||
selectedPatientObject.value = null
|
|
||||||
try {
|
try {
|
||||||
const result = await getPatientDetail(Number(id))
|
const result = await getPatientDetail(Number(id))
|
||||||
if (result && result.success && result.body && result.body.data) {
|
if (result && result.success && result.body && result.body.data) {
|
||||||
@@ -99,7 +97,6 @@ async function getPatientCurrent(id: string) {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to fetch patient:', err)
|
console.error('Failed to fetch patient:', err)
|
||||||
}
|
}
|
||||||
isPatientsLoading.value = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getMonitoringHistoryMappers() {
|
async function getMonitoringHistoryMappers() {
|
||||||
@@ -143,7 +140,10 @@ const letters = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
function handleSavePatient() {
|
function handleSavePatient() {
|
||||||
getPatientCurrent(selectedPatient.value)
|
selectedPatientObject.value = null
|
||||||
|
setTimeout(() => {
|
||||||
|
getPatientCurrent(selectedPatient.value)
|
||||||
|
}, 150)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSaveLetter() {
|
function handleSaveLetter() {
|
||||||
|
|||||||
Reference in New Issue
Block a user