Merge pull request #186 from dikstub-rssa/feat/laporan-operasi-182

Feat/laporan operasi
This commit is contained in:
Munawwirul Jamal
2025-12-01 20:48:12 +07:00
committed by GitHub
102 changed files with 7416 additions and 26 deletions
@@ -0,0 +1,28 @@
<script setup lang="ts">
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
import { config } from './history-list.cfg'
interface Props {
data: any[]
paginationMeta: PaginationMeta
}
const props = defineProps<Props>()
const isModalOpen = inject(`isHistoryDialogOpen`) as Ref<boolean>
function handlePageChange(page: number) {
emit('pageChange', page)
}
</script>
<template>
<Dialog v-model:open="isModalOpen" title="Riwayat Surat Kontrol" size="full">
<PubMyUiDataTable
v-bind="config"
:rows="data"
:skeleton-size="props.paginationMeta?.pageSize"
/>
<PaginationView :pagination-meta="props.paginationMeta" @page-change="handlePageChange" />
</Dialog>
</template>
@@ -0,0 +1,85 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import type { Patient } from '~/models/patient'
import { defineAsyncComponent } from 'vue'
import { educationCodes, genderCodes } from '~/lib/constants'
import { calculateAge } from '~/lib/utils'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/print-btn.vue'))
export const config: Config = {
cols: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {width: 130}, {width: 30},],
headers: [
[
{ label: 'NAMA PASIEN' },
{ label: 'NO.SURAT KONTROL' },
{ label: 'NO.SEP' },
{ label: 'TANGGAL RENCANA KONTROL' },
{ label: 'TANGGAL TERBIT' },
{ label: 'DPJP' },
{ label: 'SPESIALIS' },
{ label: 'SUBSPESIALIS' },
{ label: 'TIPE RAWAT' },
{ label: 'DIBUAT OLEH' },
{ label: 'DIEDIT OLEH' },
{ label: 'STATUS' },
{ label: 'AKSI' },
],
],
keys: [
'date',
'name',
'name',
'name',
'name',
'name',
'name',
'name',
'name',
'name',
'name',
'status',
'action',
],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
],
parses: {
date: (rec: unknown): unknown => {
const date = (rec as any).date
if (typeof date == 'object' && date) {
return (date as Date).toLocaleDateString('id-ID')
} else if (typeof date == 'string') {
return (date as string).substring(0, 10)
}
return date
},
specialist_subspecialist: (rec: unknown): unknown => {
return '-'
},
dpjp: (rec: unknown): unknown => {
// const { person } = rec as Patient
return '-'
},
},
components: {
action(rec, idx) {
return {
idx,
rec: rec as object,
component: action,
}
},
},
htmls: {
sep_status(_rec) {
return 'SEP Internal'
},
},
}
+6 -3
View File
@@ -4,6 +4,7 @@ import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vu
// Types
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import type { Config, } from '~/components/pub/my-ui/data-table'
// Configs
import { config } from './list-cfg'
@@ -11,9 +12,11 @@ import { config } from './list-cfg'
interface Props {
data: any[]
paginationMeta: PaginationMeta
tableConfig?: Config
}
defineProps<Props>()
const props = withDefaults(defineProps<Props>(), {
tableConfig: () => config,
})
const emit = defineEmits<{
pageChange: [page: number]
@@ -27,7 +30,7 @@ function handlePageChange(page: number) {
<template>
<div class="space-y-4">
<PubMyUiDataTable
v-bind="config"
v-bind="props.tableConfig"
:rows="data"
:skeleton-size="paginationMeta?.pageSize"
/>
+6 -3
View File
@@ -7,13 +7,16 @@ import type { PaginationMeta } from '~/components/pub/my-ui/pagination/paginatio
// Configs
import { config } from './list-cfg'
import type { Config } from '~/components/pub/my-ui/data-table'
interface Props {
data: any[]
paginationMeta: PaginationMeta
tableConfig?: Config
}
defineProps<Props>()
const props = withDefaults(defineProps<Props>(), {
tableConfig: () => config,
})
const emit = defineEmits<{
pageChange: [page: number]
@@ -27,7 +30,7 @@ function handlePageChange(page: number) {
<template>
<div class="space-y-4">
<PubMyUiDataTable
v-bind="config"
v-bind="props.tableConfig"
:rows="data"
:skeleton-size="paginationMeta?.pageSize"
/>
@@ -0,0 +1,21 @@
<script setup lang="ts">
import { ActionEvents, type ListItemDto } from '~/components/pub/my-ui/data/types';
import Button from '~/components/pub/ui/button/Button.vue';
const props = defineProps<{
}>()
const isModalOpen = inject<Ref<boolean>>('isHistoryDialogOpen')!
function openDialog() {
isModalOpen.value = true
}
</script>
<template>
<Button type="button" variant="outline" class="text-orange-500 border border-orange-400 bg-orange-50"
@click="openDialog">
<Icon name="i-lucide-history" class="h-4 w-4 align-middle transition-colors" />
History
</Button>
</template>
@@ -0,0 +1,73 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import FieldGroup from '~/components/pub/my-ui/form/field-group.vue'
import Field from '~/components/pub/my-ui/form/field.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
import Select from '~/components/pub/my-ui/form/select.vue'
import { Form } from '~/components/pub/ui/form'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import { cn } from '~/lib/utils'
interface InstallationFormData {
name: string
code: string
encounterClassCode: string
}
const props = defineProps<{
schema: any
initialValues?: Partial<InstallationFormData>
}>()
const emit = defineEmits<{
submit: [values: InstallationFormData, resetForm: () => void]
reset: [resetForm: () => void]
}>()
// Form submission handler
function onSubmitForm(values: any, { resetForm }: { resetForm: () => void }) {
emit('submit', values, resetForm)
}
// Form cancel handler
function onResetForm({ resetForm }: { resetForm: () => void }) {
emit('reset', resetForm)
}
</script>
<template>
<Form
v-slot="{ handleSubmit, resetForm }"
as=""
keep-values
:initial-values="initialValues"
>
<form id="entry-form" @submit="handleSubmit($event, (values) => onSubmitForm(values, { resetForm }))">
<div class="mb-5 border-b border-b-slate-300 pb-7 text-lg xl:text-xl">
<div class="flex flex-col justify-between">
<InputBase
field-name="patientName"
label="Nama Pasien"
placeholder="Nama Pasien"
/>
<InputBase
field-name="cardNumber"
label="Nomor Kartu"
placeholder="Nomor Kartu"
/>
<InputBase
field-name="sepNumber"
label="Nomor SEP"
placeholder="Nomor SEP"
/>
</div>
</div>
<div class="my-2 flex items-center gap-3 justify-end">
<Button @click="onResetForm" variant="secondary">Reset</Button>
<Button @click="onSubmitForm">Terapkan</Button>
</div>
</form>
</Form>
</template>
@@ -0,0 +1,52 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import FieldGroup from '~/components/pub/my-ui/form/field-group.vue'
import Field from '~/components/pub/my-ui/form/field.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
import Select from '~/components/pub/my-ui/form/select.vue'
import { Form } from '~/components/pub/ui/form'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import SelectOriginPolyclinic from '~/components/app/bpjs/control-letter/_common/select-origin-polyclinic.vue'
import SelectDestinationPolyclinic from '~/components/app/bpjs/control-letter/_common/select-destination-polyclinic.vue'
import { cn } from '~/lib/utils'
const props = defineProps()
const items = reactive([
{ id: 1, updatedBy: 'Kakek Sugiono', createdAt: new Date(Date.now() - 86400000 * 2) },
{ id: 2, updatedBy: 'Kakek Sugiono', createdAt: new Date(Date.now() - 86400000) },
{ id: 3, updatedBy: 'Kakek Sugiono', createdAt: new Date() },
])
const itemsCount = computed(() => items.length || 0)
</script>
<template>
<ul :class="cn('pb-5 flex flex-col min-h-[30rem]', '')">
<li v-for="(item, index) in items" :key="item.id" class="flex gap-3 items-start">
<div class="flex flex-col items-center">
<div class="h-5 w-5 rounded-full border-2 border-gray-300 flex items-center justify-center">
<div :class="cn('dark:bg-white border-gray-300 rounded-full p-1.5',
index === 0 ? 'bg-green-500' : 'bg-transparent'
)">
</div>
</div>
<hr v-if="index !== itemsCount - 1" class="h-14 w-0.5 bg-gray-300 dark:bg-gray-300" aria-hidden="true">
</div>
<div class="flex justify-between items-center min-w-96">
<div class="max-w-80">
<time :class="cn('mt-0 text-base font-medium text-gray-800 dark:text-gray-100', '')">
{{ item?.createdAt.toLocaleDateString('id-ID') }}
</time>
<h1 :class="cn('text-gray-500 dark:text-gray-400', '')">Ditambahkan Oleh : {{ item.updatedBy }}</h1>
<NuxtLink class="mt-1 text-orange-500" :to="`surgery-report/${item.id}`">
Lihat Detail
</NuxtLink>
</div>
</div>
</li>
</ul>
</template>
@@ -0,0 +1,94 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { Label as RadioLabel } from '~/components/pub/ui/label'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
errors?: FormErrors
class?: string
radioGroupClass?: string
radioItemClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'isNewBorn',
label = 'Status Pasien',
errors,
class: containerClass,
radioGroupClass,
radioItemClass,
labelClass,
} = props
const newbornOptions = [
{ label: 'PRC', value: 'prc' },
{ label: 'FFP', value: 'ffp' },
{ label: 'WB', value: 'wb' },
{ label: 'TC', value: 'tc' },
]
</script>
<template>
<DE.Cell :class="cn('radio-group-field', containerClass)" :col-span="2">
<DE.Label
:label-for="fieldName"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<RadioGroup
v-bind="componentField"
:class="cn('flex flex-row flex-wrap gap-4 sm:gap-6', radioGroupClass)"
>
<div
v-for="(option, index) in newbornOptions"
:key="option.value"
:class="cn('flex min-w-fit items-center space-x-2 pt-1', radioItemClass)"
>
<RadioGroupItem
:id="`${fieldName}-${index}`"
:value="option.value"
:class="
cn(
'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,
)
"
/>
<RadioLabel
:for="`${fieldName}-${index}`"
:class="
cn(
'cursor-pointer select-none text-xs font-normal leading-none transition-colors hover:text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70 sm:text-sm',
labelClass,
)
"
>
{{ option.label }}
</RadioLabel>
</div>
</RadioGroup>
</FormControl>
<FormMessage class="ml-0 mt-1" />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, BillingCodeTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => BillingCodeTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, BirthDescriptionTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => BirthDescriptionTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, BirthPlaceDescriptionTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => BirthPlaceDescriptionTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,117 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { differenceInDays, differenceInMonths, differenceInYears, parseISO } from 'date-fns'
import { Input } from '~/components/pub/ui/input'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
isWithTime?: boolean
}>()
const {
fieldName = 'birthDate',
label = 'Tanggal Lahir',
placeholder = 'Pilih tanggal lahir',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
// Reactive variables for age calculation
const patientAge = ref<string>('Masukkan tanggal lahir')
// Function to calculate age with years, months, and days
function calculateAge(birthDate: string | Date | undefined): string {
if (!birthDate) {
return 'Masukkan tanggal lahir'
}
try {
let dateObj: Date
if (typeof birthDate === 'string') {
dateObj = parseISO(birthDate)
} else {
dateObj = birthDate
}
const today = new Date()
// Calculate years, months, and days
const totalYears = differenceInYears(today, dateObj)
// Calculate remaining months after years
const yearsPassed = new Date(dateObj)
yearsPassed.setFullYear(yearsPassed.getFullYear() + totalYears)
const remainingMonths = differenceInMonths(today, yearsPassed)
// Calculate remaining days after years and months
const monthsPassed = new Date(yearsPassed)
monthsPassed.setMonth(monthsPassed.getMonth() + remainingMonths)
const remainingDays = differenceInDays(today, monthsPassed)
// Format the result
const parts = []
if (totalYears > 0) parts.push(`${totalYears} Tahun`)
if (remainingMonths > 0) parts.push(`${remainingMonths} Bulan`)
if (remainingDays > 0) parts.push(`${remainingDays} Hari`)
return parts.length > 0 ? parts.join(' ') : '0 Hari'
} catch {
return 'Masukkan tanggal lahir'
}
}
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Input
id="birthDate"
:type="props.isWithTime ? 'datetime-local' : 'date'"
min="1900-01-01"
v-bind="componentField"
:placeholder="placeholder"
@update:model-value="
(value: string | number) => {
const dateStr = typeof value === 'number' ? String(value) : value
patientAge = calculateAge(dateStr)
}
"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, DissectionTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => DissectionTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,87 @@
<script setup lang="ts">
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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const doctors = ref<Array<Item>>([])
async function fetchDpjp() {
doctors.value = await getDoctorLabelList({
serviceType: 1,
serviceDate: new Date().toISOString().substring(0, 10),
includes: 'employee-person',
}, true)
}
onMounted(() => {
fetchDpjp()
})
// function handleDpjpChange(selected: string) {
// selectedDpjpId.value = selected ?? null
// }
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="doctors"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,87 @@
<script setup lang="ts">
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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const doctors = ref<Array<Item>>([])
async function fetchDpjp() {
doctors.value = await getDoctorLabelList({
serviceType: 1,
serviceDate: new Date().toISOString().substring(0, 10),
includes: 'employee-person',
}, true)
}
onMounted(() => {
fetchDpjp()
})
// function handleDpjpChange(selected: string) {
// selectedDpjpId.value = selected ?? null
// }
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="doctors"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, SpecimenTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => SpecimenTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, SurgeryOrderTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => SurgeryOrderTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, SurgerySystemTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => SurgerySystemTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
import { occupationCodes, SurgeryTypeOptList } 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
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const itemList = computed<Array<Item>>(() => SurgeryTypeOptList)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="itemList"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,144 @@
<script setup lang="ts">
import DetailRow from '~/components/pub/my-ui/form/view/detail-row.vue'
import { type Variants, Badge } from '~/components/pub/ui/badge'
import { cn, } from '~/lib/utils'
import type { ControlLetter } from '~/models/control-letter'
import * as DE from '~/components/pub/my-ui/doc-entry'
// #region Props & Emits
const props = defineProps<{
instance: ControlLetter | null
}>()
const emit = defineEmits<{
(e: 'click'): void
}>()
const dummy = [
{
id: 1,
number: 1,
name: 'Operasi',
code: 'OP-001'
}
]
// #endregion
// #region State & Computed
// #endregion
// Computed addresses from nested data
// #endregion
// #region Lifecycle Hooks
// #endregion
// #region Functions
// #endregion region
// #region Utilities & event handlers
function onClick() {
emit('click')
}
// #endregion
// #region Watchers
// #endregion
</script>
<template>
<article :class="cn('space-y-10',)">
<div :class="cn('space-y-2',)">
<h1>Dibuat oleh {{ `Dr. Agus` }} pada {{ `11 Agustus 2025, 20.00` }}</h1>
<DetailRow label="Tanggal Laporan">{{ props.instance?.date ? new
Date(props.instance?.date).toLocaleDateString('id-ID') : '-' }}</DetailRow>
</div>
<div :class="cn('space-y-2',)">
<h1 class="font-semibold text-lg">Tim Pelaksanaan Operasi</h1>
<DetailRow label="DPJP Bedah">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Operator">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Asisten Operator">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Instrumentir">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="DPJP Anastesi">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Perawat Anastesi">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Tanggal Pembedahan">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Diagnosa Pra Bedah">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Perawat Pasca Bedah">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
</div>
<div :class="cn('space-y-2',)">
<h1 class="font-semibold text-lg">Tindakan Operatif / Non Operatif Lain</h1>
<div class="border border-gray-200 rounded-lg overflow-hidden">
<Table>
<TableHeader class="bg-gray-100">
<TableRow>
<TableHead class="w-14">No</TableHead>
<TableHead class="">Prosedur</TableHead>
<TableHead class="">Code</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="(field, idx) in dummy" :key="idx">
<TableCell class="">{{ idx + 1 }}</TableCell>
<TableCell class="">{{ field.name }}</TableCell>
<TableCell class="">{{ field.code }}</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</div>
<div :class="cn('space-y-2',)">
<h1 class="font-semibold text-lg">Data Pelaksanaan Operasi</h1>
<DE.Block :col-count="2" :cell-flex="false">
<div>
<DetailRow label="Jenis Operasi">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Kode Biling">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Sitem Operasi">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Operasi Mulai">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Operasi Selesai">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Lama Operasi"><b>{{ 1 }}</b> Jam <b>{{ 1 }}</b> Menit</DetailRow>
<DetailRow label="Pembiusan Mulai">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Pembiusan Selesai">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Lama Pembiusan"><b>{{ 1 }}</b> Jam <b>{{ 1 }}</b> Menit</DetailRow>
</div>
<div>
<DetailRow label="Jenis Pembedahan">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Operasi ke">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Keterangan Lahir">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Ket Tempat Lahir">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Berat Badan">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Ket Saat Lahir">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Uraian Operasi">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Jumlah Pendarahan">{{ props.instance?.date ? props.instance?.date : '-' }} CC</DetailRow>
</div>
<div>
<DetailRow label="PRC">{{ props.instance?.date ? props.instance?.date : '-' }} CC</DetailRow>
<DetailRow label="FPP">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="WB">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="TC">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Merk">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Nama Implant">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Stiker/Nomor Register Implant">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Nama Pendamping Implant">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
</div>
<div>
<DetailRow label-class="w-96" label="Specimen/Jaringan dikirim ke">{{ props.instance?.date ? props.instance?.date : '-' }}</DetailRow>
<DetailRow label="Keterangan Jaringan">
<Badge :variant="`outline`">
{{ `Example` }}
</Badge>
</DetailRow>
</div>
</DE.Block>
</div>
<div class="border-t-1 my-2 flex justify-end border-t-slate-300 py-2">
<PubMyUiNavFooterBa @click="onClick" />
</div>
</article>
</template>
<style scoped></style>
+259
View File
@@ -0,0 +1,259 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import SelectDate from './_common/select-date.vue'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import { FieldArray } from 'vee-validate'
import * as DE from '~/components/pub/my-ui/doc-entry'
import SelectDpjpBedah from './_common/select-dpjp-bedah.vue'
import SelectDpjpAnastesi from './_common/select-dpjp-anastesi.vue'
import SelectSurgeryType from './_common/select-surgery-type.vue'
import SelectBillingCode from './_common/select-billing-code.vue'
import SelectSurgerySystemType from './_common/select-surgery-system-type.vue'
import SelectDissectionType from './_common/select-dissection-type.vue'
import SelectSurgeryOrder from './_common/select-surgery-order.vue'
import SelectBirthDesc from './_common/select-birth-desc.vue'
import SelectBirthPlaceDesc from './_common/select-birth-place-desc.vue'
import SelectSpecimenType from './_common/select-specimen-type.vue'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import RadioBloodType from './_common/radio-blood-type.vue'
import OperativeActionPicker from './operative-action/picker-dialog.vue'
const props = defineProps<{
schema: any
initialValues?: any
errors?: FormErrors
operativeActionList?: any[]
}>()
const formSchema = toTypedSchema(props.schema)
const formRef = ref()
defineExpose({
validate: () => formRef.value?.validate(),
resetForm: () => formRef.value?.resetForm(),
setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate),
values: computed(() => formRef.value?.values),
})
</script>
<template>
<Form
ref="formRef"
v-slot="{ values }"
as=""
keep-values
:validation-schema="formSchema"
:validate-on-mount="false"
validation-mode="onSubmit"
:initial-values="initialValues ? initialValues : {}"
>
<DE.Block :col-count="4" :cell-flex="false">
<SelectDpjpBedah :errors="errors"
field-name="a1"
label="DPJP Bedah" placeholder="Pilih DPJP Bedah"
is-required
/>
<InputBase :errors="errors"
field-name="a2"
label="Operator" placeholder="Isi Operator"
/>
<InputBase :errors="errors"
field-name="a3"
label="Asisten Operator" placeholder="Isi Asisten Operator"
/>
<InputBase :errors="errors"
field-name="a4"
label="Instrumentir" placeholder="Isi Instrumentir"
/>
<SelectDpjpAnastesi :errors="errors"
field-name="a5"
label="DPJP Anastesi" placeholder="Pilih DPJP Anastesi"
is-required
/>
<InputBase :errors="errors"
field-name="a6"
label="Perawatan Anastesi" placeholder="Isi Perawatan Anastesi"
/>
<SelectDate
field-name="a7"
label="Tanggal Pembedahan"
:errors="errors"
is-required
/>
</DE.Block>
<DE.Block :col-count="4" :cell-flex="false">
<DE.Cell :col-span="2">
<TextAreaInput :errors="errors"
field-name="a8"
label="Diagnosa Pra Bedah" placeholder="Isi Diagnosa Pra Bedah"
is-required
/>
</DE.Cell>
<InputBase :errors="errors"
field-name="a9"
label="Perawat Pasca Bedah" placeholder="Isi Perawat Pasca Bedah"
/>
</DE.Block>
<!-- PICKER -->
<DE.Block :col-count="1" :cell-flex="false" class="w-1/2">
<OperativeActionPicker field-name="a63" title="Prosedur" />
</DE.Block>
<!-- -->
<DE.Block :col-count="3" :cell-flex="false">
<SelectSurgeryType :errors="errors"
field-name="a10"
label="Jenis Operasi" placeholder="Pilih Jenis Operasi"
is-required
/>
<SelectBillingCode :errors="errors"
field-name="a11"
label="Kode Billing" placeholder="Pilih Kode Billing"
is-required
/>
<SelectSurgerySystemType :errors="errors"
field-name="a12"
label="Sistem Operasi" placeholder="Pilih Sistem Operasi"
is-required
/>
<SelectDate :errors="errors"
field-name="a7"
label="Operasi Mulai"
is-required
is-with-time
/>
<SelectDate :errors="errors"
field-name="a7"
label="Operasi Selesai"
is-required
is-with-time
/>
<div>
<p class="mt-1.5 mb-2">Lama Operasi</p>
<h1 class="text-base"><b>{{ 1 }}</b> Jam <b>{{ 1 }}</b> Menit</h1>
</div>
<SelectDate :errors="errors"
field-name="a44"
label="Pembiusan Mulai"
is-required
is-with-time
/>
<SelectDate :errors="errors"
field-name="a45"
label="Pembiusan Selesai"
is-required
is-with-time
/>
<div>
<p class="mt-1.5 mb-2">Lama Pembiusan</p>
<h1 class="text-base"><b>{{ 1 }}</b> Jam <b>{{ 1 }}</b> Menit</h1>
</div>
<SelectDissectionType :errors="errors"
field-name="a13"
label="Jenis Pembedahan" placeholder="Pilih Jenis Pembedahan"
is-required
/>
<SelectSurgeryOrder :errors="errors"
field-name="a14"
label="Urutan Operasi Ke" placeholder="Pilih Urutan Operasi Ke"
is-required
/>
<SelectBirthDesc :errors="errors"
field-name="a15"
label="Ket. Lahir" placeholder="Pilih Ket. Lahir"
is-required
/>
<SelectBirthPlaceDesc :errors="errors"
field-name="a16"
label="Ket. Tempat Lahir" placeholder="Pilih Ket. Tempat Lahir"
is-required
/>
<InputBase :errors="errors"
field-name="a6"
label="Berat Badan" placeholder="Isi Berat Badan"
right-label="Gram"
numeric-only
/>
<InputBase :errors="errors"
field-name="a6"
label="Ket. Saat Lahir" placeholder="Isi Ket. Saat Lahir"
/>
<TextAreaInput :errors="errors"
field-name="a8"
label="Uraian Operasi" placeholder="Isi Uraian Operasi"
is-required
/>
<InputBase :errors="errors"
field-name="a6"
label="Jumlah Pendarahan" placeholder="Isi Jumlah Pendarahan"
right-label="cc"
numeric-only
/>
</DE.Block>
<DE.Block :col-count="1" :cell-flex="false" class="w-1/2">
<RadioBloodType :errors="errors"
field-name="a16"
label="Jenis Darah Masuk" placeholder="Pilih Jenis Darah Masuk"
/>
<InputBase :errors="errors"
class=""
field-name="a6"
label="Jumlah Darah Masuk" placeholder="Isi Jumlah Darah Masuk"
right-label="cc"
numeric-only
/>
</DE.Block>
<DE.Block :col-count="3" :cell-flex="false">
<InputBase :errors="errors"
field-name="a6"
label="Merk" placeholder="Isi Merk"
/>
<InputBase :errors="errors"
field-name="a6"
label="Nama Implant" placeholder="Isi Nama Implant"
/>
<InputBase :errors="errors"
field-name="a6"
label="Stiker / Nomor Register Implant" placeholder="Isi Stiker / Nomor Register Implant"
/>
<InputBase :errors="errors"
field-name="a6"
label="Nama Penedamping Implant" placeholder="Isi Nama Penedamping Implant"
/>
<SelectSpecimenType :errors="errors"
field-name="a17"
label="Specimen/Jaringan Dikirim Ke" placeholder="Pilih Specimen/Jaringan Dikirim Ke"
is-required
/>
</DE.Block>
<DE.Block :col-count="1" :cell-flex="false" class="w-1/2">
<FieldArray v-slot="{ fields, push, remove }" name="a32">
<div v-for="(field, idx) in fields" :key="idx" class="flex items-end gap-3 mb-3">
<InputBase :errors="errors"
:field-name="`a32[${idx}]`"
label="Keterangan Jaringan" placeholder="Isi Keterangan Jaringan"
/>
<Button v-if="idx !== 0" type="button" variant="destructive" size="sm" @click="remove(idx)">
<Icon name="i-lucide-trash-2" class="h-4 w-4" />
</Button>
</div>
<Button type="button" variant="outline"
class="mt-3 w-full rounded-md border border-primary bg-white px-4 py-2 text-primary hover:border-primary hover:bg-primary hover:text-white sm:w-auto sm:text-sm"
@click="push(``)">
<Icon name="i-lucide-plus" class="mr-2 h-4 w-4 align-middle transition-colors" />
Tambah Keterangan Jaringan
</Button>
</FieldArray>
</DE.Block>
</Form>
</template>
@@ -0,0 +1,57 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import type { Patient } from '~/models/patient'
import { defineAsyncComponent } from 'vue'
import { educationCodes, genderCodes } from '~/lib/constants'
import { calculateAge } from '~/lib/utils'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
export const config: Config = {
cols: [{}, {}, {}, {}, {}, {}, {}, {},],
headers: [
[
{ label: 'Tgl Laporan' },
{ label: 'DPJP Bedah' },
{ label: 'DPJP Anastesi' },
{ label: 'Tgl Pembedahan' },
{ label: 'Jenis Operasi' },
{ label: 'Kode Billing' },
{ label: 'Sistem Operasi' },
{ label: 'Action' },
],
],
keys: ['date', 'doctor.employee.person.name', 'doctor.employee.person.name', 'date', 'name', 'name', 'name', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
],
parses: {
date: (rec: unknown): unknown => {
const date = (rec as any).date
if (typeof date == 'object' && date) {
return (date as Date).toLocaleDateString('id-ID')
} else if (typeof date == 'string') {
return (date as string).substring(0, 10)
}
return date
},
},
components: {
action(rec, idx) {
return {
idx,
rec: rec as object,
component: action,
}
},
},
htmls: {
},
}
@@ -0,0 +1,31 @@
<script setup lang="ts">
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
import { config } from './list.cfg'
interface Props {
data: any[]
paginationMeta: PaginationMeta
}
defineProps<Props>()
const emit = defineEmits<{
pageChange: [page: number]
}>()
function handlePageChange(page: number) {
emit('pageChange', page)
}
</script>
<template>
<div class="space-y-4">
<PubMyUiDataTable
v-bind="config"
:rows="data"
:skeleton-size="paginationMeta?.pageSize"
/>
<PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" />
</div>
</template>
@@ -0,0 +1,30 @@
<script setup lang="ts">
import { ActionEvents, type LinkItem, type ListItemDto } from '~/components/pub/my-ui/data/types';
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('ap_rec_id')!
const recAction = inject<Ref<string>>('ap_rec_action')!
const recItem = inject<Ref<any>>('ap_rec_item')!
const timestamp = inject<Ref<any>>('timestamp')!
const activeKey = ref<string | null>(null)
function process() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showProcess
recItem.value = props.rec
timestamp.value = new Date().getTime()
}
</script>
<template>
<Button @click="process" variant="outline"
class="text-orange-400 border-orange-400 bg-transparent">
Pilih
<Icon name="i-lucide-arrow-right" class="h-4 w-4 align-middle transition-colors" />
</Button>
</template>
@@ -0,0 +1,44 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import type { Patient } from '~/models/patient'
import { defineAsyncComponent } from 'vue'
import { educationCodes, genderCodes } from '~/lib/constants'
import { calculateAge } from '~/lib/utils'
const action = defineAsyncComponent(() => import('./dropdown-action.vue'))
export const config: Config = {
cols: [{}, {}, {width: 30}, ],
headers: [
[
{ label: 'Nama Prosedur' },
{ label: 'Code' },
{ label: 'Action' },
],
],
keys: ['name', 'code', 'action',],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
],
parses: {
},
components: {
action(rec, idx) {
return {
idx,
rec: rec as object,
component: action,
}
},
},
htmls: {
},
}
@@ -0,0 +1,84 @@
<script setup lang="ts">
// Components
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
// Helpers
import { usePaginatedList } from '~/composables/usePaginatedList'
import { toast } from '~/components/pub/ui/toast'
import { config } from './list.cfg'
// Types
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
import { ProcedureSrcSchema, type ProcedureSrcFormData } from '~/schemas/procedure-src.schema'
// Handlers
import {
isReadonly,
isProcessing,
isFormEntryDialogOpen,
isRecordConfirmationOpen,
onResetState,
handleActionSave,
handleActionEdit,
handleActionRemove,
handleCancelForm,
} from '~/handlers/procedure-src.handler'
// Services
import { getList, getDetail } from '~/services/procedure-src.service'
const title = ref('')
interface Props {
data: any[]
paginationMeta: PaginationMeta
processFn: (input: unknown) => void
}
const props = defineProps<Props>()
const recId = ref<string>(``)
const recAction = ref<string>(``)
const recItem = ref<any>({})
const timestamp = ref<any>({})
provide('ap_rec_id', recId)
provide('ap_rec_action', recAction)
provide('ap_rec_item', recItem)
provide('timestamp', timestamp)
const emit = defineEmits<{
pageChange: [page: number]
toggleDialog: []
}>()
function handlePageChange(page: number) {
emit('pageChange', page)
}
watch([recId, recAction, ], () => {
switch (recAction.value) {
case ActionEvents.showProcess:
props.processFn({
id: recId.value,
code: recItem.value.code,
name: recItem.value.name,
})
emit('toggleDialog')
break
}
})
</script>
<template>
<div class="space-y-4">
<PubMyUiDataTable
v-bind="config"
:rows="data"
:skeleton-size="paginationMeta?.pageSize"
/>
<PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" />
</div>
</template>
@@ -0,0 +1,116 @@
<script setup lang="ts">
import ProcedureListDialog from './list.vue'
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import { FieldArray } from 'vee-validate'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import { cn } from '~/lib/utils'
import TableHeader from '~/components/pub/ui/table/TableHeader.vue'
import { is } from 'date-fns/locale'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import List from './list.vue'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import { getList, getDetail } from '~/services/procedure-src.service'
import { ActionEvents, type HeaderPrep, type RefSearchNav } from '~/components/pub/my-ui/data/types'
interface Props {
fieldName: string
title: string
}
const props = defineProps<Props>()
const isOperativeActionDialogOpen = ref(false)
provide("isOperativeActionDialogOpen", isOperativeActionDialogOpen);
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person', }),
entityName: 'surgery-report',
})
const headerPrep: HeaderPrep = {
title: props.title,
icon: 'i-lucide-clipboard-list',
}
const refSearchNav: RefSearchNav = {
onClick: () => {
// open filter modal
},
onInput: (val: string) => {
searchInput.value = val
},
onClear: () => {
searchInput.value = ''
},
}
const handleToggleOperativeActionDialog = () => {
isOperativeActionDialogOpen.value = !isOperativeActionDialogOpen.value
}
const dummy = [
{
id: 1,
number: 1,
name: 'Operasi',
code: 'OP-001'
}
]
</script>
<template>
<div class="">
<div class="mb-2 flex justify-between">
<h1 class="mb-2 font-medium">{{ title }}</h1>
<Button @click="isOperativeActionDialogOpen = true" size="xs" variant="outline"
class="text-orange-400 border-orange-400 bg-transparent">
<Icon name="i-lucide-search" class="h-4 w-4 align-middle transition-colors" />
Pilih {{ title }}
</Button>
</div>
<FieldArray v-slot="{ fields, push, remove }" :name="props.fieldName">
<Dialog
v-model:open="isOperativeActionDialogOpen"
title="" size="xl">
<Header
:prep="headerPrep"
:ref-search-nav="refSearchNav"
v-model:search="searchInput"
@search="handleSearch" />
<!-- <List :data="dummy" :process-fn="push" /> -->
<List
:data="dummy"
:pagination-meta="paginationMeta"
@page-change="handlePageChange"
@toggle-dialog="handleToggleOperativeActionDialog"
:process-fn="push"
/>
</Dialog>
<div class="border border-gray-200 rounded-lg overflow-hidden">
<Table>
<TableHeader class="bg-gray-100">
<TableRow>
<TableHead class="">Prosedur</TableHead>
<TableHead class="">Code</TableHead>
<TableHead class="w-24">Action</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="(field, idx) in fields" :key="idx">
<TableCell class="">{{ field.value?.name }}</TableCell>
<TableCell class="">{{ field.value?.code }}</TableCell>
<TableCell class="">
<Button type="button" variant="destructive" size="sm" @click="remove(idx)">
<Icon name="i-lucide-trash-2" class="h-4 w-4" />
</Button>
</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</FieldArray>
</div>
</template>
@@ -0,0 +1,19 @@
<script setup lang="ts">
import { cn } from '~/lib/utils';
const props = withDefaults(defineProps<{
therapyEndDate?: string
class?: string
}>(), {
therapyEndDate: new Date().toISOString(),
})
</script>
<template>
<div :class="cn('flex items-center gap-2 p-3 rounded-md text-orange-500 border border-orange-400 bg-orange-50',
props.class
)">
<Icon name="i-lucide-triangle-alert" class="h-4 w-4 align-middle transition-colors" />
<p class="font-medium">Pasien ini sedang menjalankan program terapi sampai {{ new Date(props.therapyEndDate).toDateString() }}</p>
</div>
</template>
@@ -0,0 +1,28 @@
<script setup lang="ts">
import { ActionEvents, type ListItemDto } from '~/components/pub/my-ui/data/types';
import Button from '~/components/pub/ui/button/Button.vue';
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('rec_id')!
const recAction = inject<Ref<string>>('rec_action')!
const recItem = inject<Ref<any>>('rec_item')!
const recDate = inject<Ref<any>>('rec_date')!
function confirm() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showConfirmVerify
recItem.value = props.rec
recDate.value = new Date().getTime()
}
</script>
<template>
<Button type="button" variant="outline" class="text-orange-500 border border-orange-400 bg-orange-50"
@click="confirm">
<Icon name="i-lucide-circle-check" class="h-4 w-4 align-middle transition-colors" />
Konfirmasi
</Button>
</template>
@@ -0,0 +1,92 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { Label as RadioLabel } from '~/components/pub/ui/label'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
errors?: FormErrors
class?: string
radioGroupClass?: string
radioItemClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'isNewBorn',
label = 'Status Pasien',
errors,
class: containerClass,
radioGroupClass,
radioItemClass,
labelClass,
} = props
const newbornOptions = [
{ label: 'Ya', value: 'YA' },
{ label: 'Tidak', value: 'TIDAK' },
]
</script>
<template>
<DE.Cell :class="cn('radio-group-field', containerClass)" :col-span="2">
<DE.Label
:label-for="fieldName"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<RadioGroup
v-bind="componentField"
:class="cn('flex flex-row flex-wrap gap-4 sm:gap-6', radioGroupClass)"
>
<div
v-for="(option, index) in newbornOptions"
:key="option.value"
:class="cn('flex min-w-fit items-center space-x-2 pt-1', radioItemClass)"
>
<RadioGroupItem
:id="`${fieldName}-${index}`"
:value="option.value"
:class="
cn(
'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,
)
"
/>
<RadioLabel
:for="`${fieldName}-${index}`"
:class="
cn(
'cursor-pointer select-none text-xs font-normal leading-none transition-colors hover:text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70 sm:text-sm',
labelClass,
)
"
>
{{ option.label }}
</RadioLabel>
</div>
</RadioGroup>
</FormControl>
<FormMessage class="ml-0 mt-1" />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,92 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { Label as RadioLabel } from '~/components/pub/ui/label'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
errors?: FormErrors
class?: string
radioGroupClass?: string
radioItemClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'isNewBorn',
label = 'Status Pasien',
errors,
class: containerClass,
radioGroupClass,
radioItemClass,
labelClass,
} = props
const newbornOptions = [
{ label: 'Suami/Istri', value: 'partner' },
{ label: 'Anak', value: 'child' },
]
</script>
<template>
<DE.Cell :class="cn('radio-group-field', containerClass)" :col-span="2">
<DE.Label
:label-for="fieldName"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<RadioGroup
v-bind="componentField"
:class="cn('flex flex-row flex-wrap gap-4 sm:gap-6', radioGroupClass)"
>
<div
v-for="(option, index) in newbornOptions"
:key="option.value"
:class="cn('flex min-w-fit items-center space-x-2 pt-1', radioItemClass)"
>
<RadioGroupItem
:id="`${fieldName}-${index}`"
:value="option.value"
:class="
cn(
'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,
)
"
/>
<RadioLabel
:for="`${fieldName}-${index}`"
:class="
cn(
'cursor-pointer select-none text-xs font-normal leading-none transition-colors hover:text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70 sm:text-sm',
labelClass,
)
"
>
{{ option.label }}
</RadioLabel>
</div>
</RadioGroup>
</FormControl>
<FormMessage class="ml-0 mt-1" />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,72 @@
<script setup lang="ts">
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 * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label,
placeholder,
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
const arrangementTypeOpts = [
{ label: 'KRS', value: "krs" },
{ label: 'MRS', value: "mrs" },
{ label: 'Pindah IGD', value: "pindahIgd" },
{ label: 'Rujuk', value: "rujuk" },
{ label: 'Rujuk Balik', value: "rujukBalik" },
{ label: 'Meninggal', value: "meninggal" },
{ label: 'Lain Lain', value: "other" },
]
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
v-show="label"
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField :name="fieldName" v-slot="{ componentField, value }">
<FormItem>
<FormControl>
<Select
v-bind="componentField"
:model-value="value"
:items="arrangementTypeOpts"
:defaultValue='arrangementTypeOpts[0]?.value'
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,52 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { differenceInDays, differenceInMonths, differenceInYears, parseISO } from 'date-fns'
import { Input } from '~/components/pub/ui/input'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
import { CalendarDate, DateFormatter, getLocalTimeZone, type DateValue } from '@internationalized/date'
const props = defineProps<{
dateValueStart?: DateValue | undefined
dateValueEnd?: DateValue | undefined
}>()
const {
dateValueStart = new CalendarDate(2022, 1, 20),
dateValueEnd = new CalendarDate(2022, 1, 20).add({ days: 20 }),
} = props
// Reactive variables for age calculation
const patientAge = ref<string>('Masukkan tanggal lahir')
const df = new DateFormatter('en-US', {
dateStyle: 'medium',
})
</script>
<template>
<Popover>
<PopoverTrigger as-child>
<Button variant="outline" :class="cn('w-[280px] justify-start text-left font-normal',
(!dateValueStart && !dateValueEnd) && 'text-muted-foreground')">
<CalendarIcon class="mr-2 h-4 w-4" />
<template v-if="dateValueStart">
<template v-if="dateValueEnd">
{{ df.format(dateValueStart.toDate(getLocalTimeZone())) }} -
{{ df.format(dateValueEnd.toDate(getLocalTimeZone())) }}
</template>
<template v-else>
{{ df.format(dateValueStart.toDate(getLocalTimeZone())) }}
</template>
</template>
<template v-else> Pick a date </template>
</Button>
</PopoverTrigger>
<PopoverContent class="w-auto p-0">
<RangeCalendar v-model="dateValue" initial-focus :number-of-months="2"
@update:start-value="(startDate) => (dateValueStart = startDate)" />
</PopoverContent>
</Popover>
</template>
@@ -0,0 +1,121 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { differenceInDays, differenceInMonths, differenceInYears, parseISO } from 'date-fns'
import { Input } from '~/components/pub/ui/input'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
isDisabled?: boolean
isWithTime?: boolean
}>()
const {
fieldName = 'birthDate',
label = 'Tanggal Lahir',
placeholder = 'Pilih tanggal lahir',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
isWithTime = false,
} = props
// Reactive variables for age calculation
const patientAge = ref<string>('Masukkan tanggal lahir')
// Function to calculate age with years, months, and days
function calculateAge(birthDate: string | Date | undefined): string {
if (!birthDate) {
return 'Masukkan tanggal lahir'
}
try {
let dateObj: Date
if (typeof birthDate === 'string') {
dateObj = parseISO(birthDate)
} else {
dateObj = birthDate
}
const today = new Date()
// Calculate years, months, and days
const totalYears = differenceInYears(today, dateObj)
// Calculate remaining months after years
const yearsPassed = new Date(dateObj)
yearsPassed.setFullYear(yearsPassed.getFullYear() + totalYears)
const remainingMonths = differenceInMonths(today, yearsPassed)
// Calculate remaining days after years and months
const monthsPassed = new Date(yearsPassed)
monthsPassed.setMonth(monthsPassed.getMonth() + remainingMonths)
const remainingDays = differenceInDays(today, monthsPassed)
// Format the result
const parts = []
if (totalYears > 0) parts.push(`${totalYears} Tahun`)
if (remainingMonths > 0) parts.push(`${remainingMonths} Bulan`)
if (remainingDays > 0) parts.push(`${remainingDays} Hari`)
return parts.length > 0 ? parts.join(' ') : '0 Hari'
} catch {
return 'Masukkan tanggal lahir'
}
}
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired && !isDisabled"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Input
id="birthDate"
:type="isWithTime ? 'datetime-local' : 'date'"
min="1900-01-01"
:max="new Date().toISOString().split('T')[0]"
v-bind="componentField"
:placeholder="placeholder"
:disabled="isDisabled"
@update:model-value="
(value: string | number) => {
const dateStr = typeof value === 'number' ? String(value) : value
patientAge = calculateAge(dateStr)
}
"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
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 * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label,
placeholder,
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
// Generate job options from constants, sama seperti pola genderCodes
const jobOptions = mapToComboboxOptList(occupationCodes)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
v-show="label"
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="jobOptions"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,70 @@
<script setup lang="ts">
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 * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
// Generate job options from constants, sama seperti pola genderCodes
const jobOptions = mapToComboboxOptList(occupationCodes)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="jobOptions"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,70 @@
<script setup lang="ts">
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 * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label = 'Pekerjaan',
placeholder = 'Pilih pekerjaan',
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
// Generate job options from constants, sama seperti pola genderCodes
const jobOptions = mapToComboboxOptList(occupationCodes)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="jobOptions"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,71 @@
<script setup lang="ts">
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 * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName?: string
label?: string
placeholder?: string
errors?: FormErrors
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
isRequired?: boolean
}>()
const {
fieldName = 'job',
label,
placeholder,
errors,
class: containerClass,
fieldGroupClass,
labelClass,
} = props
// Generate job options from constants, sama seperti pola genderCodes
const jobOptions = mapToComboboxOptList(occupationCodes)
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
v-show="label"
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
:is-required="isRequired"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:errors="errors"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Combobox
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
:items="jobOptions"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,175 @@
<script setup lang="ts">
import { ref, computed, watch, defineEmits, defineProps, onMounted, nextTick, defineExpose } from 'vue'
import Input from '~/components/pub/ui/input/Input.vue';
import Button from '~/components/pub/ui/button/Button.vue';
import waveyFingerprint from '~/assets/svg/wavey-fingerprint.svg'
/**
* TextCaptcha props:
* - length: number of characters in the core captcha
* - caseSensitive: whether validation is case sensitive
* - useSpacing: show spaced-out characters (visual obfuscation only)
* - noiseChars: include random noise characters visually (not required to type)
*/
const props = defineProps({
length: { type: Number, default: 6 },
caseSensitive: { type: Boolean, default: false },
useSpacing: { type: Boolean, default: true },
noiseChars: { type: Boolean, default: false }, // adds random noise characters to display
refreshCooldownMs: { type: Number, default: 500 }, // guard repeated refresh
})
const emit = defineEmits<{
(e: 'update:valid', valid: boolean): void
(e: 'validated', valid: boolean): void
(e: 'change', value: string): void
}>()
// Internal state
const raw = ref('') // the canonical captcha value (what user must match, ignoring visual noise)
const display = ref('') // randomized visual representation (may include spacing/noise)
const input = ref('') // user typed value
const lastRefresh = ref(0)
const valid = inject('isCaptchaValid') as Ref<boolean>
const errorMessage = ref('')
/** Characters excluding ambiguous ones: 0/O, 1/l/I etc. */
const CHARS = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
function randomChar() {
return CHARS.charAt(Math.floor(Math.random() * CHARS.length))
}
/** Generate the canonical captcha string */
function genRaw(len = props.length) {
let s = ''
for (let i = 0; i < len; i++) s += randomChar()
return s
}
/** Create a visually obfuscated display string (spacing, noise, random case) */
function genDisplay(base: string) {
const arr: string[] = []
for (const ch of base) {
// toggle case randomly (only for letters)
const c = /[A-Za-z]/.test(ch) && Math.random() > 0.5 ? (Math.random() > 0.5 ? ch.toLowerCase() : ch.toUpperCase()) : ch
arr.push(c)
if (props.useSpacing && Math.random() > 0.3) arr.push(' ') // random space
}
return arr.join('')
}
/** Refresh captcha */
function refresh() {
const now = Date.now()
if (now - lastRefresh.value < props.refreshCooldownMs) return
lastRefresh.value = now
raw.value = genRaw(props.length)
display.value = genDisplay(raw.value)
input.value = ''
valid.value = false
errorMessage.value = ''
// emit change so parent knows new value (but we don't send the raw canonical in production)
emit('change', display.value)
}
/** Normalize input and canonical for comparison */
function normalizeForCompare(s: string) {
const normalized = s.replace(/\s+/g, '') // strip spaces
return props.caseSensitive ? normalized : normalized.toLowerCase()
}
/** Validate the current input */
function validate() {
const left = normalizeForCompare(input.value)
const right = normalizeForCompare(raw.value)
if (!input.value) {
valid.value = false
errorMessage.value = 'Please enter the captcha text.'
} else if (left === right) {
valid.value = true
errorMessage.value = ''
} else {
valid.value = false
errorMessage.value = 'Captcha does not match.'
}
emit('update:valid', valid.value)
emit('validated', valid.value)
return valid.value
}
// expose a refresh method to parent via ref
defineExpose({ refresh, validate, isValid: computed(() => valid.value) })
// generate on mount
onMounted(() => refresh())
// // re-validate whenever input changes (lightweight)
// watch(input, () => {
// // we don't auto-pass until the user explicitly validate (but we can optionally live-validate)
// // Here we perform live feedback but still emit validated only when called
// const left = normalizeForCompare(input.value)
// const right = normalizeForCompare(raw.value)
// valid.value = !!input.value && left === right
// // emit a live update so the parent can disable submit accordingly
// emit('update:valid', valid.value)
// })
</script>
<template>
<div class="space-y-2 w-full max-w-sm">
<div class="flex items-center justify-between gap-3">
<!-- Captcha visual box -->
<div
role="img"
aria-label="Text captcha, type the characters shown"
tabindex="0"
class="select-none p-3 rounded-md border border-gray-200 text-white text-xl font-mono tracking-wider text-center w-full"
>
<span class="inline-block" v-html="display"></span>
</div>
<!-- Refresh -->
<div class="flex-shrink-0">
<Button variant="ghost" type="button" @click="refresh" title="Refresh captcha">
<Icon name="i-lucide-refresh-cw" />
</Button>
</div>
</div>
<!-- Input -->
<div class="flex gap-3 items-start">
<div class="flex-grow">
<Input
v-model="input"
:aria-invalid="valid ? 'false' : 'true'"
inputmode="text"
placeholder="Type the captcha text"
@keyup.enter="validate"
/>
<p v-if="errorMessage" class="text-xs text-red-500 mt-1">{{ errorMessage }}</p>
<p v-else-if="valid" class="text-xs text-green-500 mt-1">Correct</p>
<p v-else class="text-xs text-gray-500 mt-1">Not case-sensitive</p>
</div>
<Button variant="outline" type="button" @click="validate" title="Validate"
class="border-orange-400">
<Icon name="i-lucide-check" class="text-orange-400" />
</Button>
</div>
</div>
</template>
<style scoped>
/* small nicety: make noise/spaced display look irregular */
div[role="img"] {
background: url('~/assets/svg/wavey-fingerprint.svg') repeat center;
}
div[role="img"] span {
letter-spacing: 0.12em;
font-weight: 600;
user-select: none;
}
</style>
@@ -0,0 +1,30 @@
<script setup lang="ts">
import { Badge } from '~/components/pub/ui/badge'
const activeStatusCodes: Record<string, string> = {
verified: 'Verifikasi',
unverified: 'Belum Verifikasi',
}
const props = defineProps<{
rec: any
idx?: number
}>()
const statusText = computed(() => {
const code: keyof typeof activeStatusCodes = props.rec.status_code === 1 ? `verified` : `unverified`
return activeStatusCodes[code]
})
const badgeVariant = computed(() => {
return props.rec.status_code === 1 ? 'default' : 'outline'
})
</script>
<template>
<div class="flex justify-center">
<Badge :variant="badgeVariant" class="rounded-2xl text-[0.6rem]" >
{{ statusText }}
</Badge>
</div>
</template>
@@ -0,0 +1,51 @@
import type { Config } from '~/components/pub/my-ui/data-table'
export const medicalDiagnosisConfig: Config = {
cols: [{width: 10}, {}, {},],
headers: [
[
{ label: 'No' },
{ label: 'Diagnosa' },
{ label: 'ICD-X' },
],
],
keys: ['number', 'diagnosis', 'icd_x'],
parses: { },
}
export const functionalDiagnosisConfig: Config = {
cols: [{width: 10}, {}, {},],
headers: [
[
{ label: 'No' },
{ label: 'Diagnosa' },
{ label: 'ICD-X' },
],
],
keys: ['number', 'diagnosis', 'icd_x'],
parses: { },
}
export const proceduralConfig: Config = {
cols: [{width: 10}, {}, {},],
headers: [
[
{ label: 'No' },
{ label: 'Prosedur' },
{ label: 'ICD-IX' },
],
],
keys: ['number', 'procedure', 'icd_x'],
parses: { },
}
@@ -0,0 +1,28 @@
import type { Config } from '~/components/pub/my-ui/data-table'
const action = defineAsyncComponent(() => import('./_common/btn-confirmation-detail.vue'))
export const detailTherapyProtocolListConfig: Config = {
cols: [{}, {}, {}, {width: 100},],
headers: [
[
{ label: 'Program Kegiatan' },
{ label: 'Paraf Terapis' },
{ label: 'Paraf Dokter' },
{ label: 'Action' },
],
],
keys: ['program', 'therapistSign', 'doctorSign', 'action'],
parses: { },
components: {
action(rec, idx) {
return {
idx,
rec: rec as object,
component: action,
}
},
},
}
@@ -0,0 +1,145 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import { FieldArray } from 'vee-validate'
import SelectDate from './_common/select-date.vue'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import SelectSecondaryDiagnosis from './_common/select-secondary-diagnosis.vue'
import SelectPrimaryDiagnosis from './_common/select-primary-diagnosis.vue'
import SelectArrangement from './_common/select-arrangement.vue'
import type { ResumeArrangementType } from '~/schemas/resume.schema'
import SelectFaskes from './_common/select-faskes.vue'
import SelectDeathCause from './_common/select-death-cause.vue'
import { cn } from '~/lib/utils'
import RadioRelationship from './_common/radio-relationship.vue'
import RadioIllnessBcsWork from './_common/radio-illness-bcs-work.vue'
import { functionalDiagnosisConfig, medicalDiagnosisConfig, proceduralConfig } from './add-list.cfg'
import DetailRow from '~/components/pub/my-ui/form/view/detail-row.vue'
import Badge from '~/components/pub/ui/badge/Badge.vue'
import { detailTherapyProtocolListConfig } from './detail-list.cfg'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
const props = defineProps<{
}>()
const router = useRouter()
const formRef = ref()
const isConfirmationOpen = ref(false)
defineExpose({
validate: () => formRef.value?.validate(),
resetForm: () => formRef.value?.resetForm(),
setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate),
values: computed(() => formRef.value?.values),
})
function goBack() {
router.go(-1)
}
async function handleConfirmAdd() {
// handleActionClick('submit')
console.log(`tersubmit wak`)
}
function handleCancelAdd() {
isConfirmationOpen.value = false
}
// #endregion region
// #region Utilities & event handlers
async function handleActionClick(eventType: string) {
if (eventType === 'submit') {
isConfirmationOpen.value = true
// const patient: Patient = await composeFormData()
// let createdPatientId = 0
// const response = await handleActionSave(
// patient,
// () => {},
// () => {},
// toast,
// )
// const data = (response?.body?.data ?? null) as PatientBase | null
// if (!data) return
// createdPatientId = data.id
// If has callback provided redirect to callback with patientData
// if (props.callbackUrl) {
// await navigateTo(props.callbackUrl + '?patient-id=' + patient.id)
// return
// }
// Navigate to patient list or show success message
// await navigateTo('/outpatient/encounter')
// return
}
if (eventType === 'back') {
goBack()
}
}
const dummymedicalDiagnosis = [
{ id: `asdfouno182y49128y3`, program: 'Latihan penguatan otot', icd_x: 'E11' },
{ id: `asdfouno182y49128g8`, program: 'Mobilisasi otot', icd_x: 'I10' },
]
</script>
<template>
<div class="flex items-center">
<Button type="button" variant="outline" class="ml-auto text-gray-500 border border-orange-400 bg-orange-50" @click="handleActionClick('back')">
<Icon name="i-lucide-arrow-left" class="h-4 w-4 align-middle transition-colors" />
Kembali
</Button>
</div>
<section class="">
<h1 class="mb-2 text-base font-medium">Form 1</h1>
<DetailRow label="Tanggal Pemeriksaan">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Diagnosa">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Permintaan Terapi">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Frekuensi Terapi">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Waktu Mencapai Target">{{ `aaaaaa bulan` }}</DetailRow>
</section>
<Separator class="my-5" />
<section class="">
<h1 class="mb-2 text-base font-medium">Form 2</h1>
<DetailRow label="Hubungan dengan Tertanggung">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Anamnesa">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Pemeriksaan Fisik dan Uji Fungsi">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Diagnosa Medis (ICD-X)" class="mb-1">
<Badge variant="outline" class="bg-gray-200">aaaaaa</Badge>
</DetailRow>
<DetailRow label="Diagnosa Fungsional (ICD-X)" class="mb-1">
<Badge variant="outline" class="bg-gray-200">aaaaaa</Badge>
</DetailRow>
<DetailRow label="Prosedur Tata Laksana (ICD-IX CM)" class="mb-1">
<Badge variant="outline" class="bg-gray-200">aaaaaa</Badge>
</DetailRow>
<DetailRow label="Pemeriksaan Penunjang">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Evaluasi">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Anjuran">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Suspek Penyakit Akibat Kerja">{{ `aaaaaa` }}</DetailRow>
</section>
<Separator class="my-5" />
<section class="">
<h1 class="mb-2 text-base font-medium">Form 3</h1>
<DetailRow label="Diagnosa">{{ `aaaaaa` }}</DetailRow>
<DetailRow label="Permintaan Terapi">{{ `aaaaaa` }}</DetailRow>
<div class="mt-3">
<PubMyUiDataTable
v-bind="detailTherapyProtocolListConfig"
:rows="dummymedicalDiagnosis" />
</div>
</section>
</template>
@@ -0,0 +1,217 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import { FieldArray } from 'vee-validate'
import SelectDate from './_common/select-date.vue'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import SelectSecondaryDiagnosis from './_common/select-secondary-diagnosis.vue'
import SelectPrimaryDiagnosis from './_common/select-primary-diagnosis.vue'
import SelectArrangement from './_common/select-arrangement.vue'
import type { ResumeArrangementType } from '~/schemas/resume.schema'
import SelectFaskes from './_common/select-faskes.vue'
import SelectDeathCause from './_common/select-death-cause.vue'
import { cn } from '~/lib/utils'
import RadioRelationship from './_common/radio-relationship.vue'
import RadioIllnessBcsWork from './_common/radio-illness-bcs-work.vue'
import { functionalDiagnosisConfig, medicalDiagnosisConfig, proceduralConfig } from './add-list.cfg'
const props = defineProps<{
schema: any
initialValues?: any
resumeArrangementType: ResumeArrangementType
errors?: FormErrors
}>()
const formSchema = toTypedSchema(props.schema)
const formRef = ref()
defineExpose({
validate: () => formRef.value?.validate(),
resetForm: () => formRef.value?.resetForm(),
setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate),
values: computed(() => formRef.value?.values),
})
const dummymedicalDiagnosis = [
{ number: 1, diagnosis: 'Diabetes Mellitus', icd_x: 'E11' },
{ number: 2, diagnosis: 'Hipertensi', icd_x: 'I10' },
{ number: 3, diagnosis: 'Asma Bronkial', icd_x: 'J45' },
]
</script>
<template>
<Form ref="formRef" v-slot="{ values }" as="" keep-values :validation-schema="formSchema" :validate-on-mount="false"
validation-mode="onSubmit" :initial-values="initialValues ? initialValues : {}">
<h1 class="mb-1 text-base font-medium">Terapi ke 1</h1>
<!-- FORM 2 -->
<h1 class="mb-3 text-base">Form 1</h1>
<DE.Block :col-count="2" :cell-flex="false">
<SelectDate field-name="checkDate" label="Tanggal Pemeriksaan" :errors="errors"/>
<div></div>
<TextAreaInput
field-name="diagnosis"
label="Diagnosa"
placeholder="Diagnosa"
:errors="errors" />
<TextAreaInput
field-name="therapyRequest"
label="Permintaan Terapi"
placeholder="Permintaan Terapi"
:errors="errors" />
<DE.Block class="flex items-end h-fit" :col-count="3" :cell-flex="false">
<div>
<h1 class="mb-1 font-medium">Frekuensi Terapi</h1>
<div :class="cn('bg-gray-50 dark:bg-slate-950 ring-offset-background placeholder:text-muted-foreground flex justify-between items-center h-9 md:h-8 2xl:h-9 w-full rounded-md border border-gray-300 px-3 py-2 md:text-xs 2xl:text-sm file:border-0 file:bg-transparent md:file:!text-xs xl:file:!text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50',)">
<p class="">{{ `2` }}</p>
<p class="text-muted-foreground">x / Minggu</p>
</div>
</div>
<div :class="cn('bg-gray-50 dark:bg-slate-950 ring-offset-background placeholder:text-muted-foreground flex justify-between items-center h-9 md:h-8 2xl:h-9 w-full rounded-md border border-gray-300 px-3 py-2 md:text-xs 2xl:text-sm file:border-0 file:bg-transparent md:file:!text-xs xl:file:!text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50',)">
<p>
<span class="text-muted-foreground">Selama</span>
{{ `1` }}
<span class="text-muted-foreground">Bulan</span>
</p>
</div>
<InputBase
field-name="targetPeriodInMonths"
label="Waktu mencapai target (Bulan)"
placeholder="Masukkan angka"
:errors="errors"
numeric-only
/>
</DE.Block>
<TextAreaInput
field-name="therapyTarget"
label="Target Terapi"
placeholder="Target Terapi"
:errors="errors" />
</DE.Block>
<Separator class="my-4" />
<!-- FORM 2 -->
<h1 class="mb-3 text-base font-medium">Form 2</h1>
<DE.Block :col-count="2" :cell-flex="false">
<DE.Cell :col-span="2">
<RadioRelationship
field-name="relationshipToPatient"
label="Hubungan dengan tertanggung"
:errors="errors"
is-required
/>
</DE.Cell>
<TextAreaInput
field-name="anamnesa"
label="Anamnesa"
placeholder="Anamnesa"
:errors="errors" />
<TextAreaInput
field-name="physicalExamination"
label="Pemeriksaan Fisik & Uji Fungsi"
placeholder="Pemeriksaan Fisik & Uji Fungsi"
:errors="errors" />
<div class="">
<h1 class="mb-2 font-medium">Diagnosis Medis (ICD-X)</h1>
<PubMyUiDataTable
v-bind="medicalDiagnosisConfig"
:rows="dummymedicalDiagnosis"
:skeleton-size="dummymedicalDiagnosis.length"
/>
</div>
<div class="">
<h1 class="mb-2 font-medium">Diagnosis Fungsional (ICD-X)</h1>
<PubMyUiDataTable
v-bind="functionalDiagnosisConfig"
:rows="dummymedicalDiagnosis"
:skeleton-size="dummymedicalDiagnosis.length"
/>
</div>
<div class="">
<h1 class="mb-2 font-medium">Prosedur Tata Laksana (ICD-IX CM)</h1>
<PubMyUiDataTable
v-bind="proceduralConfig"
:rows="dummymedicalDiagnosis"
:skeleton-size="dummymedicalDiagnosis.length"
/>
</div>
<TextAreaInput
field-name="supportingExamination"
label="Pemeriksaan Penunjang"
placeholder="Pemeriksaan Penunjang"
:errors="errors" />
<TextAreaInput
field-name="evaluation"
label="Evaluasi"
placeholder="Evaluasi"
:errors="errors" />
<TextAreaInput
field-name="recommendation"
label="Anjuran"
placeholder="Anjuran"
:errors="errors" />
<DE.Cell :col-span="2">
<RadioIllnessBcsWork
field-name="illnessBcsWork"
label="Suspek penyakit akibat kerja"
:errors="errors"
is-required
/>
</DE.Cell>
</DE.Block>
<Separator class="my-4" />
<!-- FORM 3 -->
<h1 class="mb-3 text-base">Form 3</h1>
<DE.Block :col-count="2" :cell-flex="false">
<SelectDate field-name="checkDate" label="Tanggal Pemeriksaan" :errors="errors"/>
<div></div>
<TextAreaInput
field-name="form3-diagnosis"
label="Diagnosa"
placeholder="Diagnosa"
:errors="errors" />
<TextAreaInput
field-name="form3-therapyRequest"
label="Permintaan Terapi"
placeholder="Permintaan Terapi"
:errors="errors" />
<DE.Cell class="mt-2" :col-span="2">
<FieldArray v-slot="{ fields, push, remove }" name="form3-programActivity">
<div v-for="(field, idx) in fields" :key="idx" class="w-1/2 flex items-center gap-3 mb-3">
<TextAreaInput
class=""
:field-name="`form3-programActivity[${idx}]`"
:label="`Program/Kegiatan ${idx + 1}`"
:placeholder="`Masukkan Program/Kegiatan ${idx + 1}`"
:errors="errors" />
<Button type="button" variant="destructive" size="sm" @click="remove(idx)">
<Icon name="i-lucide-trash-2" class="h-4 w-4" />
</Button>
</div>
<Button type="button" variant="outline"
class="mt-3 w-full rounded-md border border-primary bg-white px-4 py-2 text-primary hover:border-primary hover:bg-primary hover:text-white sm:w-auto sm:text-sm"
@click="push(``)">
<Icon name="i-lucide-plus" class="mr-2 h-4 w-4 align-middle transition-colors" />
Tambah Program
</Button>
</FieldArray>
</DE.Cell>
</DE.Block>
</Form>
</template>
@@ -0,0 +1,137 @@
<script setup lang="ts">
import { toTypedSchema } from '@vee-validate/zod'
// components
import { Form } from '~/components/pub/ui/form'
import * as DE from '~/components/pub/my-ui/doc-entry'
import Separator from '~/components/pub/ui/separator/Separator.vue'
// form field components
import { BaseTextarea, RadioRelations, SelectExaminationDate, RadioWorkDisease } from './field'
// #region Props & Emits
interface Props {
schema: any
initialValues?: any
patientId: number
}
const props = defineProps<Props>()
const emit = defineEmits<{}>()
// #endregion
// #region State & Computed
// #endregion
// #region Lifecycle Hooks
// #endregion
// #region Functions
// #endregion region
// #region Utilities & event handlers
// #endregion
// #region Watchers
// #endregion
const formSchema = toTypedSchema(props.schema)
const formRef = ref()
defineExpose({
validate: () => formRef.value?.validate(),
resetForm: () => formRef.value?.resetForm(),
setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate),
values: computed(() => formRef.value?.values),
})
</script>
<template>
<Form
ref="formRef"
v-slot="{ values }"
as=""
keep-values
:validation-schema="formSchema"
:validate-on-mount="false"
validation-mode="onSubmit"
:initial-values="initialValues ? initialValues : {}"
>
<p class="mb-2 text-sm font-semibold 2xl:mb-3 2xl:text-base">Anamnesa dan Riwayat Pasien</p>
<DE.Block
:col-count="3"
:cell-flex="false"
>
<SelectExaminationDate
field-name="examinationDate"
label="Tanggal Pemeriksaan"
/>
<RadioRelations
field-name="relationshipToInsured"
label="Hubungan Dengan Tertanggung"
:col-span="2"
/>
<BaseTextarea
field-name="anamnesis"
label="Anamnesa"
/>
<BaseTextarea
field-name="medicalHistory"
label="Riwayat Penyakit"
/>
<BaseTextarea
field-name="medicationHistory"
label="Riwayat Obat"
/>
</DE.Block>
<div class="h-6">
<Separator />
</div>
<p class="mb-2 text-sm font-semibold 2xl:mb-3 2xl:text-base">Pemeriksaan Penunjang</p>
<DE.Block
:col-count="2"
:cell-flex="false"
>
<BaseTextarea
field-name="supportDiagnosis"
label="Diagnosa (ICD-X)"
/>
<BaseTextarea
field-name="functionalDiagnosis"
label="Diagnosa Fungsional (ICD-X)"
/>
<BaseTextarea
field-name="treatmentDiagnosis"
label="Diagnosa Tata Laksana (ICD-IX)"
/>
<BaseTextarea
field-name="supportExamination"
label="Pemeriksaan Penunjang"
/>
</DE.Block>
<div class="h-6">
<Separator />
</div>
<p class="mb-2 text-sm font-semibold 2xl:mb-3 2xl:text-base">Anjuran dan Evaluasi</p>
<DE.Block
:col-count="3"
:cell-flex="false"
>
<BaseTextarea
field-name="recommendation"
label="Anjuran"
/>
<BaseTextarea
field-name="evaluation"
label="Evaluasi"
/>
<RadioWorkDisease
field-name="isWorkRelatedDisease"
label="Suspek Penyakit Akibat Kerja"
/>
</DE.Block>
</Form>
</template>
@@ -0,0 +1,204 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import { FieldArray } from 'vee-validate'
import SelectDate from './_common/select-date.vue'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import { cn } from '~/lib/utils'
import RadioRelationship from './_common/radio-relationship.vue'
import RadioIllnessBcsWork from './_common/radio-illness-bcs-work.vue'
import { functionalDiagnosisConfig, proceduralConfig } from './add-list.cfg'
import FunctionalDiagnosisPicker from './picker-dialog/functional-diagnosis/diagnosis-picker.vue'
import MedicalDiagnosisPicker from './picker-dialog/medical-diagnosis/diagnosis-picker.vue'
import ArrangementProcedurePicker from './picker-dialog/arrangement-procedure/procedure-picker.vue'
const props = defineProps<{
schema: any
initialValues?: any
errors?: FormErrors
}>()
const formSchema = toTypedSchema(props.schema)
const formRef = ref()
// const isMedicalDiagnosisPickerDialogOpen = ref<boolean>(false)
// const isFunctionalDiagnosisPickerDialogOpen = ref<boolean>(false)
// const isProcedurePickerDialogOpen = ref<boolean>(false)
// function toggleMedicalDiagnosisPickerDialog() {
// isMedicalDiagnosisPickerDialogOpen.value = !isMedicalDiagnosisPickerDialogOpen.value
// }
// function toggleFunctionalDiagnosisPickerDialog() {
// isFunctionalDiagnosisPickerDialogOpen.value = !isFunctionalDiagnosisPickerDialogOpen.value
// }
// provide(`isDiagnosisPickerDialogOpen`, isDiagnosisPickerDialogOpen)
// provide(`isProcedurePickerDialogOpen`, isProcedurePickerDialogOpen)
defineExpose({
validate: () => formRef.value?.validate(),
resetForm: () => formRef.value?.resetForm(),
setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate),
values: computed(() => formRef.value?.values),
})
</script>
<template>
<Form ref="formRef" v-slot="{ values }" as="" keep-values :validation-schema="formSchema" :validate-on-mount="false"
validation-mode="onSubmit" :initial-values="initialValues ? initialValues : {}">
<h1 class="mb-1 text-base font-medium">Terapi ke 1</h1>
<!-- FORM 1 -->
<h1 class="mb-3 text-base">Form 1</h1>
<DE.Block :col-count="2" :cell-flex="false">
<SelectDate field-name="form1ExaminationDate" label="Tanggal Pemeriksaan" :errors="errors"/>
<div></div>
<TextAreaInput
field-name="form1Diagnose"
label="Diagnosa"
placeholder="Diagnosa"
:errors="errors" />
<TextAreaInput
field-name="form1TherapyRequest"
label="Permintaan Terapi"
placeholder="Permintaan Terapi"
:errors="errors" />
<DE.Block class="flex items-end h-fit" :col-count="3" :cell-flex="false">
<div>
<h1 class="mb-1 font-medium">Frekuensi Terapi</h1>
<div :class="cn('bg-gray-50 dark:bg-slate-950 ring-offset-background placeholder:text-muted-foreground flex justify-between items-center h-9 md:h-8 2xl:h-9 w-full rounded-md border border-gray-300 px-3 py-2 md:text-xs 2xl:text-sm file:border-0 file:bg-transparent md:file:!text-xs xl:file:!text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50',)">
<p class="">{{ `2` }}</p>
<p class="text-muted-foreground">x / Minggu</p>
</div>
</div>
<div :class="cn('bg-gray-50 dark:bg-slate-950 ring-offset-background placeholder:text-muted-foreground flex justify-between items-center h-9 md:h-8 2xl:h-9 w-full rounded-md border border-gray-300 px-3 py-2 md:text-xs 2xl:text-sm file:border-0 file:bg-transparent md:file:!text-xs xl:file:!text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50',)">
<p>
<span class="text-muted-foreground">Selama</span>
{{ `1` }}
<span class="text-muted-foreground">Bulan</span>
</p>
</div>
<InputBase
field-name="form1TargetPeriod"
label="Waktu mencapai target (Bulan)"
placeholder="Masukkan angka"
:errors="errors"
numeric-only
/>
</DE.Block>
<TextAreaInput
field-name="form1TherapyTarget"
label="Target Terapi"
placeholder="Target Terapi"
:errors="errors" />
</DE.Block>
<Separator class="my-4" />
<!-- FORM 2 -->
<h1 class="mb-3 text-base font-medium">Form 2</h1>
<DE.Block :col-count="2" :cell-flex="false">
<DE.Cell :col-span="2">
<RadioRelationship
field-name="form2RelationshipToInsured"
label="Hubungan dengan tertanggung"
:errors="errors"
is-required
/>
</DE.Cell>
<TextAreaInput
field-name="anamnesis"
label="Anamnesa"
placeholder="Anamnesa"
:errors="errors" />
<TextAreaInput
field-name="form2PhysicalExamination"
label="Pemeriksaan Fisik & Uji Fungsi"
placeholder="Pemeriksaan Fisik & Uji Fungsi"
:errors="errors" />
<MedicalDiagnosisPicker
field-name="medicalDiagnoses"
title="Diagnosis Medis (ICD-X)" />
<FunctionalDiagnosisPicker
field-name="functionDiagnoses"
title="Diagnosis Fungsional (ICD-X)" />
<ArrangementProcedurePicker
field-name="procedures"
title="Prosedur Tata Laksana (ICD-IX CM)" />
<TextAreaInput
field-name="supportingExams"
label="Pemeriksaan Penunjang"
placeholder="Pemeriksaan Penunjang"
:errors="errors" />
<TextAreaInput
field-name="evaluation"
label="Evaluasi"
placeholder="Evaluasi"
:errors="errors" />
<TextAreaInput
field-name="instruction"
label="Anjuran"
placeholder="Anjuran"
:errors="errors" />
<DE.Cell :col-span="2">
<RadioIllnessBcsWork
field-name="workCauseStatus"
label="Suspek penyakit akibat kerja"
:errors="errors"
is-required
/>
</DE.Cell>
</DE.Block>
<Separator class="my-4" />
<!-- FORM 3 -->
<h1 class="mb-3 text-base">Form 3</h1>
<DE.Block :col-count="2" :cell-flex="false">
<SelectDate field-name="form3ExaminationDate" label="Tanggal Pemeriksaan" :errors="errors"/>
<div></div>
<TextAreaInput
field-name="form3Diagnose"
label="Diagnosa"
placeholder="Diagnosa"
:errors="errors" />
<TextAreaInput
field-name="form3TherapyRequest"
label="Permintaan Terapi"
placeholder="Permintaan Terapi"
:errors="errors" />
<DE.Cell class="mt-2" :col-span="2">
<FieldArray v-slot="{ fields, push, remove }" name="form3ProgramActivities">
<div v-for="(field, idx) in fields" :key="idx" class="w-1/2 flex items-center gap-3 mb-3">
<TextAreaInput
class=""
:field-name="`form3ProgramActivities[${idx}]`"
:label="`Program/Kegiatan ${idx + 1}`"
:placeholder="`Masukkan Program/Kegiatan ${idx + 1}`"
:errors="errors" />
<Button v-if="idx !== 0" type="button" variant="destructive" size="sm" @click="remove(idx)">
<Icon name="i-lucide-trash-2" class="h-4 w-4" />
</Button>
</div>
<Button type="button" variant="outline"
class="mt-3 w-full rounded-md border border-primary bg-white px-4 py-2 text-primary hover:border-primary hover:bg-primary hover:text-white sm:w-auto sm:text-sm"
@click="push(``)">
<Icon name="i-lucide-plus" class="mr-2 h-4 w-4 align-middle transition-colors" />
Tambah Program
</Button>
</FieldArray>
</DE.Cell>
</DE.Block>
</Form>
</template>
@@ -0,0 +1,40 @@
<script setup lang="ts">
import { Label as RadioLabel } from '~/components/pub/ui/label'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
label: string
fieldName: string
placeholder?: string
colSpan?: number
}>()
const { label, fieldName, placeholder = 'Masukkan catatan' } = props
</script>
<template>
<DE.Cell :col-span="colSpan || 1">
<DE.Label :label-for="fieldName">
{{ label }}
</DE.Label>
<DE.Field :id="fieldName">
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Textarea
v-bind="componentField"
:placeholder="placeholder"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,4 @@
export { default as RadioRelations } from './radio-relations.vue'
export { default as SelectExaminationDate } from './select-examination-date.vue'
export { default as BaseTextarea } from './base-textarea.vue'
export { default as RadioWorkDisease } from './radio-work-disease.vue'
@@ -0,0 +1,77 @@
<script setup lang="ts">
import { Label as RadioLabel } from '~/components/pub/ui/label'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
defineProps<{
label: string
fieldName: string
containerClass?: string
radioGroupClass?: string
radioItemClass?: string
labelClass?: string
colSpan?: number
}>()
const options = [
{ label: 'Suami/Istri', value: 'spouse' },
{ label: 'Anak', value: 'child' },
]
</script>
<template>
<DE.Cell
:class="cn('radio-group-field', containerClass)"
:col-span="colSpan || 2"
>
<DE.Label :label-for="fieldName">
{{ label }}
</DE.Label>
<DE.Field :id="fieldName">
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<RadioGroup
v-bind="componentField"
:class="cn('flex flex-row flex-wrap gap-4 sm:gap-6', radioGroupClass)"
>
<div
v-for="(option, index) in options"
:key="option.value"
:class="cn('flex min-w-fit items-center space-x-2 pt-1', radioItemClass)"
>
<RadioGroupItem
:id="`${fieldName}-${index}`"
:value="option.value"
:class="
cn(
'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,
)
"
/>
<RadioLabel
:for="`${fieldName}-${index}`"
:class="
cn(
'cursor-pointer select-none text-xs font-normal leading-none transition-colors hover:text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70 sm:text-sm',
labelClass,
)
"
>
{{ option.label }}
</RadioLabel>
</div>
</RadioGroup>
</FormControl>
<FormMessage class="ml-0 mt-1" />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,77 @@
<script setup lang="ts">
import { Label as RadioLabel } from '~/components/pub/ui/label'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
defineProps<{
label: string
fieldName: string
containerClass?: string
radioGroupClass?: string
radioItemClass?: string
labelClass?: string
colSpan?: number
}>()
const options = [
{ label: 'Ya', value: 'YA' },
{ label: 'Tidak', value: 'TIDAK' },
]
</script>
<template>
<DE.Cell
:class="cn('radio-group-field', containerClass)"
:col-span="colSpan || 1"
>
<DE.Label :label-for="fieldName">
{{ label }}
</DE.Label>
<DE.Field :id="fieldName">
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<RadioGroup
v-bind="componentField"
:class="cn('flex flex-row flex-wrap gap-4 sm:gap-6', radioGroupClass)"
>
<div
v-for="(option, index) in options"
:key="option.value"
:class="cn('flex min-w-fit items-center space-x-2 pt-1', radioItemClass)"
>
<RadioGroupItem
:id="`${fieldName}-${index}`"
:value="option.value"
:class="
cn(
'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,
)
"
/>
<RadioLabel
:for="`${fieldName}-${index}`"
:class="
cn(
'cursor-pointer select-none text-xs font-normal leading-none transition-colors hover:text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70 sm:text-sm',
labelClass,
)
"
>
{{ option.label }}
</RadioLabel>
</div>
</RadioGroup>
</FormControl>
<FormMessage class="ml-0 mt-1" />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,52 @@
<script setup lang="ts">
import { Input } from '~/components/pub/ui/input'
import { cn } from '~/lib/utils'
import * as DE from '~/components/pub/my-ui/doc-entry'
const props = defineProps<{
fieldName: string
label: string
placeholder?: string
class?: string
selectClass?: string
fieldGroupClass?: string
labelClass?: string
}>()
const { placeholder = 'Pilih tanggal pemeriksaan', class: containerClass, fieldGroupClass, labelClass } = props
</script>
<template>
<DE.Cell :class="cn('select-field-group', fieldGroupClass, containerClass)">
<DE.Label
:label-for="fieldName"
:class="cn('select-field-label', labelClass)"
>
{{ label }}
</DE.Label>
<DE.Field
:id="fieldName"
:class="cn('select-field-wrapper')"
>
<FormField
v-slot="{ componentField }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Input
id="birthDate"
type="date"
min="1980-01-01"
:max="new Date().toISOString().split('T')[0]"
v-bind="componentField"
:placeholder="placeholder"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</DE.Field>
</DE.Cell>
</template>
@@ -0,0 +1,43 @@
<script setup lang="ts">
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
import { config } from './history-list.cfg'
import { CalendarDate, DateFormatter, getLocalTimeZone } from '@internationalized/date'
import type { DateRange } from 'radix-vue'
import { cn } from '~/lib/utils'
interface Props {
data: any[]
paginationMeta: PaginationMeta
}
defineProps<Props>()
const emit = defineEmits<{
pageChange: [page: number]
}>()
const df = new DateFormatter('en-US', {
dateStyle: 'medium',
})
const dateValue = ref({
start: new CalendarDate(2022, 1, 20),
end: new CalendarDate(2022, 1, 20).add({ days: 20 }),
}) as Ref<DateRange>
function handlePageChange(page: number) {
emit('pageChange', page)
}
</script>
<template>
<div class="space-y-4">
<PubMyUiDataTable
v-bind="config"
:rows="data"
:skeleton-size="paginationMeta?.pageSize"
/>
<PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" />
</div>
</template>
@@ -0,0 +1,45 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import type { Patient } from '~/models/patient'
import { defineAsyncComponent } from 'vue'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dp.vue'))
export const config: Config = {
cols: [{}, {}, {}, {}, {width: 140}, {width: 3},],
headers: [
[
{ label: 'Tgl Pemeriksaan' },
{ label: 'DPJP' },
{ label: 'Anamnesa' },
{ label: 'Permintaan Terapi' },
{ label: 'Program/Kegiatan' },
{ label: 'Action' },
],
],
keys: ['birth_date', 'person.name', 'person.name', 'person.name', 'birth_date', "action"],
parses: {
birth_date: (rec: unknown): unknown => {
const { person } = rec as Patient
if (typeof person.birthDate == 'object' && person.birthDate) {
return (person.birthDate as Date).toLocaleDateString('id-ID')
} else if (typeof person.birthDate == 'string') {
return (person.birthDate as string).substring(0, 10)
}
return person.birthDate
},
},
components: {
action(rec, idx) {
return {
idx,
rec: rec as object,
component: action,
}
},
},
}
@@ -0,0 +1,53 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import type { Patient } from '~/models/patient'
import { defineAsyncComponent } from 'vue'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-duvp.vue'))
const statusBadge = defineAsyncComponent(() => import('./_common/verify-badge.vue'))
export const config: Config = {
cols: [{}, {}, {}, {}, {width: 140}, {width: 3},],
headers: [
[
{ label: 'Tgl Pemeriksaan' },
{ label: 'Anamnesa' },
{ label: 'Permintaan Terapi' },
{ label: 'Program' },
{ label: 'Status' },
{ label: 'Action' },
],
],
keys: ['anamnesis', 'anamnesis', 'anamnesis', 'anamnesis', 'status', 'action'],
parses: {
birth_date: (rec: unknown): unknown => {
const { person } = rec as Patient
if (typeof person.birthDate == 'object' && person.birthDate) {
return (person.birthDate as Date).toLocaleDateString('id-ID')
} else if (typeof person.birthDate == 'string') {
return (person.birthDate as string).substring(0, 10)
}
return person.birthDate
},
},
components: {
action(rec, idx) {
return {
idx,
rec: rec as object,
component: action,
}
},
status(rec, idx) {
return {
idx,
rec: rec as object,
component: statusBadge,
}
},
},
}
@@ -0,0 +1,31 @@
<script setup lang="ts">
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
import { config } from './list.cfg'
interface Props {
data: any[]
paginationMeta: PaginationMeta
}
defineProps<Props>()
const emit = defineEmits<{
pageChange: [page: number]
}>()
function handlePageChange(page: number) {
emit('pageChange', page)
}
</script>
<template>
<div class="space-y-4">
<PubMyUiDataTable
v-bind="config"
:rows="data"
:skeleton-size="paginationMeta?.pageSize"
/>
<PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" />
</div>
</template>
@@ -0,0 +1,64 @@
<script setup lang="ts">
import { ActionEvents, type LinkItem, type ListItemDto } from '~/components/pub/my-ui/data/types';
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('ap_rec_id')!
const recAction = inject<Ref<string>>('ap_rec_action')!
const recItem = inject<Ref<any>>('ap_rec_item')!
const activeKey = ref<string | null>(null)
const linkItems: LinkItem[] = [
{
label: 'Process',
onClick: () => {
process()
},
icon: 'i-lucide-arrow-right',
},
]
function process() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showProcess
recItem.value = props.rec
}
</script>
<template>
<div>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<SidebarMenuButton
size="lg"
class="data-[state=open]:text-sidebar-accent-foreground data-[state=open]:bg-white dark:data-[state=open]:bg-slate-800"
>
<Icon
name="i-lucide-chevrons-up-down"
class="ml-auto size-4"
/>
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
class="w-[--radix-dropdown-menu-trigger-width] min-w-40 rounded-lg border border-slate-200 bg-white text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
align="end"
>
<DropdownMenuGroup>
<DropdownMenuItem
v-for="item in linkItems"
:key="item.label"
class="hover:bg-gray-100 dark:hover:bg-slate-700"
@click="item.onClick"
@mouseenter="activeKey = item.label"
@mouseleave="activeKey = null"
>
<Icon :name="item.icon ?? ''" />
<span :class="activeKey === item.label ? 'text-sidebar-accent-foreground' : ''">{{ item.label }}</span>
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
</template>
@@ -0,0 +1,33 @@
import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
const action = defineAsyncComponent(() => import('./dropdown-action-p.vue'))
export const config: Config = {
cols: [{}, {}, {}, { width: 50 }],
headers: [[{ label: 'Kode' }, { label: 'Nama (FHIR)' }, { label: 'Nama (ID)' }, { label: '' }]],
keys: ['code', 'name', 'indName', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama (FHIR)' },
{ key: 'indName', label: 'Nama (ID)' },
],
parses: {},
components: {
action(rec, idx) {
const res: RecComponent = {
idx,
rec: rec as object,
component: action,
}
return res
},
},
htmls: {},
}
@@ -0,0 +1,120 @@
<script setup lang="ts">
// Components
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
// Helpers
import { usePaginatedList } from '~/composables/usePaginatedList'
import { toast } from '~/components/pub/ui/toast'
import { config } from './procedure-list-cfg'
// Types
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
import { ProcedureSrcSchema, type ProcedureSrcFormData } from '~/schemas/procedure-src.schema'
// Handlers
import {
isReadonly,
isProcessing,
isFormEntryDialogOpen,
isRecordConfirmationOpen,
onResetState,
handleActionSave,
handleActionEdit,
handleActionRemove,
handleCancelForm,
} from '~/handlers/procedure-src.handler'
// Services
import { getList, getDetail } from '~/services/procedure-src.service'
const title = ref('')
interface Props {
processFn: (input: unknown) => void
}
const props = defineProps<Props>()
const {
data,
isLoading,
paginationMeta,
searchInput,
handlePageChange,
handleSearch,
fetchData: getItemList,
} = usePaginatedList({
fetchFn: async (params: any) => {
const result = await getList({
search: params.search,
sort: 'createdAt:desc',
'page-number': params['page-number'] || 0,
'page-size': params['page-size'] || 10,
})
return { success: result.success || false, body: result.body || {} }
},
entityName: 'procedure-src',
})
const headerPrep: HeaderPrep = {
title: 'MCU Prosedur',
icon: 'i-lucide-clipboard-list',
refSearchNav: {
placeholder: 'Cari (min. 3 karakter)...',
minLength: 3,
debounceMs: 500,
showValidationFeedback: true,
onInput: (val: string) => {
searchInput.value = val
},
onClick: () => {},
onClear: () => {},
},
}
const recId = ref<string>(``)
const recAction = ref<string>(``)
const recItem = ref<any>({})
provide('ap_rec_id', recId)
provide('ap_rec_action', recAction)
provide('ap_rec_item', recItem)
provide('table_data_loader', isLoading)
const isModalOpen = inject(`isProcedurePickerDialogOpen`) as Ref<boolean>
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showProcess:
props.processFn({
id: recId.value,
code: recItem.value.code,
name: recItem.value.name,
})
isModalOpen.value = false
break
}
})
onMounted(async () => {
await getItemList()
})
</script>
<template>
<Dialog v-model:open="isModalOpen" title="" size="xl">
<Header
v-model="searchInput"
:prep="headerPrep"
:ref-search-nav="headerPrep.refSearchNav"
@search="handleSearch"
class=""
/>
<AppProcedureSrcList
:table-config="config"
:data="data"
:pagination-meta="paginationMeta"
@page-change="handlePageChange"
/>
</Dialog>
</template>
@@ -0,0 +1,62 @@
<script setup lang="ts">
import ProcedureListDialog from './procedure-list.vue'
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import { FieldArray } from 'vee-validate'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import { cn } from '~/lib/utils'
import TableHeader from '~/components/pub/ui/table/TableHeader.vue'
import { is } from 'date-fns/locale'
interface Props {
fieldName: string
title: string
}
const props = defineProps<Props>()
const isProcedurePickerDialogOpen = ref<boolean>(false)
provide(`isProcedurePickerDialogOpen`, isProcedurePickerDialogOpen)
</script>
<template>
<div class="">
<div class="mb-2 flex items-center justify-between">
<h1 class="mb-2 font-medium">{{ title }}</h1>
<Button @click="isProcedurePickerDialogOpen = true" size="xs" variant="outline"
class="text-orange-400 border-orange-400 bg-transparent">
<Icon name="i-lucide-search" class="h-4 w-4 align-middle transition-colors" />
Pilih Diagnosis
</Button>
</div>
<FieldArray v-slot="{ fields, push, remove }" :name="props.fieldName">
<ProcedureListDialog :process-fn="push" />
<div class="border border-gray-200 rounded-lg overflow-hidden">
<Table>
<TableHeader class="bg-gray-100">
<TableRow>
<TableHead class="w-1/2">Prosedur</TableHead>
<TableHead class="w-1/2">ICD-X</TableHead>
<TableHead class="w-1/2">Action</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="(field, idx) in fields" :key="idx">
<TableCell class="">{{ field.value?.name }}</TableCell>
<TableCell class="">{{ field.value?.code }}</TableCell>
<TableCell class="">
<Button type="button" variant="destructive" size="sm" @click="remove(idx)">
<Icon name="i-lucide-trash-2" class="h-4 w-4" />
</Button>
</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</FieldArray>
</div>
</template>
@@ -0,0 +1,33 @@
import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
const action = defineAsyncComponent(() => import('./dropdown-action-p.vue'))
export const config: Config = {
cols: [{}, {}, {}, { width: 50 }],
headers: [[{ label: 'Kode' }, { label: 'Nama (FHIR)' }, { label: 'Nama (ID)' }, { label: '' }]],
keys: ['code', 'name', 'indName', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama (FHIR)' },
{ key: 'indName', label: 'Nama (ID)' },
],
parses: {},
components: {
action(rec, idx) {
const res: RecComponent = {
idx,
rec: rec as object,
component: action,
}
return res
},
},
htmls: {},
}
@@ -0,0 +1,108 @@
<script setup lang="ts">
// Components
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
// Helpers
import { usePaginatedList } from '~/composables/usePaginatedList'
import { toast } from '~/components/pub/ui/toast'
import { config } from './diagnosis-list-cfg'
// Types
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
import { DiagnoseSrcSchema, type DiagnoseSrcFormData } from '~/schemas/diagnose-src.schema'
// Handlers
// Services
import { getList, getDetail } from '~/services/diagnose-src.service'
const title = ref('')
interface Props {
processFn: (input: unknown) => void
}
const props = defineProps<Props>()
const {
data,
isLoading,
paginationMeta,
searchInput,
handlePageChange,
handleSearch,
fetchData: getItemList,
} = usePaginatedList({
fetchFn: async (params: any) => {
const result = await getList({
search: params.search,
sort: 'createdAt:desc',
'page-number': params['page-number'] || 0,
'page-size': params['page-size'] || 10,
})
return { success: result.success || false, body: result.body || {} }
},
entityName: 'diagnose-src',
})
const headerPrep: HeaderPrep = {
title: 'Daftar Diagnosis',
icon: 'i-lucide-microscope',
refSearchNav: {
placeholder: 'Cari (min. 3 karakter)...',
minLength: 3,
debounceMs: 500,
showValidationFeedback: true,
onInput: (val: string) => {
searchInput.value = val
},
onClick: () => {},
onClear: () => {},
},
}
const recId = ref<string>(``)
const recAction = ref<string>(``)
const recItem = ref<any>({})
provide('fd_rec_id', recId)
provide('fd_rec_action', recAction)
provide('fd_rec_item', recItem)
provide('table_data_loader', isLoading)
const isModalOpen = inject(`isFunctionalPickerDialogOpen`) as Ref<boolean>
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showProcess:
props.processFn({
id: recId.value,
code: recItem.value.code,
name: recItem.value.name,
})
isModalOpen.value = false
break
}
})
onMounted(async () => {
await getItemList()
})
</script>
<template>
<Dialog v-model:open="isModalOpen" title="" size="xl">
<Header
v-model="searchInput"
:prep="headerPrep"
:ref-search-nav="headerPrep.refSearchNav"
@search="handleSearch"
class=""
/>
<AppDiagnoseSrcList
:data="data"
:pagination-meta="paginationMeta"
:table-config="config"
@page-change="handlePageChange"
/>
</Dialog>
</template>
@@ -0,0 +1,62 @@
<script setup lang="ts">
import DiagnosisListDialog from './diagnosis-list.vue'
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import { FieldArray } from 'vee-validate'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import { cn } from '~/lib/utils'
import TableHeader from '~/components/pub/ui/table/TableHeader.vue'
import { is } from 'date-fns/locale'
interface Props {
fieldName: string
title: string
}
const props = defineProps<Props>()
const isFunctionalPickerDialogOpen = ref<boolean>(false)
provide(`isFunctionalPickerDialogOpen`, isFunctionalPickerDialogOpen)
</script>
<template>
<div class="">
<div class="mb-2 flex items-center justify-between">
<h1 class="mb-2 font-medium">{{ title }}</h1>
<Button @click="isFunctionalPickerDialogOpen = true" size="xs" variant="outline"
class="text-orange-400 border-orange-400 bg-transparent">
<Icon name="i-lucide-search" class="h-4 w-4 align-middle transition-colors" />
Pilih Diagnosis
</Button>
</div>
<FieldArray v-slot="{ fields, push, remove }" :name="fieldName">
<DiagnosisListDialog :process-fn="push" />
<div class="border border-gray-200 rounded-lg overflow-hidden">
<Table>
<TableHeader class="bg-gray-100">
<TableRow>
<TableHead class="w-1/2">Diagnosis</TableHead>
<TableHead class="w-1/2">ICD-X</TableHead>
<TableHead class="w-1/2">Action</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="(field, idx) in fields" :key="idx">
<TableCell class="">{{ field.value?.name }}</TableCell>
<TableCell class="">{{ field.value?.code }}</TableCell>
<TableCell class="">
<Button type="button" variant="destructive" size="sm" @click="remove(idx)">
<Icon name="i-lucide-trash-2" class="h-4 w-4" />
</Button>
</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</FieldArray>
</div>
</template>
@@ -0,0 +1,64 @@
<script setup lang="ts">
import { ActionEvents, type LinkItem, type ListItemDto } from '~/components/pub/my-ui/data/types';
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('fd_rec_id')!
const recAction = inject<Ref<string>>('fd_rec_action')!
const recItem = inject<Ref<any>>('fd_rec_item')!
const activeKey = ref<string | null>(null)
const linkItems: LinkItem[] = [
{
label: 'Process',
onClick: () => {
process()
},
icon: 'i-lucide-arrow-right',
},
]
function process() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showProcess
recItem.value = props.rec
}
</script>
<template>
<div>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<SidebarMenuButton
size="lg"
class="data-[state=open]:text-sidebar-accent-foreground data-[state=open]:bg-white dark:data-[state=open]:bg-slate-800"
>
<Icon
name="i-lucide-chevrons-up-down"
class="ml-auto size-4"
/>
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
class="w-[--radix-dropdown-menu-trigger-width] min-w-40 rounded-lg border border-slate-200 bg-white text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
align="end"
>
<DropdownMenuGroup>
<DropdownMenuItem
v-for="item in linkItems"
:key="item.label"
class="hover:bg-gray-100 dark:hover:bg-slate-700"
@click="item.onClick"
@mouseenter="activeKey = item.label"
@mouseleave="activeKey = null"
>
<Icon :name="item.icon ?? ''" />
<span :class="activeKey === item.label ? 'text-sidebar-accent-foreground' : ''">{{ item.label }}</span>
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
</template>
@@ -0,0 +1,33 @@
import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
const action = defineAsyncComponent(() => import('./dropdown-action-p.vue'))
export const config: Config = {
cols: [{}, {}, {}, { width: 50 }],
headers: [[{ label: 'Kode' }, { label: 'Nama (FHIR)' }, { label: 'Nama (ID)' }, { label: '' }]],
keys: ['code', 'name', 'indName', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama (FHIR)' },
{ key: 'indName', label: 'Nama (ID)' },
],
parses: {},
components: {
action(rec, idx) {
const res: RecComponent = {
idx,
rec: rec as object,
component: action,
}
return res
},
},
htmls: {},
}
@@ -0,0 +1,107 @@
<script setup lang="ts">
// Components
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
// Helpers
import { usePaginatedList } from '~/composables/usePaginatedList'
import { toast } from '~/components/pub/ui/toast'
import { config } from './diagnosis-list-cfg'
// Types
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
import { DiagnoseSrcSchema, type DiagnoseSrcFormData } from '~/schemas/diagnose-src.schema'
// Services
import { getList, getDetail } from '~/services/diagnose-src.service'
const title = ref('')
interface Props {
processFn: (input: unknown) => void
}
const props = defineProps<Props>()
const {
data,
isLoading,
paginationMeta,
searchInput,
handlePageChange,
handleSearch,
fetchData: getItemList,
} = usePaginatedList({
fetchFn: async (params: any) => {
const result = await getList({
search: params.search,
sort: 'createdAt:desc',
'page-number': params['page-number'] || 0,
'page-size': params['page-size'] || 10,
})
return { success: result.success || false, body: result.body || {} }
},
entityName: 'diagnose-src',
})
const headerPrep: HeaderPrep = {
title: 'Daftar Diagnosis',
icon: 'i-lucide-microscope',
refSearchNav: {
placeholder: 'Cari (min. 3 karakter)...',
minLength: 3,
debounceMs: 500,
showValidationFeedback: true,
onInput: (val: string) => {
searchInput.value = val
},
onClick: () => {},
onClear: () => {},
},
}
const recId = ref<string>(``)
const recAction = ref<string>(``)
const recItem = ref<any>({})
provide('md_rec_id', recId)
provide('md_rec_action', recAction)
provide('md_rec_item', recItem)
provide('table_data_loader', isLoading)
const isModalOpen = inject(`isMedicalDiagnosisPickerDialogOpen`) as Ref<boolean>
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showProcess:
props.processFn({
id: recId.value,
code: recItem.value.code,
name: recItem.value.name,
})
isModalOpen.value = false
break
}
})
onMounted(async () => {
await getItemList()
})
</script>
<template>
<Dialog v-model:open="isModalOpen" title="" size="xl">
<Header
v-model="searchInput"
:prep="headerPrep"
:ref-search-nav="headerPrep.refSearchNav"
@search="handleSearch"
class=""
/>
<AppDiagnoseSrcList
:data="data"
:pagination-meta="paginationMeta"
:table-config="config"
@page-change="handlePageChange"
/>
</Dialog>
</template>
@@ -0,0 +1,63 @@
<script setup lang="ts">
import DiagnosisListDialog from './diagnosis-list.vue'
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import { Form } from '~/components/pub/ui/form'
import { FieldArray } from 'vee-validate'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
import { cn } from '~/lib/utils'
import TableHeader from '~/components/pub/ui/table/TableHeader.vue'
import { is } from 'date-fns/locale'
interface Props {
fieldName: string
title: string
}
const props = defineProps<Props>()
const isMedicalDiagnosisPickerDialogOpen = ref<boolean>(false)
provide(`isMedicalDiagnosisPickerDialogOpen`, isMedicalDiagnosisPickerDialogOpen)
</script>
<template>
<div class="">
<div class="mb-2 flex items-center justify-between">
<h1 class="mb-2 font-medium">{{ title }}</h1>
<Button @click="isMedicalDiagnosisPickerDialogOpen = true" size="xs" variant="outline"
class="text-orange-400 border-orange-400 bg-transparent">
<Icon name="i-lucide-search" class="h-4 w-4 align-middle transition-colors" />
Pilih Diagnosis
</Button>
</div>
<FieldArray v-slot="{ fields, push, remove }" :name="fieldName">
<DiagnosisListDialog :process-fn="push" />
<div class="border border-gray-200 rounded-lg overflow-hidden">
<Table>
<TableHeader class="bg-gray-100">
<TableRow>
<TableHead class="w-1/2">Diagnosis</TableHead>
<TableHead class="w-1/2">ICD-X</TableHead>
<TableHead class="w-1/2">Action</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="(field, idx) in fields" :key="idx">
<TableCell class="">{{ field.value?.name }}</TableCell>
<TableCell class="">{{ field.value?.code }}</TableCell>
<TableCell class="">
<Button type="button" variant="destructive" size="sm" @click="remove(idx)">
<Icon name="i-lucide-trash-2" class="h-4 w-4" />
</Button>
</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</FieldArray>
</div>
</template>
@@ -0,0 +1,64 @@
<script setup lang="ts">
import { ActionEvents, type LinkItem, type ListItemDto } from '~/components/pub/my-ui/data/types';
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('md_rec_id')!
const recAction = inject<Ref<string>>('md_rec_action')!
const recItem = inject<Ref<any>>('md_rec_item')!
const activeKey = ref<string | null>(null)
const linkItems: LinkItem[] = [
{
label: 'Process',
onClick: () => {
process()
},
icon: 'i-lucide-arrow-right',
},
]
function process() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showProcess
recItem.value = props.rec
}
</script>
<template>
<div>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<SidebarMenuButton
size="lg"
class="data-[state=open]:text-sidebar-accent-foreground data-[state=open]:bg-white dark:data-[state=open]:bg-slate-800"
>
<Icon
name="i-lucide-chevrons-up-down"
class="ml-auto size-4"
/>
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
class="w-[--radix-dropdown-menu-trigger-width] min-w-40 rounded-lg border border-slate-200 bg-white text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
align="end"
>
<DropdownMenuGroup>
<DropdownMenuItem
v-for="item in linkItems"
:key="item.label"
class="hover:bg-gray-100 dark:hover:bg-slate-700"
@click="item.onClick"
@mouseenter="activeKey = item.label"
@mouseleave="activeKey = null"
>
<Icon :name="item.icon ?? ''" />
<span :class="activeKey === item.label ? 'text-sidebar-accent-foreground' : ''">{{ item.label }}</span>
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
</template>
@@ -0,0 +1,108 @@
<script setup lang="ts">
import type { FormErrors } from '~/types/error'
import { toTypedSchema } from '@vee-validate/zod'
import FieldGroup from '~/components/pub/my-ui/form/field-group.vue'
import Field from '~/components/pub/my-ui/form/field.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
import Select from '~/components/pub/my-ui/form/select.vue'
import { Form } from '~/components/pub/ui/form'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import type { InstallationFormData } from '~/schemas/installation.schema'
import TextCaptcha from './_common/text-captcha.vue'
const props = defineProps<{
schema: any
errors?: FormErrors
}>()
const emit = defineEmits<{
submit: [values: InstallationFormData, resetForm: () => void]
cancel: [resetForm: () => void]
}>()
const formSchema = toTypedSchema(props.schema)
const formRef = ref()
const captchaRef = ref<InstanceType<typeof TextCaptcha> | null>(null)
const captchaValid = ref(false)
// Form submission handler
function onSubmitForm(values: any, { resetForm }: { resetForm: () => void }) {
const formData: InstallationFormData = {
name: values.name || '',
code: values.code || '',
}
emit('submit', formData, resetForm)
}
function onCaptchaUpdate(valid: boolean) {
captchaValid.value = valid
}
// Form cancel handler
function onCancelForm({ resetForm }: { resetForm: () => void }) {
emit('cancel', resetForm)
}
defineExpose({
validate: () => formRef.value?.validate(),
resetForm: () => formRef.value?.resetForm(),
setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate),
values: computed(() => formRef.value?.values),
})
</script>
<template>
<Form
ref="formRef"
v-slot="{ values }"
as=""
keep-values
:validation-schema="formSchema"
validation-mode="onSubmit"
>
<div class="border-b border-b-slate-300 pb-3 text-lg xl:text-xl">
<div class="flex flex-col justify-between">
<InputBase
field-name="name"
label="Nama"
placeholder="Masukkan Nama"
:errors="errors"/>
<InputBase
field-name="email"
label="Email"
placeholder="Masukkan Email"
:errors="errors"/>
<div class="mt-2">
<Label class="" for="password">Password</Label>
<Field class="" id="password" :errors="errors">
<FormField v-slot="{ componentField }" name="password">
<FormItem>
<FormControl>
<Input
id="password"
v-bind="componentField"
type="password"
class="w-full"
/>
</FormControl>
<FormMessage />
</FormItem>
</FormField>
</Field>
</div>
<TextCaptcha
ref="captchaRef"
:length="5"
:useSpacing="true"
:noiseChars="true"
@update:valid="onCaptchaUpdate"
/>
</div>
</div>
</Form>
</template>
+58 -11
View File
@@ -11,8 +11,19 @@ import { getList, remove } from '~/services/control-letter.service'
import { toast } from '~/components/pub/ui/toast'
import type { Encounter } from '~/models/encounter'
import WarningAlert from '~/components/pub/my-ui/alert/warning-alert.vue'
import type { PagePermission } from '~/models/role'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
import { unauthorizedToast } from '~/lib/utils'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import DocPreviewDialog from '~/components/pub/my-ui/modal/doc-preview-dialog.vue'
import HistoryDialog from '~/components/app/control-letter/history-dialog.vue'
// #endregion
// #region Permission
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { getPagePermissions } = useRBAC()
const pagePermission = getPagePermissions(roleAccess)
// #region State
const props = defineProps<{
encounter?: Encounter
@@ -24,6 +35,10 @@ const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSe
fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person', }),
entityName: 'control-letter',
})
const historyData = usePaginatedList({
fetchFn: (params) => getList({ ...params, includes: ['person', 'person-Addresses'] }),
entityName: 'control-letter-history',
})
const refSearchNav: RefSearchNav = {
onClick: () => {
@@ -37,6 +52,10 @@ const refSearchNav: RefSearchNav = {
},
}
const isHistoryDialogOpen = ref(false)
provide('isHistoryDialogOpen', isHistoryDialogOpen)
const isDocPreviewDialogOpen = ref(false)
const isRecordConfirmationOpen = ref(false)
const summaryLoading = ref(false)
const isRequirementsMet = ref(true)
@@ -44,17 +63,20 @@ const isRequirementsMet = ref(true)
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const timestamp = ref(new Date().toISOString())
const headerPrep: HeaderPrep = {
title: "Surat Kontrol",
icon: 'i-lucide-newspaper',
addNav: {
}
if (pagePermission.canCreate) {
headerPrep.addNav = {
label: "Surat Kontrol",
onClick: () => navigateTo({
name: 'rehab-encounter-id-control-letter-add',
params: { id: encounterId },
}),
},
}
}
// #endregion
@@ -105,11 +127,12 @@ function handleCancelConfirmation() {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('timestamp', isLoading)
provide('table_data_loader', isLoading)
// #endregion
// #region Watchers
watch([recId, recAction], () => {
watch([recId, recAction, timestamp], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
navigateTo({
@@ -119,17 +142,22 @@ watch([recId, recAction], () => {
break
case ActionEvents.showEdit:
// TODO: Handle edit action
// isFormEntryDialogOpen.value = true
navigateTo({
name: 'rehab-encounter-id-control-letter-control_letter_id-edit',
params: { id: encounterId, "control_letter_id": recId.value },
})
if(pagePermission.canUpdate){
navigateTo({
name: 'rehab-encounter-id-control-letter-control_letter_id-edit',
params: { id: encounterId, "control_letter_id": recId.value },
})
} else {
unauthorizedToast()
}
break
case ActionEvents.showConfirmDelete:
// Trigger confirmation modal open
isRecordConfirmationOpen.value = true
if(pagePermission.canDelete){
isRecordConfirmationOpen.value = true
} else {
unauthorizedToast()
}
break
}
})
@@ -151,8 +179,19 @@ watch([recId, recAction], () => {
:ref-search-nav="refSearchNav"
@search="handleSearch" />
<div class="mb-3 flex justify-end items-center">
<Button variant="outline"
class="gap-1 bg-transparent items-center text-orange-400 border-orange-400"
@click="isHistoryDialogOpen = true">
<Icon name="i-lucide-history" class="h-4 w-4" /> Riwayat Program Nasional</Button>
</div>
<AppControlLetterList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
<Dialog v-model:open="isDocPreviewDialogOpen" title="Preview Dokumen" size="2xl">
<DocPreviewDialog :link="`https://www.antennahouse.com/hubfs/xsl-fo-sample/pdf/basic-link-1.pdf`" />
</Dialog>
<RecordConfirmation v-model:open="isRecordConfirmationOpen" action="delete" :record="recItem"
@confirm="handleConfirmDelete" @cancel="handleCancelConfirmation">
<template #default="{ record }">
@@ -172,5 +211,13 @@ watch([recId, recAction], () => {
</div>
</template>
</RecordConfirmation>
<HistoryDialog
v-model:is-modal-open="isHistoryDialogOpen"
:data="historyData.data.value"
:pagination-meta="historyData.paginationMeta"
@page-change="historyData.handlePageChange"
/>
</div>
</template>
@@ -0,0 +1,65 @@
<script setup lang="ts">
import { useRouter } from 'vue-router'
import { withBase } from '~/models/_base'
import type { HeaderPrep } from '~/components/pub/my-ui/data/types'
import type { Patient } from '~/models/patient'
import type { Person } from '~/models/person'
import { getDetail } from '~/services/surgery-report.service'
// Components
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import type { SurgeryReport } from '~/models/surgery-report'
// #region Props & Emits
const props = defineProps<{
}>()
// #endregion
// #region State & Computed
const route = useRoute()
const router = useRouter()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const surgeryReportId = typeof route.params.surgery_report_id == 'string' ? parseInt(route.params.surgery_report_id) : 0
const surgeryReport = ref<SurgeryReport | null>(null)
const headerPrep: HeaderPrep = {
title: 'Detail Laporan Operasi',
icon: 'i-lucide-newspaper',
}
// #endregion
// #region Lifecycle Hooks
// onMounted(async () => {
// const result = await getDetail(controlLetterId, {
// includes: "unit,specialist,subspecialist,doctor-employee-person",
// })
// if (result.success) {
// controlLetter.value = result.body?.data
// }
// })
// #endregion
// #region Functions
function goBack() {
router.go(-1)
}
// #endregion region
// #region Utilities & event handlers
function handleAction() {
goBack()
}
// #endregion
// #region Watchers
// #endregion
</script>
<template>
<Header :prep="headerPrep" :ref-search-nav="headerPrep.refSearchNav" />
<AppSurgeryReportDetail :instance="surgeryReport" @click="handleAction" />
</template>
@@ -0,0 +1,148 @@
<script setup lang="ts">
import { useRouter } from 'vue-router'
import type { Patient, genPatientProps } from '~/models/patient'
import type { ExposedForm } from '~/types/form'
import type { PatientBase } from '~/models/patient'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import { genPatient } from '~/models/patient'
import { PatientSchema } from '~/schemas/patient.schema'
import { PersonAddressRelativeSchema } from '~/schemas/person-address-relative.schema'
import { PersonAddressSchema } from '~/schemas/person-address.schema'
import { PersonContactListSchema } from '~/schemas/person-contact.schema'
import { PersonFamiliesSchema } from '~/schemas/person-family.schema'
import { ResponsiblePersonSchema } from '~/schemas/person-relative.schema'
import { uploadAttachment } from '~/services/patient.service'
import { getDetail, update } from '~/services/surgery-report.service'
import type { SurgeryReport } from '~/models/surgery-report'
import ActionDialog from '~/components/pub/my-ui/nav-footer/ba-su.vue'
import { toast } from '~/components/pub/ui/toast'
import { withBase } from '~/models/_base'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { SurgeryReportSchema } from '~/schemas/surgery-report.schema'
import { formatDateYyyyMmDd } from '~/lib/date'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import { getList, remove } from '~/services/surgery-report.service'
import { handleActionEdit } from '~/handlers/surgery-report.handler'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
// #region Props & Emits
const props = defineProps<{
callbackUrl?: string
}>()
// form related state
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person', }),
entityName: 'surgery-report',
})
// #endregion
// #region State & Computed
const route = useRoute()
const router = useRouter()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const surgeryReportId = typeof route.params.surgery_report_id == 'string' ? parseInt(route.params.surgery_report_id) : 0
const inputForm = ref<ExposedForm<any> | null>(null)
const surgeryReport = ref({})
const isConfirmationOpen = ref(false)
const selectedOperativeAction = ref<any>(null)
// #endregion
// #region Lifecycle Hooks
onMounted(async () => {
const result = await getDetail(surgeryReportId)
if (result.success) {
const responseData = {...result.body.data, date: formatDateYyyyMmDd(result.body.data.date)}
surgeryReport.value = responseData
inputForm.value?.setValues(responseData)
}
})
// #endregion
// #region Functions
function goBack() {
router.go(-1)
}
async function handleConfirmAdd() {
const response = await handleActionEdit(
surgeryReportId,
await composeFormData(),
() => { },
() => { },
toast,
)
goBack()
}
async function composeFormData(): Promise<SurgeryReport> {
const [input,] = await Promise.all([
inputForm.value?.validate(),
])
const results = [input]
const allValid = results.every((r) => r?.valid)
// exit, if form errors happend during validation
if (!allValid) return Promise.reject('Form validation failed')
const formData = input?.values
formData.encounter_id = encounterId
return new Promise((resolve) => resolve(formData))
}
// #endregion region
// #region Utilities & event handlers
async function handleActionClick(eventType: string) {
if (eventType === 'submit') {
isConfirmationOpen.value = true
}
if (eventType === 'back') {
if (props.callbackUrl) {
await navigateTo(props.callbackUrl)
return
}
goBack()
}
}
function handleCancelAdd() {
isConfirmationOpen.value = false
}
// #endregion
// #region Watchers
// #endregion
</script>
<template>
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">Update Laporan Operasi</div>
<code>{{ selectedOperativeAction }}</code>
<AppSurgeryReportEntry
ref="inputForm"
:schema="SurgeryReportSchema"
:operative-action-list="[]"
/>
<div class="my-2 flex justify-end py-2">
<Action :enable-draft="false" @click="handleActionClick" />
</div>
<Confirmation
v-model:open="isConfirmationOpen"
title="Simpan Data"
message="Apakah Anda yakin ingin menyimpan data ini?"
confirm-text="Simpan"
@confirm="handleConfirmAdd"
@cancel="handleCancelAdd"
/>
</template>
<style scoped>
/* component style */
</style>
@@ -0,0 +1,200 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
// #region Imports
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
import { ActionEvents } from '~/components/pub/my-ui/data/types'
import Filter from '~/components/pub/my-ui/nav-header/filter.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import { usePaginatedList } from '~/composables/usePaginatedList'
import { getList, remove } from '~/services/surgery-report.service'
import { toast } from '~/components/pub/ui/toast'
import type { Encounter } from '~/models/encounter'
import WarningAlert from '~/components/pub/my-ui/alert/warning-alert.vue'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
// #endregion
// #region State
const props = defineProps<{
encounter?: Encounter
}>()
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person', }),
entityName: 'surgery-report',
})
const isHistoryDialogOpen = ref(false)
const isFilterDialogOpen = ref(false)
const isRecordConfirmationOpen = ref(false)
const summaryLoading = ref(false)
const isRequirementsMet = ref(true)
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const headerPrep: HeaderPrep = {
title: "Laporan Operasi",
icon: 'i-lucide-history',
addNav: {
label: "Laporan Operasi",
onClick: () => navigateTo({
name: 'rehab-encounter-id-surgery-report-add',
params: { id: encounterId },
}),
},
}
const refSearchNav: RefSearchNav = {
onClick: () => {
isFilterDialogOpen.value = true
},
onInput: (val: string) => {
searchInput.value = val
},
onClear: () => {
searchInput.value = ''
},
}
headerPrep.components = [
{
component: defineAsyncComponent(() => import('~/components/app/surgery-report/_common/btn-history.vue')),
props: { }
},
];
// #endregion
// #region Lifecycle Hooks
onMounted(() => {
getListData()
})
// #endregion
// #region Functions
async function getListData() {
try {
summaryLoading.value = true
await new Promise((resolve) => setTimeout(resolve, 500))
} catch (error) {
console.error('Error fetching Data:', error)
} finally {
summaryLoading.value = false
}
}
// Handle confirmation result
function handleFiltering(value: any) {
isFilterDialogOpen.value = false
}
async function handleConfirmDelete(record: any, action: string) {
if (action === 'delete' && record?.id) {
try {
const result = await remove(record.id)
if (result.success) {
toast({ title: 'Berhasil', description: 'Data berhasil dihapus', variant: 'default' })
await fetchData()
} else {
toast({ title: 'Gagal', description: `Data gagal dihapus`, variant: 'destructive' })
}
} catch (error) {
toast({ title: 'Gagal', description: `Something went wrong`, variant: 'destructive' })
}
}
}
function handleCancelConfirmation() {
// Reset record state when cancelled
recId.value = 0
recAction.value = ''
recItem.value = null
}
// #endregion
// #region Provide
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('table_data_loader', isLoading)
provide('isHistoryDialogOpen', isHistoryDialogOpen)
// #endregion
// #region Watchers
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
navigateTo({
name: 'rehab-encounter-id-surgery-report-control_letter_id',
params: { id: encounterId, "control_letter_id": recId.value },
})
break
case ActionEvents.showEdit:
// TODO: Handle edit action
// isFormEntryDialogOpen.value = true
navigateTo({
name: 'rehab-encounter-id-surgery-report-control_letter_id-edit',
params: { id: encounterId, "control_letter_id": recId.value },
})
break
case ActionEvents.showConfirmDelete:
// Trigger confirmation modal open
isRecordConfirmationOpen.value = true
break
}
})
// #endregion
</script>
<template>
<WarningAlert v-if="!isRequirementsMet"
class="mb-5"
text="Syarat pembuatan Laporan Operasi belum terpenuhi"
:description="[
'Lanjutan Penatalaksanaan Pasien harus pulang/KRS.',
'Status Resume Medis harus tervalidasi.'
]" />
<div v-else>
<Header :prep="headerPrep" />
<Filter
:prep="headerPrep"
:ref-search-nav="refSearchNav"
:enable-export="false"
/>
<AppSurgeryReportList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
<Dialog v-model:open="isFilterDialogOpen" title="Filter" size="lg">
<AppSurgeryReportCommonFilter @submit="handleFiltering" />
</Dialog>
<Dialog v-model:open="isHistoryDialogOpen" title="History">
<AppSurgeryReportCommonHistoryDialog />
</Dialog>
<RecordConfirmation v-model:open="isRecordConfirmationOpen" action="delete" :record="recItem"
@confirm="handleConfirmDelete" @cancel="handleCancelConfirmation">
<template #default="{ record }">
<div class="text-sm">
<p>
<strong>ID:</strong>
{{ record?.id }}
</p>
<p v-if="record?.firstName">
<strong>Nama:</strong>
{{ record.firstName }}
</p>
<p v-if="record?.code">
<strong>Kode:</strong>
{{ record.cellphone }}
</p>
</div>
</template>
</RecordConfirmation>
</div>
</template>
@@ -0,0 +1,152 @@
<script setup lang="ts">
import { useRouter } from 'vue-router'
import type { ExposedForm } from '~/types/form'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import { toast } from '~/components/pub/ui/toast'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { TherapyProtocolMedicRehabilitationSchema, TherapyProtocolSchema } from '~/schemas/therapy-protocol.schema'
import { handleActionSave } from '~/handlers/therapy-protocol.handler'
// #region Props & Emits
const props = defineProps<{
callbackUrl?: string
}>()
// form related state
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const inputForm = ref<ExposedForm<any> | null>(null)
// #endregion
// #region State & Computed
const router = useRouter()
const isConfirmationOpen = ref(false)
// #endregion
// #region Lifecycle Hooks
// #endregion
// #region Functions
function goBack() {
router.go(-1)
}
async function handleConfirmAdd() {
const inputData: any = await composeFormData()
const response = await handleActionSave(
inputData,
() => { },
() => { },
toast,
)
const data = (response?.body?.data ?? null)
if (!data) return
goBack()
}
async function composeFormData(): Promise<any> {
const [input,] = await Promise.all([
inputForm.value?.validate(),
])
const results = [input]
const allValid = results.every((r) => r?.valid)
// exit, if form errors happend during validation
if (!allValid) return Promise.reject('Form validation failed')
const formData = input?.values
formData.medicalDiagnoses = JSON.stringify(formData.medicalDiagnoses)
formData.functionDiagnoses = JSON.stringify(formData.functionDiagnoses)
formData.procedures = JSON.stringify(formData.procedures)
formData.encounter_id = encounterId
return new Promise((resolve) => resolve(formData))
}
// #endregion region
// #region Utilities & event handlers
async function handleActionClick(eventType: string) {
if (eventType === 'submit') {
isConfirmationOpen.value = true
}
if (eventType === 'back') {
if (props.callbackUrl) return navigateTo(props.callbackUrl)
goBack()
}
}
function handleCancelAdd() {
isConfirmationOpen.value = false
}
// #endregion
// #region Watchers
// #endregion
const initial = {
// Required String Fields
form1ExaminationDate: "2025-11-06",
form1Diagnose: 'Awwww',
form1TherapyRequest: 'Awwww',
form1TargetPeriod: 4,
form1TherapyTarget: 'Awwww',
form2RelationshipToInsured: 'child',
anamnesis: 'Bobo aja wak',
form2PhysicalExamination: 'Awwww',
medicalDiagnoses: [
{
id: 3,
code: "PROC002",
name: "Cesarean section"
}
],
functionDiagnoses: [
{
id: 3,
code: "PROC002",
name: "Cesarean section"
}
],
procedures: [
{
id: 5,
code: "PROC0100",
name: "Physical therapy session"
}
],
supportingExams: 'Awwww',
evaluation: 'Awwww',
instruction: 'Awwww',
workCauseStatus: 'TIDAK',
form3ExaminationDate: "2025-11-06",
form3Diagnose: 'Awwww',
form3TherapyRequest: 'Awwww',
form3ProgramActivities: ['Menonton Kakek Meninggoy',],
}
</script>
<template>
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">Tambah</div>
<AppTherapyProtocolEntry
ref="inputForm"
:schema="TherapyProtocolMedicRehabilitationSchema"
:resume-arrangement-type="inputForm?.values.arrangement"
:initial-values="initial"
/>
<div class="my-2 flex justify-end py-2">
<Action :enable-draft="false"
@click="handleActionClick"/>
</div>
<Confirmation
v-model:open="isConfirmationOpen"
title="Simpan Data"
message="Apakah Anda yakin ingin menyimpan data ini?"
confirm-text="Simpan"
@confirm="handleConfirmAdd"
@cancel="handleCancelAdd"
/>
</template>
@@ -0,0 +1,115 @@
<script setup lang="ts">
import type { ExposedForm } from '~/types/form';
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { ActionEvents } from '~/components/pub/my-ui/data/types'
// #region Props & Emits
const props = defineProps<{
callbackUrl?: string
}>()
// form related state
const personPatientForm = ref<ExposedForm<any> | null>(null)
// #endregion
// #region State & Computed
const router = useRouter()
const isConfirmationOpen = ref(false)
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const recDate = ref<any>(null)
// #endregion
// #region Lifecycle Hooks
// #endregion
// #region Functions
function goBack() {
router.go(-1)
}
async function handleConfirmAdd() {
// handleActionClick('submit')
console.log(`tersubmit wak`)
}
function handleCancelAdd() {
isConfirmationOpen.value = false
}
// #endregion region
// #region Utilities & event handlers
async function handleActionClick(eventType: string) {
if (eventType === 'submit') {
isConfirmationOpen.value = true
// const patient: Patient = await composeFormData()
// let createdPatientId = 0
// const response = await handleActionSave(
// patient,
// () => {},
// () => {},
// toast,
// )
// const data = (response?.body?.data ?? null) as PatientBase | null
// if (!data) return
// createdPatientId = data.id
// If has callback provided redirect to callback with patientData
// if (props.callbackUrl) {
// await navigateTo(props.callbackUrl + '?patient-id=' + patient.id)
// return
// }
// Navigate to patient list or show success message
// await navigateTo('/outpatient/encounter')
// return
}
if (eventType === 'back') {
if (props.callbackUrl) {
await navigateTo(props.callbackUrl)
return
}
goBack()
// handleCancelForm()
}
}
// #endregion
// #region Provide
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('rec_date', recDate) // for divergence if we trigger same action on same Record Item multiple times
// #endregion
// #region Watchers
watch([recId, recAction, recDate], () => {
switch (recAction.value) {
case ActionEvents.showConfirmVerify:
handleActionClick('submit')
break
}
})
// #endregion
</script>
<template>
<AppTherapyProtocolDetail />
<Confirmation
v-model:open="isConfirmationOpen"
title="Konfirmasi"
message="Apakah Anda yakin ingin Konfirmasi data ini?"
confirm-text="Konfirmasi"
@confirm="handleConfirmAdd"
@cancel="handleCancelAdd"
/>
</template>
@@ -0,0 +1,123 @@
<script setup lang="ts">
import type { ExposedForm } from '~/types/form';
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { getDetail } from '~/services/therapy-protocol.service';
import { handleActionEdit } from '~/handlers/therapy-protocol.handler'
import { TherapyProtocolMedicRehabilitationSchema } from '~/schemas/therapy-protocol.schema';
// #region Props & Emits
const props = defineProps<{
callbackUrl?: string
}>()
// form related state
const inputForm = ref<ExposedForm<any> | null>(null)
// #endregion
// #region State & Computed
const router = useRouter()
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const therapyId = typeof route.params.therapy_protocol_id == 'string' ? parseInt(route.params.therapy_protocol_id) : 0
const isConfirmationOpen = ref(false)
// #endregion
// #region Lifecycle Hooks
onMounted(async () => {
const result = await getDetail(therapyId)
if (result.success) {
const currentValue = result.body?.data || {}
currentValue.medicalDiagnoses = await JSON.parse(currentValue.medicalDiagnoses)
currentValue.functionDiagnoses = await JSON.parse(currentValue.functionDiagnoses)
currentValue.procedures = await JSON.parse(currentValue.procedures)
console.log(currentValue)
inputForm.value?.setValues(currentValue)
}
})
// #endregion
// #region Functions
function goBack() {
router.go(-1)
}
async function handleConfirmAdd() {
const inputData: any = await composeFormData()
const response = await handleActionEdit(
inputData,
therapyId,
() => { },
() => { },
toast,
)
const data = (response?.body?.data ?? null)
if (!data) return
goBack()
}
async function composeFormData(): Promise<any> {
const [input,] = await Promise.all([
inputForm.value?.validate(),
])
const results = [input]
const allValid = results.every((r) => r?.valid)
// exit, if form errors happend during validation
if (!allValid) return Promise.reject('Form validation failed')
const formData = input?.values
formData.medicalDiagnoses = JSON.stringify(formData.medicalDiagnoses)
formData.functionDiagnoses = JSON.stringify(formData.functionDiagnoses)
formData.procedures = JSON.stringify(formData.procedures)
formData.encounter_id = encounterId
return new Promise((resolve) => resolve(formData))
}
// #endregion region
// #region Utilities & event handlers
async function handleActionClick(eventType: string) {
if (eventType === 'submit') {
isConfirmationOpen.value = true
}
if (eventType === 'back') {
if (props.callbackUrl) return navigateTo(props.callbackUrl)
goBack()
}
}
function handleCancelAdd() {
isConfirmationOpen.value = false
}
// #endregion
// #region Watchers
// #endregion
</script>
<template>
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">Edit</div>
<AppTherapyProtocolEntry
ref="inputForm"
:schema="TherapyProtocolMedicRehabilitationSchema"
:resume-arrangement-type="inputForm?.values.arrangement"
/>
<div class="my-2 flex justify-end py-2">
<Action :enable-draft="false"
@click="handleActionClick"/>
</div>
<Confirmation
v-model:open="isConfirmationOpen"
title="Simpan Data"
message="Apakah Anda yakin ingin menyimpan data ini?"
confirm-text="Simpan"
@confirm="handleConfirmAdd"
@cancel="handleCancelAdd"
/>
</template>
@@ -0,0 +1,178 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
import type { Summary } from '~/components/pub/my-ui/summary-card/type'
// #region Imports
import { Calendar, Hospital, UserCheck, UsersRound } from 'lucide-vue-next'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
import { ActionEvents } from '~/components/pub/my-ui/data/types'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import SummaryCard from '~/components/pub/my-ui/summary-card/summary-card.vue'
import { usePaginatedList } from '~/composables/usePaginatedList'
import { getPatients, removePatient } from '~/services/patient.service'
import DetailRow from '~/components/pub/my-ui/form/view/detail-row.vue'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import type { Encounter } from '~/models/encounter'
import { cn } from '~/lib/utils'
import { CalendarDate, DateFormatter, getLocalTimeZone } from '@internationalized/date'
import type { DateRange } from 'radix-vue'
// #endregion
// Props
interface Props {
}
const props = defineProps<Props>()
// #endregion
// #region State
const isVerifyDialogOpen = ref(false)
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
entityName: 'patient',
})
const df = new DateFormatter('en-US', {
dateStyle: 'medium',
})
const dateValue = ref({
start: new CalendarDate(2022, 1, 20),
end: new CalendarDate(2022, 1, 20).add({ days: 20 }),
}) as Ref<DateRange>
const summaryLoading = ref(false)
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
// #endregion
// #region Lifecycle Hooks
onMounted(() => {
getPatientSummary()
})
// #endregion
// #region Functions
async function getPatientSummary() {
try {
summaryLoading.value = true
await new Promise((resolve) => setTimeout(resolve, 500))
} catch (error) {
console.error('Error fetching patient summary:', error)
} finally {
summaryLoading.value = false
}
}
async function handleConfirmAdd() {
isVerifyDialogOpen.value = true
}
async function handleActionClick(eventType: string) {
if (eventType === 'submit') {
// const patient: Patient = await composeFormData()
// let createdPatientId = 0
// const response = await handleActionSave(
// patient,
// () => {},
// () => {},
// toast,
// )
// const data = (response?.body?.data ?? null) as PatientBase | null
// if (!data) return
// createdPatientId = data.id
// If has callback provided redirect to callback with patientData
// if (props.callbackUrl) {
// await navigateTo(props.callbackUrl + '?patient-id=' + patient.id)
// return
// }
// Navigate to patient list or show success message
// await navigateTo('/outpatient/encounter')
// return
}
if (eventType === 'back') {
isVerifyDialogOpen.value = false
}
}
// #endregion
// #region Provide
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('table_data_loader', isLoading)
// #endregion
// #region Watchers
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
navigateTo({
name: 'therapy-protocol-id-detail',
params: { id: recId.value },
})
break
case ActionEvents.showEdit:
navigateTo({
name: 'therapy-protocol-id-edit',
params: { id: recId.value },
})
break
case ActionEvents.showConfirmVerify:
// Trigger confirmation modal open
handleConfirmAdd()
break
case ActionEvents.showPrint:
navigateTo('https://google.com', {
external: true,
open: { target: "_blank" },
});
break
}
})
// #endregion
</script>
<template>
<Popover>
<PopoverTrigger as-child>
<Button variant="outline" :class="cn('mb-3 w-[280px] justify-start text-left font-normal',
!dateValue && 'text-muted-foreground')">
<CalendarIcon class="mr-2 h-4 w-4" />
<template v-if="dateValue.start">
<template v-if="dateValue.end">
{{ df.format(dateValue.start.toDate(getLocalTimeZone())) }} -
{{ df.format(dateValue.end.toDate(getLocalTimeZone())) }}
</template>
<template v-else>
{{ df.format(dateValue.start.toDate(getLocalTimeZone())) }}
</template>
</template>
<template v-else> Pick a date </template>
</Button>
</PopoverTrigger>
<PopoverContent class="w-auto p-0">
<RangeCalendar v-model="dateValue" initial-focus :number-of-months="2"
@update:start-value="(startDate) => (dateValue.start = startDate)" />
</PopoverContent>
</Popover>
<AppTherapyProtocolHistoryDialog
:data="data"
:pagination-meta="paginationMeta"
@page-change="handlePageChange" />
</template>
@@ -0,0 +1,262 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
import type { Summary } from '~/components/pub/my-ui/summary-card/type'
// #region Imports
import { Calendar, Hospital, UserCheck, UsersRound } from 'lucide-vue-next'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
import { ActionEvents } from '~/components/pub/my-ui/data/types'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import SummaryCard from '~/components/pub/my-ui/summary-card/summary-card.vue'
import { usePaginatedList } from '~/composables/usePaginatedList'
import { getList, remove } from '~/services/therapy-protocol.service'
import DetailRow from '~/components/pub/my-ui/form/view/detail-row.vue'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import type { Encounter } from '~/models/encounter'
import { cn } from '~/lib/utils'
import { CalendarDate, DateFormatter, getLocalTimeZone } from '@internationalized/date'
import type { DateRange } from 'radix-vue'
import type { ExposedForm } from '~/types/form'
import { VerificationSchema } from '~/schemas/verification.schema'
import { handleActionSave } from '~/handlers/therapy-protocol.handler'
import { toast } from '~/components/pub/ui/toast'
import DocPreviewDialog from '~/components/pub/my-ui/modal/doc-preview-dialog.vue'
// #endregion
// Props
interface Props {
encounter: Encounter
}
const props = defineProps<Props>()
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
// #endregion
// #region State
const isVerifyDialogOpen = ref(false)
const isHistoryDialogOpen = ref(false)
const isPatientInTherapy = ref(false)
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
fetchFn: (params) => getList({ ...params }),
entityName: 'therapy-protocol',
})
const df = new DateFormatter('en-US', {
dateStyle: 'medium',
})
const dateValue = ref({
start: new CalendarDate(2022, 1, 20),
end: new CalendarDate(2022, 1, 20).add({ days: 20 }),
}) as Ref<DateRange>
const isRecordConfirmationOpen = ref(false)
const isDocPreviewDialogOpen = ref(false)
const summaryLoading = ref(false)
const inputForm = ref<ExposedForm<any> | null>(null)
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const timestamp = ref<number>(0)
const isCaptchaValid = ref(false)
provide('isCaptchaValid', isCaptchaValid)
const headerPrep: HeaderPrep = {
title: "Protokol Terapi",
icon: 'i-lucide-newspaper',
addNav: {
label: "Protokol Terapi",
onClick: () => navigateTo({
name: 'rehab-encounter-id-therapy-protocol-add',
}),
},
}
// #endregion
// #region Lifecycle Hooks
onMounted(() => {
getPatientSummary()
const isInTherapy = false // TODO: determine if patient is in therapy
handleIsPatientInTherapy(isInTherapy)
})
// #endregion
// #region Functions
function handleIsPatientInTherapy(value: boolean) {
if (value) {
isPatientInTherapy.value = true
} else {
isPatientInTherapy.value = false
}
}
async function handleOpenHistory() {
isHistoryDialogOpen.value = true
console.log(`jalan history`)
}
async function getPatientSummary() {
try {
summaryLoading.value = true
await new Promise((resolve) => setTimeout(resolve, 500))
} catch (error) {
console.error('Error fetching patient summary:', error)
} finally {
summaryLoading.value = false
}
}
async function handleVerify() {
isVerifyDialogOpen.value = true
}
async function handleConfirmVerify() {
const inputData: any = await composeFormData()
const response = await handleActionSave(
inputData,
() => { },
() => { },
toast,
)
const data = (response?.body?.data ?? null)
if (!data) return
isVerifyDialogOpen.value = false
}
async function composeFormData(): Promise<any> {
const [input,] = await Promise.all([
inputForm.value?.validate(),
])
const results = [input]
const allValid = results.every((r) => r?.valid)
// exit, if form errors happend during validation
if (!allValid) return Promise.reject('Form validation failed')
const formData = input?.values
// formData.encounter_id = encounterId
return new Promise((resolve) => resolve(formData))
}
// #endregion region
// #region Utilities & event handlers
async function handleActionClick(eventType: string) {
if (eventType === 'submit') {
handleConfirmVerify()
}
if (eventType === 'back') {
isVerifyDialogOpen.value = false
}
}
// #endregion
// #region Provide
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('timestamp', timestamp)
provide('table_data_loader', isLoading)
// #endregion
// #region Watchers
watch([recId, recAction, timestamp], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
navigateTo({
name: 'therapy-protocol-id-detail',
params: { id: recId.value },
})
break
case ActionEvents.showEdit:
navigateTo({
name: 'rehab-encounter-id-therapy-protocol-therapy_protocol_id-edit',
params: { therapy_protocol_id: recId.value },
})
break
case ActionEvents.showConfirmVerify:
// Trigger confirmation modal open
handleVerify()
break
case ActionEvents.showPrint:
isDocPreviewDialogOpen.value = true
break
}
})
// #endregion
</script>
<template>
<Header :prep="{ ...headerPrep }" />
<section class="mb-5 flex justify-between items-center">
<!-- DATE RANGE -->
<Popover>
<PopoverTrigger as-child>
<Button variant="outline" :class="cn('w-[280px] justify-start text-left font-normal',
!dateValue && 'text-muted-foreground')">
<CalendarIcon class="mr-2 h-4 w-4" />
<template v-if="dateValue.start">
<template v-if="dateValue.end">
{{ df.format(dateValue.start.toDate(getLocalTimeZone())) }} -
{{ df.format(dateValue.end.toDate(getLocalTimeZone())) }}
</template>
<template v-else>
{{ df.format(dateValue.start.toDate(getLocalTimeZone())) }}
</template>
</template>
<template v-else> Pick a date </template>
</Button>
</PopoverTrigger>
<PopoverContent class="w-auto p-0">
<RangeCalendar v-model="dateValue" initial-focus :number-of-months="2"
@update:start-value="(startDate) => (dateValue.start = startDate)" />
</PopoverContent>
</Popover>
<!-- HISTORY -->
<Button variant="outline" :class="cn('',)" @click="handleOpenHistory">
<Icon name="i-lucide-history" class="h-4 w-4" />
History
</Button>
</section>
<AppTherapyProtocolCommonBannerPatientInTherapy
v-if="isPatientInTherapy"
class="mb-5" />
<AppTherapyProtocolList
:data="data"
:pagination-meta="paginationMeta"
@page-change="handlePageChange"/>
<Dialog v-model:open="isVerifyDialogOpen" title="Verifikasi">
<AppTherapyProtocolVerifyDialog
ref="inputForm"
:schema="VerificationSchema"
/>
<div class="flex justify-end">
<Action v-show="isCaptchaValid" :enable-draft="false" @click="handleActionClick" />
</div>
</Dialog>
<Dialog v-model:open="isHistoryDialogOpen" title="History" size="full">
<ContentTherapyProtocolHistoryList />
</Dialog>
<Dialog v-model:open="isDocPreviewDialogOpen" title="Preview Dokumen" size="2xl">
<!-- <DocPreviewDialog :link="recItem.url" /> -->
<DocPreviewDialog :link="`https://www.antennahouse.com/hubfs/xsl-fo-sample/pdf/basic-link-1.pdf`" />
</Dialog>
</template>
@@ -0,0 +1,77 @@
<script setup lang="ts">
import type { LinkItem, ListItemDto } from './types'
import { ActionEvents } from './types'
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('rec_id')!
const recAction = inject<Ref<string>>('rec_action')!
const recItem = inject<Ref<any>>('rec_item')!
const activeKey = ref<string | null>(null)
const linkItems: LinkItem[] = [
{
label: 'Detail',
onClick: () => {
detail()
},
icon: 'i-lucide-eye',
},
{
label: 'Print',
onClick: () => {
print()
},
icon: 'i-lucide-printer',
},
]
function detail() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showDetail
recItem.value = props.rec
}
function print() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showPrint
recItem.value = props.rec
}
</script>
<template>
<div>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<SidebarMenuButton
size="lg"
class="data-[state=open]:text-sidebar-accent-foreground data-[state=open]:bg-white dark:data-[state=open]:bg-slate-800"
>
<Icon
name="i-lucide-chevrons-up-down"
class="ml-auto size-4"
/>
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
class="w-[--radix-dropdown-menu-trigger-width] min-w-40 rounded-lg border border-slate-200 bg-white text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
align="end"
>
<DropdownMenuGroup>
<DropdownMenuItem
v-for="item in linkItems"
:key="item.label"
class="hover:bg-gray-100 dark:hover:bg-slate-700"
@click="item.onClick"
@mouseenter="activeKey = item.label"
@mouseleave="activeKey = null"
>
<Icon :name="item.icon ?? ''" />
<span :class="activeKey === item.label ? 'text-sidebar-accent-foreground' : ''">{{ item.label }}</span>
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
</template>
@@ -0,0 +1,106 @@
<script setup lang="ts">
import type { LinkItem, ListItemDto } from './types'
import { ActionEvents } from './types'
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('rec_id')!
const recAction = inject<Ref<string>>('rec_action')!
const recItem = inject<Ref<any>>('rec_item')!
const timestamp = inject<Ref<any>>('timestamp')!
const activeKey = ref<string | null>(null)
const linkItems: LinkItem[] = [
{
label: 'Detail',
onClick: () => {
detail()
},
icon: 'i-lucide-eye',
},
{
label: 'Edit',
onClick: () => {
edit()
},
icon: 'i-lucide-pencil',
},
{
label: 'Verifikasi',
onClick: () => {
verify()
},
icon: 'i-lucide-shield-check',
},
{
label: 'Print',
onClick: () => {
print()
},
icon: 'i-lucide-printer',
},
]
function detail() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showDetail
recItem.value = props.rec
}
function edit() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showEdit
recItem.value = props.rec
}
function verify() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showConfirmVerify
recItem.value = props.rec
timestamp.value = new Date().getTime()
}
function print() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showPrint
recItem.value = props.rec
}
</script>
<template>
<div>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<SidebarMenuButton
size="lg"
class="data-[state=open]:text-sidebar-accent-foreground data-[state=open]:bg-white dark:data-[state=open]:bg-slate-800"
>
<Icon
name="i-lucide-chevrons-up-down"
class="ml-auto size-4"
/>
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
class="w-[--radix-dropdown-menu-trigger-width] min-w-40 rounded-lg border border-slate-200 bg-white text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
align="end"
>
<DropdownMenuGroup>
<DropdownMenuItem
v-for="item in linkItems"
:key="item.label"
class="hover:bg-gray-100 dark:hover:bg-slate-700"
@click="item.onClick"
@mouseenter="activeKey = item.label"
@mouseleave="activeKey = null"
>
<Icon :name="item.icon ?? ''" />
<span :class="activeKey === item.label ? 'text-sidebar-accent-foreground' : ''">{{ item.label }}</span>
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
</template>
@@ -0,0 +1,64 @@
<script setup lang="ts">
import type { LinkItem, ListItemDto } from './types'
import { ActionEvents } from './types'
const props = defineProps<{
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('rec_id')!
const recAction = inject<Ref<string>>('rec_action')!
const recItem = inject<Ref<any>>('rec_item')!
const activeKey = ref<string | null>(null)
const linkItems: LinkItem[] = [
{
label: 'Process',
onClick: () => {
process()
},
icon: 'i-lucide-arrow-right',
},
]
function process() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showProcess
recItem.value = props.rec
}
</script>
<template>
<div>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<SidebarMenuButton
size="lg"
class="data-[state=open]:text-sidebar-accent-foreground data-[state=open]:bg-white dark:data-[state=open]:bg-slate-800"
>
<Icon
name="i-lucide-chevrons-up-down"
class="ml-auto size-4"
/>
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
class="w-[--radix-dropdown-menu-trigger-width] min-w-40 rounded-lg border border-slate-200 bg-white text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
align="end"
>
<DropdownMenuGroup>
<DropdownMenuItem
v-for="item in linkItems"
:key="item.label"
class="hover:bg-gray-100 dark:hover:bg-slate-700"
@click="item.onClick"
@mouseenter="activeKey = item.label"
@mouseleave="activeKey = null"
>
<Icon :name="item.icon ?? ''" />
<span :class="activeKey === item.label ? 'text-sidebar-accent-foreground' : ''">{{ item.label }}</span>
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
</template>
@@ -0,0 +1,30 @@
<script setup lang="ts">
import { ActionEvents, type ListItemDto } from '~/components/pub/my-ui/data/types';
const props = defineProps<{
url: string
btnTxt?: string
rec: ListItemDto
}>()
const recId = inject<Ref<number>>('rec_id')!
const recAction = inject<Ref<string>>('rec_action')!
const recItem = inject<Ref<any>>('rec_item')!
const timestamp = inject<Ref<any>>('timestamp')!
function handlePrint() {
recId.value = props.rec.id || 0
recAction.value = ActionEvents.showPrint
recItem.value = props.rec
timestamp.value = new Date().toISOString()
}
</script>
<template>
<Button
class="gap-3 items-center border-orange-400 text-orange-400"
variant="outline" @click="handlePrint">
<Icon name="i-lucide-printer" class="h-4 w-4" />
{{ props.btnTxt || 'Preview' }}
</Button>
</template>
+1
View File
@@ -88,6 +88,7 @@ export const ActionEvents = {
showCancel: 'showCancel',
showVerify: 'showVerify',
showValidate: 'showValidate',
showConfirmVerify: 'showConfirmVerify',
showPrint: 'showPrint',
}
@@ -1,13 +1,17 @@
<script setup lang="ts">
defineProps<{
import { cn } from '~/lib/utils';
const props = defineProps<{
label: string
class?: string
labelClass?: string
}>()
</script>
<template>
<div class="flex flex-col gap-1 lg:grid lg:grid-cols-[180px_minmax(0,1fr)] lg:gap-x-3">
<div :class="cn(`flex flex-col gap-1 lg:grid lg:grid-cols-[180px_minmax(0,1fr)] lg:gap-x-3`, props.class)">
<!-- Label -->
<span class="text-md font-normal text-muted-foreground">
<span :class="cn(`text-md font-normal text-muted-foreground`, props.labelClass)">
{{ label }}
</span>
+1 -1
View File
@@ -66,4 +66,4 @@ const isOpen = computed({
</DialogDescription>
</DialogContent>
</Dialog>
</template>
</template>
@@ -50,8 +50,11 @@ const value = ref({
end: todayCalendar,
}) as Ref<DateRange>
function onInput(event: Event) {
props.refSearchNav?.onInput((event.target as HTMLInputElement).value)
}
function onFilterClick() {
console.log('Search:', searchQuery.value)
console.log('Date Range:', dateRange.value)
props.refSearchNav?.onClick()
}
@@ -60,9 +63,11 @@ function onFilterClick() {
<template>
<header>
<div class="flex items-center gap-2 mb-4 2xl:mb-5">
<div class="relative w-64">
<div v-if="refSearchNav" class="relative w-64">
<Search class="absolute left-3 top-1/2 size-4 -translate-y-1/2 text-gray-400" />
<Input v-model="searchQuery" type="text" placeholder="Cari Nama /No.RM" class="pl-9" />
<Input v-model="searchQuery" @input="onInput"
type="text" placeholder="Cari .." class="pl-9" />
</div>
<Popover>
@@ -101,7 +106,7 @@ function onFilterClick() {
</Button>
<DropdownMenu v-show="props.enableExport">
<DropdownMenuTrigger as-child>
<DropdownMenuTrigger v-show="props.enableExport" as-child>
<Button variant="outline" class="ml-auto border-orange-500 text-orange-600 hover:bg-orange-50">
<Icon name="i-lucide-download" class="h-4 w-4" />
Ekspor
+24
View File
@@ -0,0 +1,24 @@
// Handlers
import { genCrudHandler } from '~/handlers/_handler'
// Services
import { create, update, remove } from '~/services/surgery-report.service'
export const {
recId,
recAction,
recItem,
isReadonly,
isProcessing,
isFormEntryDialogOpen,
isRecordConfirmationOpen,
onResetState,
handleActionSave,
handleActionEdit,
handleActionRemove,
handleCancelForm,
} = genCrudHandler({
create,
update,
remove,
})
+24
View File
@@ -0,0 +1,24 @@
// Handlers
import { genCrudHandler } from '~/handlers/_handler'
// Services
import { create, update, remove } from '~/services/therapy-protocol.service'
export const {
recId,
recAction,
recItem,
isReadonly,
isProcessing,
isFormEntryDialogOpen,
isRecordConfirmationOpen,
onResetState,
handleActionSave,
handleActionEdit,
handleActionRemove,
handleCancelForm,
} = genCrudHandler({
create,
update,
remove,
})
+62
View File
@@ -425,3 +425,65 @@ export const supportingDocOpt = [
{ label: 'Data Penunjang', value: 'encounter-support' },
{ label: 'Lain - Lain', value: 'encounter-other' },
]
export type SurgeryType = "kecil" | "sedang" | "besar" | "khusus"
export const SurgeryTypeOptList: { label: string; value: SurgeryType }[] = [
{ label: 'Kecil', value: 'kecil' },
{ label: 'Sedang', value: 'sedang' },
{ label: 'Besar', value: 'besar' },
{ label: 'Khusus', value: 'khusus' },
]
export type BillingCodeType = "general" | "regional" | "local"
export const BillingCodeTypeOptList: { label: string; value: BillingCodeType }[] = [
{ label: 'General', value: 'general' },
{ label: 'Regional', value: 'regional' },
{ label: 'Local', value: 'local' },
]
export type SurgerySystemType = "cito" | "urgent" | "efektif" | "khusus"
export const SurgerySystemTypeOptList: { label: string; value: SurgerySystemType }[] = [
{ label: 'Cito', value: 'cito' },
{ label: 'Urgent', value: 'urgent' },
{ label: 'Efektif', value: 'efektif' },
{ label: 'Khusus', value: 'khusus' },
]
export type DissectionType = "bersih" | "bersih terkontaminasi" | "terkontaminasi kotor" | "kotor"
export const DissectionTypeOptList: { label: string; value: DissectionType }[] = [
{ label: 'Bersih', value: 'bersih' },
{ label: 'Bersih terkontaminasi', value: 'bersih terkontaminasi' },
{ label: 'Terkontaminasi kotor', value: 'terkontaminasi kotor' },
{ label: 'Kotor', value: 'kotor' },
]
export type SurgeryOrderType = "satu" | "ulangan"
export const SurgeryOrderTypeOptList: { label: string; value: SurgeryOrderType }[] = [
{ label: 'Satu', value: 'satu' },
{ label: 'Ulangan', value: 'ulangan' },
]
export type BirthDescriptionType = "lahir hidup" | "lahir mati"
export const BirthDescriptionTypeOptList: { label: string; value: BirthDescriptionType }[] = [
{ label: 'Lahir Hidup', value: 'lahir hidup' },
{ label: 'Lahir Mati', value: 'lahir mati' },
]
export type BirthPlaceDescriptionType = "rssa" | "bidan luar" | "dokter luar" | "dukun bayi" | "puskesmas" | "paramedis luar"
export const BirthPlaceDescriptionTypeOptList: { label: string; value: BirthPlaceDescriptionType }[] = [
{ label: 'RSSA', value: 'rssa' },
{ label: 'Bidan luar', value: 'bidan luar' },
{ label: 'Dokter luar', value: 'dokter luar' },
{ label: 'Dukun bayi', value: 'dukun bayi' },
{ label: 'Puskesmas', value: 'puskesmas' },
{ label: 'Paramedis luar', value: 'paramedis luar' },
]
export type SpecimenType = "pa" | "mikrobiologi" | "laborat" | "tidak perlu"
export const SpecimenTypeOptList: { label: string; value: SpecimenType }[] = [
{ label: 'PA', value: 'pa' },
{ label: 'Mikrobiologi', value: 'mikrobiologi' },
{ label: 'Laborat', value: 'laborat' },
{ label: 'Tidak perlu', value: 'tidak perlu' },
]
+1 -1
View File
@@ -160,4 +160,4 @@ export function unauthorizedToast() {
description: 'You are not authorized to perform this action.',
variant: 'destructive',
})
}
}
+37
View File
@@ -0,0 +1,37 @@
import { type Base, genBase } from "./_base"
import { genDoctor, type Doctor } from "./doctor"
import { genEncounter, type Encounter } from "./encounter"
import { genSpecialist, type Specialist } from "./specialist"
import { genSubspecialist, type Subspecialist } from "./subspecialist"
import { genUnit, type Unit } from "./unit"
export interface SurgeryReport extends Base {
encounter_id: number
encounter: Encounter
unit_id: number
unit: Unit
specialist_id: number
specialist: Specialist
subspecialist_id: number
subspecialist: Subspecialist
doctor_id: number
doctor: Doctor
date: ''
}
export function genSurgeryReport(): SurgeryReport {
return {
...genBase(),
encounter_id: 0,
encounter: genEncounter(),
unit_id: 0,
unit: genUnit(),
specialist_id: 0,
specialist: genSpecialist(),
subspecialist_id: 0,
subspecialist: genSubspecialist(),
doctor_id: 0,
doctor: genDoctor(),
date: ''
}
}
@@ -0,0 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Update Surat Kontrol',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/patient']
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// navigateTo('/403')
// }
// Define permission-based computed properties
// const canRead = hasReadAccess(roleAccess)
const canRead = true
</script>
<template>
<div>
<div v-if="canRead">
<ContentSurgeryReportEntry />
</div>
<Error v-else :status-code="403" />
</div>
</template>
@@ -0,0 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Detail Surat Kontrol',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/patient']
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// navigateTo('/403')
// }
// Define permission-based computed properties
// const canRead = hasReadAccess(roleAccess)
const canRead = true
</script>
<template>
<div>
<div v-if="canRead">
<ContentSurgeryReportDetail :patient-id="Number(route.params.id)" />
</div>
<Error v-else :status-code="403" />
</div>
</template>
@@ -0,0 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Tambah Surat Kontrol',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, getPagePermissions } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// navigateTo('/403')
// }
// Define permission-based computed properties
const pagePermission = getPagePermissions(roleAccess)
const callbackUrl = route.query['return-path'] as string | undefined
</script>
<template>
<div>
<div v-if="pagePermission.canRead">
<ContentSurgeryReportEntry :callback-url="callbackUrl" />
</div>
<Error v-else :status-code="403" />
</div>
</template>
@@ -0,0 +1,44 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Protokol Terapi',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// throw createError({
// statusCode: 403,
// statusMessage: 'Access denied',
// })
// }
// Define permission-based computed properties
const canCreate = true // hasCreateAccess(roleAccess)
</script>
<template>
<div v-if="canCreate">
<ContentTherapyProtocolEdit />
</div>
<Error
v-else
:status-code="403"
/>
</template>
@@ -0,0 +1,44 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Protokol Terapi',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// throw createError({
// statusCode: 403,
// statusMessage: 'Access denied',
// })
// }
// Define permission-based computed properties
const canCreate = true // hasCreateAccess(roleAccess)
</script>
<template>
<div v-if="canCreate">
<ContentTherapyProtocolAdd />
</div>
<Error
v-else
:status-code="403"
/>
</template>
@@ -0,0 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Detail Protokol Terapi',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// throw createError({
// statusCode: 403,
// statusMessage: 'Access denied',
// })
// }
// Define permission-based computed properties
const canCreate = true // hasCreateAccess(roleAccess)
</script>
<template>
<div v-if="canCreate">
<ContentTherapyProtocolDetail/>
</div>
<Error v-else :status-code="403" />
</template>
@@ -0,0 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Edit Protokol Terapi',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// throw createError({
// statusCode: 403,
// statusMessage: 'Access denied',
// })
// }
// Define permission-based computed properties
const canCreate = true // hasCreateAccess(roleAccess)
</script>
<template>
<div v-if="canCreate">
<ContentTherapyProtocolEdit />
</div>
<Error v-else :status-code="403" />
</template>
@@ -0,0 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Tambah Protokol Terapi',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
// if (!hasAccess) {
// throw createError({
// statusCode: 403,
// statusMessage: 'Access denied',
// })
// }
// Define permission-based computed properties
const canCreate = true // hasCreateAccess(roleAccess)
</script>
<template>
<div v-if="canCreate">
<ContentTherapyProtocolAdd />
</div>
<Error v-else :status-code="403" />
</template>
+47
View File
@@ -0,0 +1,47 @@
import { z } from 'zod'
const SurgeryReportSchema = z.object({
sepStatus: z.string({
required_error: 'Mohon isi status SEP',
}).default('SEP Internal'),
unit_code: z.string({
required_error: 'Mohon isi Unit',
}),
specialist_code: z.string({
required_error: 'Mohon isi Spesialis',
}),
subspecialist_code: z.string({
required_error: 'Mohon isi Sub Spesialis',
}),
doctor_code: z.string({
required_error: 'Mohon isi DPJP',
}),
encounter_code: z.string().optional(),
date: z.string({
required_error: 'Mohon lengkapi Tanggal Kontrol',
})
.refine(
(date) => {
// Jika kosong, return false untuk required validation
if (!date || date.trim() === '') return false
// Jika ada isi, validasi format tanggal
try {
const dateObj = new Date(date)
// Cek apakah tanggal valid dan tahun >= 1900
return !isNaN(dateObj.getTime()) && dateObj.getFullYear() >= 1900
} catch {
return false
}
},
{
message: 'Mohon lengkapi Tanggal Kontrol dengan format yang valid',
},
)
.transform((dateStr) => new Date(dateStr).toISOString()),
})
type SurgeryReportFormData = z.infer<typeof SurgeryReportSchema>
export { SurgeryReportSchema }
export type { SurgeryReportFormData }
+159
View File
@@ -0,0 +1,159 @@
import { z } from 'zod'
const TherapyProtocolSchema = z.object({
examinationDate: z.string({
required_error: 'Pilih tanggal pemeriksaan',
}),
relationshipToInsured: z.enum(['spouse', 'child'], {
required_error: 'Pilih hubungan',
}),
anamnesis: z.string({
required_error: 'Mohon lengkapi catatan anamnesa',
}),
medicalHistory: z.string({
required_error: 'Mohon lengkapi catatan riwayat penyakit',
}),
medicationHistory: z.string({
required_error: 'Mohon lengkapi catatan riwayat obat',
}),
supportDiagnosis: z.array(
z.object({
diagnosis: z.string({
required_error: 'Isi diagnosis',
}),
}),
{
required_error: 'Isi diagnosis',
},
),
functionalDiagnosis: z.array(
z
.object({
diagnosis: z.string({}),
})
.optional(),
{
required_error: 'Isi diagnosis',
},
),
treatmentDiagnosis: z.array(
z.object({
diagnosis: z.string({
required_error: 'Isi diagnosis',
}),
}),
{
required_error: 'Isi diagnosis',
},
),
supportExamination: z.string({
required_error: 'Mohon lengkapi catatan pemeriksaan penunjang',
}),
recommendation: z.string({
required_error: 'Mohon lengkapi catatan anjuran',
}),
evaluation: z.string({
required_error: 'Mohon lengkapi catatan evaluasi',
}),
isWorkRelatedDisease: z.string({
required_error: 'Pilih apakah penyakit berkaitan dengan pekerjaan',
}),
})
const PickerItemSchema = z.object({
id: z.number().optional(),
code: z.string(),
name: z.string()
})
const TherapyProtocolMedicRehabilitationSchema = z.object({
form1ExaminationDate: z.string({
required_error: 'Pilih tanggal pemeriksaan',
}),
form1Diagnose: z.string({
required_error: 'Mohon lengkapi catatan diagnosa',
}),
form1TherapyRequest: z.string({
required_error: 'Mohon lengkapi catatan terapi',
}),
form1TargetPeriod: z.number({
required_error: 'Mohon lengkapi catatan terapi',
}),
form1TherapyTarget: z.string({
required_error: 'Mohon lengkapi catatan terapi',
}),
form2RelationshipToInsured: z.enum(['spouse', 'child'], {
required_error: 'Pilih hubungan',
}),
anamnesis: z.string({
required_error: 'Mohon lengkapi catatan anamnesa',
}),
form2PhysicalExamination: z.string({
required_error: 'Mohon lengkapi catatan pemeriksaan fisik',
}),
medicalDiagnoses: z.array(PickerItemSchema).default([]),
functionDiagnoses: z.array(PickerItemSchema).default([]),
procedures: z.array(PickerItemSchema).default([]),
supportingExams: z.string({
required_error: 'Mohon lengkapi catatan pemeriksaan penunjang',
}),
evaluation: z.string({
required_error: 'Mohon lengkapi catatan evaluasi',
}),
instruction: z.string({
required_error: 'Mohon lengkapi catatan anjuran',
}),
workCauseStatus: z.enum(['YA', 'TIDAK'], {
required_error: 'Pilih apakah penyakit berkaitan dengan pekerjaan',
}),
form3ExaminationDate: z.string({
required_error: 'Pilih tanggal pemeriksaan',
}),
form3Diagnose: z.string({
required_error: 'Mohon lengkapi catatan diagnosa',
}),
form3TherapyRequest: z.string({
required_error: 'Mohon lengkapi catatan terapi',
}),
form3ProgramActivities: z.array(
z.string({
required_error: 'Mohon lengkapi Program/Kegiatan',
}),
{
required_error: 'Isi Program/Kegiatan',
},
).default(['']),
})
// {
// "encounter_id": 4,
// "doctor_code": "doc-3",
// "anamnesis": "",
// "medicalDiagnoses": "", //json
// "functionDiagnoses": "", //json
// "procedures":"",
// "supportingExams":"",
// "instruction":"",
// "evaluation":"",
// "workCauseStatus":"YA",
// "frequency":1,
// "intervalUnit_code":"day",
// "duration":30,
// "durationUnit_code":"min"
// }
type TherapyProtocolFormData = z.infer<typeof TherapyProtocolSchema>
type TherapyProtocolMedicRehabilitationFormData = z.infer<typeof TherapyProtocolMedicRehabilitationSchema>
export { TherapyProtocolSchema, TherapyProtocolMedicRehabilitationSchema }
export type { TherapyProtocolFormData, TherapyProtocolMedicRehabilitationFormData }

Some files were not shown because too many files have changed in this diff Show More