diff --git a/app/components/app/encounter/entry-form.vue b/app/components/app/encounter/entry-form.vue index 12fe5138..68edf83a 100644 --- a/app/components/app/encounter/entry-form.vue +++ b/app/components/app/encounter/entry-form.vue @@ -11,6 +11,7 @@ import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-singl import { educationCodes, genderCodes, occupationCodes, religionCodes, relationshipCodes } from '~/lib/constants' import { mapToComboboxOptList } from '~/lib/utils' +import { computed } from 'vue' interface DivisionFormData { name: string @@ -34,6 +35,7 @@ const props = defineProps<{ schema: any initialValues?: Partial errors?: FormErrors + selectedPatientObject?: any }>() const emit = defineEmits<{ @@ -49,6 +51,19 @@ const genderOpts = mapToComboboxOptList(genderCodes) const formSchema = toTypedSchema(props.schema) +// Computed properties for patient data +const patientName = computed(() => { + return props.selectedPatientObject?.person?.name || '' +}) + +const patientNik = computed(() => { + return props.selectedPatientObject?.person?.residentIdentityNumber || '' +}) + +const patientRm = computed(() => { + return props.selectedPatientObject?.number || '' +}) + // Form submission handler function onSubmitForm(values: any, { resetForm }: { resetForm: () => void }) { const formData: DivisionFormData = { @@ -147,6 +162,7 @@ function onAddSep(formContext: any) { @@ -164,7 +180,13 @@ function onAddSep(formContext: any) { - + @@ -177,7 +199,13 @@ function onAddSep(formContext: any) { - + diff --git a/app/components/content/encounter/entry.vue b/app/components/content/encounter/entry.vue index 2f57dd40..796ea58b 100644 --- a/app/components/content/encounter/entry.vue +++ b/app/components/content/encounter/entry.vue @@ -1,14 +1,27 @@