feat/order-things: added ap-mcu-order
This commit is contained in:
No files matched your search
@@ -0,0 +1,94 @@
|
||||
package apmcuorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emo "simrs-vx/internal/domain/main-entities/mcu-order"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
McuOrder_Id string `json:"mcuOrder_id"`
|
||||
Substances string `json:"substances"`
|
||||
Fictations string `json:"fictations"`
|
||||
Localization string `json:"localization"`
|
||||
ClinicalDiagnoses string `json:"clinicalDiagnoses"`
|
||||
Stadium string `json:"stadium"`
|
||||
ClinicalNotes string `json:"clinicalNotes"`
|
||||
PastHistory string `json:"pastHistory"`
|
||||
CurrentHistory string `json:"currentHistory"`
|
||||
PrevApMcu string `json:"prevApMcu"`
|
||||
PrevApMcuNotes string `json:"prevApMcuNotes"`
|
||||
SupportingExams string `json:"supportingExams"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
McuOrder_Id string `json:"mcu-order-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint64 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint64 `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
McuOrder_Id string `json:"mcuOrder_id"`
|
||||
McuOrder *emo.McuOrder
|
||||
Substances string `json:"substances"`
|
||||
Fictations string `json:"fictations"`
|
||||
Localization string `json:"localization"`
|
||||
ClinicalDiagnoses string `json:"clinicalDiagnoses"`
|
||||
Stadium string `json:"stadium"`
|
||||
ClinicalNotes string `json:"clinicalNotes"`
|
||||
PastHistory string `json:"pastHistory"`
|
||||
CurrentHistory string `json:"currentHistory"`
|
||||
PrevApMcu string `json:"prevApMcu"`
|
||||
PrevApMcuNotes string `json:"prevApMcuNotes"`
|
||||
SupportingExams string `json:"supportingExams"`
|
||||
}
|
||||
|
||||
func (d ApMcuOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
McuOrder_Id: d.McuOrder_Id,
|
||||
Substances: d.Substances,
|
||||
Fictations: d.Fictations,
|
||||
Localization: d.Localization,
|
||||
ClinicalDiagnoses: d.ClinicalDiagnoses,
|
||||
Stadium: d.Stadium,
|
||||
ClinicalNotes: d.ClinicalNotes,
|
||||
PastHistory: d.PastHistory,
|
||||
CurrentHistory: d.CurrentHistory,
|
||||
PrevApMcu: d.PrevApMcu,
|
||||
PrevApMcuNotes: d.PrevApMcuNotes,
|
||||
}
|
||||
resp.McuOrder = d.McuOrder
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []ApMcuOrder) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package apmcuorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emo "simrs-vx/internal/domain/main-entities/mcu-order"
|
||||
)
|
||||
|
||||
type ApMcuOrder struct {
|
||||
ecore.BigMain
|
||||
McuOrder_Id string `json:"mcuOrder_id" gorm:"unique;size:10"`
|
||||
McuOrder *emo.McuOrder `json:"mcuOrder,omitempty" gorm:"foreignKey:McuOrder_Id;references:Id"`
|
||||
Substances string `json:"substances"`
|
||||
Fictations string `json:"fictations"`
|
||||
Localization string `json:"localization"`
|
||||
ClinicalDiagnoses string `json:"clinicalDiagnoses"`
|
||||
Stadium string `json:"stadium"`
|
||||
ClinicalNotes string `json:"clinicalNotes"`
|
||||
PastHistory string `json:"pastHistory"`
|
||||
CurrentHistory string `json:"currentHistory"`
|
||||
PrevApMcu string `json:"prevApMcu"`
|
||||
PrevApMcuNotes string `json:"prevApMcuNotes"`
|
||||
SupportingExams string `json:"supportingExams"`
|
||||
}
|
||||
Reference in New Issue
Block a user