77 lines
5.5 KiB
Go
77 lines
5.5 KiB
Go
package encounter
|
|
|
|
import (
|
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
|
evs "simrs-vx/internal/domain/bpjs-entities/vclaim-sep"
|
|
eam "simrs-vx/internal/domain/main-entities/ambulatory"
|
|
ea "simrs-vx/internal/domain/main-entities/appointment"
|
|
edc "simrs-vx/internal/domain/main-entities/death-cause"
|
|
ed "simrs-vx/internal/domain/main-entities/doctor"
|
|
eem "simrs-vx/internal/domain/main-entities/emergency"
|
|
ee "simrs-vx/internal/domain/main-entities/employee"
|
|
eip "simrs-vx/internal/domain/main-entities/inpatient"
|
|
ei "simrs-vx/internal/domain/main-entities/insurance-company"
|
|
eir "simrs-vx/internal/domain/main-entities/internal-reference"
|
|
ep "simrs-vx/internal/domain/main-entities/patient"
|
|
er "simrs-vx/internal/domain/main-entities/rehab/base"
|
|
es "simrs-vx/internal/domain/main-entities/specialist"
|
|
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
|
eu "simrs-vx/internal/domain/main-entities/unit"
|
|
|
|
erc "simrs-vx/internal/domain/references/common"
|
|
ere "simrs-vx/internal/domain/references/encounter"
|
|
"time"
|
|
)
|
|
|
|
type Encounter struct {
|
|
ecore.Main // adjust this according to the needs
|
|
Patient_Id *uint `json:"patient_id"`
|
|
Patient *ep.Patient `json:"patient,omitempty" gorm:"foreignKey:Patient_Id;references:Id"`
|
|
RegisteredAt *time.Time `json:"registeredAt"`
|
|
Class_Code ere.EncounterClassCode `json:"class_code" gorm:"not null;size:10"`
|
|
Unit_Id *uint `json:"unit_id"`
|
|
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
|
Specialist_Id *uint16 `json:"specialist_id"`
|
|
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
|
|
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
|
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"`
|
|
VisitDate time.Time `json:"visitDate"`
|
|
StartedAt *time.Time `json:"startedAt"`
|
|
FinishedAt *time.Time `json:"finishedAt"`
|
|
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code" gorm:"size:10"`
|
|
InsuranceCompany_Id *uint `json:"insuranceCompany_id"`
|
|
InsuranceCompany *ei.InsuranceCompany `json:"insuranceCompany,omitempty" gorm:"foreignKey:InsuranceCompany_Id;references:Id"`
|
|
Member_Number *string `json:"memberNumber" gorm:"unique;size:20"`
|
|
RefType_Code *ere.RefTypeCode `json:"refType_code"`
|
|
Ref_Number *string `json:"refNumber" gorm:"unique;size:20"`
|
|
Trx_Number *string `json:"trxNumber" gorm:"unique;size:20"`
|
|
Appointment_Doctor_Id *uint `json:"appointment_doctor_id"`
|
|
Appointment_Doctor *ed.Doctor `json:"appointment_doctor,omitempty" gorm:"foreignKey:Appointment_Doctor_Id;references:Id"`
|
|
Adm_Employee_Id *uint `json:"adm_employee_id"`
|
|
Adm_Employee *ee.Employee `json:"adm_employee,omitempty" gorm:"foreignKey:Adm_Employee_Id;references:Id"`
|
|
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
|
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty" gorm:"foreignKey:Responsible_Doctor_Id;references:Id"`
|
|
Discharge_Method_Code *ere.DischargeMethodCode `json:"discharge_method_code" gorm:"size:16"`
|
|
RefSource_Name *string `json:"refSource_name" gorm:"size:100"`
|
|
Appointment_Id *uint `json:"appointment_id"`
|
|
Appointment *ea.Appointment `json:"appointment,omitempty" gorm:"foreignKey:Appointment_Id;references:Id"`
|
|
EarlyEducation *string `json:"earlyEducation"`
|
|
MedicalDischargeEducation *string `json:"medicalDischargeEducation"`
|
|
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
|
DischargeReason *string `json:"dischargeReason"`
|
|
Status_Code erc.DataStatusCode `json:"status_code" gorm:"size:10"`
|
|
VclaimSep *evs.VclaimSep `json:"vclaimSep,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
|
Discharge_Date *time.Time `json:"discharge_date"`
|
|
InternalReferences *[]eir.InternalReference `json:"internalReferences,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
|
DeathCause *edc.DeathCause `json:"deathCause,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
|
NewStatus bool `json:"newStatus"`
|
|
Ambulatory *eam.Ambulatory `json:"ambulatory,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
|
Emergency *eem.Emergency `json:"emergency,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
|
Inpatient *eip.Inpatient `json:"inpatient,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
|
Rehab *er.Basic `json:"rehab,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
|
}
|
|
|
|
func (d Encounter) IsDone() bool {
|
|
return d.Status_Code == erc.DSCDone
|
|
}
|