material, device-order required doctor_id, infra search and parent,childrens
This commit is contained in:
No files matched your search
@@ -2,13 +2,20 @@ package materialorder
|
||||
|
||||
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"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -48,6 +55,8 @@ type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
@@ -55,6 +64,8 @@ func (d MaterialOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
|
||||
@@ -20,3 +20,7 @@ type MaterialOrder struct {
|
||||
func (d MaterialOrder) IsCompleted() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
|
||||
func (d MaterialOrder) IsSameDoctor(doctor_id *uint) bool {
|
||||
return d.Doctor_Id == doctor_id
|
||||
}
|
||||
Reference in New Issue
Block a user