Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into feat/orders
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
package deviceorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/device"
|
||||
edo "simrs-vx/internal/domain/main-entities/device-order"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
DeviceOrder_Id *uint `json:"deviceOrder_id"`
|
||||
Device_Id *uint `json:"device_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
DeviceOrder_Id *uint `json:"deviceOrder_id"`
|
||||
Device_Id *uint `json:"device_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
DeviceOrder_Id *uint `json:"deviceOrder_id"`
|
||||
DeviceOrder *edo.DeviceOrder `json:"deviceOrder,omitempty"`
|
||||
Device_Id *uint `json:"device_id"`
|
||||
Device *ed.Device `json:"device,omitempty"`
|
||||
}
|
||||
|
||||
func (d DeviceOrderItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
DeviceOrder_Id: d.DeviceOrder_Id,
|
||||
DeviceOrder: d.DeviceOrder,
|
||||
Device_Id: d.Device_Id,
|
||||
Device: d.Device,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []DeviceOrderItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package deviceorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/device"
|
||||
edo "simrs-vx/internal/domain/main-entities/device-order"
|
||||
)
|
||||
|
||||
type DeviceOrderItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
DeviceOrder_Id *uint `json:"deviceOrder_id"`
|
||||
DeviceOrder *edo.DeviceOrder `json:"deviceOrder,omitempty" gorm:"foreignKey:DeviceOrder_Id;references:Id"`
|
||||
Device_Id *uint `json:"device_id"`
|
||||
Device *ed.Device `json:"device,omitempty" gorm:"foreignKey:Device_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package deviceorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
}
|
||||
|
||||
func (d DeviceOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []DeviceOrder) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package deviceorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
)
|
||||
|
||||
type DeviceOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package materialorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/material"
|
||||
emo "simrs-vx/internal/domain/main-entities/material-order"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
MaterialOrder_Id *uint `json:"materialOrder_id"`
|
||||
Material_Id *uint `json:"material_id"`
|
||||
Count *uint16 `json:"count"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
MaterialOrder_Id *uint `json:"materialOrder_id"`
|
||||
Material_Id *uint `json:"material_id"`
|
||||
Count *uint16 `json:"count"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
MaterialOrder_Id *uint `json:"materialOrder_id"`
|
||||
MaterialOrder *emo.MaterialOrder `json:"materialOrder,omitempty"`
|
||||
Material_Id *uint `json:"material_id"`
|
||||
Material *em.Material `json:"material,omitempty"`
|
||||
Count *uint16 `json:"count"`
|
||||
}
|
||||
|
||||
func (d MaterialOrderItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
MaterialOrder_Id: d.MaterialOrder_Id,
|
||||
MaterialOrder: d.MaterialOrder,
|
||||
Material_Id: d.Material_Id,
|
||||
Material: d.Material,
|
||||
Count: d.Count,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MaterialOrderItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package materialorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/material"
|
||||
emo "simrs-vx/internal/domain/main-entities/material-order"
|
||||
)
|
||||
|
||||
type MaterialOrderItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
MaterialOrder_Id *uint `json:"materialOrder_id"`
|
||||
MaterialOrder *emo.MaterialOrder `json:"materialOrder,omitempty" gorm:"foreignKey:MaterialOrder_Id;references:Id"`
|
||||
Material_Id *uint `json:"material_id"`
|
||||
Material *em.Material `json:"material,omitempty" gorm:"foreignKey:Material_Id;references:Id"`
|
||||
Count *uint16 `json:"count"`
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package materialorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
}
|
||||
|
||||
func (d MaterialOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MaterialOrder) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package materialorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
)
|
||||
|
||||
type MaterialOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package mcuorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
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"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
McuOrder_Id *uint `json:"mcuOrder_id"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
McuOrder_Id *uint `json:"mcuOrder_id"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
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"`
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []McuOrderItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package mcuorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
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"
|
||||
)
|
||||
|
||||
type McuOrderItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
McuOrder_Id *uint `json:"mcuOrder_id"`
|
||||
McuOrder *emo.McuOrder `json:"mcuOrder,omitempty" gorm:"foreignKey:McuOrder_Id;references:Id"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Id;references:Id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package mcuorder
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
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"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
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"`
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []McuOrder) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package mcuorder
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
type McuOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emi "simrs-vx/internal/domain/main-entities/medication-item"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
MedicationItem_Id *uint `json:"medicationItem_id"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain *uint `json:"remain"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
MedicationItem_Id *uint `json:"medicationItem_id"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain *uint `json:"remain"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
MedicationItem_Id *uint `json:"medicationItem_id"`
|
||||
MedicationItem *emi.MedicationItem `json:"medicationItem,omitempty"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain *uint `json:"remain"`
|
||||
}
|
||||
|
||||
func (d MedicationItemDist) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
MedicationItem_Id: d.MedicationItem_Id,
|
||||
MedicationItem: d.MedicationItem,
|
||||
DateTime: d.DateTime,
|
||||
Remain: d.Remain,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicationItemDist) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emi "simrs-vx/internal/domain/main-entities/medication-item"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MedicationItemDist struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
MedicationItem_Id *uint `json:"medicationItem_id"`
|
||||
MedicationItem *emi.MedicationItem `json:"medicationItem,omitempty" gorm:"foreignKey:MedicationItem_Id;references:Id"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain *uint `json:"remain"`
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eme "simrs-vx/internal/domain/main-entities/medication"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Medication_Id *uint `json:"medication_id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
// IntervalUnit_Code
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Medication_Id *uint `json:"medication_id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
// IntervalUnit_Code
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
Medication_Id *uint `json:"medication_id"`
|
||||
Medication *eme.Medication `json:"medication,omitempty"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
// IntervalUnit_Code
|
||||
}
|
||||
|
||||
func (d MedicationItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Medication_Id: d.Medication_Id,
|
||||
Medication: d.Medication,
|
||||
IsMix: d.IsMix,
|
||||
Medicine_Id: d.Medicine_Id,
|
||||
Medicine: d.Medicine,
|
||||
MedicineMix_Id: d.MedicineMix_Id,
|
||||
MedicineMix: d.MedicineMix,
|
||||
Usage: d.Usage,
|
||||
Interval: d.Interval,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicationItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eme "simrs-vx/internal/domain/main-entities/medication"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
)
|
||||
|
||||
type MedicationItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Medication_Id *uint `json:"medication_id"`
|
||||
Medication *eme.Medication `json:"medication,omitempty" gorm:"foreignKey:Medication_Id;references:Id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
// IntervalUnit_Code
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package medication
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ep "simrs-vx/internal/domain/main-entities/pharmacist"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist_id"`
|
||||
Pharmacist *ep.Pharmacist `json:"pharmacist,omitempty"`
|
||||
}
|
||||
|
||||
func (d Medication) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
IssuedAt: d.IssuedAt,
|
||||
Pharmacist_Id: d.Pharmacist_Id,
|
||||
Pharmacist: d.Pharmacist,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Medication) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package medication
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ep "simrs-vx/internal/domain/main-entities/pharmacist"
|
||||
)
|
||||
|
||||
type Medication struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist_id"`
|
||||
Pharmacist *ep.Pharmacist `json:"pharmacist,omitempty" gorm:"foreignKey:Pharmacist_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package prescriptionitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
ep "simrs-vx/internal/domain/main-entities/prescription"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Prescription_Id *uint `json:"prescription_id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Prescription_Id *uint `json:"prescription_id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
Prescription_Id *uint `json:"prescription_id"`
|
||||
Prescription *ep.Prescription `json:"prescription,omitempty"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
}
|
||||
|
||||
func (d PrescriptionItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Prescription_Id: d.Prescription_Id,
|
||||
Prescription: d.Prescription,
|
||||
IsMix: d.IsMix,
|
||||
Medicine_Id: d.Medicine_Id,
|
||||
Medicine: d.Medicine,
|
||||
MedicineMix_Id: d.MedicineMix_Id,
|
||||
MedicineMix: d.MedicineMix,
|
||||
Usage: d.Usage,
|
||||
Interval: d.Interval,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []PrescriptionItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package prescriptionitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
ep "simrs-vx/internal/domain/main-entities/prescription"
|
||||
)
|
||||
|
||||
type PrescriptionItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Prescription_Id *uint `json:"prescription_id"`
|
||||
Prescription *ep.Prescription `json:"prescription,omitempty" gorm:"foreignKey:Prescription_Id;references:Id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||
Usage uint8 `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
// IntervalUnit_Code
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package prescription
|
||||
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
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
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
}
|
||||
|
||||
func (d Prescription) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
IssuedAt: d.IssuedAt,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Prescription) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package prescription
|
||||
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Prescription struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import (
|
||||
appointment "simrs-vx/internal/domain/main-entities/appointment"
|
||||
counter "simrs-vx/internal/domain/main-entities/counter"
|
||||
device "simrs-vx/internal/domain/main-entities/device"
|
||||
deviceorder "simrs-vx/internal/domain/main-entities/device-order"
|
||||
deviceorderitem "simrs-vx/internal/domain/main-entities/device-order-item"
|
||||
diagnosesrc "simrs-vx/internal/domain/main-entities/diagnose-src"
|
||||
district "simrs-vx/internal/domain/main-entities/district"
|
||||
division "simrs-vx/internal/domain/main-entities/division"
|
||||
@@ -25,10 +27,17 @@ import (
|
||||
laborant "simrs-vx/internal/domain/main-entities/laborant"
|
||||
language "simrs-vx/internal/domain/main-entities/language"
|
||||
material "simrs-vx/internal/domain/main-entities/material"
|
||||
materialorder "simrs-vx/internal/domain/main-entities/material-order"
|
||||
materialorderitem "simrs-vx/internal/domain/main-entities/material-order-item"
|
||||
mcuorder "simrs-vx/internal/domain/main-entities/mcu-order"
|
||||
mcuorderitem "simrs-vx/internal/domain/main-entities/mcu-order-item"
|
||||
mcusrc "simrs-vx/internal/domain/main-entities/mcu-src"
|
||||
mcusrccategory "simrs-vx/internal/domain/main-entities/mcu-src-category"
|
||||
medicalactionsrc "simrs-vx/internal/domain/main-entities/medical-action-src"
|
||||
medicalactionsrcitem "simrs-vx/internal/domain/main-entities/medical-action-src-item"
|
||||
medication "simrs-vx/internal/domain/main-entities/medication"
|
||||
medicationitem "simrs-vx/internal/domain/main-entities/medication-item"
|
||||
medicationitemdist "simrs-vx/internal/domain/main-entities/medication-item-dist"
|
||||
medicine "simrs-vx/internal/domain/main-entities/medicine"
|
||||
medicinegroup "simrs-vx/internal/domain/main-entities/medicine-group"
|
||||
medicinemethod "simrs-vx/internal/domain/main-entities/medicine-method"
|
||||
@@ -44,6 +53,8 @@ import (
|
||||
pharmacist "simrs-vx/internal/domain/main-entities/pharmacist"
|
||||
pharmacycompany "simrs-vx/internal/domain/main-entities/pharmacy-company"
|
||||
practiceschedule "simrs-vx/internal/domain/main-entities/practice-schedule"
|
||||
prescription "simrs-vx/internal/domain/main-entities/prescription"
|
||||
prescriptionitem "simrs-vx/internal/domain/main-entities/prescription-item"
|
||||
proceduresrc "simrs-vx/internal/domain/main-entities/procedure-src"
|
||||
province "simrs-vx/internal/domain/main-entities/province"
|
||||
regency "simrs-vx/internal/domain/main-entities/regency"
|
||||
@@ -117,5 +128,16 @@ func getMainEntities() []any {
|
||||
&emergency.Emergency{},
|
||||
&inpatient.Inpatient{},
|
||||
&ambulatory.Ambulatory{},
|
||||
&prescription.Prescription{},
|
||||
&prescriptionitem.PrescriptionItem{},
|
||||
&medication.Medication{},
|
||||
&medicationitem.MedicationItem{},
|
||||
&medicationitemdist.MedicationItemDist{},
|
||||
&deviceorder.DeviceOrder{},
|
||||
&deviceorderitem.DeviceOrderItem{},
|
||||
&materialorder.MaterialOrder{},
|
||||
&materialorderitem.MaterialOrderItem{},
|
||||
&mcuorder.McuOrder{},
|
||||
&mcuorderitem.McuOrderItem{},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user