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' export interface Person extends Base { name: string // alias?: string frontTitle?: string | null endTitle?: string | null birthDate?: string birthRegency_code?: string | null gender_code?: string | null residentIdentityNumber?: string | null passportNumber?: string | null drivingLicenseNumber?: string | null religion_code?: string | null education_code?: string | null occupation_code?: string | null occupation_name?: string | null ethnic_code?: string | null language_code?: string | null nationality?: string | null communicationIssueStatus?: boolean disability?: string | null residentIdentityFileUrl?: string | null passportFileUrl?: string | null drivingLicenseFileUrl?: string | null familyIdentityFileUrl?: string | null maritalStatus_code?: string // preload data for detail patient birthRegency?: Regency | null addresses?: PersonAddress[] | null contacts?: PersonContact[] | null relatives?: PersonRelative[] | null ethnic?: Ethnic | null language?: Language | null } export function genPerson(): Person { return { ...genBase(), frontTitle: '', name: '', endTitle: '', } } export function parseName(person: Person): string { if (!person) return '' const fullName = [person.frontTitle, person.name, person.endTitle].filter(Boolean).join(' ').trim() return fullName }