fix(role): update role of encounter

This commit is contained in:
riefive
2025-11-14 11:11:09 +07:00
parent 8547373a17
commit bf69c80072
+30 -33
View File
@@ -18,7 +18,7 @@ import Consultation from '~/components/content/consultation/list.vue'
import ProtocolList from '~/components/app/chemotherapy/list.protocol.vue' import ProtocolList from '~/components/app/chemotherapy/list.protocol.vue'
import MedicineProtocolList from '~/components/app/chemotherapy/list.medicine.vue' import MedicineProtocolList from '~/components/app/chemotherapy/list.medicine.vue'
const authStore = useUserStore() const { getActiveRole } = useUserStore()
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
@@ -27,8 +27,8 @@ const props = defineProps<{
subClassCode?: 'reg' | 'rehab' | 'chemo' | 'emg' | 'eon' | 'op' | 'icu' | 'hcu' | 'vk' subClassCode?: 'reg' | 'rehab' | 'chemo' | 'emg' | 'eon' | 'op' | 'icu' | 'hcu' | 'vk'
}>() }>()
const activeRole = authStore.getActiveRole() const activeRole = getActiveRole()
const activePosition = getPositionAs(activeRole) const activePosition = ref(getPositionAs(activeRole))
const tabs = ref([] as any) const tabs = ref([] as any)
// activeTab selalu sinkron dengan query param // activeTab selalu sinkron dengan query param
@@ -159,43 +159,43 @@ const tabsRaws: TabItem[] = [
value: 'report', value: 'report',
label: 'Laporan Tindakan', label: 'Laporan Tindakan',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['chemo'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'patient-note', value: 'patient-note',
label: 'CPRJ', label: 'CPRJ',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'education-assessment', value: 'education-assessment',
label: 'Asesmen Kebutuhan Edukasi', label: 'Asesmen Kebutuhan Edukasi',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'consent', value: 'consent',
label: 'General Consent', label: 'General Consent',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'patient-note', value: 'patient-note',
label: 'CPRJ', label: 'CPRJ',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'prescription', value: 'prescription',
label: 'Order Obat', label: 'Order Obat',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
component: PrescriptionList, component: PrescriptionList,
}, },
{ {
@@ -203,56 +203,56 @@ const tabsRaws: TabItem[] = [
label: 'Order Alkes', label: 'Order Alkes',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'mcu-radiology', value: 'mcu-radiology',
label: 'Order Radiologi', label: 'Order Radiologi',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'mcu-lab-pc', value: 'mcu-lab-pc',
label: 'Order Lab PK', label: 'Order Lab PK',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'mcu-lab-micro', value: 'mcu-lab-micro',
label: 'Order Lab Mikro', label: 'Order Lab Mikro',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'mcu-lab-pa', value: 'mcu-lab-pa',
label: 'Order Lab PA', label: 'Order Lab PA',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'medical-action', value: 'medical-action',
label: 'Order Ruang Tindakan', label: 'Order Ruang Tindakan',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'mcu-result', value: 'mcu-result',
label: 'Hasil Penunjang', label: 'Hasil Penunjang',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'consultation', value: 'consultation',
label: 'Konsultasi', label: 'Konsultasi',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
component: Consultation, component: Consultation,
props: { encounter: data }, props: { encounter: data },
}, },
@@ -261,21 +261,21 @@ const tabsRaws: TabItem[] = [
label: 'Resume', label: 'Resume',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'control', value: 'control',
label: 'Surat Kontrol', label: 'Surat Kontrol',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'screening', value: 'screening',
label: 'Skrinning MPP', label: 'Skrinning MPP',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
{ {
value: 'supporting-document', value: 'supporting-document',
@@ -289,28 +289,25 @@ const tabsRaws: TabItem[] = [
label: 'Tarif Tindakan', label: 'Tarif Tindakan',
groups: ['medical'], groups: ['medical'],
classCode: ['ambulatory', 'emergency', 'inpatient'], classCode: ['ambulatory', 'emergency', 'inpatient'],
subClassCode: ['reg', 'rehab', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'], subClassCode: ['reg', 'rehab', 'chemo', 'emg', 'eon', 'op', 'icu', 'hcu', 'vk'],
}, },
] ]
function getTabs() { function getTabs() {
return tabsRaws return tabsRaws
.filter((tab: TabItem) => (tab.groups ? tab.groups.some((group: string) => group?.includes(activePosition)) : true)) .filter((tab: TabItem) => (tab.groups ? tab.groups.some((group: string) => group === activePosition.value) : false))
.filter((tab: TabItem) => (tab.classCode && props.classCode ? tab.classCode.includes(props.classCode) : true)) .filter((tab: TabItem) => (tab.classCode && props.classCode ? tab.classCode.includes(props.classCode) : false))
.filter((tab: TabItem) => (tab.subClassCode && props.subClassCode ? tab.subClassCode.includes(props.subClassCode) : true)) .filter((tab: TabItem) => (tab.subClassCode && props.subClassCode ? tab.subClassCode.includes(props.subClassCode) : false))
.map((tab: TabItem) => { .map((tab: TabItem) => {
return { ...tab, props: { ...tab.props, encounter: data } } return { ...tab, props: { ...tab.props, encounter: data } }
}) })
} }
watch( watch(getActiveRole, () => {
() => activePosition, const activeRole = getActiveRole()
() => { activePosition.value = getPositionAs(activeRole)
if (activePosition) { tabs.value = getTabs()
tabs.value = getTabs() })
}
}
)
onMounted(() => { onMounted(() => {
tabs.value = getTabs() tabs.value = getTabs()