84 lines
2.2 KiB
Go
84 lines
2.2 KiB
Go
package internal_reference
|
|
|
|
import (
|
|
erc "simrs-vx/internal/domain/references/common"
|
|
|
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
|
ed "simrs-vx/internal/domain/main-entities/doctor"
|
|
es "simrs-vx/internal/domain/main-entities/specialist"
|
|
)
|
|
|
|
type CreateDto struct {
|
|
Encounter_Id *uint `json:"-"`
|
|
Specialist_Code *string `json:"specialist_code"`
|
|
Doctor_Code *string `json:"doctor_code"`
|
|
Nurse_Code *string `json:"nurse_code"`
|
|
Status_Code erc.DataApprovalCode `json:"status_code"`
|
|
SrcDoctor_Code *string `json:"srcDoctor_code"`
|
|
SrcNurse_Code *string `json:"srcNurse_code"`
|
|
}
|
|
|
|
type ReadListDto struct {
|
|
FilterDto
|
|
Includes string `json:"includes"`
|
|
Pagination ecore.Pagination
|
|
}
|
|
|
|
type FilterDto struct {
|
|
Encounter_Id *uint `json:"encounter-id"`
|
|
Specialist_Code *uint `json:"specialist-code"`
|
|
Doctor_Code *uint `json:"doctor-code"`
|
|
Status_Code erc.DataApprovalCode `json:"status-code"`
|
|
}
|
|
|
|
type ReadDetailDto struct {
|
|
Id uint `json:"id"`
|
|
Includes string `json:"includes"`
|
|
}
|
|
|
|
type UpdateDto struct {
|
|
Id uint `json:"id"`
|
|
CreateDto
|
|
}
|
|
|
|
type DeleteDto struct {
|
|
Id uint `json:"id"`
|
|
}
|
|
|
|
type MetaDto struct {
|
|
PageNumber int `json:"page_number"`
|
|
PageSize int `json:"page_size"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type ResponseDto struct {
|
|
ecore.Main
|
|
Encounter_Id *uint `json:"encounter_id"`
|
|
Specialist_Code *string `json:"specialist_code"`
|
|
Specialist *es.Specialist `json:"specialist,omitempty"`
|
|
Doctor_Code *string `json:"doctor_id"`
|
|
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
|
Status_Code *erc.DataApprovalCode `json:"status_code"`
|
|
}
|
|
|
|
func (d InternalReference) ToResponse() ResponseDto {
|
|
resp := ResponseDto{
|
|
Encounter_Id: d.Encounter_Id,
|
|
Specialist_Code: d.Specialist_Code,
|
|
Specialist: d.Specialist,
|
|
Doctor_Code: d.Doctor_Code,
|
|
Doctor: d.Doctor,
|
|
Status_Code: d.Status_Code,
|
|
}
|
|
resp.Main = d.Main
|
|
return resp
|
|
}
|
|
|
|
func ToResponseList(data []InternalReference) []ResponseDto {
|
|
resp := make([]ResponseDto, len(data))
|
|
for i, u := range data {
|
|
resp[i] = u.ToResponse()
|
|
}
|
|
return resp
|
|
}
|