Merge branch 'feat/consultation-82' into fe-prescription-56

This commit is contained in:
2025-10-08 08:00:01 +07:00
252 changed files with 10818 additions and 997 deletions
+30
View File
@@ -0,0 +1,30 @@
Based on the following information:
Template
code varchar 10 notnull
name varchar 10
Original_SrcCode_Id int notnull
dateTime datetime notnull
date date
I created the following typescript:
import { type Base, genBase } from "./_base"
export interface Template extends Base {
code: string
name?: string
original_srcCode_id: number
dateTime: string
date?: string
}
export function genTemplate(): Template {
return {
...genBase(),
code: '',
original_srcCode_id: 0,
dateTime: '',
}
}
With similar method, create typescript based on the following information:
[copy from excel]
+49
View File
@@ -0,0 +1,49 @@
export interface Base {
id: number
createdAt: string | null
updatedAt: string | null
deletedAt?: string | null
}
export interface CodeName {
name: string
code: string
}
export interface TreeItem {
value: string
label: string
hasChildren: boolean
children?: TreeItem[]
}
export function genBase(): Base {
return {
id: 0,
createdAt: '',
updatedAt: '',
}
}
export type WithBase<T extends Base> = Omit<T, keyof Base> & Required<Base>
/**
* The function `withBase` sets default values for item properties if not provided.
* @param item - The `withBase` function takes in an optional parameter `item`, which is a
* partial object of type `T`. The function merges the properties of `item` with default values for
* `id`, `createdAt`, `updatedAt`, and `deletedAt`. The function then returns an object of type
* @returns The `withBase` function returns an object with default values for the properties
* `id`, `createdAt`, `updatedAt`, and `deletedAt`, along with any additional properties provided in
* the `item` parameter. The returned object has a type `WithBase<T>`, which extends `T` and
* includes the default properties.
*/
export function withBase<T extends Base>(item: Partial<T> = {}): WithBase<T> {
return {
id: 0,
createdAt: null,
updatedAt: null,
deletedAt: null,
...item,
} as WithBase<T>
}
+18
View File
@@ -0,0 +1,18 @@
import { type Base, genBase } from "./_base"
export interface Adime extends Base {
encounter_id: number
employee_id: number
time?: string
value: unknown
}
export function genAdime(): Adime {
return {
...genBase(),
encounter_id: 0,
employee_id: 0,
value: ''
}
}
+14
View File
@@ -0,0 +1,14 @@
import { type Base, genBase } from "./_base"
export interface Ambulatory extends Base {
encounter_id: number
class_code: string
}
export function genAmbulatory(): Ambulatory {
return {
...genBase(),
encounter_id: 0,
class_code: '',
}
}
+24
View File
@@ -0,0 +1,24 @@
import { type Base, genBase } from "./_base"
export interface Appointment extends Base {
practiceSchedule_id: number
patient_id: number
person_residentIdentitynumber: string
person_name: string
person_phoneNumber: string
paymentMethod_code: string
refNumber: string
}
export function genAppointment(): Appointment {
return {
...genBase(),
practiceSchedule_id: 0,
patient_id: 0,
person_residentIdentitynumber: '',
person_name: '',
person_phoneNumber: '',
paymentMethod_code: '',
refNumber: '',
}
}
+20
View File
@@ -0,0 +1,20 @@
import { type Base, genBase } from "./_base"
export interface Chemo extends Base {
encounter_id: number
status_code: string
verified_at: string
verified_by_user_id: number
src_unit_id: number
}
export function genChemo(): Chemo {
return {
...genBase(),
encounter_id: 0,
status_code: '',
verified_at: '',
verified_by_user_id: 0,
src_unit_id: 0,
}
}
+45
View File
@@ -0,0 +1,45 @@
export interface Consultation {
id: number
encounter_id: number
unit_id: number
doctor_id?: number
problem: string
solution?: string
repliedAt?: string
}
export interface CreateDto {
encounter_id: number
problem: string
unit_id: number
}
export interface UpdateDto {
id: number
problem: string
unit_id: number
}
export interface DeleteDto {
id: number
}
export function genCreateDto(): CreateDto {
return {
encounter_id: 0,
problem: '',
unit_id: 0,
}
}
export function genConsultation(): Consultation {
return {
id: 0,
encounter_id: 0,
unit_id: 0,
doctor_id: 0,
problem: '',
solution: '',
repliedAt: '',
}
}
+16
View File
@@ -0,0 +1,16 @@
import { type Base, genBase } from "./_base"
export interface DeviceOrderItem extends Base {
deviceOrder_id: number
device_id: number
count: number
}
export function genDeviceOrderItem(): DeviceOrderItem {
return {
...genBase(),
deviceOrder_id: 0,
device_id: 0,
count: 0,
}
}
+15
View File
@@ -0,0 +1,15 @@
import { type Base, genBase } from "./_base"
export interface DeviceOrder extends Base {
encounter_id: number
doctor_id: number
status_code?: string
}
export function genDeviceOrder(): DeviceOrder {
return {
...genBase(),
encounter_id: 0,
doctor_id: 0,
}
}
+11 -2
View File
@@ -1,7 +1,16 @@
import type { ItemMeta } from "./_model"
import { type Base, genBase } from "./_base"
export interface Device extends ItemMeta {
export interface Device extends Base {
code: string
name: string
uom_code: string
}
export function genDevice(): Device {
return {
...genBase(),
code: '',
name: '',
uom_code: '',
}
}
+13 -2
View File
@@ -1,7 +1,18 @@
import type { ItemMeta } from "./_model"
import { type Base, genBase } from "./_base"
export interface DivisionPosition extends ItemMeta {
export interface DivisionPosition extends Base {
code: string
name: string
division_id: number
employee_id?: number
}
export function genDivisionPosition(): DivisionPosition {
return {
...genBase(),
code: '',
name: '',
division_id: 0,
employee_id: 0,
}
}
+10 -6
View File
@@ -1,14 +1,18 @@
import type { ItemMeta } from "./_model"
import { type Base, genBase } from "./_base"
export interface Division extends ItemMeta {
export interface Division extends Base {
code: string
name: string
parent_id?: number | null
childrens?: Division[] | null
}
export interface DivisionPosition extends ItemMeta {
code: string
name: string
division_id: number
export function genDivision(): Division {
return {
...genBase(),
code: '',
name: '',
parent_id: null,
childrens: null,
}
}
+18
View File
@@ -0,0 +1,18 @@
import { type Base, genBase } from "./_base"
export interface DoctorFee extends Base {
doctor_id: number
feeType_code: string
price: number
item_id: number
}
export function genDoctorFee(): DoctorFee {
return {
...genBase(),
doctor_id: 0,
feeType_code: '',
price: 0,
item_id: 0,
}
}
+16 -20
View File
@@ -1,31 +1,30 @@
import type { ItemMeta } from "./_model"
import { genEmployee, type Employee } from "./employee"
import { type Base, genBase } from "./_base"
import { type Employee, genEmployee } from "./employee"
import type { Specialist } from "./specialist"
import type { Subspecialist } from "./subspecialist"
export interface Doctor extends ItemMeta {
export interface Doctor extends Base {
employee_id: number
employee: Employee
ihs_number: string
sip_number: string
unit_id?: number
specialist_id?: number
specialist?: Specialist
subspecialist_id?: number
bpjs_code: string
subspecialist?: Subspecialist
bpjs_code?: string
}
// use one dto for both create and update
export interface CreateDto {
name?: string
frontTitle?: string
endTitle?: string
identity_number?: string
sip_no?: string
ihs_number?: string
phone?: string
email?: string
bpjs_code?: string
status_code?: number
outPatient_rate?: number
inPatient_rate?: number
employee_id: number
ihs_number: string
sip_number: string
unit_id?: number
specialist_id?: number
subspecialist_id?: number
bpjs_code: string
}
export interface GetListDto {
@@ -49,13 +48,10 @@ export interface DeleteDto {
export function genDoctor(): Doctor {
return {
id: 0,
createdAt: '',
updatedAt: '',
...genBase(),
employee_id: 0,
employee: genEmployee(),
ihs_number: '',
sip_number: '',
bpjs_code: '',
}
}
+15
View File
@@ -0,0 +1,15 @@
import { type Base, genBase } from "./_base"
export interface Emergency extends Base {
encounter_id: number
class_code: string
}
export function genEmergency(): Emergency {
return {
...genBase(),
encounter_id: 0,
class_code: '',
}
}
+17 -10
View File
@@ -1,16 +1,30 @@
import { type Base, genBase } from "./_base"
import { type Person, genPerson } from "./person"
export interface Employee {
export interface Employee extends Base {
user_id: number
person_id: number
person: Person
position_code: string
division_code?: string
number?: string
status_code: string
}
export interface CreateDto extends Employee {
user_id: number
person_id: number
position_code: string
division_code: string
number: string
status_code: string
}
export interface CreateDto extends Employee {}
export interface GetListDto {
position_code?: string
division_code?: string
number?: string
}
export interface UpdateDto extends Employee {
id: number
@@ -20,20 +34,13 @@ export interface DeleteDto {
id: number
}
export interface GetListDto extends Employee {
id: number
createdAt: string
updatedAt: string
}
export function genEmployee(): Employee {
return {
...genBase(),
user_id: 0,
person_id: 0,
person: genPerson(),
position_code: '',
division_code: '',
number: '',
status_code: '',
}
}
+18
View File
@@ -0,0 +1,18 @@
import { type Base, genBase } from "./_base"
export interface EncounterPayment extends Base {
encounter_id: number
paymentMethod_code: string
insuranceCompany_id?: number
member_number?: string
ref_number?: string
trx_number?: string
}
export function genEncounterPayment(): EncounterPayment {
return {
...genBase(),
encounter_id: 0,
paymentMethod_code: '',
}
}
+14
View File
@@ -0,0 +1,14 @@
import { type Base, genBase } from "./_base"
export interface Ethnic extends Base {
code: string
name: string
}
export function genEthnic(): Ethnic {
return {
...genBase(),
code: '',
name: '',
}
}
+10
View File
@@ -0,0 +1,10 @@
export interface Infra {
id?: number
code: string
name: string
infraGroup_code: string
parent_id?: number | string | null
specialist_id?: number | string | null
subspecialist_id?: number | string | null
unit_id?: number | string | null
}
+16
View File
@@ -0,0 +1,16 @@
import { type Base, genBase } from "./_base"
export interface Template extends Base {
encounter_id: number
class_code: string
infra_id: number
}
export function genTemplate(): Template {
return {
...genBase(),
encounter_id: 0,
class_code: '',
infra_id: 0,
}
}
+38 -2
View File
@@ -1,6 +1,42 @@
export interface Installation {
id?: number | null
import { type Base, genBase } from "./_base"
export interface Installation extends Base {
code: string
name: string
encounterClass_code?: string | null
}
export interface CreateDto {
name: string
code: string
encounterClass_code?: string | null
}
export interface GetListDto {
page: number
size: number
name?: string
code?: string
encounterClass_code?: string
}
export interface GetDetailDto {
id?: string
}
export interface UpdateDto extends CreateDto {
id?: number
}
export interface DeleteDto {
id?: string
}
export function genInstallation(): Installation {
return {
...genBase(),
name: 'name',
code: 'code',
encounterClass_code: null,
}
}
+20
View File
@@ -0,0 +1,20 @@
import { type Base, genBase } from "./_base"
export interface InsuranceCompany extends Base {
code: string
name: string
regency_code: string
address: string
phoneNumber: string
}
export function genInsuranceCompany(): InsuranceCompany {
return {
...genBase(),
code: '',
name: '',
regency_code: '',
address: '',
phoneNumber: '',
}
}
+4 -3
View File
@@ -1,5 +1,6 @@
export interface ItemPrice {
id: number
import { type Base, genBase } from "./_base"
export interface ItemPrice extends Base {
item_id: number
price: number
insuranceCompany_code: string
@@ -32,7 +33,7 @@ export interface DeleteDto {
export function genItemPrice(): ItemPrice {
return {
id: 0,
...genBase(),
item_id: 1,
price: 1,
insuranceCompany_code: 'test',
+11 -10
View File
@@ -1,5 +1,6 @@
export interface Item {
id: number
import { type Base, genBase } from "./_base"
export interface Item extends Base {
name: string
code: string
itemGroup_code: string
@@ -25,24 +26,24 @@ export interface GetListDto {
}
export interface GetDetailDto {
id?: string
id: number
}
export interface UpdateDto extends CreateDto {
id?: number
id: number
}
export interface DeleteDto {
id?: string
id: string
}
export function genItem(): Item {
return {
id: 0,
name: 'test',
code: 'test',
itemGroup_code: 'test',
uom_code: 'test',
...genBase(),
name: '',
code: '',
itemGroup_code: '',
uom_code: '',
infra_id: 1,
stock: 1,
}
+13
View File
@@ -0,0 +1,13 @@
import { type Base, genBase } from "./_base"
export interface laborant extends Base {
employee_id: number
ihs_number?: string
}
export function genlaborant(): laborant {
return {
...genBase(),
employee_id: 0,
}
}
+14
View File
@@ -0,0 +1,14 @@
import { type Base, genBase } from "./_base"
export interface Language extends Base {
code: string
name: string
}
export function genMcuSrc(): Language {
return {
...genBase(),
code: '',
name: '',
}
}
+15
View File
@@ -0,0 +1,15 @@
import { type Base, genBase } from "./_base"
export interface MaterialOrderItem extends Base {
materialOrder_id: number
material_id: number
count?: number
}
export function genMaterialOrderItem(): MaterialOrderItem {
return {
...genBase(),
materialOrder_id: 0,
material_id: 0,
}
}
+15
View File
@@ -0,0 +1,15 @@
import { type Base, genBase } from "./_base"
export interface MaterialOrder extends Base {
encounter_id: number
doctor_id: number
status_code?: string
}
export function genMaterialOrder(): MaterialOrder {
return {
...genBase(),
encounter_id: 0,
doctor_id: 0,
}
}
+13 -1
View File
@@ -1,6 +1,18 @@
export interface Material {
import { type Base, genBase } from "./_base"
export interface Material extends Base {
code: string
name: string
uom_code: string
stock: number
}
export function genMaterial(): Material {
return {
...genBase(),
code: '',
name: '',
uom_code: '',
stock: 0,
}
}
+17
View File
@@ -0,0 +1,17 @@
import { type Base, genBase } from "./_base"
export interface McuOrderItem extends Base {
mcuOrder_id: number
mcuSrc_id: number
examinationDate?: string
result?: string
status_code?: string
}
export function genMcuOrderItem(): McuOrderItem {
return {
...genBase(),
mcuOrder_id: 0,
mcuSrc_id: 0,
}
}
+16
View File
@@ -0,0 +1,16 @@
import { type Base, genBase } from "./_base"
export interface McuOrderSubItem extends Base {
mcuSubSrc_id: number
mcuOrderItem_id: number
result?: string
status_code?: string
}
export function genMcuOrderSubItem(): McuOrderSubItem {
return {
...genBase(),
mcuSubSrc_id: 0,
mcuOrderItem_id: 0,
}
}
+23
View File
@@ -0,0 +1,23 @@
import { type Base, genBase } from "./_base"
export interface McuOrder extends Base {
encounter_id: number
doctor_id: number
status_code?: string
specimenPickTime: string
examinationDate: string
number?: number
temperature?: number
mcuUrgencyLevel_code?: string
}
export function genMcuOrder(): McuOrder {
return {
...genBase(),
encounter_id: 0,
doctor_id: 0,
specimenPickTime: '',
examinationDate: ''
}
}
+16
View File
@@ -0,0 +1,16 @@
import { type Base, genBase } from "./_base"
export interface McuSrcCategory extends Base {
code: string
name: string
scope_code: string
}
export function genMcuSrcCategory(): McuSrcCategory {
return {
...genBase(),
code: '',
name: '',
scope_code: '',
}
}
+18
View File
@@ -0,0 +1,18 @@
import { type Base, genBase } from "./_base"
export interface McuSrc extends Base {
code: string
name: string
mcuSrcCategory_code: string
item_id: number
}
export function genMcuSrc(): McuSrc {
return {
...genBase(),
code: '',
name: '',
mcuSrcCategory_code: '',
item_id: 0
}
}
+18
View File
@@ -0,0 +1,18 @@
import { type Base, genBase } from "./_base"
export interface McuSubSrcCategory extends Base {
code: string
name: string
mcuSrc_id: number
item_id: number
}
export function genMcuSubSrcCategory(): McuSubSrcCategory {
return {
...genBase(),
code: '',
name: '',
mcuSrc_id: 0,
item_id: 0
}
}
+17
View File
@@ -0,0 +1,17 @@
import { type Base, genBase } from "./_base"
export interface MedicationItemDist extends Base {
medicationItem_id: number
nurse_id: number
dateTime: string
remain?: number
}
export function genMedicationItemDist(): MedicationItemDist {
return {
...genBase(),
medicationItem_id: 0,
nurse_id: 0,
dateTime: '',
}
}
+28
View File
@@ -0,0 +1,28 @@
import { type Base, genBase } from "./_base"
export interface MedicationItem extends Base {
medication_id: number
isMix?: boolean
medicine_id?: number
medicineMix_id?: number
frequency: number
dose: number
interval: number
intervalUnit_code: string
usage?: string
intervalMultplier?: number
quantity?: number
isRedeemed?: boolean
note?: string
}
export function genMedicationItem(): MedicationItem {
return {
...genBase(),
medication_id: 0,
frequency: 0,
dose: 0,
interval: 0,
intervalUnit_code: '',
}
}
+17
View File
@@ -0,0 +1,17 @@
import { type Base, genBase } from "./_base"
export interface Medication extends Base {
encounter_id: number
pharmachist_id: number
issuedAt?: string
status_code?: string
}
export function genMedication(): Medication {
return {
...genBase(),
encounter_id: 0,
pharmachist_id: 0,
}
}
+7 -6
View File
@@ -1,5 +1,6 @@
export interface MedicineGroup {
id: number
import { type Base, genBase } from "./_base"
export interface MedicineGroup extends Base {
name: string
code: string
}
@@ -28,10 +29,10 @@ export interface DeleteDto {
id?: string
}
export function genMedicineGroup(): MedicineGroup {
export function genMedicine(): MedicineGroup {
return {
id: 0,
name: '',
code: '',
...genBase(),
name: 'name',
code: 'code',
}
}
+5 -4
View File
@@ -1,5 +1,6 @@
export interface MedicineMethod {
id: number
import { type Base, genBase } from "./_base"
export interface MedicineMethod extends Base {
name: string
code: string
}
@@ -28,9 +29,9 @@ export interface DeleteDto {
id?: string
}
export function genMedicineMethod(): MedicineMethod {
export function genMedicine(): MedicineMethod {
return {
id: 0,
...genBase(),
name: 'name',
code: 'code',
}
+18 -19
View File
@@ -1,12 +1,8 @@
export interface MedicineBase {
name: string
code: string
}
import { type Base, genBase } from "./_base"
export interface Medicine {
id: number
name: string
export interface Medicine extends Base {
code: string
name: string
medicineGroup_code: string
medicineMethod_code: string
uom_code: string
@@ -14,9 +10,9 @@ export interface Medicine {
stock: number
}
export interface CreateDto {
name: string
export interface CreateDto {
code: string
name: string
medicineGroup_code: string
medicineMethod_code: string
uom_code: string
@@ -26,7 +22,6 @@ export interface CreateDto {
export interface UpdateDto extends CreateDto {
id: number
// id: string | number
}
export interface GetListDto {
@@ -45,22 +40,26 @@ export interface GetListDto {
}
export interface GetDetailDto {
id?: string
id: number
}
export interface UpdateDto extends CreateDto {
id: number
}
export interface DeleteDto {
id?: string
id: number
}
export function genMedicine(): Medicine {
return {
id: 0,
name: '',
code: '',
medicineGroup_code: '',
medicineMethod_code: '',
uom_code: '',
infra_id: '',
...genBase(),
name: 'name',
code: 'code',
medicineGroup_code: 'medicineGroup_code',
medicineMethod_code: 'medicineMethod_code',
uom_code: 'uom_code',
infra_id: null,
stock: 0
}
}
+3 -2
View File
@@ -1,6 +1,7 @@
import { type Base, genBase } from "./_base"
import { type Medicine, genMedicine } from "./medicine";
interface MedicinemixItem {
interface MedicinemixItem extends Base {
id: number
medicineMix_id: number
medicine_id: number
@@ -36,7 +37,7 @@ export interface DeleteDto {
export function MedicinemixItem(): MedicinemixItem {
return {
id: 0,
...genBase(),
medicineMix_id: 0,
medicine_id: 0,
medicine: genMedicine(),
+4 -3
View File
@@ -1,5 +1,6 @@
export interface Medicinemix {
id: number
import { type Base, genBase } from "./_base"
export interface Medicinemix extends Base {
name: string
uom_code: string
}
@@ -29,7 +30,7 @@ export interface DeleteDto {
export function genMedicinemix(): Medicinemix {
return {
id: 0,
...genBase(),
name: '',
uom_code: '',
}
+13
View File
@@ -0,0 +1,13 @@
import { type Base, genBase } from "./_base"
export interface Midwife extends Base {
employee_id: number
ihs_number?: string
}
export function genMidwife(): Midwife {
return {
...genBase(),
employee_id: 0,
}
}
+17
View File
@@ -0,0 +1,17 @@
import { type Base, genBase } from "./_base"
export interface Nurse extends Base {
employee_id: number
ihs_number?: string
unit_id: number
infra_id: number
}
export function genNurse(): Nurse {
return {
...genBase(),
employee_id: 0,
unit_id: 0,
infra_id: 0,
}
}
+15
View File
@@ -0,0 +1,15 @@
import { type Base, genBase } from "./_base"
export interface NutritionExam extends Base {
encounter_id: number
nutritionist_id: number
status_code?: string
}
export function genNutritionExam(): NutritionExam {
return {
...genBase(),
encounter_id: 0,
nutritionist_id: 0,
}
}
+17
View File
@@ -0,0 +1,17 @@
import { type Base, genBase } from "./_base"
export interface Nurse extends Base {
employee_id: number
ihs_number?: string
unit_id: number
infra_id: number
}
export function genNurse(): Nurse {
return {
...genBase(),
employee_id: 0,
unit_id: 0,
infra_id: 0,
}
}
+16
View File
@@ -0,0 +1,16 @@
import { type Base, genBase } from "./_base"
export interface PatientInsurance extends Base {
patient_id: number
insuranceCompany_id: number
member_number: string
}
export function genPatientInsurance(): PatientInsurance {
return {
...genBase(),
patient_id: 0,
insuranceCompany_id: 0,
member_number: ''
}
}
+137
View File
@@ -0,0 +1,137 @@
import { type Base, genBase } from './_base'
import type { PatientFormData } from '~/schemas/patient.schema'
import type { PersonAddressFormData } from '~/schemas/person-address.schema'
import type { PersonAddressRelativeFormData } from '~/schemas/person-address-relative.schema'
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 type { PersonAddress } from './person-address'
import type { PersonContact } from './person-contact'
import type { PersonRelative } from './person-relative'
import { contactTypeMapping } from '~/lib/constants'
export interface PatientBase extends Base {
person_id?: number
newBornStatus?: boolean
registeredAt?: Date | string | null
status_code?: string
number?: string
}
export interface PatientEntity extends PatientBase {
person: Person
personAddresses: PersonAddress[]
personContacts: PersonContact[]
personRelatives: PersonRelative[]
}
export interface genPatientProps {
patient: PatientFormData
residentAddress: PersonAddressFormData
cardAddress: PersonAddressRelativeFormData
familyData: PersonFamiliesFormData
contacts: PersonContactFormData
responsible: PersonRelativeFormData
}
export function genPatient(props: genPatientProps): PatientEntity {
const { patient, residentAddress, cardAddress, familyData, contacts, responsible } = props
const addresses: PersonAddress[] = [{ ...genBase(), person_id: 0, locationType: '', ...residentAddress }]
const familiesContact: PersonRelative[] = []
const personContacts: PersonContact[] = []
// jika alamat ktp sama dengan domisili saat ini
if (cardAddress.isSameAddress === '1') {
addresses.push({ ...genBase(), person_id: 0, locationType: '', ...residentAddress })
}
// add data orang tua
if (familyData.shareFamilyData === '1') {
for (const family of familyData.families) {
familiesContact.push({
id: 0,
relationship_code: family.relation,
name: family.name,
education_code: family.education,
occupation_name: family.occupation,
occupation_code: family.occupation,
responsible: false,
})
}
}
// add kontak pasien
if (contacts && contacts.contacts.length > 0) {
for (const contact of contacts.contacts) {
// Convert UI contactType to backend type_code using mapping
const mappedContactType = contactTypeMapping[contact.contactType]
personContacts.push({
...genBase(),
person_id: 0,
type_code: mappedContactType || '',
value: contact.contactNumber,
})
}
}
// add penanggung jawab
if (responsible) {
for (const contact of responsible.contacts) {
familiesContact.push({
id: 0,
relationship_code: contact.relation,
name: contact.name,
address: contact.address,
phoneNumber: contact.phone,
responsible: true,
})
}
}
return {
person: {
id: 0,
name: patient.fullName,
alias: patient.alias,
birthDate: patient.birthDate,
birthRegency_code: patient.birthPlace,
gender_code: patient.gender,
residentIdentityNumber: patient.identityNumber,
passportNumber: patient.passportNumber,
drivingLicenseNumber: patient.drivingLicenseNumber,
religion_code: patient.religion,
education_code: patient.education,
occupation_code: patient.job,
occupation_name: patient.job,
ethnic_code: patient.ethnicity,
language_code: patient.language,
communicationIssueStatus: patient.communicationBarrier,
disability: patient.disability,
nationality: patient.nationality,
// residentIdentityFileUrl: patient.residentIdentityFileUrl,
// passportFileUrl: patient.passportFileUrl,
// drivingLicenseFileUrl: patient.drivingLicenseFileUrl,
// familyIdentityFileUrl: patient.familyIdentityFileUrl,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
deletedAt: null,
},
personAddresses: addresses,
personContacts: personContacts,
personRelatives: familiesContact,
registeredAt: new Date(),
status_code: 'active',
newBornStatus: false,
person_id: 0,
id: 0,
number: '0x000000000000000000000000000000',
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
deletedAt: null,
}
}
+21
View File
@@ -0,0 +1,21 @@
import { type Base, genBase } from "./_base"
export interface PersonAddress extends Base {
person_id: number
locationType: string
address: string
rt?: string
rw?: string
postalCode?: string
village_code: string
}
export function genPersonAddress(): PersonAddress {
return {
...genBase(),
person_id: 0,
locationType: '',
address: '',
village_code: '',
}
}
+16
View File
@@ -0,0 +1,16 @@
import { type Base, genBase } from "./_base"
export interface PersonContact extends Base {
person_id: number
type_code: string
value: string
}
export function genPersonContact(): PersonContact {
return {
...genBase(),
person_id: 0,
type_code: '',
value: '',
}
}
+14
View File
@@ -0,0 +1,14 @@
export interface PersonRelative {
id: number
person_id?: number
relationship_code?: string
name?: string
address?: string
village_code?: string
gender_code?: string
phoneNumber?: string
education_code?: string
occupation_name?: string
occupation_code?: string
responsible?: boolean
}
+8 -6
View File
@@ -1,7 +1,8 @@
import type { ItemMeta } from '~/models/_model'
import { type Base, genBase } from "./_base"
export interface Person extends ItemMeta {
id: number
export interface Person extends Base {
// todo: awaiting approve from stake holder: buat field sapaan
// todo: adjust field ketika person Balita
name: string
alias?: string
frontTitle?: string
@@ -18,6 +19,9 @@ export interface Person extends ItemMeta {
occupation_name?: string
ethnic_code?: string
language_code?: string
nationality?: string
communicationIssueStatus?: boolean
disability?: string
residentIdentityFileUrl?: string
passportFileUrl?: string
drivingLicenseFileUrl?: string
@@ -26,9 +30,7 @@ export interface Person extends ItemMeta {
export function genPerson(): Person {
return {
id: 0,
createdAt: '',
updatedAt: '',
...genBase(),
name: '',
}
}
+13
View File
@@ -0,0 +1,13 @@
import { type Base, genBase } from "./_base"
export interface Pharmachist extends Base {
employee_id: number
ihs_number?: string
}
export function genPharmachist(): Pharmachist {
return {
...genBase(),
employee_id: 0,
}
}
+23
View File
@@ -0,0 +1,23 @@
import { type Base, genBase } from "./_base"
import { type Doctor, genDoctor } from "./doctor"
export interface PracticeSchedule extends Base {
doctor_id: number
doctor: Doctor
unit_code: number
day_code: number
starttime: string
endtime: string
}
export function genPracticeSchedule(): PracticeSchedule {
return {
...genBase(),
doctor_id: 0,
doctor: genDoctor(),
unit_code: 0,
day_code: 0,
starttime: '',
endtime: '',
}
}
+5 -6
View File
@@ -22,26 +22,26 @@ export interface CreateDto {
issuedAt: string
status_code: string
}
export interface GetListDto {
encounter_id: number
doctor_id: number
issuedAt: string
status_code: string
}
export interface GetDetailDto {
id?: string
}
export interface UpdateDto extends CreateDto {
id?: number
}
export interface DeleteDto {
id?: string
}
export function genPresciption(): Prescription {
return {
id: 0,
@@ -54,4 +54,3 @@ export function genPresciption(): Prescription {
items: [],
}
}
+14
View File
@@ -0,0 +1,14 @@
import { type Base, genBase } from "./_base"
export interface Province extends Base {
code: string
name: string
}
export function genProvince(): Province {
return {
...genBase(),
code: '',
name: '',
}
}
+22
View File
@@ -0,0 +1,22 @@
import { type Base, genBase } from "./_base"
export interface Queue extends Base {
appointment_id: number
counter_id: number
status_code: string
waitTimeStamp: number
startTimeStamp: number
endTimeStamp: number
}
export function genQueue(): Queue {
return {
...genBase(),
appointment_id: 0,
counter_id: 0,
status_code: '',
waitTimeStamp: 0,
startTimeStamp: 0,
endTimeStamp: 0,
}
}
+16
View File
@@ -0,0 +1,16 @@
import { type Base, genBase } from "./_base"
export interface Regency extends Base {
code: string
name: string
province_code: string
}
export function genRegency(): Regency {
return {
...genBase(),
code: '',
name: '',
province_code: '',
}
}
+17
View File
@@ -0,0 +1,17 @@
import { type Base, genBase } from "./_base"
export interface Sbar extends Base {
encounter_id: number
employee_id: number
time?: string
value: unknown
}
export function genSbar(): Sbar {
return {
...genBase(),
encounter_id: 0,
employee_id: 0,
value: '',
}
}
+18
View File
@@ -0,0 +1,18 @@
import { type Base, genBase } from "./_base"
export interface Soapi extends Base {
encounter_id: number
employee_id: number
time?: string
typeCode?: string
value: unknown
}
export function genSoapi(): Soapi {
return {
...genBase(),
encounter_id: 0,
employee_id: 0,
value: '',
}
}
+6 -10
View File
@@ -1,29 +1,25 @@
import type { ItemMeta } from "./_model";
import { type Base, genBase } from "./_base"
import { type Person, genPerson } from "./person";
import { type Specialist, genSpecialist } from "./specialist";
import { type Subspecialist, genSubspecialist } from "./subspecialist";
import { type Subspecialist } from "./subspecialist";
export interface SpecialistIntern extends ItemMeta {
export interface SpecialistIntern extends Base {
person_id: number
person: Person
specialist_id: number
specialist: Specialist
subspecialist_id: number
subspecialist: Subspecialist
subspecialist_id?: number
subspecialist?: Subspecialist
user_id: number
}
export function genSpecialistIntern(): SpecialistIntern {
return {
id: 0,
createdAt: '',
updatedAt: '',
...genBase(),
person_id: 0,
person: genPerson(),
specialist_id: 0,
specialist: genSpecialist(),
subspecialist_id: 0,
subspecialist: genSubspecialist(),
user_id: 0,
}
}
+5 -7
View File
@@ -1,18 +1,16 @@
import type { ItemMeta } from "./_model"
import { type Base, genBase } from "./_base"
export interface Specialist extends ItemMeta {
export interface Specialist extends Base {
code: string
name: string
unit_id: number | string
unit_id?: number | string | null
}
export function genSpecialist(): Specialist {
return {
id: 0,
createdAt: '',
updatedAt: '',
...genBase(),
code: '',
name: '',
unit_id: 0
}
}
}
+5 -7
View File
@@ -1,18 +1,16 @@
import type { ItemMeta } from "./_model"
import { type Base, genBase } from "./_base"
export interface Subspecialist extends ItemMeta {
export interface Subspecialist extends Base {
code: string
name: string
specialist_id: number | string
specialist_id?: number | string | null
}
export function genSubspecialist(): Subspecialist {
return {
id: 0,
createdAt: '',
updatedAt: '',
...genBase(),
code: '',
name: '',
specialist_id: 0
}
}
}
+32
View File
@@ -0,0 +1,32 @@
import { type Base, genBase } from "./_base"
export interface triage extends Base {
encounter_id: number
arrival_time: string
arrival_condition_code: string
arrival_transporation_code: string
patient_name: string
patient_id: number
patient_residentIdentityNumber: string
patient_birthDate: string
patient_gender_code: string
diagnosis: string
doctor_id: number
}
export function gentriage(): triage {
return {
...genBase(),
encounter_id: 0,
arrival_time: '',
arrival_condition_code: '',
arrival_transporation_code: '',
patient_name: '',
patient_id: 0,
patient_residentIdentityNumber: '',
patient_birthDate: '',
patient_gender_code: '',
diagnosis: '',
doctor_id: 0,
}
}
+13 -3
View File
@@ -1,6 +1,16 @@
export interface Unit {
id?: number
import { type Base, genBase } from "./_base"
export interface Unit extends Base {
code: string
name: string
installation_id?: string | number
installation_id?: number | string | null
}
export function genUnit(): Unit {
return {
...genBase(),
code: '',
name: '',
installation_id: 0,
}
}
+5 -2
View File
@@ -1,4 +1,6 @@
export interface Uom {
import { type Base, genBase } from "./_base"
export interface Uom extends Base {
code: string
name: string
erp_id: string
@@ -6,8 +8,9 @@ export interface Uom {
export function genUom(): Uom {
return {
...genBase(),
code: '',
name: '',
erp_id: '',
}
}
}
+8 -10
View File
@@ -1,19 +1,17 @@
export interface User {
id: number
import { type Base, genBase } from "./_base"
export interface User extends Base {
name: string
password: string
// password: string // not returning password from API
status_code: string
createdAt: string
updatedAt: string
position_code: string
}
export function genUser(): User {
return {
id: 0,
...genBase(),
name: '',
password: '',
status_code: '',
createdAt: '',
updatedAt: '',
}
position_code: ''
}
}