diff --git a/app/components/app/patient/entry-form.vue b/app/components/app/patient/entry-form.vue index 341bdcd5..4f577091 100644 --- a/app/components/app/patient/entry-form.vue +++ b/app/components/app/patient/entry-form.vue @@ -34,7 +34,7 @@ interface PatientFormInput { drivingLicenseNumber?: string passportNumber?: string fullName?: string - isNewBorn?: 'YA' | 'TIDAK' + isNewBorn?: string gender?: string birthPlace?: string birthDate?: string @@ -45,8 +45,8 @@ interface PatientFormInput { ethnicity?: string language?: string religion?: string - communicationBarrier?: 'YA' | 'TIDAK' - disability?: 'YA' | 'TIDAK' + communicationBarrier?: string + disability?: string disabilityType?: string note?: string residentIdentityFile?: File @@ -61,7 +61,7 @@ interface Props { const props = defineProps() const formSchema = toTypedSchema(PatientSchema) -const { values, resetForm, setValues, validate } = useForm({ +const { values, resetForm, setValues, setFieldValue, validate } = useForm({ name: 'patientForm', validationSchema: formSchema, initialValues: (props.initialValues ?? {}) as any, @@ -135,6 +135,7 @@ defineExpose({ :is-disabled="isReadonly" /> @@ -47,7 +47,7 @@ const genderOptions = [ :id="fieldName" :errors="errors" class="pt-0.5" - > + > @@ -60,7 +60,7 @@ const dissabilityOptions = [ :class="cn('flex flex-row flex-wrap gap-4 sm:gap-6', radioGroupClass)" >
@@ -70,7 +70,7 @@ const dissabilityOptions = [ :value="option.value" :class=" cn( - 'peer border-1 relative h-4 w-4 rounded-full border-muted-foreground before:absolute before:inset-1 before:rounded-full before:bg-primary before:opacity-0 before:transition-opacity data-[state=checked]:border-primary data-[state=checked]:bg-white data-[state=checked]:before:opacity-100 sm:h-5 sm:w-5', + 'border-1 peer relative h-4 w-4 rounded-full border-muted-foreground before:absolute before:inset-1 before:rounded-full before:bg-primary before:opacity-0 before:transition-opacity data-[state=checked]:border-primary data-[state=checked]:bg-white data-[state=checked]:before:opacity-100 sm:h-5 sm:w-5', containerClass, ) " @@ -80,9 +80,7 @@ const dissabilityOptions = [ :class=" cn( 'select-none text-xs !font-normal leading-none transition-colors', - isDisabled - ? 'cursor-not-allowed opacity-70' - : 'cursor-pointer hover:text-primary', + isDisabled ? 'cursor-not-allowed opacity-70' : 'cursor-pointer hover:text-primary', labelClass, ) " diff --git a/app/components/app/patient/fields/radio-newborn.vue b/app/components/app/patient/fields/radio-newborn.vue index 4b66f8db..55fdb11e 100644 --- a/app/components/app/patient/fields/radio-newborn.vue +++ b/app/components/app/patient/fields/radio-newborn.vue @@ -29,8 +29,8 @@ const { } = props const newbornOptions = [ - { label: 'Ya', value: 'YA' }, - { label: 'Tidak', value: 'TIDAK' }, + { label: 'Ya', value: 'yes' }, + { label: 'Tidak', value: 'no' }, ] @@ -81,9 +81,7 @@ const newbornOptions = [ :class=" cn( 'select-none text-xs !font-normal leading-none transition-colors', - isDisabled - ? 'cursor-not-allowed opacity-70' - : 'cursor-pointer hover:text-primary', + isDisabled ? 'cursor-not-allowed opacity-70' : 'cursor-pointer hover:text-primary', labelClass, ) " diff --git a/app/components/app/patient/fields/select-job.vue b/app/components/app/patient/fields/select-job.vue index f9751a5e..18b0e857 100644 --- a/app/components/app/patient/fields/select-job.vue +++ b/app/components/app/patient/fields/select-job.vue @@ -30,7 +30,10 @@ const { } = props // Generate job options from constants, sama seperti pola genderCodes -const jobOptions = mapToComboboxOptList(occupationCodes) +const jobOptions = mapToComboboxOptList(occupationCodes).map(({ label, value }) => ({ + label, + value, +}))