feat (mcu-order): adjust mcu dto and helper
This commit is contained in:
No files matched your search
@@ -5,6 +5,7 @@ import (
|
||||
emo "simrs-vx/internal/domain/main-entities/mcu-order"
|
||||
ems "simrs-vx/internal/domain/main-entities/mcu-src"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
@@ -51,22 +52,24 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
McuOrder_Id *uint `json:"mcuOrder_id"`
|
||||
McuOrder *emo.McuOrder `json:"mcuOrder,omitempty"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
McuOrder_Id *uint `json:"mcuOrder_id"`
|
||||
McuOrder *emo.McuOrder `json:"mcuOrder,omitempty"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
}
|
||||
|
||||
func (d McuOrderItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
McuOrder_Id: d.McuOrder_Id,
|
||||
McuOrder: d.McuOrder,
|
||||
McuSrc_Id: d.McuSrc_Id,
|
||||
McuSrc: d.McuSrc,
|
||||
Result: d.Result,
|
||||
Status_Code: d.Status_Code,
|
||||
McuOrder_Id: d.McuOrder_Id,
|
||||
McuOrder: d.McuOrder,
|
||||
McuSrc_Id: d.McuSrc_Id,
|
||||
McuSrc: d.McuSrc,
|
||||
Result: d.Result,
|
||||
Status_Code: d.Status_Code,
|
||||
ExaminationDate: d.ExaminationDate,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -4,13 +4,20 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ercl "simrs-vx/internal/domain/references/clinical"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
SpecimenPickTime *time.Time `json:"specimenPickTime"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Number uint8 `json:"number"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
McuUrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"mcuUrgencyLevel_code""`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -20,9 +27,14 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
SpecimenPickTime *time.Time `json:"specimenPickTime"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Number uint8 `json:"number"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
McuUrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"mcuUrgencyLevel_code""`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
@@ -49,20 +61,30 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
SpecimenPickTime *time.Time `json:"specimenPickTime"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Number uint8 `json:"number"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
McuUrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"mcuUrgencyLevel_code""`
|
||||
}
|
||||
|
||||
func (d McuOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Status_Code: d.Status_Code,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Status_Code: d.Status_Code,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
SpecimenPickTime: d.SpecimenPickTime,
|
||||
ExaminationDate: d.ExaminationDate,
|
||||
Number: d.Number,
|
||||
Temperature: d.Temperature,
|
||||
McuUrgencyLevel_Code: d.McuUrgencyLevel_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -84,7 +84,20 @@ type ResponseDto struct {
|
||||
}
|
||||
|
||||
func (d *PersonRelative) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{}
|
||||
resp := ResponseDto{
|
||||
Person_Id: d.Person_Id,
|
||||
Relationship_Code: d.Relationship_Code,
|
||||
Name: d.Name,
|
||||
Address: d.Address,
|
||||
Village_Code: d.Village_Code,
|
||||
Village: d.Village,
|
||||
Gender_Code: d.Gender_Code,
|
||||
PhoneNumber: d.PhoneNumber,
|
||||
Education_Code: d.Education_Code,
|
||||
Occupation_Code: d.Occupation_Code,
|
||||
Occupation_Name: d.Occupation_Name,
|
||||
Responsible: d.Responsible,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user