⚡ enhance (icd): get provide data
This commit is contained in:
@@ -7,94 +7,18 @@ const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dr
|
|||||||
const statusBadge = defineAsyncComponent(() => import('./status-badge.vue'))
|
const statusBadge = defineAsyncComponent(() => import('./status-badge.vue'))
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
cols: [
|
cols: [{}, {}, {}, {}],
|
||||||
{},
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
{ width: 100 },
|
|
||||||
{ width: 120 },
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
{ width: 100 },
|
|
||||||
{ width: 100 },
|
|
||||||
{},
|
|
||||||
{ width: 50 },
|
|
||||||
],
|
|
||||||
|
|
||||||
headers: [
|
headers: [[{ label: 'Kode' }, { label: 'Nama (FHIR)' }, { label: 'Nama (ID)' }, { label: '' }]],
|
||||||
[
|
|
||||||
{ label: 'Nama' },
|
|
||||||
{ label: 'Rekam Medis' },
|
|
||||||
{ label: 'KTP' },
|
|
||||||
{ label: 'Tgl Lahir' },
|
|
||||||
{ label: 'Umur' },
|
|
||||||
{ label: 'JK' },
|
|
||||||
{ label: 'Pendidikan' },
|
|
||||||
{ label: 'Status' },
|
|
||||||
{ label: '' },
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
keys: [
|
keys: ['code', 'name', 'indName', 'action'],
|
||||||
'name',
|
|
||||||
'medicalRecord_number',
|
|
||||||
'identity_number',
|
|
||||||
'birth_date',
|
|
||||||
'patient_age',
|
|
||||||
'gender',
|
|
||||||
'education',
|
|
||||||
'status',
|
|
||||||
'action',
|
|
||||||
],
|
|
||||||
|
|
||||||
delKeyNames: [
|
delKeyNames: [
|
||||||
{ key: 'code', label: 'Kode' },
|
{ key: 'code', label: 'Kode' },
|
||||||
{ key: 'name', label: 'Nama' },
|
{ key: 'name', label: 'Nama' },
|
||||||
],
|
],
|
||||||
|
|
||||||
parses: {
|
parses: {},
|
||||||
name: (rec: unknown): unknown => {
|
|
||||||
const recX = rec as SmallDetailDto
|
|
||||||
return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}`
|
|
||||||
},
|
|
||||||
identity_number: (rec: unknown): unknown => {
|
|
||||||
const recX = rec as SmallDetailDto
|
|
||||||
if (recX.identity_number?.substring(0, 5) === 'BLANK') {
|
|
||||||
return '(TANPA NIK)'
|
|
||||||
}
|
|
||||||
return recX.identity_number
|
|
||||||
},
|
|
||||||
birth_date: (rec: unknown): unknown => {
|
|
||||||
const recX = rec as SmallDetailDto
|
|
||||||
if (typeof recX.birth_date == 'object' && recX.birth_date) {
|
|
||||||
return (recX.birth_date as Date).toLocaleDateString()
|
|
||||||
} else if (typeof recX.birth_date == 'string') {
|
|
||||||
return (recX.birth_date as string).substring(0, 10)
|
|
||||||
}
|
|
||||||
return recX.birth_date
|
|
||||||
},
|
|
||||||
patient_age: (rec: unknown): unknown => {
|
|
||||||
const recX = rec as SmallDetailDto
|
|
||||||
return recX.birth_date?.split('T')[0]
|
|
||||||
},
|
|
||||||
gender: (rec: unknown): unknown => {
|
|
||||||
const recX = rec as SmallDetailDto
|
|
||||||
if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') {
|
|
||||||
return 'Tidak Diketahui'
|
|
||||||
}
|
|
||||||
return recX.gender_code
|
|
||||||
},
|
|
||||||
education: (rec: unknown): unknown => {
|
|
||||||
const recX = rec as SmallDetailDto
|
|
||||||
if (typeof recX.education_code == 'number' && recX.education_code >= 0) {
|
|
||||||
return recX.education_code
|
|
||||||
} else if (typeof recX.education_code) {
|
|
||||||
return recX.education_code
|
|
||||||
}
|
|
||||||
return '-'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
action(rec, idx) {
|
action(rec, idx) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { config } from './list-cfg'
|
import { config } from './list-cfg'
|
||||||
|
|
||||||
defineProps<{ data: any[] }>()
|
defineProps<{ data: any[] }>()
|
||||||
const modelValue = defineModel<any | null>()
|
const modelValue = defineModel<any[]>('modelValue', { default: [] })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
|
||||||
import { Trash2 } from 'lucide-vue-next'
|
import { Trash2 } from 'lucide-vue-next'
|
||||||
// import { Button } from '@/components/ui/button'
|
|
||||||
// import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
|
|
||||||
|
|
||||||
interface Diagnosa {
|
interface Diagnosa {
|
||||||
id: number
|
id: number
|
||||||
@@ -10,10 +7,10 @@ interface Diagnosa {
|
|||||||
icd: string
|
icd: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const list = ref<Diagnosa[]>([{ id: 1, diagnosa: 'Acute appendicitis', icd: 'K35' }])
|
const modelValue = defineModel<Diagnosa[]>({ default: [] })
|
||||||
|
|
||||||
function removeItem(id: number) {
|
function removeItem(id: number) {
|
||||||
list.value = list.value.filter((item) => item.id !== id)
|
modelValue.value = modelValue.value.filter((item) => item.id !== id)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -30,12 +27,19 @@ function removeItem(id: number) {
|
|||||||
</TableHeader>
|
</TableHeader>
|
||||||
|
|
||||||
<TableBody>
|
<TableBody>
|
||||||
<TableRow v-for="(item, i) in list" :key="item.id">
|
<TableRow
|
||||||
|
v-for="(item, i) in modelValue"
|
||||||
|
:key="item.id"
|
||||||
|
>
|
||||||
<TableCell class="text-center font-medium">{{ i + 1 }}</TableCell>
|
<TableCell class="text-center font-medium">{{ i + 1 }}</TableCell>
|
||||||
<TableCell>{{ item.diagnosa }}</TableCell>
|
<TableCell>{{ item.code }}</TableCell>
|
||||||
<TableCell>{{ item.icd }}</TableCell>
|
<TableCell>{{ item.name }}</TableCell>
|
||||||
<TableCell class="text-center">
|
<TableCell class="text-center">
|
||||||
<Button variant="ghost" size="icon" @click="removeItem(item.id)">
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
@click="removeItem(item.id)"
|
||||||
|
>
|
||||||
<Trash2 class="h-4 w-4 text-gray-500 hover:text-red-500" />
|
<Trash2 class="h-4 w-4 text-gray-500 hover:text-red-500" />
|
||||||
</Button>
|
</Button>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
Reference in New Issue
Block a user