feat (user): implement user management feature

This commit is contained in:
Abizrh
2025-08-28 01:18:55 +07:00
parent a7a77cb497
commit 35e2c663f5
12 changed files with 517 additions and 121 deletions
+169 -119
View File
@@ -1,170 +1,220 @@
export interface ActiveStatusCode {
code: 'active' | 'inactive'
name: 'Aktif' | 'Tidak Aktif'
export const activeStatusCodes: Record<string, string> = {
active: 'Aktif',
inactive: 'Tidak Aktif',
}
export interface DataStatusCode {
code: 'new' | 'review' | 'process' | 'done' | 'canceled' | 'rejected' | 'skiped'
name: 'Baru' | 'Review' | 'Proses' | 'Selesai' | 'Dibatalkan' | 'Ditolak' | 'Dilewati'
export const dataStatusCodes: Record<string, string> = {
new: 'Baru',
review: 'Review',
process: 'Proses',
done: 'Selesai',
canceled: 'Dibatalkan',
rejected: 'Ditolak',
skiped: 'Dilewati',
}
export interface UserStatusCode {
code: 'new' | 'active' | 'inactive' | 'blocked' | 'suspended'
name: 'Baru' | 'Aktif' | 'Tidak Aktif' | 'Diblokir' | 'Dibekukan'
export const userStatusCodes: Record<string, string> = {
new: 'Baru',
active: 'Aktif',
inactive: 'Tidak Aktif',
blocked: 'Diblokir',
suspended: 'Dibekukan',
}
export interface ItemGroupCode {
code: 'infra' | 'medicine' | 'device' | 'material'
name: 'Infrastruktur' | 'Obat' | 'Peralatan' | 'Perlengkapan'
export const itemGroupCodes: Record<string, string> = {
infra: 'Infrastruktur',
medicine: 'Obat',
device: 'Peralatan',
material: 'Perlengkapan',
}
export interface UnitTypeCode {
code: 'reg' | 'exa' | 'pay' | 'pha' | 'lab' | 'rad'
name: 'Registrasi' | 'Pemeriksaan' | 'Pembayaran' | 'Farmasai' | 'Laboratorium' | 'Radiologi'
export const unitTypeCodes: Record<string, string> = {
reg: 'Registrasi',
exa: 'Pemeriksaan',
pay: 'Pembayaran',
pha: 'Farmasai',
lab: 'Laboratorium',
rad: 'Radiologi',
}
export interface QueueStatusCode {
code: 'wait' | 'proc' | 'done' | 'cancel' | 'skip'
name: 'Tunggu' | 'Proses' | 'Selesai' | 'Batal' | 'Dilewati'
export const queueStatusCodes: Record<string, string> = {
wait: 'Tunggu',
proc: 'Proses',
done: 'Selesai',
cancel: 'Batal',
skip: 'Dilewati',
}
export interface EncounterClassCode {
code: 'outpatient' | 'ambulatory' | 'emergency' | 'inpatient' | 'draft' | 'done' | 'cancel' | 'skip'
name: 'Rawat Jalan' | 'Rawat Jalan' | 'Gawat Darurat' | 'Rawat Inap' | 'Draft' | 'Selesai' | 'Batal' | 'Dilewati'
export const encounterClassCodes: Record<string, string> = {
outpatient: 'Rawat Jalan',
ambulatory: 'Rawat Jalan',
emergency: 'Gawat Darurat',
inpatient: 'Rawat Inap',
draft: 'Draft',
done: 'Selesai',
cancel: 'Batal',
skip: 'Dilewati',
}
export interface TimeUnitCode {
code: 'sec' | 'min' | 'hour' | 'day' | 'week' | 'month' | 'year'
name: 'Detik' | 'Menit' | 'Jam' | 'Hari' | 'Minggu' | 'Bulan' | 'Tahun'
export const timeUnitCodes: Record<string, string> = {
sec: 'Detik',
min: 'Menit',
hour: 'Jam',
day: 'Hari',
week: 'Minggu',
month: 'Bulan',
year: 'Tahun',
}
export interface DischargeMethodCode {
code: 'home' | 'home-request'
name: 'Home' | 'Home Request'
export const dischargeMethodCodes: Record<string, string> = {
home: 'Home',
'home-request': 'Home Request',
}
export interface GenderCode {
code: 'male' | 'female' | 'not-stated' | 'unknown'
name: 'Laki' | 'Perempuan' | 'Tidak Disebutkan' | 'Tidak Diketahui'
export const genderCodes: Record<string, string> = {
male: 'Laki - Laki',
female: 'Perempuan',
'not-stated': 'Tidak Disebutkan',
unknown: 'Tidak Diketahui',
}
export interface ReligionCode {
code: 'islam' | 'protestan' | 'katolik' | 'hindu' | 'buda' | 'konghucu'
name: 'Islam' | 'Protestan' | 'Katolik' | 'Hindu' | 'Buda' | 'Konghucu'
export const religionCodes: Record<string, string> = {
islam: 'Islam',
protestan: 'Protestan',
katolik: 'Katolik',
hindu: 'Hindu',
buda: 'Buda',
konghucu: 'Konghucu',
}
export interface EducationCode {
code: 'TS' | 'TK' | 'SD' | 'SMP' | 'SMA' | 'D1' | 'D2' | 'D3' | 'S1' | 'S2' | 'S3'
name: 'TS' | 'TK' | 'SD' | 'SMP' | 'SMA' | 'D1' | 'D2' | 'D3' | 'S1' | 'S2' | 'S3'
export const educationCodes: Record<string, string> = {
TS: 'TS',
TK: 'TK',
SD: 'SD',
SMP: 'SMP',
SMA: 'SMA',
D1: 'D1',
D2: 'D2',
D3: 'D3',
S1: 'S1',
S2: 'S2',
S3: 'S3',
}
export interface OccupationCode {
code: 'tidak-bekerja' | 'pns' | 'polisi' | 'tni' | 'guru' | 'wiraswasta' | 'kary-swasta' | 'lainnya'
name:
| 'Tidak Bekerja'
| 'Pegawai Negeri Sipil'
| 'Polisi'
| 'TNI'
| 'Guru'
| 'Wiraswasta'
| 'Karyawan Swasta'
| 'Lainnya'
export const occupationCodes: Record<string, string> = {
'tidak-bekerja': 'Tidak Bekerja',
pns: 'Pegawai Negeri Sipil',
polisi: 'Polisi',
tni: 'TNI',
guru: 'Guru',
wiraswasta: 'Wiraswasta',
'kary-swasta': 'Karyawan Swasta',
lainnya: 'Lainnya',
}
export interface PersonContactType {
code: 'phone' | 'm-phone' | 'email' | 'fax'
name: 'Telepon' | 'HP / Ponsel' | 'Email' | 'Fax'
export const personContactTypes: Record<string, string> = {
phone: 'Telepon',
'm-phone': 'HP / Ponsel',
email: 'Email',
fax: 'Fax',
}
export interface DayCode {
code: '0' | '1' | '2' | '3' | '4' | '5' | '6'
name: 'Minggu' | '' | '' | '' | '' | '' | 'Sabtu'
export const dayCodes: Record<string, string> = {
'0': 'Minggu',
'1': '',
'2': '',
'3': '',
'4': '',
'5': '',
'6': 'Sabtu',
}
export interface PaymentMethodCode {
code: 'cash' | 'debit' | 'credit' | 'insurance' | 'membership'
name: 'Cash' | 'Debit' | 'Kredit' | 'Asuransi' | 'Membership'
export const paymentMethodCodes: Record<string, string> = {
cash: 'Cash',
debit: 'Debit',
credit: 'Kredit',
insurance: 'Asuransi',
membership: 'Membership',
}
export interface TransportationCode {
code: 'ambulance' | 'car' | 'motor-cycle' | 'other'
name: 'Ambulans' | 'Mobil' | 'Motor' | 'Lainnya'
export const transportationCodes: Record<string, string> = {
ambulance: 'Ambulans',
car: 'Mobil',
'motor-cycle': 'Motor',
other: 'Lainnya',
}
export interface PersonConditionCode {
code: 'res' | 'emg' | 'urg' | 'lurg' | 'nurg' | 'doa'
name: 'Resutiasi' | 'Darurat' | 'Mendesak' | 'Kurang Mendesak' | 'Mendesak' | 'Meninggal Saat Tiba'
export const personConditionCodes: Record<string, string> = {
res: 'Resutiasi',
emg: 'Darurat',
urg: 'Mendesak',
lurg: 'Kurang Mendesak',
nurg: 'Mendesak',
doa: 'Meninggal Saat Tiba',
}
export interface EmergencyClassCode {
code: 'emg' | 'eon'
name: 'Darurat' | 'Ponek'
export const emergencyClassCodes: Record<string, string> = {
emg: 'Darurat',
eon: 'Ponek',
}
export interface OutpatientClassCode {
code: 'op' | 'icu' | 'hcu' | 'vk'
name: 'Rawat Inap' | 'ICU' | 'HCU' | 'Kamar Bersalin'
export const outpatientClassCodes: Record<string, string> = {
op: 'Rawat Inap',
icu: 'ICU',
hcu: 'HCU',
vk: 'Kamar Bersalin',
}
export interface CheckupScopeCode {
code: 'lab' | 'mic-lab' | 'pa-lab' | 'rad'
name: 'Laboratorium' | 'Microbacterial Laboratorium' | 'Patology Anatomy Laboratorium' | 'Radiology'
export const checkupScopeCodes: Record<string, string> = {
lab: 'Laboratorium',
'mic-lab': 'Microbacterial Laboratorium',
'pa-lab': 'Patology Anatomy Laboratorium',
rad: 'Radiology',
}
export interface EmployeePositionCode {
code: 'doctor' | 'nurse' | 'nutritionist' | 'laborant' | 'pharmacy' | 'payment' | 'payment-verificator' | 'management'
name:
| 'Dokter'
| 'Perawat'
| 'Ahli Gisi'
| 'Laboran'
| 'Farmasi'
| 'Pembayaran'
| 'Konfirmasi Pembayaran'
| 'Management'
export const employeePositionCodes: Record<string, string> = {
doctor: 'Dokter',
nurse: 'Perawat',
nutritionist: 'Ahli Gisi',
laborant: 'Laboran',
pharmacy: 'Farmasi',
payment: 'Pembayaran',
'payment-verificator': 'Konfirmasi Pembayaran',
management: 'Management',
}
export interface SubjectCode {
code:
| 'pri-compl'
| 'sec-compl'
| 'cur-disea-hist'
| 'pas-disea-hist'
| 'fam-disea-hist'
| 'alg-hist'
| 'alg-react'
| 'med-hist'
name:
| 'Primary Complaint'
| 'Secondary Complaint'
| 'Current Disease History'
| 'Past Disease History'
| 'Family Disease History'
| 'Allergic Hist'
| 'Allergic Reaction'
| 'Medication Hist'
export const subjectCodes: Record<string, string> = {
'pri-compl': 'Primary Complaint',
'sec-compl': 'Secondary Complaint',
'cur-disea-hist': 'Current Disease History',
'pas-disea-hist': 'Past Disease History',
'fam-disea-hist': 'Family Disease History',
'alg-hist': 'Allergic Hist',
'alg-react': 'Allergic Reaction',
'med-hist': 'Medication Hist',
}
export interface ObjectCode {
code: 'consc-level' | 'consc-level-det' | 'syst-bp' | 'diast-bp' | 'hear-rt' | 'temp' | 'spo2' | 'weight' | 'height'
name:
| 'Tingkat Kesadaran'
| 'Detail Tingkat Kesadaran'
| 'Tekanan Darah Systolic'
| 'Tekanan Darah Diastolic'
| 'Detak Jantung'
| 'Suhu'
| 'SpO2'
| 'Berat Badan'
| 'Tinggi Badan'
export const objectCodes: Record<string, string> = {
'consc-level': 'Tingkat Kesadaran',
'consc-level-det': 'Detail Tingkat Kesadaran',
'syst-bp': 'Tekanan Darah Systolic',
'diast-bp': 'Tekanan Darah Diastolic',
'hear-rt': 'Detak Jantung',
temp: 'Suhu',
spo2: 'SpO2',
weight: 'Berat Badan',
height: 'Tinggi Badan',
}
export interface AssessmentCode {
code: 'early-diag' | 'late-diag' | 'sec-diag'
name: 'Diagnosis Awal' | 'Diagnosis Akhir' | 'Diagnosis Sekunder'
export const assessmentCodes: Record<string, string> = {
'early-diag': 'Diagnosis Awal',
'late-diag': 'Diagnosis Akhir',
'sec-diag': 'Diagnosis Sekunder',
}
export interface InstructionCode {
code: 'detail' | 'med-act' | 'medication' | 'material'
name: 'Detail Instruksi' | 'Tindakan medis' | 'Obat' | 'BMHP'
export const instructionCodes: Record<string, string> = {
detail: 'Detail Instruksi',
'med-act': 'Tindakan medis',
medication: 'Obat',
material: 'BMHP',
}