Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into feat/crud
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
package device
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
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"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
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
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom,omitempty"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d Device) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Device) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package device
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
)
|
||||
|
||||
type Device struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package doctorfee
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
erc "simrs-vx/internal/domain/references/clinical"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
|
||||
Price *float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
|
||||
Price *float64 `json:"price"`
|
||||
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"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
|
||||
Price *float64 `json:"price"`
|
||||
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
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
|
||||
Price *float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d DoctorFee) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
FeeTypeCode: d.FeeTypeCode,
|
||||
Price: d.Price,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []DoctorFee) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package doctorfee
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
erc "simrs-vx/internal/domain/references/clinical"
|
||||
)
|
||||
|
||||
type DoctorFee struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code" gorm:"size:11"`
|
||||
Price *float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -2,17 +2,20 @@ package itemprice
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eic "simrs-vx/internal/domain/main-entities/insurance-company"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Price float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Price float64 `json:"price"`
|
||||
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Price float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Price float64 `json:"price"`
|
||||
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
@@ -20,9 +23,10 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Price float64 `json:"price"`
|
||||
Id uint16 `json:"id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Price float64 `json:"price"`
|
||||
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
@@ -42,15 +46,20 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
Price float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
Price float64 `json:"price"`
|
||||
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
|
||||
InsuranceCompany *eic.InsuranceCompany `json:"insuranceCompany,omitempty"`
|
||||
}
|
||||
|
||||
func (d ItemPrice) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Item_Id: d.Item_Id,
|
||||
Price: d.Price,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
Price: d.Price,
|
||||
InsuranceCompany_Code: d.InsuranceCompany_Code,
|
||||
InsuranceCompany: d.InsuranceCompany,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -2,12 +2,15 @@ package itemprice
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eic "simrs-vx/internal/domain/main-entities/insurance-company"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
)
|
||||
|
||||
type ItemPrice struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
Price float64 `json:"price"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
Price float64 `json:"price"`
|
||||
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code" gorm:"size:20"`
|
||||
InsuranceCompany *eic.InsuranceCompany `json:"insuranceCompany,omitempty" gorm:"foreignKey:InsuranceCompany_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -7,21 +7,21 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code *string `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *float64 `json:"stock"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code *string `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code *string `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *float64 `json:"stock"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code *string `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
@@ -29,13 +29,13 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code *string `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *float64 `json:"stock"`
|
||||
Id uint16 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code *string `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
@@ -62,7 +62,7 @@ type ResponseDto struct {
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom,omitempty"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *float64 `json:"stock"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
|
||||
func (d Item) ToResponse() ResponseDto {
|
||||
|
||||
@@ -15,5 +15,5 @@ type Item struct {
|
||||
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Infra_Id *int16 `json:"infra_id"`
|
||||
Stock *float64 `json:"stock"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package material
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Stock *int `json:"stock"`
|
||||
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"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Stock *int `json:"stock"`
|
||||
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
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom,omitempty"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d Material) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Stock: d.Stock,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Material) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package material
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
)
|
||||
|
||||
type Material struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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 MedicalActionSrcItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
||||
MedicalActionSrc *emas.MedicalActionSrc `json:"medicalActionSrc,omitempty" gorm:"foreignKey:MedicalActionSrc_Id;references:Id"`
|
||||
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
||||
ProcedureSrc *eps.ProcedureSrc `json:"procedureSrc,omitempty" gorm:"foreignKey:ProcedureSrc_Id;references:Id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package medicalactionsrc
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
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"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
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
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d MedicalActionSrc) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicalActionSrc) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package medicalactionsrc
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
)
|
||||
|
||||
type MedicalActionSrc struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package medicinemixitem
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
}
|
||||
|
||||
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
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
}
|
||||
|
||||
func (d MedicineMixItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
MedicineMix_Id: d.MedicineMix_Id,
|
||||
MedicineMix: d.MedicineMix,
|
||||
Medicine_Id: d.Medicine_Id,
|
||||
Medicine: d.Medicine,
|
||||
Dose: d.Dose,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicineMixItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package medicinemixitem
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
type MedicineMixItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package medicinemix
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Name string `json:"name"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
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
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (d MedicineMix) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Name: d.Name,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicineMix) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package medicinemix
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type MedicineMix struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package medicine
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ein "simrs-vx/internal/domain/main-entities/infra"
|
||||
eit "simrs-vx/internal/domain/main-entities/item"
|
||||
emg "simrs-vx/internal/domain/main-entities/medicine-group"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-method"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
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"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
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
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
||||
MedicineGroup *emg.MedicineGroup `json:"medicineGroup"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code"`
|
||||
MedicineMethod *emm.MedicineMethod `json:"medicineMethod"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ein.Infra `json:"infra,omitempty"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *eit.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d Medicine) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
MedicineGroup_Code: d.MedicineGroup_Code,
|
||||
MedicineGroup: d.MedicineGroup,
|
||||
MedicineMethod_Code: d.MedicineMethod_Code,
|
||||
MedicineMethod: d.MedicineMethod,
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Dose: d.Dose,
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra: d.Infra,
|
||||
Stock: d.Stock,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Medicine) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package medicine
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ein "simrs-vx/internal/domain/main-entities/infra"
|
||||
eit "simrs-vx/internal/domain/main-entities/item"
|
||||
emg "simrs-vx/internal/domain/main-entities/medicine-group"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-method"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
)
|
||||
|
||||
type Medicine struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code" gorm:"size:10"`
|
||||
MedicineGroup *emg.MedicineGroup `json:"medicineGroup,omitempty" gorm:"foreignKey:MedicineGroup_Code;references:Code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code" gorm:"size:10"`
|
||||
MedicineMethod *emm.MedicineMethod `json:"medicineMethod,omitempty" gorm:"foreignKey:MedicineMethod_Code;references:Code"`
|
||||
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *eit.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package clinical
|
||||
|
||||
type (
|
||||
CheckupScopeCode string
|
||||
CheckupScopeCode string
|
||||
DoctorFeeTypeCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -9,4 +10,9 @@ const (
|
||||
CSCMLab CheckupScopeCode = "mic-lab" // Microbacterial Laboratorium
|
||||
CSCPLab CheckupScopeCode = "pa-lab" // Patology Anatomy Laboratorium
|
||||
CSCRad CheckupScopeCode = "radiology" // Radiology
|
||||
|
||||
DFTCOut DoctorFeeTypeCode = "outpatient" // Rawat Jalan
|
||||
DFTCInp DoctorFeeTypeCode = "inpatient" // Rawat Inap
|
||||
DFTCEme DoctorFeeTypeCode = "emergency" // Darurat
|
||||
DFTCReh DoctorFeeTypeCode = "medic-rehab" // Rehab Medik
|
||||
)
|
||||
|
||||
@@ -6,11 +6,13 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
counter "simrs-vx/internal/domain/main-entities/counter"
|
||||
device "simrs-vx/internal/domain/main-entities/device"
|
||||
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"
|
||||
divisionposition "simrs-vx/internal/domain/main-entities/division-position"
|
||||
doctor "simrs-vx/internal/domain/main-entities/doctor"
|
||||
doctorfee "simrs-vx/internal/domain/main-entities/doctor-fee"
|
||||
employee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ethnic "simrs-vx/internal/domain/main-entities/ethnic"
|
||||
infra "simrs-vx/internal/domain/main-entities/infra"
|
||||
@@ -20,10 +22,16 @@ import (
|
||||
item "simrs-vx/internal/domain/main-entities/item"
|
||||
itemgroup "simrs-vx/internal/domain/main-entities/item-group"
|
||||
itemprice "simrs-vx/internal/domain/main-entities/item-price"
|
||||
material "simrs-vx/internal/domain/main-entities/material"
|
||||
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"
|
||||
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"
|
||||
medicinemix "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
medicinemixitem "simrs-vx/internal/domain/main-entities/medicine-mix-item"
|
||||
nurse "simrs-vx/internal/domain/main-entities/nurse"
|
||||
nutritionist "simrs-vx/internal/domain/main-entities/nutritionist"
|
||||
person "simrs-vx/internal/domain/main-entities/person"
|
||||
@@ -107,6 +115,14 @@ func GetEntities() []any {
|
||||
&mcusrc.McuSrc{},
|
||||
ðnic.Ethnic{},
|
||||
&insurancecompany.InsuranceCompany{},
|
||||
&medicine.Medicine{},
|
||||
&medicinemix.MedicineMix{},
|
||||
&medicinemixitem.MedicineMixItem{},
|
||||
&medicalactionsrc.MedicalActionSrc{},
|
||||
&medicalactionsrcitem.MedicalActionSrcItem{},
|
||||
&material.Material{},
|
||||
&device.Device{},
|
||||
&doctorfee.DoctorFee{},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user