Merge branch 'dev' into feat/consultation-82
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
import { type Doctor, genDoctor } from "./doctor"
|
||||
import { genEmployee, type Employee } from "./employee"
|
||||
import { type Patient, genPatient } from "./patient"
|
||||
import type { Specialist } from "./specialist"
|
||||
import type { Subspecialist } from "./subspecialist"
|
||||
import { genUnit, type Unit } from "./unit"
|
||||
|
||||
export interface Encounter {
|
||||
id: number
|
||||
patient_id: number
|
||||
patient: Patient
|
||||
registeredAt: string
|
||||
class_code: string
|
||||
unit_id: number
|
||||
unit: Unit
|
||||
specialist_id?: number
|
||||
specilist?: Specialist
|
||||
subspecialist_id?: number
|
||||
subspecialist?: Subspecialist
|
||||
visitdate: string
|
||||
adm_employee_id: number
|
||||
adm_employee: Employee
|
||||
@@ -30,9 +38,11 @@ export function genEncounter(): Encounter {
|
||||
return {
|
||||
id: 0,
|
||||
patient_id: 0,
|
||||
patient: genPatient(),
|
||||
registeredAt: '',
|
||||
class_code: '',
|
||||
unit_id: 0,
|
||||
unit: genUnit(),
|
||||
visitdate: '',
|
||||
adm_employee_id: 0,
|
||||
adm_employee: genEmployee(),
|
||||
|
||||
+25
-4
@@ -6,7 +6,7 @@ import type { PersonFamiliesFormData } from '~/schemas/person-family.schema'
|
||||
import type { PersonContactFormData } from '~/schemas/person-contact.schema'
|
||||
import type { PersonRelativeFormData } from '~/schemas/person-relative.schema'
|
||||
|
||||
import type { Person } from './person'
|
||||
import { genPerson, type Person } from './person'
|
||||
import type { PersonAddress } from './person-address'
|
||||
import type { PersonContact } from './person-contact'
|
||||
import type { PersonRelative } from './person-relative'
|
||||
@@ -21,7 +21,7 @@ export interface PatientBase extends Base {
|
||||
number?: string
|
||||
}
|
||||
|
||||
export interface Patient extends PatientBase {
|
||||
export interface PatientEntity extends PatientBase {
|
||||
person: Person
|
||||
personAddresses: PersonAddress[]
|
||||
personContacts: PersonContact[]
|
||||
@@ -37,8 +37,7 @@ export interface genPatientProps {
|
||||
responsible: PersonRelativeFormData
|
||||
}
|
||||
|
||||
export function genPatient(props: genPatientProps): Patient {
|
||||
console.log(props)
|
||||
export function genPatientEntity(props: genPatientProps): PatientEntity {
|
||||
const { patient, residentAddress, cardAddress, familyData, contacts, responsible } = props
|
||||
|
||||
const addresses: PersonAddress[] = [{ ...genBase(), person_id: 0, ...residentAddress }]
|
||||
@@ -158,3 +157,25 @@ export function genPatient(props: genPatientProps): Patient {
|
||||
deletedAt: null,
|
||||
}
|
||||
}
|
||||
|
||||
// New model
|
||||
export interface Patient extends Base {
|
||||
person_id?: number
|
||||
person: Person
|
||||
newBornStatus?: boolean
|
||||
registeredAt?: Date | string | null
|
||||
status_code?: string
|
||||
number?: string
|
||||
}
|
||||
|
||||
export function genPatient(): Patient {
|
||||
return {
|
||||
...genBase(),
|
||||
person_id: 0,
|
||||
registeredAt: '',
|
||||
status_code: '',
|
||||
number: '',
|
||||
newBornStatus: false,
|
||||
person: genPerson(),
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { type Base, genBase } from './_base'
|
||||
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 { PersonAddress } from './person-address'
|
||||
import type { PersonContact } from './person-contact'
|
||||
import type { PersonRelative } from './person-relative'
|
||||
import type { Regency } from './regency'
|
||||
|
||||
export interface Person extends Base {
|
||||
|
||||
Reference in New Issue
Block a user