remove several ids and fix constraint

This commit is contained in:
dpurbosakti
2025-11-10 13:25:00 +07:00
parent 363467a8cb
commit 6d49dca925
36 changed files with 294 additions and 305 deletions

No files matched your search

@@ -20,7 +20,7 @@ type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Date *time.Time `json:"date"`
Problem *string `json:"problem" validate:"maxLength=10240"`
DstUnit_Id *uint `json:"dstUnit_id"`
DstUnit_Code *string `json:"dstUnit_code"`
}
type ReadListDto struct {
@@ -30,9 +30,9 @@ type ReadListDto struct {
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
DstUnit_Id *uint `json:"dstUnit-id"`
DstDoctor_Id *uint `json:"dstDoctor-id"`
Encounter_Id *uint `json:"encounter-id"`
DstUnit_Code *string `json:"dstUnit-code"`
DstDoctor_Code *string `json:"dstDoctor-code"`
}
type ReadDetailDto struct {
@@ -63,29 +63,29 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Date *time.Time `json:"date"`
Problem *string `json:"problem"`
Solution *string `json:"solution"`
DstUnit_Id *uint `json:"dstUnit_id"`
DstUnit *eu.Unit `json:"dstUnit,omitempty"`
DstDoctor_Id *uint `json:"dstDoctor_id"`
DstDoctor *ed.Doctor `json:"dstDoctor,omitempty"`
RepliedAt *time.Time `json:"repliedAt"`
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Date *time.Time `json:"date"`
Problem *string `json:"problem"`
Solution *string `json:"solution"`
DstUnit_Code *string `json:"dstUnit_code"`
DstUnit *eu.Unit `json:"dstUnit,omitempty"`
DstDoctor_Code *string `json:"dstDoctor_code"`
DstDoctor *ed.Doctor `json:"dstDoctor,omitempty"`
RepliedAt *time.Time `json:"repliedAt"`
}
func (d Consultation) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Date: d.Date,
Problem: d.Problem,
Solution: d.Solution,
DstUnit_Id: d.DstUnit_Id,
DstUnit: d.DstUnit,
DstDoctor_Id: d.DstDoctor_Id,
DstDoctor: d.DstDoctor,
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Date: d.Date,
Problem: d.Problem,
Solution: d.Solution,
DstUnit_Code: d.DstUnit_Code,
DstUnit: d.DstUnit,
DstDoctor_Code: d.DstDoctor_Code,
DstDoctor: d.DstDoctor,
}
resp.Main = d.Main
return resp
@@ -17,11 +17,9 @@ type Consultation struct {
Problem *string `json:"case" gorm:"size:10240"`
Solution *string `json:"solution" gorm:"size:10240"`
DstUnit_Id *uint `json:"dstUnit_id"`
DstUnit_Code *string `json:"dstUnit_code"`
DstUnit *eu.Unit `json:"dstUnit" gorm:"foreignKey:DstUnit_Id;references:Id"`
DstDoctor_Id *uint `json:"dstDoctor_id"`
DstUnit *eu.Unit `json:"dstUnit" gorm:"foreignKey:DstUnit_Code;references:Code"`
DstDoctor_Code *string `json:"dstDoctor_code"`
DstDoctor *ed.Doctor `json:"dstDoctor" gorm:"foreignKey:DstDoctor_Id;references:Id"`
DstDoctor *ed.Doctor `json:"dstDoctor" gorm:"foreignKey:DstDoctor_Code;references:Code"`
RepliedAt *time.Time `json:"repliedAt"`
}
@@ -5,7 +5,6 @@ import (
"time"
// internal - lib
pa "simrs-vx/internal/lib/auth"
// internal - domain - base-entities
ecore "simrs-vx/internal/domain/base-entities/core"
@@ -20,12 +19,12 @@ import (
)
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Unit_Id *uint `json:"unit_id"`
Specialist_Id *uint `json:"specialist_id"`
Subspecialist_Id *uint `json:"subspecialist_id"`
Doctor_Id *uint `json:"doctor_id"`
Date *time.Time `json:"date"`
Encounter_Id *uint `json:"encounter_id"`
Unit_Code *string `json:"unit_code"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
Doctor_Code *string `json:"doctor_code"`
Date *time.Time `json:"date"`
}
type ReadListDto struct {
@@ -35,12 +34,12 @@ type ReadListDto struct {
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Unit_Id *uint `json:"unit-id"`
Specialist_Id *uint `json:"specialist-id"`
Subspecialist_Id *uint `json:"subspecialist-id"`
Doctor_Id *uint `json:"doctor-id"`
Date *time.Time `json:"date"`
Encounter_Id *uint `json:"encounter-id"`
Unit_Code *string `json:"unit-code"`
Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"`
Doctor_Code *string `json:"doctor-code"`
Date *time.Time `json:"date"`
}
type ReadDetailDto struct {
@@ -57,13 +56,6 @@ type DeleteDto struct {
Id uint `json:"id"`
}
type ReplyDto struct {
Id uint `json:"id"`
Solution *string `json:"solution"`
pa.AuthInfo
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
@@ -72,32 +64,32 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Unit_Id *uint `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty"`
Specialist_Id *uint `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Id *uint `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
Date *time.Time `json:"date"`
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Code *string `json:"subspecialist_code"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
Date *time.Time `json:"date"`
}
func (d ControlLetter) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Unit_Id: d.Unit_Id,
Unit: d.Unit,
Specialist_Id: d.Specialist_Id,
Specialist: d.Specialist,
Subspecialist_Id: d.Subspecialist_Id,
Subspecialist: d.Subspecialist,
Doctor_Id: d.Doctor_Id,
Doctor: d.Doctor,
Date: d.Date,
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Unit_Code: d.Unit_Code,
Unit: d.Unit,
Specialist_Code: d.Specialist_Code,
Specialist: d.Specialist,
Subspecialist_Code: d.Subspecialist_Code,
Subspecialist: d.Subspecialist,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
Date: d.Date,
}
resp.Main = d.Main
return resp
@@ -15,17 +15,13 @@ type ControlLetter struct {
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter" gorm:"foreignKey:Encounter_Id;references:Id"`
Unit_Id *uint `json:"unit_id"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit" gorm:"foreignKey:Unit_Id;references:Id"`
Specialist_Id *uint `json:"specialist_id"`
Unit *eu.Unit `json:"unit" gorm:"foreignKey:Unit_Code;references:Code"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist" gorm:"foreignKey:Specialist_Id;references:Id"`
Subspecialist_Id *uint `json:"subspecialist_id"`
Specialist *es.Specialist `json:"specialist" gorm:"foreignKey:Specialist_Code;references:Code"`
Subspecialist_Code *string `json:"subspecialist_code"`
Subspecialist *ess.Subspecialist `json:"subspecialist" gorm:"foreignKey:Subspecialist_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist" gorm:"foreignKey:Subspecialist_Code;references:Code"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor" gorm:"foreignKey:Doctor_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor" gorm:"foreignKey:Doctor_Code;references:Code"`
Date *time.Time `json:"date"`
}
+4 -3
View File
@@ -38,7 +38,7 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
@@ -46,12 +46,13 @@ type ReadDetailDto struct {
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
+38 -38
View File
@@ -33,27 +33,27 @@ import (
)
type CreateDto struct {
Patient_Id *uint `json:"patient_id"`
RegisteredAt *time.Time `json:"registeredAt"`
Class_Code ere.EncounterClassCode `json:"class_code" validate:"maxLength=10"`
SubClass_Code *string `json:"subClass_code" validate:"maxLength=10"` // for sub
Infra_Id *uint16 `json:"infra_id"` // for inpatient
Unit_Id *uint `json:"unit_id"`
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:"member_number" validate:"maxLength=20"`
Ref_Number *string `json:"ref_number" validate:"maxLength=20"`
Trx_Number *string `json:"trx_number" validate:"maxLength=20"`
Appointment_Doctor_Id *uint `json:"appointment_doctor_id"`
Adm_Employee_Id *uint `json:"-"`
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
RefSource_Name *string `json:"refSource_name" validate:"maxLength=100"`
Appointment_Id *uint `json:"appointment_id"`
RefTypeCode ere.RefTypeCode `json:"refTypeCode"`
NewStatus bool `json:"newStatus"`
Patient_Id *uint `json:"patient_id"`
RegisteredAt *time.Time `json:"registeredAt"`
Class_Code ere.EncounterClassCode `json:"class_code" validate:"maxLength=10"`
SubClass_Code *string `json:"subClass_code" validate:"maxLength=10"` // for sub
Infra_Id *uint16 `json:"infra_id"` // for inpatient
Unit_Id *uint `json:"unit_id"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
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:"member_number" validate:"maxLength=20"`
Ref_Number *string `json:"ref_number" validate:"maxLength=20"`
Trx_Number *string `json:"trx_number" validate:"maxLength=20"`
Appointment_Doctor_Code *string `json:"appointment_doctor_code"`
Adm_Employee_Id *uint `json:"-"`
Responsible_Doctor_Code *string `json:"responsible_doctor_code"`
RefSource_Name *string `json:"refSource_name" validate:"maxLength=100"`
Appointment_Id *uint `json:"appointment_id"`
RefTypeCode ere.RefTypeCode `json:"refTypeCode"`
NewStatus bool `json:"newStatus"`
Id uint `json:"-"`
RecentEncounterAdm *Encounter `json:"-"` // if subClass_Code is rehab
@@ -76,11 +76,11 @@ type FilterDto struct {
RegisteredAt *time.Time `json:"registeredAt"`
Class_Code ere.EncounterClassCode `json:"class-code" validate:"maxLength=10"`
Unit_Id *uint `json:"unit-id"`
Specialist_Id *uint16 `json:"specialist-id"`
Subspecialist_Id *uint16 `json:"subspecialist-id"`
Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"`
VisitDate time.Time `json:"visitDate"`
Appoinment_Doctor_Id *uint `json:"appointment-doctor-id"`
Responsible_Doctor_Id *uint `json:"responsible-doctor-id"`
Appoinment_Doctor_Code *string `json:"appointment-doctor-code"`
Responsible_Doctor_Code *string `json:"responsible-doctor-code"`
DischargeMethod_Code ere.DischargeMethodCode `json:"dischargeMethod-code" validate:"maxLength=10"`
RefSource_Name *string `json:"refSource-name" validate:"maxLength=100"`
Appointment_Id *uint `json:"appointment-id"`
@@ -125,11 +125,11 @@ type DischargeDto struct {
}
type CheckinDto struct {
Id uint `json:"id"`
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
Adm_Employee_Id *uint `json:"adm_employee_id"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
Id uint `json:"id"`
Responsible_Doctor_Code *string `json:"responsible_doctor_code"`
Adm_Employee_Id *uint `json:"adm_employee_id"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
}
type SwitchUnitDto struct {
@@ -150,9 +150,9 @@ type ResponseDto struct {
RegisteredAt *time.Time `json:"registeredAt"`
Class_Code ere.EncounterClassCode `json:"class_code"`
Unit_Id *uint `json:"unit_id"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist_Code *string `json:"subspecialist_code"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
Unit *eu.Unit `json:"unit,omitempty"`
VisitDate time.Time `json:"visitDate"`
@@ -161,9 +161,9 @@ type ResponseDto struct {
Member_Number *string `json:"member_number"`
Ref_Number *string `json:"ref_number"`
Trx_Number *string `json:"trx_number"`
Appointment_Doctor_Id *uint `json:"appointment_doctor_id"`
Appointment_Doctor_Code *string `json:"appointment_doctor_code"`
Appointment_Doctor *ed.Doctor `json:"appointment_doctor,omitempty"`
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
Responsible_Doctor_Code *string `json:"responsible_doctor_code"`
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty"`
Adm_Employee_Id *uint `json:"adm_employee_id"`
Adm_Employee *ee.Employee `json:"adm_employee,omitempty"`
@@ -198,9 +198,9 @@ func (d Encounter) ToResponse() ResponseDto {
Class_Code: d.Class_Code,
Unit_Id: d.Unit_Id,
Unit: d.Unit,
Specialist_Id: d.Specialist_Id,
Specialist_Code: d.Specialist_Code,
Specialist: d.Specialist,
Subspecialist_Id: d.Subspecialist_Id,
Subspecialist_Code: d.Subspecialist_Code,
Subspecialist: d.Subspecialist,
VisitDate: d.VisitDate,
PaymentMethod_Code: d.PaymentMethod_Code,
@@ -208,11 +208,11 @@ func (d Encounter) ToResponse() ResponseDto {
Member_Number: d.Member_Number,
Ref_Number: d.Ref_Number,
Trx_Number: d.Trx_Number,
Appointment_Doctor_Id: d.Appointment_Doctor_Id,
Appointment_Doctor_Code: d.Appointment_Doctor_Code,
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_Code: d.Responsible_Doctor_Code,
Responsible_Doctor: d.Responsible_Doctor,
Discharge_Method_Code: d.Discharge_Method_Code,
RefSource_Name: d.RefSource_Name,
@@ -30,31 +30,29 @@ type Encounter struct {
RegisteredAt *time.Time `json:"registeredAt"`
Class_Code ere.EncounterClassCode `json:"class_code" gorm:"not null;size:10"`
Unit_Id *uint `json:"unit_id"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist_Code *string `json:"specialist_code"`
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"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
Subspecialist_Code *string `json:"subspecialist_code"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
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_Code *string `json:"insuranceCompany_code"`
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_Code *string `json:"appointment_doctor_code"`
Appointment_Doctor *ed.Doctor `json:"appointment_doctor,omitempty" gorm:"foreignKey:Appointment_Doctor_Id;references:Id"`
Appointment_Doctor *ed.Doctor `json:"appointment_doctor,omitempty" gorm:"foreignKey:Appointment_Doctor_Code;references:Code"`
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_Code *string `json:"responsible_doctor_code"`
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty" gorm:"foreignKey:Responsible_Doctor_Id;references:Id"`
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty" gorm:"foreignKey:Responsible_Doctor_Code;references:Code"`
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"`
@@ -10,8 +10,8 @@ import (
type CreateDto struct {
Encounter_Id *uint `json:"-"`
Unit_Id *uint16 `json:"unit_id"`
Doctor_Id *uint `json:"doctor_Id"`
Unit_Code *string `json:"unit_code"`
Doctor_Code *string `json:"doctor_code"`
Status_Code erc.DataApprovalCode `json:"status_code"`
}
@@ -23,8 +23,8 @@ type ReadListDto struct {
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Unit_Id *uint `json:"unit-id"`
Doctor_Id *uint `json:"doctor-id"`
Unit_Code *uint `json:"unit-code"`
Doctor_Code *uint `json:"doctor-code"`
Status_Code erc.DataApprovalCode `json:"status-code"`
}
@@ -51,9 +51,9 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Unit_Id *uint16 `json:"unit_id"`
Unit_Code *string `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
Status_Code *erc.DataApprovalCode `json:"status_code"`
}
@@ -61,9 +61,9 @@ type ResponseDto struct {
func (d InternalReference) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Unit_Id: d.Unit_Id,
Unit_Code: d.Unit_Code,
Unit: d.Unit,
Doctor_Id: d.Doctor_Id,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
Status_Code: d.Status_Code,
}
@@ -11,11 +11,9 @@ import (
type InternalReference struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Unit_Id *uint16 `json:"unit_id"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Status_Code *erc.DataApprovalCode `json:"status_code"`
}
+4 -3
View File
@@ -29,19 +29,20 @@ type FilterDto struct {
Infra_Code *string `json:"infra-code"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -6,11 +6,11 @@ import (
)
type CreateDto struct {
Doctor_Id *uint `json:"doctor_id"`
Unit_Code *string `json:"unit_code"`
Day_Code *erc.DayCode `json:"day_code"`
StartTime *string `json:"startTime" validate:"maxLength=5"`
EndTime *string `json:"endTime" validate:"maxLength=5"`
Doctor_Code *string `json:"doctor_code"`
Unit_Code *string `json:"unit_code"`
Day_Code *erc.DayCode `json:"day_code"`
StartTime *string `json:"startTime" validate:"maxLength=5"`
EndTime *string `json:"endTime" validate:"maxLength=5"`
}
type ReadListDto struct {
@@ -20,11 +20,11 @@ type ReadListDto struct {
}
type FilterDto struct {
Doctor_Id *uint `json:"doctor-id"`
Unit_Code *string `json:"unit-code"`
Day_Code *erc.DayCode `json:"day-code"`
StartTime *string `json:"startTime"`
EndTime *string `json:"endTime"`
Doctor_Code *string `json:"doctor-code"`
Unit_Code *string `json:"unit-code"`
Day_Code *erc.DayCode `json:"day-code"`
StartTime *string `json:"startTime"`
EndTime *string `json:"endTime"`
}
type ReadDetailDto struct {
@@ -48,20 +48,20 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Doctor_Id *uint `json:"doctor_id"`
Unit_Code *string `json:"unit_code"`
Day_Code *erc.DayCode `json:"day_code"`
StartTime *string `json:"startTime"`
EndTime *string `json:"endTime"`
Doctor_Code *string `json:"doctor_code"`
Unit_Code *string `json:"unit_code"`
Day_Code *erc.DayCode `json:"day_code"`
StartTime *string `json:"startTime"`
EndTime *string `json:"endTime"`
}
func (d PracticeSchedule) ToResponse() ResponseDto {
resp := ResponseDto{
Doctor_Id: d.Doctor_Id,
Unit_Code: d.Unit_Code,
Day_Code: d.Day_Code,
StartTime: d.StartTime,
EndTime: d.EndTime,
Doctor_Code: d.Doctor_Code,
Unit_Code: d.Unit_Code,
Day_Code: d.Day_Code,
StartTime: d.StartTime,
EndTime: d.EndTime,
}
resp.Main = d.Main
return resp
@@ -9,9 +9,8 @@ import (
type PracticeSchedule struct {
ecore.Main // adjust this according to the needs
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
Day_Code *erc.DayCode `json:"day_code"`
@@ -8,7 +8,7 @@ import (
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
}
@@ -22,7 +22,7 @@ type ReadListDto struct {
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Doctor_Id *uint `json:"doctor-id"`
Doctor_Code *string `json:"doctor-code"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
}
@@ -50,7 +50,7 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
@@ -59,7 +59,7 @@ type ResponseDto struct {
func (d ResponsibleDoctorHist) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Doctor_Id: d.Doctor_Id,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
StartedAt: d.StartedAt,
FinishedAt: d.FinishedAt,
@@ -9,9 +9,8 @@ import (
type ResponsibleDoctorHist struct {
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
}
@@ -9,7 +9,7 @@ import (
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
Anamnesis *string `json:"anamnesis" validate:"maxLength=2048"`
MedicalDiagnoses *string `json:"medicalDiagnoses"`
FunctionDiagnoses *string `json:"functionDiagnoses"`
@@ -31,8 +31,8 @@ type ReadListDto struct {
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Doctor_Id *uint `json:"doctor-id"`
Encounter_Id *uint `json:"encounter-id"`
Doctor_Code *string `json:"doctor-code"`
}
type ReadDetailDto struct {
@@ -59,7 +59,7 @@ type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
Anamnesis *string `json:"anamnesis"`
MedicalDiagnoses *string `json:"medicalDiagnoses"`
@@ -79,7 +79,7 @@ func (d TherapyProtocol) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Doctor_Id: d.Doctor_Id,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
Anamnesis: d.Anamnesis,
MedicalDiagnoses: d.MedicalDiagnoses,
@@ -13,9 +13,8 @@ type TherapyProtocol struct {
Encounter_Id *uint `json:"encounter_id" gorm:"not null"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Anamnesis *string `json:"anamnesis" gorm:"size:2048"`
MedicalDiagnoses *string `json:"medicalDiagnoses"`