117 lines
3.1 KiB
TypeScript
117 lines
3.1 KiB
TypeScript
export const generalEduCode = {
|
|
'right-obg': 'Hak dan kewajiban pasien dan keluarga',
|
|
'general-consent': 'General Consent',
|
|
service: 'Pelayanan yang disediakan (jam pelayanan, akses pelayanan dan proses pelayanan)',
|
|
'all-care-service': 'Sumber alternatif asuhan di tempat lain/faskes lain',
|
|
'home-plan': 'Rencana tindakan di rumah',
|
|
'home-care': 'Kebutuhan perawatan di rumah',
|
|
orientation: 'Orientasi Ruangan',
|
|
'fall-risk-prevention': 'Pencegahan risiko jatuh',
|
|
'alt-care': 'Alternatif pelayanan',
|
|
'act-delay': 'Penundaan Tindakan',
|
|
others: 'Lain-lain',
|
|
} as const
|
|
|
|
export type GeneralEduCodeKey = keyof typeof generalEduCode
|
|
|
|
export const specialEduCode = {
|
|
'disease-diag-dev': 'Diagnosa penyakit dan perkembangannya',
|
|
'safe-med-usage': 'Penggunaan obat yang aman',
|
|
'side-effect': 'Efek samping dan reaksi obat',
|
|
diet: 'Diet/Nutrisi',
|
|
'pain-mgmt': 'Manajemen nyeri',
|
|
'medical-eq-usage': 'Penggunaan Peralatan Medis',
|
|
'rehab-technique': 'Teknik Rehabilitasi',
|
|
'prevention-act': 'Tindakan pencegahan (cuci tangan, pemasangan gelang)',
|
|
} as const
|
|
|
|
export type SpecialEduCodeKey = keyof typeof specialEduCode
|
|
|
|
export const eduAssessmentCode = {
|
|
'learn-ability': 'Kemampuan Belajar',
|
|
'learn-will': 'Kemauan Belajar',
|
|
obstacle: 'Hambatan',
|
|
'learn-method': 'Metode Pembelajaran',
|
|
lang: 'Bahasa',
|
|
'lang-obstacle': 'Hambatan Bahasa',
|
|
belief: 'Keyakinan',
|
|
} as const
|
|
|
|
export type EduAssessmentCodeKey = keyof typeof eduAssessmentCode
|
|
|
|
export const abilityCode = {
|
|
able: 'Mampu',
|
|
'not-able': 'Tidak Mampu',
|
|
} as const
|
|
|
|
export type AbilityCodeKey = keyof typeof abilityCode
|
|
|
|
export const willCode = {
|
|
ready: 'Siap',
|
|
interested: 'Tertarik',
|
|
'not-interested': 'Tidak Tertarik',
|
|
} as const
|
|
|
|
export type WillCodeKey = keyof typeof willCode
|
|
|
|
export const medObstacleCode = {
|
|
hearing: 'Pendengaran',
|
|
sight: 'Penglihatan',
|
|
physical: 'Fisik',
|
|
emotional: 'Emosional',
|
|
cognitif: 'Kognitif',
|
|
} as const
|
|
|
|
export type MedObstacleCodeKey = keyof typeof medObstacleCode
|
|
|
|
export const learnMethodCode = {
|
|
demo: 'Demonstrasi',
|
|
'discuss-leaflet': 'Diskusi Leaflet',
|
|
} as const
|
|
|
|
export type LearnMethodCodeKey = keyof typeof learnMethodCode
|
|
|
|
export const langClassCode = {
|
|
ind: 'Indonesia',
|
|
region: 'Daerah',
|
|
foreign: 'Asing',
|
|
} as const
|
|
|
|
export type LangClassCodeKey = keyof typeof langClassCode
|
|
|
|
export const translatorSrcCode = {
|
|
team: 'Tim Penerjemah',
|
|
family: 'Keluarga',
|
|
} as const
|
|
|
|
export type TranslatorSrcCodeKey = keyof typeof translatorSrcCode
|
|
|
|
// helpers
|
|
type EduCodeType = 'general' | 'special'
|
|
export function serializeKeyToBoolean(type: EduCodeType, selected: string[]): Record<string, boolean> {
|
|
switch (type) {
|
|
case 'general': {
|
|
return Object.keys(generalEduCode).reduce(
|
|
(acc, key) => {
|
|
acc[key] = selected.includes(key)
|
|
return acc
|
|
},
|
|
{} as Record<string, boolean>,
|
|
)
|
|
}
|
|
|
|
case 'special': {
|
|
return Object.keys(specialEduCode).reduce(
|
|
(acc, key) => {
|
|
acc[key] = selected.includes(key)
|
|
return acc
|
|
},
|
|
{} as Record<string, boolean>,
|
|
)
|
|
}
|
|
|
|
default:
|
|
throw new Error('unknown type to serialize')
|
|
}
|
|
}
|