mbois gak rek?
This commit is contained in:
+3
-2
@@ -1,4 +1,3 @@
|
||||
|
||||
export interface Base {
|
||||
id: number
|
||||
createdAt: string | null
|
||||
@@ -20,7 +19,9 @@ export interface TreeItem {
|
||||
|
||||
export function genBase(): Base {
|
||||
return {
|
||||
id: 0,
|
||||
// -1 buat mock data
|
||||
// backend harusnya non-negative/ > 0 (untuk auto increment constraint) jadi harusnya aman ya
|
||||
id: -1,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { type Base, genBase } from "./_base"
|
||||
import { type Employee, genEmployee } from "./employee"
|
||||
import type { Unit } from "./unit"
|
||||
import type { Specialist } from "./specialist"
|
||||
import type { Subspecialist } from "./subspecialist"
|
||||
import { type Base, genBase } from './_base'
|
||||
import { type Employee, genEmployee } from './employee'
|
||||
import type { Unit } from './unit'
|
||||
import type { Specialist } from './specialist'
|
||||
import type { Subspecialist } from './subspecialist'
|
||||
|
||||
export interface Doctor extends Base {
|
||||
employee_id: number
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
import { type Base, genBase } from './_base'
|
||||
|
||||
export type JsonRaw = string
|
||||
|
||||
export interface EduAssessment extends Base {
|
||||
encounter_id: number
|
||||
generalEdus: Record<string, string>
|
||||
specialEdus: Record<string, string>
|
||||
assessments: Record<string, string>
|
||||
plan: Record<string, string>
|
||||
}
|
||||
|
||||
export function genEduAssessment(): EduAssessment {
|
||||
return {
|
||||
...genBase(),
|
||||
encounter_id: 0,
|
||||
generalEdus: {},
|
||||
specialEdus: {},
|
||||
assessments: {},
|
||||
plan: {},
|
||||
}
|
||||
}
|
||||
|
||||
export interface EduAssessmentRaw extends Base {
|
||||
encounter_id: number
|
||||
generalEdus: string
|
||||
specialEdus: string
|
||||
assessments: string
|
||||
plan: string
|
||||
}
|
||||
|
||||
export function genEduAssessmentRaw(): EduAssessmentRaw {
|
||||
return {
|
||||
...genBase(),
|
||||
encounter_id: 0,
|
||||
generalEdus: '',
|
||||
specialEdus: '',
|
||||
assessments: '',
|
||||
plan: '',
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export function genEncounter(): Encounter {
|
||||
patient: genPatient(),
|
||||
registeredAt: '',
|
||||
class_code: '',
|
||||
unit_code: '',
|
||||
unit_code: 0,
|
||||
unit: genUnit(),
|
||||
visitDate: '',
|
||||
adm_employee_id: 0,
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { type Base, genBase } from "./_base"
|
||||
import type { Employee } from "./employee"
|
||||
|
||||
export interface Nurse extends Base {
|
||||
employee_id: number
|
||||
employee?: Employee
|
||||
ihs_number?: string
|
||||
unit_id: number
|
||||
infra_id: number
|
||||
|
||||
+14
-5
@@ -1,7 +1,7 @@
|
||||
import { type Base, genBase } from "./_base"
|
||||
import type { PersonAddress } from "./person-address"
|
||||
import type { PersonContact } from "./person-contact"
|
||||
import type { PersonRelative } from "./person-relative"
|
||||
import { type Base, genBase } from './_base'
|
||||
import type { PersonAddress } from './person-address'
|
||||
import type { PersonContact } from './person-contact'
|
||||
import type { PersonRelative } from './person-relative'
|
||||
import type { Ethnic } from './ethnic'
|
||||
import type { Language } from './language'
|
||||
import type { Regency } from './regency'
|
||||
@@ -43,6 +43,15 @@ export interface Person extends Base {
|
||||
export function genPerson(): Person {
|
||||
return {
|
||||
...genBase(),
|
||||
name: '',
|
||||
frontTitle: '[MOCK] dr. ',
|
||||
name: 'Agus Iwan Setiawan',
|
||||
endTitle: 'Sp.Bo',
|
||||
}
|
||||
}
|
||||
|
||||
export function parseName(person: Person): string {
|
||||
if (!person) return ''
|
||||
const fullName = [person.frontTitle, person.name, person.endTitle].filter(Boolean).join(' ').trim()
|
||||
|
||||
return fullName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user