refactor(patient): rename PatientEntity to Patient and update related components
Update interface name from PatientEntity to Patient for better clarity and consistency. Modify all related components and models to use the new interface name. Also includes minor improvements to address handling in patient forms.
This commit is contained in:
@@ -21,7 +21,7 @@ export interface PatientBase extends Base {
|
||||
number?: string
|
||||
}
|
||||
|
||||
export interface PatientEntity extends PatientBase {
|
||||
export interface Patient extends PatientBase {
|
||||
person: Person
|
||||
personAddresses: PersonAddress[]
|
||||
personContacts: PersonContact[]
|
||||
@@ -37,16 +37,16 @@ export interface genPatientProps {
|
||||
responsible: PersonRelativeFormData
|
||||
}
|
||||
|
||||
export function genPatient(props: genPatientProps): PatientEntity {
|
||||
export function genPatient(props: genPatientProps): Patient {
|
||||
const { patient, residentAddress, cardAddress, familyData, contacts, responsible } = props
|
||||
|
||||
const addresses: PersonAddress[] = [{ ...genBase(), person_id: 0, locationType: '', ...residentAddress }]
|
||||
const addresses: PersonAddress[] = [{ ...genBase(), person_id: 0, ...residentAddress }]
|
||||
const familiesContact: PersonRelative[] = []
|
||||
const personContacts: PersonContact[] = []
|
||||
|
||||
// jika alamat ktp sama dengan domisili saat ini
|
||||
if (cardAddress.isSameAddress) {
|
||||
addresses.push({ ...genBase(), person_id: 0, locationType: '', ...residentAddress })
|
||||
addresses.push({ ...genBase(), ...residentAddress, person_id: 0, locationType: 'identity' })
|
||||
}
|
||||
|
||||
// add data orang tua
|
||||
|
||||
@@ -12,3 +12,4 @@ export interface PersonRelative {
|
||||
occupation_code?: string
|
||||
responsible?: boolean
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user