88 lines
2.3 KiB
Go
88 lines
2.3 KiB
Go
package chemo_plan
|
|
|
|
import (
|
|
// std
|
|
"time"
|
|
|
|
ere "simrs-vx/internal/domain/references/encounter"
|
|
|
|
// internal - domain - main-entities
|
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
|
)
|
|
|
|
type CreateDto struct {
|
|
Parent_Id *uint `json:"parent_id"`
|
|
SeriesNumber *uint16 `json:"seriesNumber"`
|
|
CycleNumber *uint `json:"cycleNumber"`
|
|
PlanDate *time.Time `json:"planDate"`
|
|
RealizationDate *time.Time `json:"realizationDate"`
|
|
Notes *string `json:"notes"`
|
|
Status ere.StatusProtocolChemo `json:"status"`
|
|
}
|
|
|
|
type ReadListDto struct {
|
|
FilterDto
|
|
Includes string `json:"includes"`
|
|
Pagination ecore.Pagination
|
|
}
|
|
|
|
type FilterDto struct {
|
|
Parent_Id *uint `json:"parent-id"`
|
|
Protocol_Id *uint `json:"protocol-id"`
|
|
}
|
|
|
|
type ReadDetailDto struct {
|
|
Id uint16 `json:"id"`
|
|
Includes string `json:"includes"`
|
|
}
|
|
|
|
type UpdateDto struct {
|
|
Id uint16 `json:"id"`
|
|
CreateDto
|
|
}
|
|
|
|
type DeleteDto struct {
|
|
Id uint16 `json:"id"`
|
|
}
|
|
|
|
type MetaDto struct {
|
|
PageNumber int `json:"page_number"`
|
|
PageSize int `json:"page_size"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type ResponseDto struct {
|
|
ecore.Main
|
|
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
|
Protocol_Id *uint `json:"protocol_id"`
|
|
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
|
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
|
PlanDate *time.Time `json:"planDate"`
|
|
RealizationDate *time.Time `json:"realizationDate"`
|
|
Notes *string `json:"notes"`
|
|
Status ere.StatusProtocolChemo `json:"status"`
|
|
Reasons *string `json:"reasons"`
|
|
}
|
|
|
|
func (d ChemoPlan) ToResponse() ResponseDto {
|
|
resp := ResponseDto{
|
|
Parent_Id: d.Parent_Id,
|
|
SeriesNumber: d.SeriesNumber,
|
|
CycleNumber: d.CycleNumber,
|
|
PlanDate: d.PlanDate,
|
|
RealizationDate: d.RealizationDate,
|
|
Notes: d.Notes,
|
|
Status: d.Status,
|
|
}
|
|
resp.Main = d.Main
|
|
return resp
|
|
}
|
|
|
|
func ToResponseList(data []ChemoPlan) []ResponseDto {
|
|
resp := make([]ResponseDto, len(data))
|
|
for i, u := range data {
|
|
resp[i] = u.ToResponse()
|
|
}
|
|
return resp
|
|
}
|