78 lines
2.1 KiB
Go
78 lines
2.1 KiB
Go
package medicalactionsrcitem
|
|
|
|
import (
|
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
|
ei "simrs-vx/internal/domain/main-entities/item"
|
|
emas "simrs-vx/internal/domain/main-entities/medical-action-src"
|
|
eps "simrs-vx/internal/domain/main-entities/procedure-src"
|
|
)
|
|
|
|
type CreateDto struct {
|
|
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
|
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
|
Item_Id *uint `json:"item_id"`
|
|
}
|
|
|
|
type ReadListDto struct {
|
|
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
|
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
|
Item_Id *uint `json:"item_id"`
|
|
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
NoPagination int `json:"no_pagination"`
|
|
}
|
|
|
|
type ReadDetailDto struct {
|
|
Id uint16 `json:"id"`
|
|
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
|
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
|
Item_Id *uint `json:"item_id"`
|
|
}
|
|
|
|
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
|
|
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
|
MedicalActionSrc *emas.MedicalActionSrc `json:"medicalActionSrc,omitempty"`
|
|
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
|
ProcedureSrc *eps.ProcedureSrc `json:"procedureSrc,omitempty"`
|
|
Item_Id *uint `json:"item_id"`
|
|
Item *ei.Item `json:"item,omitempty"`
|
|
}
|
|
|
|
func (d MedicalActionSrcItem) ToResponse() ResponseDto {
|
|
resp := ResponseDto{
|
|
MedicalActionSrc_Id: d.MedicalActionSrc_Id,
|
|
MedicalActionSrc: d.MedicalActionSrc,
|
|
ProcedureSrc_Id: d.ProcedureSrc_Id,
|
|
ProcedureSrc: d.ProcedureSrc,
|
|
Item_Id: d.Item_Id,
|
|
Item: d.Item,
|
|
}
|
|
resp.Main = d.Main
|
|
return resp
|
|
}
|
|
|
|
func ToResponseList(data []MedicalActionSrcItem) []ResponseDto {
|
|
resp := make([]ResponseDto, len(data))
|
|
for i, u := range data {
|
|
resp[i] = u.ToResponse()
|
|
}
|
|
return resp
|
|
}
|