31 lines
881 B
Go
31 lines
881 B
Go
/*
|
|
DESCRIPTION:
|
|
Any functions that are used internally by the use-case
|
|
*/
|
|
package encounter
|
|
|
|
import (
|
|
e "simrs-vx/internal/domain/main-entities/encounter"
|
|
)
|
|
|
|
func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Encounter) {
|
|
var inputSrc *e.CreateDto
|
|
if inputT, ok := any(input).(*e.CreateDto); ok {
|
|
inputSrc = inputT
|
|
} else {
|
|
inputTemp := any(input).(*e.UpdateDto)
|
|
inputSrc = &inputTemp.CreateDto
|
|
}
|
|
|
|
data.Patient_Id = inputSrc.Patient_Id
|
|
data.Class_Code = inputSrc.Class_Code
|
|
data.Unit_Id = inputSrc.Unit_Id
|
|
data.Specialist_Id = inputSrc.Specialist_Id
|
|
data.Subspecialist_Id = inputSrc.Subspecialist_Id
|
|
data.VisitDate = inputSrc.VisitDate
|
|
data.Appointment_Doctor_Id = inputSrc.Appointment_Doctor_Id
|
|
data.Responsible_Doctor_Id = inputSrc.Responsible_Doctor_Id
|
|
data.RefSource_Name = inputSrc.RefSource_Name
|
|
data.Appointment_Id = inputSrc.Appointment_Id
|
|
}
|