diff --git a/app/components/app/outpatient/encounter/_common/select-date.vue b/app/components/app/outpatient/encounter/_common/select-date.vue index 5ab4ffc1..057d0a63 100644 --- a/app/components/app/outpatient/encounter/_common/select-date.vue +++ b/app/components/app/outpatient/encounter/_common/select-date.vue @@ -98,7 +98,6 @@ function calculateAge(birthDate: string | Date | undefined): string { id="birthDate" type="date" min="1900-01-01" - :max="new Date().toISOString().split('T')[0]" v-bind="componentField" :placeholder="placeholder" @update:model-value=" diff --git a/app/components/app/outpatient/encounter/_common/select-dpjp.vue b/app/components/app/outpatient/encounter/_common/select-dpjp.vue index 0852195b..393fe988 100644 --- a/app/components/app/outpatient/encounter/_common/select-dpjp.vue +++ b/app/components/app/outpatient/encounter/_common/select-dpjp.vue @@ -3,8 +3,10 @@ import type { FormErrors } from '~/types/error' import Combobox from '~/components/pub/my-ui/combobox/combobox.vue' import { cn, mapToComboboxOptList } from '~/lib/utils' import { occupationCodes } from '~/lib/constants' +import { getValueLabelList as getDoctorLabelList } from '~/services/doctor.service' import * as DE from '~/components/pub/my-ui/doc-entry' +import type { Item } from '~/components/pub/my-ui/combobox' const props = defineProps<{ fieldName?: string @@ -28,8 +30,28 @@ const { labelClass, } = props -// Generate job options from constants, sama seperti pola genderCodes -const jobOptions = mapToComboboxOptList(occupationCodes) +const doctors = ref>([]) + +async function fetchDpjp() { + doctors.value = await getDoctorLabelList({ + serviceType: 1, + serviceDate: new Date().toISOString().substring(0, 10), + specialistCode: 0, + includes: 'employee-person', + }) +} + +const selectedDpjpId = inject>("selectedDpjpId")! +function handleDpjpChange(selected: string) { + console.log(`change dphp`) + selectedDpjpId.value = selected ?? null + const dpjp = doctors.value.find(s => s.value === selectedDpjpId.value) + console.log(dpjp) +} + +onMounted(() => { + fetchDpjp() +})