feat (encounter): update entity and adjust
This commit is contained in:
@@ -4,8 +4,10 @@ import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
evs "simrs-vx/internal/domain/bpjs-entities/vclaim-sep"
|
||||
ea "simrs-vx/internal/domain/main-entities/appointment"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
@@ -25,7 +27,13 @@ type CreateDto struct {
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code" gorm:"size:10"`
|
||||
InsuranceCompany_Id *uint `json:"insuranceCompany_id"`
|
||||
Member_Number *string `json:"memberNumber" validate:"maxLength=20"`
|
||||
Ref_Number *string `json:"refNumber" validate:"maxLength=20"`
|
||||
Trx_Number *string `json:"trxNumber" validate:"maxLength=20"`
|
||||
Appointment_Doctor_Id *uint `json:"appointment_doctor_id"`
|
||||
Adm_Employee_Id *uint `json:"adm_employee_id"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
RefSource_Name *string `json:"refSource_name" validate:"maxLength=100"`
|
||||
Appointment_Id *uint `json:"appointment_id"`
|
||||
@@ -97,10 +105,17 @@ type ResponseDto struct {
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code"`
|
||||
InsuranceCompany_Id *uint `json:"insuranceCompany_id"`
|
||||
Member_Number *string `json:"memberNumber"`
|
||||
Ref_Number *string `json:"refNumber"`
|
||||
Trx_Number *string `json:"trxNumber"`
|
||||
Appointment_Doctor_Id *uint `json:"assignment_doctor_id"`
|
||||
Appointment_Doctor *ed.Doctor `json:"assignment_doctor,omitempty"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty"`
|
||||
Adm_Employee_Id *uint `json:"adm_employee_id"`
|
||||
Adm_Employee *ee.Employee `json:"adm_employee,omitempty"`
|
||||
DischargeMethod_Code *ere.DischargeMethodCode `json:"dischargeMethod_code"`
|
||||
RefSource_Name *string `json:"refSource_name"`
|
||||
Appointment_Id *uint `json:"appointment_id"`
|
||||
@@ -110,6 +125,7 @@ type ResponseDto struct {
|
||||
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
||||
DischargeReason *string `json:"dischargeReason"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
VclaimSep *evs.VClaimSep `json:"vclaimSep,omitempty"`
|
||||
}
|
||||
|
||||
func (d Encounter) ToResponse() ResponseDto {
|
||||
@@ -125,8 +141,15 @@ func (d Encounter) ToResponse() ResponseDto {
|
||||
Subspecialist_Id: d.Subspecialist_Id,
|
||||
Subspecialist: d.Subspecialist,
|
||||
VisitDate: d.VisitDate,
|
||||
PaymentMethod_Code: d.PaymentMethod_Code,
|
||||
InsuranceCompany_Id: d.InsuranceCompany_Id,
|
||||
Member_Number: d.Member_Number,
|
||||
Ref_Number: d.Ref_Number,
|
||||
Trx_Number: d.Trx_Number,
|
||||
Appointment_Doctor_Id: d.Appointment_Doctor_Id,
|
||||
Appointment_Doctor: d.Appointment_Doctor,
|
||||
Adm_Employee_Id: d.Adm_Employee_Id,
|
||||
Adm_Employee: d.Adm_Employee,
|
||||
Responsible_Doctor_Id: d.Responsible_Doctor_Id,
|
||||
Responsible_Doctor: d.Responsible_Doctor,
|
||||
DischargeMethod_Code: d.DischargeMethod_Code,
|
||||
@@ -138,6 +161,7 @@ func (d Encounter) ToResponse() ResponseDto {
|
||||
AdmDischargeEducation: d.AdmDischargeEducation,
|
||||
DischargeReason: d.DischargeReason,
|
||||
Status_Code: d.Status_Code,
|
||||
VclaimSep: d.VclaimSep,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -32,14 +32,14 @@ type Encounter struct {
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
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"`
|
||||
Ref_Number *string `json:"refNumber" gorm:"unique;size:20"`
|
||||
Trx_Number *string `json:"trxNumber" gorm:"unique;size:20"`
|
||||
InsuranceCompany *ei.InsuranceCompany `json:"insuranceCompany,omitempty" gorm:"foreignKey:InsuranceCompany_Id;references:Id"`
|
||||
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:"admEmployee_id"`
|
||||
Adm_Employee *ee.Employee `json:"admEmployee,omitempty" gorm:"foreignKey:Adm_Employee_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"`
|
||||
DischargeMethod_Code *ere.DischargeMethodCode `json:"dischargeMethod_code" gorm:"size:16"`
|
||||
|
||||
@@ -55,7 +55,13 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Encounter) {
|
||||
data.Specialist_Id = inputSrc.Specialist_Id
|
||||
data.Subspecialist_Id = inputSrc.Subspecialist_Id
|
||||
data.VisitDate = inputSrc.VisitDate
|
||||
data.PaymentMethod_Code = inputSrc.PaymentMethod_Code
|
||||
data.InsuranceCompany_Id = inputSrc.InsuranceCompany_Id
|
||||
data.Member_Number = inputSrc.Member_Number
|
||||
data.Ref_Number = inputSrc.Ref_Number
|
||||
data.Trx_Number = inputSrc.Trx_Number
|
||||
data.Appointment_Doctor_Id = inputSrc.Appointment_Doctor_Id
|
||||
data.Adm_Employee_Id = inputSrc.Adm_Employee_Id
|
||||
data.Responsible_Doctor_Id = inputSrc.Responsible_Doctor_Id
|
||||
data.RefSource_Name = inputSrc.RefSource_Name
|
||||
data.Appointment_Id = inputSrc.Appointment_Id
|
||||
|
||||
Reference in New Issue
Block a user