merge migration

This commit is contained in:
vanilia
2025-11-10 08:23:39 +07:00
288 changed files with 7029 additions and 2850 deletions
@@ -28,9 +28,8 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code *string `json:"code"`
Includes string `json:"includes"`
Id uint16 `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
@@ -6,8 +6,9 @@ import (
)
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Class_Code ere.AmbulatoryClassCode `json:"class_code" validate:"maxLength=10"`
Encounter_Id *uint `json:"encounter_id"`
Class_Code ere.AmbulatoryClassCode `json:"class_code" validate:"maxLength=10"`
VisitMode_Code ere.VisitModeCode `json:"visitMode_code"`
}
type ReadListDto struct {
@@ -42,12 +43,16 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Class_Code ere.AmbulatoryClassCode `json:"class_code"`
Encounter_Id *uint `json:"encounter_id"`
Class_Code ere.AmbulatoryClassCode `json:"class_code"`
VisitMode_Code ere.VisitModeCode `json:"visitMode_code"`
}
func (d Ambulatory) ToResponse() ResponseDto {
resp := ResponseDto{}
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Class_Code: d.Class_Code,
}
resp.Main = d.Main
return resp
}
@@ -0,0 +1,76 @@
package antibioticinuse
import (
ecore "simrs-vx/internal/domain/base-entities/core"
eas "simrs-vx/internal/domain/main-entities/antibiotic-src"
emo "simrs-vx/internal/domain/main-entities/mcu-order"
erc "simrs-vx/internal/domain/references/common"
"time"
)
type CreateDto struct {
McuOrder_Id *uint `json:"mcuOrder_id"`
AntibioticSrc_Id *uint `json:"antibioticSrc_id"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
McuOrder_Id *uint `json:"mcu-order-id"`
AntibioticSrc_Id *uint `json:"mcu-src-id"`
Result *string `json:"result"`
Status_Code erc.DataStatusCode `json:"status-code"`
}
type ReadDetailDto struct {
Id uint `json:"id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type SetScheduleDto struct {
Id uint `json:"id"`
ExaminationDate *time.Time `json:"examinationDate"`
}
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"`
AntibioticSrc_Id *uint `json:"antibioticSrc_id"`
Antibiotic *eas.CreateDto `json:"mcuSrc,omitempty"`
}
func (d AntibioticInUse) ToResponse() ResponseDto {
resp := ResponseDto{
McuOrder_Id: d.McuOrder_Id,
McuOrder: d.McuOrder,
AntibioticSrc_Id: d.AntibioticSrc_Id,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []AntibioticInUse) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,15 @@
package antibioticinuse
import (
ecore "simrs-vx/internal/domain/base-entities/core"
eas "simrs-vx/internal/domain/main-entities/antibiotic-src"
emo "simrs-vx/internal/domain/main-entities/mcu-order"
)
type AntibioticInUse struct {
ecore.Main // adjust this according to the needs
McuOrder_Id *uint `json:"mcuOrder_id" gorm:"uniqueIndex:idx_order_src"`
McuOrder *emo.McuOrder `json:"mcuOrder,omitempty" gorm:"foreignKey:McuOrder_Id;references:Id"`
AntibioticSrc_Id *uint `json:"antibioticSrcSrc_id" gorm:"uniqueIndex:idx_order_src"`
AntibioticSrc *eas.AntibioticSrc `json:"antibioticSrc,omitempty" gorm:"foreignKey:AntibioticSrc_Id;references:Id"`
}
@@ -0,0 +1,66 @@
package antibioticsrccategory
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code *string `json:"code"`
}
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.SmallMain
Code string `json:"code"`
Name string `json:"name"`
}
func (d AntibioticSrcCategory) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
}
resp.SmallMain = d.SmallMain
return resp
}
func ToResponseList(data []AntibioticSrcCategory) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,11 @@
package antibioticsrccategory
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type AntibioticSrcCategory struct {
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:20"`
Name string `json:"name" gorm:"size:50"`
}
@@ -0,0 +1,76 @@
package antibioticsrc
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
AntibioticSrcCategory_Code *string `json:"antibioticSrcCategory_code" validate:"maxLength=20"`
Item_Id *uint `json:"item_id"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
AntibioticSrcCategory_Code *string `json:"antibiotic-src-category-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code *string `json:"code"`
}
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
Code string `json:"code"`
Name string `json:"name"`
AntibioticSrcCategory_Code *string `json:"antibioticSrcCategory_code"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
}
func (d AntibioticSrc) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
AntibioticSrcCategory_Code: d.AntibioticSrcCategory_Code,
// Item_Id: d.Item_Id,
// Item: d.Item,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []AntibioticSrc) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,16 @@
package antibioticsrc
import (
ecore "simrs-vx/internal/domain/base-entities/core"
easc "simrs-vx/internal/domain/main-entities/antibiotic-src-category"
)
type AntibioticSrc struct {
ecore.Main // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:20"`
Name string `json:"name" gorm:"size:50"`
AntibioticSrcCategory_Code *string `json:"antibioticSrcCategory_code" gorm:"size:20"`
AntibioticSrcCategory *easc.AntibioticSrcCategory `json:"antibioticSrcCategory,omitempty" gorm:"foreignKey:AntibioticSrcCategory_Code;references:Code"`
// Item_Id *uint `json:"item_id"`
// Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -0,0 +1,70 @@
package authpartner
import (
// internal - domain - main-entities
ecore "simrs-vx/internal/domain/base-entities/core"
)
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
SecretKey string `json:"secretKey"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
Sort string `json:"sort"`
}
type FilterDto struct {
Code *string `json:"code"`
Name *string `json:"name"`
}
type ReadDetailDto struct {
Id *uint16 `json:"id"`
Code *string `json:"code"`
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
Code string `json:"code"`
Name string `json:"name"`
SecretKey string `json:"secretKey"`
}
func (d AuthPartner) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
SecretKey: d.SecretKey,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []AuthPartner) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,12 @@
package authpartner
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type AuthPartner struct {
ecore.Main // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:50"`
Name string `json:"name" gorm:"unique;size:100"`
SecretKey string `json:"secretKey" gorm:"size:255"`
}
@@ -0,0 +1,91 @@
package chemo_protocol
import (
// std
"time"
// internal - domain - references
erc "simrs-vx/internal/domain/references/common"
// internal - domain - main-entities
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"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Duration *uint `json:"duration"`
DurationUnit_Code *erc.TimeUnitCode `json:"durationUnit_code"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-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
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Duration *uint `json:"duration"`
DurationUnit_Code *erc.TimeUnitCode `json:"durationUnit_code"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
}
func (d ChemoProtocol) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Patient_Weight: d.Patient_Weight,
Patient_Height: d.Patient_Height,
Diagnoses: d.Diagnoses,
Duration: d.Duration,
DurationUnit_Code: d.DurationUnit_Code,
StartDate: d.StartDate,
EndDate: d.EndDate,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []ChemoProtocol) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -52,6 +52,8 @@ type DeleteDto struct {
type VerifyDto struct {
Id uint16 `json:"id"`
Status_Code erc.DataVerifiedCode `json:"status_code"`
Bed *string `json:"bed" validate:"required"`
Needs *string `json:"needs" validate:"required"`
pa.AuthInfo
}
@@ -12,6 +12,7 @@ import (
// internal - domain - main-entities
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
es "simrs-vx/internal/domain/main-entities/specialist"
ess "simrs-vx/internal/domain/main-entities/subspecialist"
@@ -23,6 +24,7 @@ type CreateDto struct {
Unit_Id *uint `json:"unit_id"`
Specialist_Id *uint `json:"specialist_id"`
Subspecialist_Id *uint `json:"subspecialist_id"`
Doctor_Id *uint `json:"doctor_id"`
Date *time.Time `json:"date"`
}
@@ -37,11 +39,13 @@ type FilterDto struct {
Unit_Id *uint `json:"unit-id"`
Specialist_Id *uint `json:"specialist-id"`
Subspecialist_Id *uint `json:"subspecialist-id"`
Doctor_Id *uint `json:"doctor-id"`
Date *time.Time `json:"date"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id uint16 `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
@@ -69,13 +73,15 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter" gorm:"foreignKey:Encounter_Id;references:Id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Unit_Id *uint `json:"unit_id"`
Unit *eu.Unit `json:"unit" gorm:"foreignKey:Unit_Id;references:Id"`
Unit *eu.Unit `json:"unit,omitempty"`
Specialist_Id *uint `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist" gorm:"foreignKey:Specialist_Id;references:Id"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Id *uint `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist" gorm:"foreignKey:Subspecialist_Id;references:Id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
Date *time.Time `json:"date"`
}
@@ -89,6 +95,8 @@ func (d ControlLetter) ToResponse() ResponseDto {
Specialist: d.Specialist,
Subspecialist_Id: d.Subspecialist_Id,
Subspecialist: d.Subspecialist,
Doctor_Id: d.Doctor_Id,
Doctor: d.Doctor,
Date: d.Date,
}
resp.Main = d.Main
+9 -8
View File
@@ -8,11 +8,11 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
Infra_Id *uint16 `json:"infra_id"`
Item_Id *uint `json:"item_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
Infra_Code *string `json:"infra_code"`
Item_Code *string `json:"item_code"`
}
type ReadListDto struct {
@@ -32,17 +32,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -14,7 +14,9 @@ type Device struct {
Uom_Code string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code" gorm:"size:10"`
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
Item_Id *uint `json:"item_id"`
Item_Code *string `json:"item_code" gorm:"size:50"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -7,7 +7,7 @@ import (
type Basic struct {
ecore.SmallMain // adjust this according to the needs
Division_Id *uint16 `json:"division_id"`
Division_Code *string `json:"division_code" gorm:"size:10"`
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
HeadStatus bool `json:"headStatus"`
@@ -7,11 +7,11 @@ import (
)
type CreateDto struct {
Division_Id *uint16 `json:"division_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Division_Code *string `json:"division_code"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
}
type ReadListDto struct {
@@ -22,26 +22,27 @@ type ReadListDto struct {
}
type FilterDto struct {
Division_Id *uint16 `json:"division-id"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Division_Code *string `json:"division-code"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -52,23 +53,23 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Division_Id *uint16 `json:"division_id"`
Division *ed.Division `json:"division,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
Division_Code *string `json:"division_code"`
Division *ed.Division `json:"division,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
}
func (d DivisionPosition) ToResponse() ResponseDto {
resp := ResponseDto{
Division_Id: d.Division_Id,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
Division_Code: d.Division_Code,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
}
resp.SmallMain = d.SmallMain
if d.Division != nil {
@@ -7,5 +7,5 @@ import (
type DivisionPosition struct {
eb.Basic
Division *ed.Division `json:"division" gorm:"foreignKey:Division_Id;references:Id"`
Division *ed.Division `json:"division" gorm:"foreignKey:Division_Code;references:Code"`
}
+13 -12
View File
@@ -6,9 +6,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Parent_Id *uint16 `json:"parent_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Parent_Code *string `json:"parent_code"`
}
type ReadListDto struct {
@@ -20,25 +20,26 @@ type ReadListDto struct {
}
type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
Parent_Id *uint16 `json:"parent-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Code string `json:"code"`
Name string `json:"name"`
Parent_Code *string `json:"parent-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -51,7 +52,7 @@ type ResponseDto struct {
ecore.SmallMain
Code string `json:"code"`
Name string `json:"name"`
Parent_Id *uint16 `json:"parent_id"`
Parent_Code *string `json:"parent_code"`
Parent *Division `json:"parent,omitempty"`
Childrens []Division `json:"childrens,omitempty"`
DivisionPosition []edpb.Basic `json:"divisionPositions,omitempty"`
@@ -61,7 +62,7 @@ func (d Division) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
Parent_Id: d.Parent_Id,
Parent_Code: d.Parent_Code,
Parent: d.Parent,
Childrens: d.Childrens,
DivisionPosition: d.DivisionPositions,
@@ -7,10 +7,10 @@ import (
type Division struct {
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:10"`
Code string `json:"code" gorm:"uniqueIndex;size:10"`
Name string `json:"name" gorm:"size:50"`
Parent_Id *uint16 `json:"parent_id"`
Parent *Division `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
DivisionPositions []edpb.Basic `json:"divisionPositions,omitempty" gorm:"foreignKey:Division_Id;references:Id"`
Parent_Code *string `json:"parent_code" gorm:"size:10"`
Parent *Division `json:"parent" gorm:"foreignKey:Parent_Code;references:Code"`
Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Code;references:Code"` // may need references to self
DivisionPositions []edpb.Basic `json:"divisionPositions,omitempty" gorm:"foreignKey:Division_Code;references:Code"`
}
+39 -36
View File
@@ -6,16 +6,18 @@ import (
es "simrs-vx/internal/domain/main-entities/specialist"
ess "simrs-vx/internal/domain/main-entities/subspecialist"
eu "simrs-vx/internal/domain/main-entities/unit"
"time"
)
type CreateDto struct {
Code *string `json:"code" validate:"maxLength=20"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
SIP_Number *string `json:"sip_number"`
Unit_Id *uint16 `json:"unit_id"`
Specialist_Id *uint16 `json:"specialist_id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Code *string `json:"code" validate:"maxLength=20"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
SIP_Number *string `json:"sip_number"`
SIP_ExpiredDate *time.Time `json:"sip_expiredDate"`
Unit_Code *string `json:"unit_code"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
}
type ReadListDto struct {
@@ -25,13 +27,14 @@ type ReadListDto struct {
}
type FilterDto struct {
Code *string `json:"code"`
Employee_Id *uint `json:"employee-id"`
IHS_Number *string `json:"ihs-number" validate:"maxLength=20"`
SIP_Number *string `json:"sip-number" validate:"maxLength=20"`
Unit_Id *uint `json:"unit-id"`
Specialist_Id *uint16 `json:"specialist-id"`
Subspecialist_Id *uint16 `json:"subspecialist-id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee-id"`
IHS_Number *string `json:"ihs-number" validate:"maxLength=20"`
SIP_Number *string `json:"sip-number" validate:"maxLength=20"`
SIP_ExpiredDate *string `json:"sip-expiredDate"`
Unit_Code *string `json:"unit-code"`
Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"`
}
type ReadDetailDto struct {
@@ -59,32 +62,32 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
IHS_Number *string `json:"ihs_number"`
SIP_Number *string `json:"sip_number"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty" `
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
IHS_Number *string `json:"ihs_number"`
SIP_Number *string `json:"sip_number"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist,omitempty" `
Subspecialist_Code *string `json:"subspecialist_code"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
}
func (d Doctor) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
IHS_Number: d.IHS_Number,
SIP_Number: d.SIP_Number,
Unit_Id: d.Unit_Id,
Unit: d.Unit,
Specialist_Id: d.Specialist_Id,
Specialist: d.Specialist,
Subspecialist_Id: d.Subspecialist_Id,
Subspecialist: d.Subspecialist,
Code: d.Code,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
IHS_Number: d.IHS_Number,
SIP_Number: d.SIP_Number,
Unit_Code: d.Unit_Code,
Unit: d.Unit,
Specialist_Code: d.Specialist_Code,
Specialist: d.Specialist,
Subspecialist_Code: d.Subspecialist_Code,
Subspecialist: d.Subspecialist,
}
resp.Main = d.Main
return resp
+14 -12
View File
@@ -6,19 +6,21 @@ import (
es "simrs-vx/internal/domain/main-entities/specialist"
ess "simrs-vx/internal/domain/main-entities/subspecialist"
eu "simrs-vx/internal/domain/main-entities/unit"
"time"
)
type Doctor struct {
ecore.Main // adjust this according to the needs
Code *string `json:"code" gorm:"unique;size:20"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
SIP_Number *string `json:"sip_number" gorm:"unique;size:20"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
ecore.Main // adjust this according to the needs
Code *string `json:"code" gorm:"unique;size:20"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
SIP_Number *string `json:"sip_number" gorm:"unique;size:20"`
SIP_ExpiredDate *time.Time `json:"sip_expiredDate"`
Unit_Code *string `json:"unit_code" gorm:"size:10"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
}
@@ -6,15 +6,17 @@ import (
eu "simrs-vx/internal/domain/main-entities/user"
erc "simrs-vx/internal/domain/references/common"
erg "simrs-vx/internal/domain/references/organization"
"time"
)
type Employee struct {
ecore.Main // adjust this according to the needs
User_Id *uint `json:"user_id"`
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"`
Person_Id *uint `json:"person_id"`
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"`
Position_Code *erg.EmployeePositionCode `json:"position_code" gorm:"size:20"`
Number *string `json:"number" gorm:"size:20"`
Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"`
ecore.Main // adjust this according to the needs
User_Id *uint `json:"user_id"`
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"`
Person_Id *uint `json:"person_id"`
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"`
Position_Code *erg.EmployeePositionCode `json:"position_code" gorm:"size:20"`
Number *string `json:"number" gorm:"size:20"`
Contract_ExpiredDate *time.Time `json:"contract_expiredDate"`
Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"`
}
@@ -48,6 +48,8 @@ type CreateDto struct {
Appointment_Id *uint `json:"appointment_id"`
RefTypeCode ere.RefTypeCode `json:"refTypeCode"`
NewStatus bool `json:"newStatus"`
VisitMode_Code *ere.VisitModeCode `json:"visitMode_code"` // if subClass_Code is rehab
AllocatedVisitCount *int `json:"allocatedVisitCount"` // if subClass_Code is rehab and VisitMode_Code is "adm"
pa.AuthInfo
}
+25 -24
View File
@@ -9,15 +9,15 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=15"`
Parent_Id *uint16 `json:"parent_id"`
Item_Id *uint `json:"item_id"`
Unit_Id *uint16 `json:"unit_id"`
Specialist_Id *uint16 `json:"specialist_id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Infra_Id *uint16 `json:"-"` // for room
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=15"`
Parent_Code *string `json:"parent_code"`
Item_Code *string `json:"-"`
Unit_Code *string `json:"unit_code"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
Infra_Code *string `json:"infra_code"` // for room
}
type ReadListDto struct {
@@ -32,24 +32,25 @@ type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup-code"`
Parent_Id *uint16 `json:"parent-id"`
Item_Id *uint `json:"item-id"`
Parent_Code *string `json:"parent-code"`
Item_Id *string `json:"item-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code *string `json:"code"`
Item_Id *uint `json:"item_id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Item_Code *string `json:"item_code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -63,10 +64,10 @@ type ResponseDto struct {
Code string `json:"code"`
Name string `json:"name"`
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code"`
Parent_Id *uint16 `json:"parent_id"`
Parent_Code *string `json:"parent_code"`
Parent *Infra `json:"parent,omitempty"`
Childrens []Infra `json:"childrens,omitempty"`
Item_Id *uint `json:"item_id"`
Item_Code *string `json:"item_code"`
Item *ei.Item `json:"item,omitempty"`
Rooms []erb.Basic `json:"rooms,omitempty"`
}
@@ -76,12 +77,12 @@ func (d Infra) ToResponse() ResponseDto {
Code: d.Code,
Name: d.Name,
InfraGroup_Code: d.InfraGroup_Code,
Parent_Id: d.Parent_Id,
Parent: d.Parent,
Childrens: d.Childrens,
Item_Id: d.Item_Id,
Item: d.Item,
Rooms: d.Rooms,
Parent_Code: d.Parent_Code,
// Parent: d.Parent,
Childrens: d.Childrens,
Item_Code: d.Item_Code,
Item: d.Item,
Rooms: d.Rooms,
}
resp.SmallMain = d.SmallMain
return resp
@@ -3,6 +3,7 @@ package infra
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
erb "simrs-vx/internal/domain/main-entities/room/base"
ero "simrs-vx/internal/domain/references/organization"
@@ -10,13 +11,13 @@ import (
type Infra struct {
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:10"`
Code string `json:"code" gorm:"uniqueIndex;size:10;not null"`
Name string `json:"name" gorm:"size:50"`
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:15"`
Parent_Id *uint16 `json:"parent_id"`
Parent *Infra `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
Childrens []Infra `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Id"`
Parent_Code *string `json:"parent_code" gorm:"size:10"`
Parent *Infra `json:"parent" gorm:"foreignKey:Parent_Code;references:Code"`
Childrens []Infra `json:"childrens" gorm:"foreignKey:Parent_Code;references:Code"`
Item_Code *string `json:"item_code" gorm:"size:50"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Code;references:Code"`
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Code;references:Code"`
}
@@ -6,13 +6,13 @@ import (
)
type Basic struct {
ecore.SmallMain // adjust this according to the needs
Installation_Id *uint16 `json:"installation_id" gorm:"not null"`
Code string `json:"code" gorm:"unique;size:10;not null"`
Name string `json:"name" gorm:"size:30;not null"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
ecore.SmallMain // adjust this according to the needs
Installation_Code *string `json:"installation_code" gorm:"size:10"`
Code string `json:"code" gorm:"unique;size:10;not null"`
Name string `json:"name" gorm:"size:30;not null"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
}
func (Basic) TableName() string {
@@ -7,11 +7,11 @@ import (
)
type CreateDto struct {
Installation_Id *uint16 `json:"installation_id" validate:"required"`
Code string `json:"code" validate:"maxLength=10;required"`
Name string `json:"name" validate:"maxLength=30;required"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Installation_Code *string `json:"installation_code" validate:"required"`
Code string `json:"code" validate:"maxLength=10;required"`
Name string `json:"name" validate:"maxLength=30;required"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
}
type ReadListDto struct {
@@ -22,26 +22,27 @@ type ReadListDto struct {
}
type FilterDto struct {
Installation_Id *uint16 `json:"installation-id"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Installation_Code *string `json:"installation-code"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -52,24 +53,24 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Installation_Id *uint16 `json:"installation_id"`
Installation *ei.Installation `json:"installation,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
Installation_Code *string `json:"installation_code"`
Installation *ei.Installation `json:"installation,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
}
func (d InstallationPosition) ToResponse() ResponseDto {
resp := ResponseDto{
Installation_Id: d.Installation_Id,
Installation: d.Installation,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
Installation_Code: d.Installation_Code,
Installation: d.Installation,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
}
resp.SmallMain = d.SmallMain
return resp
@@ -7,5 +7,5 @@ import (
type InstallationPosition struct {
eib.Basic // adjust this according to the needs
Installation *ei.Installation `json:"installation,omitempty" gorm:"foreignKey:Installation_Id;references:Id"`
Installation *ei.Installation `json:"installation,omitempty" gorm:"foreignKey:Installation_Code;references:Code"`
}
@@ -11,5 +11,5 @@ type Installation struct {
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
EncounterClass_Code ere.EncounterClassCode `json:"encounterClass_code" gorm:"size:10"`
InstallationPositions []eipb.Basic `json:"installationPositions,omitempty" gorm:"foreignKey:Installation_Id;references:Id"`
InstallationPositions []eipb.Basic `json:"installationPositions,omitempty" gorm:"foreignKey:Installation_Code;references:Code"`
}
+8 -7
View File
@@ -11,7 +11,7 @@ type CreateDto struct {
Name string `json:"name" validate:"maxLength=100"`
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" validate:"maxLength=10"`
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code"`
Stock *int `json:"stock"`
}
@@ -27,23 +27,24 @@ type FilterDto struct {
Name string `json:"name"`
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup-code"`
Uom_Code *string `json:"uom-code"`
Infra_Id *uint16 `json:"infra-id"`
Infra_Code *string `json:"infra-code"`
Stock *int `json:"stock"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -59,7 +60,7 @@ type ResponseDto struct {
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code"`
Uom_Code *string `json:"uom_code"`
Uom *eu.Uom `json:"uom,omitempty"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code"`
Stock *int `json:"stock"`
}
@@ -70,7 +71,7 @@ func (d Item) ToResponse() ResponseDto {
ItemGroup_Code: d.ItemGroup_Code,
Uom_Code: d.Uom_Code,
Uom: d.Uom,
Infra_Id: d.Infra_Id,
Infra_Code: d.Infra_Code,
Stock: d.Stock,
}
resp.Main = d.Main
+1 -1
View File
@@ -14,6 +14,6 @@ type Item struct {
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" gorm:"size:15"`
Uom_Code *string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code" gorm:"size:10"`
Stock *int `json:"stock"`
}
+35 -34
View File
@@ -8,12 +8,12 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
Infra_Id *uint16 `json:"infra_id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
Infra_Code *string `json:"infra_code"`
Stock *int `json:"stock"`
Item_Code *string `json:"item_code"`
}
type ReadListDto struct {
@@ -24,28 +24,29 @@ type ReadListDto struct {
}
type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom-code"`
Infra_Id *uint16 `json:"infra-id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom-code"`
Infra_Code *string `json:"infra-code"`
Stock *int `json:"stock"`
Item_Code *string `json:"item-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Item_Id *uint `json:"item_id"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -56,28 +57,28 @@ type MetaDto struct {
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"`
Infra_Id *uint16 `json:"infra_id"`
Infra *ein.Infra `json:"infra,omitempty"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Uom *eu.Uom `json:"uom,omitempty"`
Infra_Code *string `json:"infra_code"`
Infra *ein.Infra `json:"infra,omitempty"`
Stock *int `json:"stock"`
Item_Code *string `json:"item_code"`
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,
Infra_Id: d.Infra_Id,
Infra: d.Infra,
Stock: d.Stock,
Item_Id: d.Item_Id,
Item: d.Item,
Code: d.Code,
Name: d.Name,
Uom_Code: d.Uom_Code,
Uom: d.Uom,
Infra_Code: d.Infra_Code,
Infra: d.Infra,
Stock: d.Stock,
Item_Code: d.Item_Code,
Item: d.Item,
}
resp.Main = d.Main
return resp
@@ -14,8 +14,10 @@ type Material struct {
Uom_Code string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code" gorm:"size:10"`
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Item_Code *string `json:"item_code" gorm:"size:50"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -28,6 +28,7 @@ type CreateDto struct {
Number uint8 `json:"number"`
Temperature float64 `json:"temperature"`
UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code"`
Scope_Code ercl.McuScopeCode `json:"scope_code"`
pa.AuthInfo
}
@@ -8,7 +8,6 @@ import (
ercl "simrs-vx/internal/domain/references/clinical"
erc "simrs-vx/internal/domain/references/common"
ere "simrs-vx/internal/domain/references/encounter"
)
type McuOrder struct {
@@ -23,7 +22,7 @@ type McuOrder struct {
Number uint8 `json:"number"`
Temperature float64 `json:"temperature"`
UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code" gorm:"not null;size:15"`
Scope_Code *ere.CheckupScopeCode `json:"scope_code" gorm:"index;size:10"`
Scope_Code ercl.McuScopeCode `json:"scope_code" gorm:"index;size:10"`
}
func (d McuOrder) IsCompleted() bool {
@@ -3,13 +3,13 @@ package division
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ere "simrs-vx/internal/domain/references/encounter"
erc "simrs-vx/internal/domain/references/clinical"
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
Scope_Code *ere.CheckupScopeCode `json:"scope_code" validate:"maxLength=10"`
Code string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
Scope_Code erc.McuScopeCode `json:"scope_code" validate:"maxLength=10"`
}
type ReadListDto struct {
@@ -20,10 +20,10 @@ type ReadListDto struct {
}
type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
Scope_Code *ere.CheckupScopeCode `json:"scope-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Code string `json:"code"`
Name string `json:"name"`
Scope_Code *erc.McuScopeCode `json:"scope-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
@@ -48,9 +48,9 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Code string `json:"code"`
Name string `json:"name"`
Scope_Code *ere.CheckupScopeCode `json:"scope_code"`
Code string `json:"code"`
Name string `json:"name"`
Scope_Code erc.McuScopeCode `json:"scope_code"`
}
func (d McuSrcCategory) ToResponse() ResponseDto {
@@ -2,12 +2,12 @@ package division
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ere "simrs-vx/internal/domain/references/encounter"
erc "simrs-vx/internal/domain/references/clinical"
)
type McuSrcCategory struct {
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:20"`
Name string `json:"name" gorm:"size:50"`
Scope_Code *ere.CheckupScopeCode `json:"scope_code" gorm:"index;size:10"`
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:20"`
Name string `json:"name" gorm:"size:50"`
Scope_Code erc.McuScopeCode `json:"scope_code" gorm:"index;size:10"`
}
+14 -13
View File
@@ -16,9 +16,9 @@ type CreateDto struct {
MedicineMethod_Code *string `json:"medicineMethod_code" validate:"maxLength=10"`
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Item_Code *string `json:"item_code"`
}
type ReadListDto struct {
@@ -35,25 +35,26 @@ type FilterDto struct {
MedicineMethod_Code *string `json:"medicineMethod-code"`
Uom_Code *string `json:"uom-code"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra-id"`
Infra_Code *string `json:"infra-code"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item-id"`
Item_Code *string `json:"item-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code *string `json:"code"`
Item_Id *uint `json:"item_id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Item_Code *uint `json:"item_code"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -73,10 +74,10 @@ type ResponseDto struct {
Uom_Code *string `json:"uom_code"`
Uom *eu.Uom `json:"uom"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code"`
Infra *ein.Infra `json:"infra,omitempty"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Item_Code *string `json:"item_code"`
Item *eit.Item `json:"item,omitempty"`
}
@@ -91,10 +92,10 @@ func (d Medicine) ToResponse() ResponseDto {
Uom_Code: d.Uom_Code,
Uom: d.Uom,
Dose: d.Dose,
Infra_Id: d.Infra_Id,
Infra_Code: d.Infra_Code,
Infra: d.Infra,
Stock: d.Stock,
Item_Id: d.Item_Id,
Item_Code: d.Item_Code,
Item: d.Item,
}
resp.Main = d.Main
@@ -21,8 +21,10 @@ type Medicine struct {
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code" gorm:"size:10"`
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Item_Code *string `json:"item_code" gorm:"size:50"`
Item *eit.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
+8 -8
View File
@@ -11,8 +11,8 @@ type CreateDto struct {
Code *string `json:"code" validate:"maxLength=20"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
Unit_Id *uint16 `json:"unit_id"`
Infra_Id *uint16 `json:"infra_id"`
Unit_Code *string `json:"unit_code"`
Infra_Code *string `json:"infra_code"`
}
type ReadListDto struct {
@@ -25,8 +25,8 @@ type FilterDto struct {
Code *string `json:"code"`
Employee_Id *uint `json:"employee-id"`
IHS_Number *string `json:"ihs-number"`
Unit_Id *uint16 `json:"unit-id"`
Infra_Id *uint16 `json:"infra-id"`
Unit_Code *string `json:"unit-code"`
Infra_Code *string `json:"infra-code"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
@@ -56,9 +56,9 @@ type ResponseDto struct {
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
IHS_Number *string `json:"ihs_number"`
Unit_Id *uint16 `json:"unit_id"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty"`
Infra_Id *uint16 `json:"infra_id"`
Infra_Code *string `json:"infra_code"`
Infra *ei.Infra `json:"infra,omitempty"`
}
@@ -68,9 +68,9 @@ func (d Nurse) ToResponse() ResponseDto {
Employee_Id: d.Employee_Id,
Employee: d.Employee,
IHS_Number: d.IHS_Number,
Unit_Id: d.Unit_Id,
Unit_Code: d.Unit_Code,
Unit: d.Unit,
Infra_Id: d.Infra_Id,
Infra_Code: d.Infra_Code,
Infra: d.Infra,
}
resp.Main = d.Main
@@ -13,8 +13,8 @@ type Nurse struct {
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
Infra_Id *uint16 `json:"infra_id"`
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
Unit_Code *string `json:"unit_code" gorm:"size:10"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
Infra_Code *string `json:"infra_code" gorm:"size:10"`
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
}
@@ -14,7 +14,7 @@ import (
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code erc.DataStatusCode `json:"status_code"`
@@ -29,7 +29,7 @@ type ReadListDto struct {
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Doctor_Id *uint `json:"doctor-id"`
Doctor_Code *string `json:"doctor-code"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code *erc.DataStatusCode `json:"status-code"`
}
@@ -58,7 +58,7 @@ type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code erc.DataStatusCode `json:"status_code"`
@@ -68,7 +68,7 @@ func (d Prescription) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Doctor_Id: d.Doctor_Id,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
IssuedAt: d.IssuedAt,
Status_Code: d.Status_Code,
@@ -14,8 +14,8 @@ 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"`
Doctor_Code *string `json:"doctor_code" gorm:"size:20"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
@@ -0,0 +1,68 @@
package rehab
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
)
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
AllocatedVisitCount *int `json:"allocatedVisitCount"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Doctor_Id *uint `json:"doctor-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
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
AllocatedVisitCount *int `json:"allocatedVisitCount"`
}
func (d Rehab) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
AllocatedVisitCount: d.AllocatedVisitCount,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []Rehab) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -28,9 +28,8 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code *string `json:"code"`
Includes string `json:"includes"`
Id uint16 `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
@@ -8,14 +8,14 @@ import (
)
type Basic struct {
ecore.SmallMain // adjust this according to the needs
Infra_Id *uint16 `json:"infra_id"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
ecore.SmallMain // adjust this according to the needs
Infra_Code *string `json:"infra_code" gorm:"size:10"`
Unit_Code *string `json:"unit_code" gorm:"size:10"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
}
func (Basic) TableName() string {
+24 -24
View File
@@ -9,10 +9,10 @@ import (
)
type CreateDto struct {
Infra_Id *uint16 `json:"infra_id"`
Unit_Id *uint16 `json:"unit_id"`
Specialist_Id *uint16 `json:"specialist_id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Infra_Code *string `json:"infra_code"`
Unit_Code *string `json:"unit_code"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
}
type ReadListDto struct {
@@ -22,10 +22,10 @@ type ReadListDto struct {
}
type FilterDto struct {
Infra_Id *uint16 `json:"infra-id"`
Unit_Id *uint16 `json:"unit-id"`
Specialist_Id *uint16 `json:"specialist-id"`
Subspecialist_Id *uint16 `json:"subspecialist-id"`
Infra_Code *string `json:"infra-code"`
Unit_Code *string `json:"unit-code"`
Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"`
}
type ReadDetailDto struct {
@@ -49,26 +49,26 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Infra_Id *uint16 `json:"infra_id"`
Infra *ei.Infra `json:"infra,omitempty"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
Infra_Code *string `json:"infra_code"`
Infra *ei.Infra `json:"infra,omitempty"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Code *string `json:"subspecialist_code"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
}
func (d Room) ToResponse() ResponseDto {
resp := ResponseDto{
Infra_Id: d.Infra_Id,
Infra: d.Infra,
Unit_Id: d.Unit_Id,
Unit: d.Unit,
Specialist_Id: d.Specialist_Id,
Specialist: d.Specialist,
Subspecialist_Id: d.Subspecialist_Id,
Subspecialist: d.Subspecialist,
Infra_Code: d.Infra_Code,
Infra: d.Infra,
Unit_Code: d.Unit_Code,
Unit: d.Unit,
Specialist_Code: d.Specialist_Code,
Specialist: d.Specialist,
Subspecialist_Code: d.Subspecialist_Code,
Subspecialist: d.Subspecialist,
}
resp.SmallMain = d.SmallMain
return resp
+1 -1
View File
@@ -7,5 +7,5 @@ import (
type Room struct {
ebase.Basic
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id"`
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
}
@@ -9,10 +9,10 @@ import (
)
type CreateDto struct {
Person_Id *uint `json:"person_id"`
Specialist_Id *uint16 `json:"specialist_id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
User_Id *uint `json:"user_id"`
Person_Id *uint `json:"person_id"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
User_Id *uint `json:"user_id"`
}
type ReadListDto struct {
@@ -22,10 +22,10 @@ type ReadListDto struct {
}
type FilterDto struct {
Person_Id *uint `json:"person-id"`
Specialist_Id *uint16 `json:"specialist-id"`
Subspecialist_Id *uint16 `json:"subspecialist-id"`
User_Id *uint `json:"user-id"`
Person_Id *uint `json:"person-id"`
Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"`
User_Id *uint `json:"user-id"`
}
type ReadDetailDto struct {
@@ -50,26 +50,26 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Person_Id *uint `json:"person_id"`
Person *ep.Person `json:"person,omitempty"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
User_Id *uint `json:"user_id"`
User *eu.User `json:"user,omitempty"`
Person_Id *uint `json:"person_id"`
Person *ep.Person `json:"person,omitempty"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist_Code *string `json:"subspecialist_code"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
User_Id *uint `json:"user_id"`
User *eu.User `json:"user,omitempty"`
}
func (d SpecialistIntern) ToResponse() ResponseDto {
resp := ResponseDto{
Person_Id: d.Person_Id,
Person: d.Person,
Specialist_Id: d.Specialist_Id,
Specialist: d.Specialist,
Subspecialist_Id: d.Subspecialist_Id,
Subspecialist: d.Subspecialist,
User_Id: d.User_Id,
User: d.User,
Person_Id: d.Person_Id,
Person: d.Person,
Specialist_Code: d.Specialist_Code,
Specialist: d.Specialist,
Subspecialist_Code: d.Subspecialist_Code,
Subspecialist: d.Subspecialist,
User_Id: d.User_Id,
User: d.User,
}
resp.Main = d.Main
return resp
@@ -9,13 +9,13 @@ import (
)
type SpecialistIntern struct {
ecore.Main // adjust this according to the needs
Person_Id *uint `json:"person_id"`
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
User_Id *uint `json:"user_id"`
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id"`
ecore.Main // adjust this according to the needs
Person_Id *uint `json:"person_id"`
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id"`
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
User_Id *uint `json:"user_id"`
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id"`
}
@@ -7,7 +7,7 @@ import (
type Basic struct {
ecore.SmallMain // adjust this according to the needs
Specialist_Id *uint16 `json:"specialist_id" gorm:"not null"`
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
Code string `json:"code" gorm:"unique;size:10;not null"`
Name string `json:"name" gorm:"size:30;not null"`
HeadStatus bool `json:"headStatus"`
@@ -7,11 +7,11 @@ import (
)
type CreateDto struct {
Specialist_Id *uint16 `json:"specialist_id" validate:"required"`
Code string `json:"code" validate:"maxLength=10;required"`
Name string `json:"name" validate:"maxLength=30;required"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Specialist_Code *string `json:"specialist_code" validate:"required"`
Code string `json:"code" validate:"maxLength=10;required"`
Name string `json:"name" validate:"maxLength=30;required"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
}
type ReadListDto struct {
@@ -22,26 +22,27 @@ type ReadListDto struct {
}
type FilterDto struct {
Specialist_Id *uint16 `json:"specialist-id"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Specialist_Code *string `json:"specialist-code"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -52,24 +53,24 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
}
func (d SpecialistPosition) ToResponse() ResponseDto {
resp := ResponseDto{
Specialist_Id: d.Specialist_Id,
Specialist: d.Specialist,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
Specialist_Code: d.Specialist_Code,
Specialist: d.Specialist,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
}
resp.SmallMain = d.SmallMain
return resp
@@ -7,5 +7,5 @@ import (
type SpecialistPosition struct {
esb.Basic
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
}
+13 -12
View File
@@ -8,9 +8,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Unit_Id *uint16 `json:"unit_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Unit_Code *string `json:"unit_code"`
}
type ReadListDto struct {
@@ -21,25 +21,26 @@ type ReadListDto struct {
}
type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
Unit_Id *uint16 `json:"unit-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Code string `json:"code"`
Name string `json:"name"`
Unit_Code *string `json:"unit-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -52,7 +53,7 @@ type ResponseDto struct {
ecore.SmallMain
Code string `json:"code"`
Name string `json:"name"`
Unit_Id *uint16 `json:"unit_id"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty"`
SpecialistPositions []espb.Basic `json:"specialistPositions,omitempty"`
Subspecialists []essb.Basic `json:"subspecialists,omitempty"`
@@ -63,7 +64,7 @@ func (d Specialist) ToResponse() ResponseDto {
Code: d.Code,
Name: d.Name,
Unit: d.Unit,
Unit_Id: d.Unit_Id,
Unit_Code: d.Unit_Code,
SpecialistPositions: d.SpecialistPositions,
Subspecialists: d.Subspecialists,
}
@@ -11,8 +11,8 @@ type Specialist struct {
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
Unit_Code *string `json:"unit_code" gorm:"size:10"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
}
@@ -6,13 +6,13 @@ import (
)
type Basic struct {
ecore.SmallMain // adjust this according to the needs
Subspecialist_Id *uint16 `json:"subspecialist_id" gorm:"not null"`
Code string `json:"code" gorm:"unique;size:10;not null"`
Name string `json:"name" gorm:"size:30;not null"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
ecore.SmallMain // adjust this according to the needs
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
Code string `json:"code" gorm:"unique;size:10;not null"`
Name string `json:"name" gorm:"size:30;not null"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
}
func (Basic) TableName() string {
@@ -7,11 +7,11 @@ import (
)
type CreateDto struct {
Subspecialist_Id *uint16 `json:"subspecialist_id" validate:"required"`
Code string `json:"code" validate:"maxLength=10;required"`
Name string `json:"name" validate:"maxLength=30;required"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Subspecialist_Code *string `json:"subspecialist_code" validate:"required"`
Code string `json:"code" validate:"maxLength=10;required"`
Name string `json:"name" validate:"maxLength=30;required"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
}
type ReadListDto struct {
@@ -22,26 +22,27 @@ type ReadListDto struct {
}
type FilterDto struct {
Subspecialist_Id *uint16 `json:"subspecialist-id"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Subspecialist_Code *string `json:"subspecialist-code"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
Employee_Id *uint `json:"employee-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -52,24 +53,24 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
Subspecialist_Code *string `json:"subspecialist_id"`
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
}
func (d SubspecialistPosition) ToResponse() ResponseDto {
resp := ResponseDto{
Subspecialist_Id: d.Subspecialist_Id,
Subspecialist: d.Subspecialist,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
Subspecialist_Code: d.Subspecialist_Code,
Subspecialist: d.Subspecialist,
Code: d.Code,
Name: d.Name,
HeadStatus: d.HeadStatus,
Employee_Id: d.Employee_Id,
Employee: d.Employee,
}
resp.SmallMain = d.SmallMain
return resp
@@ -7,5 +7,5 @@ import (
type SubspecialistPosition struct {
esb.Basic
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"`
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
}
@@ -8,7 +8,7 @@ type Basic struct {
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
}
func (Basic) TableName() string {
@@ -7,9 +7,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Specialist_Id *uint16 `json:"specialist_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Specialist_Code *string `json:"specialist_code"`
}
type ReadListDto struct {
@@ -20,25 +20,26 @@ type ReadListDto struct {
}
type FilterDto struct {
Code *string `json:"code"`
Name *string `json:"name"`
Specialist_Id *uint16 `json:"specialist-id"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Code *string `json:"code"`
Name *string `json:"name"`
Specialist_Code *string `json:"specialist-code"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -49,20 +50,20 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Code string `json:"code"`
Name string `json:"name"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist []espb.Basic `json:"subspecialistPositions,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
Specialist_Code *string `json:"specialist_code"`
Specialist *es.Specialist `json:"specialist,omitempty"`
Subspecialist []espb.Basic `json:"subspecialistPositions,omitempty"`
}
func (d Subspecialist) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
Specialist_Id: d.Specialist_Id,
Specialist: d.Specialist,
Subspecialist: d.SubspecialistPositions,
Code: d.Code,
Name: d.Name,
Specialist_Code: d.Specialist_Code,
Specialist: d.Specialist,
Subspecialist: d.SubspecialistPositions,
}
resp.SmallMain = d.SmallMain
return resp
@@ -8,6 +8,6 @@ import (
type Subspecialist struct {
esb.Basic
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
SubspecialistPositions []espb.Basic `json:"subspecialistPositions,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
SubspecialistPositions []espb.Basic `json:"subspecialistPositions,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
}
@@ -0,0 +1,107 @@
package therapy_protocol
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"
"simrs-vx/internal/domain/references/common"
)
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
Anamnesis *string `json:"anamnesis" validate:"maxLength=2048"`
MedicalDiagnoses *string `json:"medicalDiagnoses"`
FunctionDiagnoses *string `json:"functionDiagnoses"`
Procedures *string `json:"procedures"`
SupportingExams *string `json:"supportingExams" validate:"maxLength=2048"`
Instruction *string `json:"instruction" validate:"maxLength=2048"`
Evaluation *string `json:"evaluation" validate:"maxLength=2048"`
WorkCauseStatus *string `json:"workCauseStatus"`
Frequency *uint `json:"frequency"`
IntervalUnit_Code *common.TimeUnitCode `json:"intervalUnit_code" validate:"maxLength=10"`
Duration *uint `json:"duration"`
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_code" validate:"maxLength=10"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Doctor_Id *uint `json:"doctor-id"`
}
type ReadDetailDto struct {
Id uint `json:"id"`
Includes string `json:"includes"`
}
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
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
Anamnesis *string `json:"anamnesis"`
MedicalDiagnoses *string `json:"medicalDiagnoses"`
FunctionDiagnoses *string `json:"functionDiagnoses"`
Procedures *string `json:"procedures"`
SupportingExams *string `json:"supportingExams"`
Instruction *string `json:"instruction"`
Evaluation *string `json:"evaluation"`
WorkCauseStatus *string `json:"workCauseStatus"`
Frequency *uint `json:"frequency"`
IntervalUnit_Code *common.TimeUnitCode `json:"intervalUnit_code"`
Duration *uint `json:"duration"`
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_code"`
}
func (d TherapyProtocol) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Doctor_Id: d.Doctor_Id,
Doctor: d.Doctor,
Anamnesis: d.Anamnesis,
MedicalDiagnoses: d.MedicalDiagnoses,
FunctionDiagnoses: d.FunctionDiagnoses,
Procedures: d.Procedures,
SupportingExams: d.SupportingExams,
Instruction: d.Instruction,
Evaluation: d.Evaluation,
WorkCauseStatus: d.WorkCauseStatus,
Frequency: d.Frequency,
IntervalUnit_Code: d.IntervalUnit_Code,
Duration: d.Duration,
DurationUnit_Code: d.DurationUnit_Code,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []TherapyProtocol) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -7,7 +7,7 @@ import (
type Basic struct {
ecore.SmallMain // adjust this according to the needs
Unit_Id *uint16 `json:"unit_id" gorm:"not null"`
Unit_Code *string `json:"unit_code" gorm:"size:10"`
Code string `json:"code" gorm:"unique;size:10;not null"`
Name string `json:"name" gorm:"size:30;not null"`
HeadStatus bool `json:"headStatus"`
@@ -7,7 +7,7 @@ import (
)
type CreateDto struct {
Unit_Id *uint16 `json:"unit_id" validate:"required"`
Unit_Code *string `json:"unit_code" validate:"required"`
Code string `json:"code" validate:"maxLength=10;required"`
Name string `json:"name" validate:"maxLength=30;required"`
HeadStatus bool `json:"headStatus"`
@@ -22,7 +22,7 @@ type ReadListDto struct {
}
type FilterDto struct {
Unit_Id *uint16 `json:"unit-id"`
Unit_Code *string `json:"unit-code"`
Code string `json:"code"`
Name string `json:"name"`
HeadStatus *bool `json:"head-status"`
@@ -31,17 +31,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -52,7 +53,7 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Unit_Id *uint16 `json:"unit_id"`
Unit_Code *string `json:"unit_code"`
Unit *eu.Unit `json:"unit,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
@@ -63,7 +64,7 @@ type ResponseDto struct {
func (d UnitPosition) ToResponse() ResponseDto {
resp := ResponseDto{
Unit_Id: d.Unit_Id,
Unit_Code: d.Unit_Code,
Unit: d.Unit,
Code: d.Code,
Name: d.Name,
@@ -7,5 +7,5 @@ import (
type UnitPosition struct {
eub.Basic
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
}
+23 -22
View File
@@ -7,9 +7,9 @@ import (
)
type CreateDto struct {
Installation_Id *uint16 `json:"installation_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Installation_Code *string `json:"installation_code"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
@@ -20,26 +20,27 @@ type ReadListDto struct {
}
type FilterDto struct {
Installation_Id *uint16 `json:"installation-id"`
Code string `json:"code"`
Name string `json:"name"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
Installation_Code *string `json:"installation-code"`
Code string `json:"code"`
Name string `json:"name"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Installation_Id *uint16 `json:"installation_id"`
Code *string `json:"code"`
Includes string `json:"includes"`
Id *uint16 `json:"id"`
Installation_Code *string `json:"installation_code"`
Code *string `json:"code"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -50,19 +51,19 @@ type MetaDto struct {
type ResponseDto struct {
ecore.SmallMain
Installation_Id *uint16 `json:"installation_id"`
Installation *ei.Installation `json:"installation,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
UnitPositions []eipb.Basic `json:"unitPositions,omitempty"`
Installation_Code *string `json:"installation_code"`
Installation *ei.Installation `json:"installation,omitempty"`
Code string `json:"code"`
Name string `json:"name"`
UnitPositions []eipb.Basic `json:"unitPositions,omitempty"`
}
func (d Unit) ToResponse() ResponseDto {
resp := ResponseDto{
Installation_Id: d.Installation_Id,
Code: d.Code,
Name: d.Name,
UnitPositions: d.UnitPositions,
Installation_Code: d.Installation_Code,
Code: d.Code,
Name: d.Name,
UnitPositions: d.UnitPositions,
}
resp.SmallMain = d.SmallMain
if d.Installation != nil {
+7 -7
View File
@@ -8,11 +8,11 @@ import (
)
type Unit struct {
ecore.SmallMain // adjust this according to the needs
Installation_Id *uint16 `json:"installation_id"`
Installation *ei.Installation `json:"installation" gorm:"foreignKey:Installation_Id"`
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Type_Code *ero.UnitTypeCode `json:"type_code"`
UnitPositions []eub.Basic `json:"unitPositions,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
ecore.SmallMain // adjust this according to the needs
Installation_Code *string `json:"installation_code" gorm:"size:10"`
Installation *ei.Installation `json:"installation" gorm:"foreignKey:Installation_Code;references:Code"`
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Type_Code *ero.UnitTypeCode `json:"type_code"`
UnitPositions []eub.Basic `json:"unitPositions,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
}
@@ -0,0 +1,75 @@
// FES = From External Source
package userfes
import (
// internal - domain - main-entities
ecore "simrs-vx/internal/domain/base-entities/core"
eap "simrs-vx/internal/domain/main-entities/auth-partner"
)
type CreateDto struct {
Name string `json:"name"`
AuthPartner_Code string `json:"authPartner_code"`
User_Name string `json:"user_name"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
Sort string `json:"sort"`
}
type FilterDto struct {
Name *string `json:"name"`
AuthPartner_Code *string `json:"authPartner_code"`
User_Name *string `json:"user_name"`
Includes string `json:"includes"`
}
type ReadDetailDto struct {
Id uint `json:"id"`
Includes string `json:"includes"`
}
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"`
AuthPartner_Code string `json:"authPartner_code"`
AuthPartner *eap.AuthPartner `json:"authPartner,omitempty"`
User_Name string `json:"user_name"`
}
func (d UserFes) ToResponse() ResponseDto {
resp := ResponseDto{
Name: d.Name,
AuthPartner_Code: d.AuthPartner_Code,
AuthPartner: d.AuthPartner,
User_Name: d.User_Name,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []UserFes) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,17 @@
// FES = From External Source
package userfes
import (
ecore "simrs-vx/internal/domain/base-entities/core"
eap "simrs-vx/internal/domain/main-entities/auth-partner"
eau "simrs-vx/internal/domain/main-entities/user"
)
type UserFes struct {
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"size:100"`
AuthPartner_Code string `json:"authPartner_code" gorm:"size:30"`
AuthPartner *eap.AuthPartner `json:"authPartner,omitempty" gorm:"foreignKey:AuthPartner_Code;references:Code"`
User_Name string `json:"user_name" gorm:"size:50"`
User *eau.User `json:"user,omitempty" gorm:"foreignKey:User_Name;references:Name"`
}
+4 -4
View File
@@ -24,10 +24,10 @@ type CreateDto struct {
Employee *EmployeUpdateDto `json:"employee"`
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
Unit_Id *uint16 `json:"unit_id"`
Infra_Id *uint16 `json:"infra_id"`
Specialist_Id *uint16 `json:"specialist_id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Unit_Code *string `json:"unit_code"`
Infra_Code *string `json:"infra_code"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20"`
}
@@ -9,6 +9,7 @@ type (
InstructionCode string
HeadToToeCode string
McuUrgencyLevelCode string
McuScopeCode string
SoapiTypeCode string
MedicalActionTypeCode string
VehicleTypeCode string
@@ -24,6 +25,7 @@ type (
)
const (
SCDetail SubjectCode = "detail" // Detail
SCPrimaryComplain SubjectCode = "pri-complain" // Keluhan Utama
SCSecComplain SubjectCode = "sec-complain" // Secondary Complaint
SCCurrentDiseaseHistory SubjectCode = "cur-disea-hist" // Current Disease History
@@ -34,6 +36,7 @@ const (
SCMedicationHistory SubjectCode = "med-hist" // Medication History
SCBloodType SubjectCode = "blood-type" // Blood Type
Detail ObjectCode = "detail" // Detail
OCConsciousnessLevel ObjectCode = "consc-level" // Tingkat Kesadaran
OCConsciousnessLevelDet ObjectCode = "consc-level-det" // Detail Tingkat Kesadaran
OCSystolicBloodPressure ObjectCode = "syst-bp" // Tekanan Darah Systolic
@@ -63,6 +66,7 @@ const (
OCHeight ObjectCode = "height" // Tinggi Badan
OCHeadToToe ObjectCode = "head-to-toe" // Kepala Sampai Kaki
ACDetail AssessmentCode = "detail" // Detail
ACEarlyDiag AssessmentCode = "early-diag" // Diagnosis Awal
ACLateDiag AssessmentCode = "late-diag" // Diagnosis Akhir
ACSecDiag AssessmentCode = "sec-diag" // Diagnosis Sekunder
@@ -193,7 +197,7 @@ type Soapi struct {
// ---------------- SUBJECT ----------------
type SubjectSection struct {
Note string `json:"note,omitempty"`
Detail string `json:"detail,omitempty"`
PrimComplain string `json:"prim-compl,omitempty"`
SecComplainQ string `json:"sec-compl,omitempty"`
PrimaryComplain string `json:"pri-complain,omitempty"`
@@ -209,7 +213,7 @@ type SubjectSection struct {
// ---------------- OBJECT ----------------
type ObjectSection struct {
Note string `json:"note,omitempty"`
Detail string `json:"detail,omitempty"`
ConsciousnessLevel string `json:"consc-level,omitempty"`
ConsciousnessLevelDet string `json:"consc-level-det,omitempty"`
SystolicBloodPressure string `json:"syst-bp,omitempty"`
@@ -242,9 +246,16 @@ type ObjectSection struct {
// ---------------- ASSESSMENT ----------------
type AssessmentSection struct {
EarlyDiagnosis DiagnosisDetail `json:"early-diag,omitempty"`
LateDiagnosis DiagnosisDetail `json:"late-diag,omitempty"`
SecondaryDiag DiagnosisDetail `json:"sec-diag,omitempty"`
Detail string `json:"detail,omitempty"`
EarlyDiagnosis DiagnosisDetail `json:"early-diag,omitempty"`
LateDiagnosis DiagnosisDetail `json:"late-diag,omitempty"`
SecondaryDiag DiagnosisDetail `json:"sec-diag,omitempty"`
EarlyDiagnosisMed DiagnosisDetail `json:"early-med-diag,omitempty"`
LateDiagnosisMed DiagnosisDetail `json:"late-med-diag,omitempty"`
SecondaryDiagnosisMed DiagnosisDetail `json:"sec-med-diag,omitempty"`
EarlyDiagnosisFunc DiagnosisDetail `json:"early-func-diag,omitempty"`
LateDiagnosisFunc DiagnosisDetail `json:"late-func-diag,omitempty"`
SecondaryDiagnosisFunc DiagnosisDetail `json:"sec-func-diag,omitempty"`
}
// nested object {note, codes}
@@ -8,7 +8,6 @@ type (
PersonConditionCode string
EmergencyClassCode string
OutpatientClassCode string
CheckupScopeCode string
AmbulatoryClassCode string
InpatientClassCode string
UploadCode string
@@ -33,18 +32,19 @@ const (
QSCCancel QueueStatusCode = "cancel" // Dibatalkan
QSCSkip QueueStatusCode = "skip" // Dilewati
DMCHome DischargeMethodCode = "home" // Pulang
DMCHomeReq DischargeMethodCode = "home-request" // Pulang Atas Permintaan Sendiri
DMCConsulBack DischargeMethodCode = "consul-back" // Konsultasi Balik / Lanjutan
//DMCConsulPoly DischargeMethodCode = "consul-poly" // Konsultasi Poliklinik Lain
//DMCConsulExecutive DischargeMethodCode = "consul-executive" // Konsultasi Antar Dokter Eksekutif
DMCConsulChDay DischargeMethodCode = "consul-ch-day" // Konsultasi Hari Lain
DMCEmergency DischargeMethodCode = "emergency" // Rujuk IGD
DMCEmergencyCovid DischargeMethodCode = "emergency-covid" // Rujuk IGD Covid
DMCInpatient DischargeMethodCode = "inpatient" // Rujuk Rawat Inap
DMCExtRef DischargeMethodCode = "external" // Rujuk Faskes Lain
DMCDeath DischargeMethodCode = "death" // Meninggal
DMCDeathOnArrival DischargeMethodCode = "death-on-arrival" // Meninggal Saat Tiba
DMCHome DischargeMethodCode = "home" // Pulang
DMCHomeReq DischargeMethodCode = "home-request" // Pulang Atas Permintaan Sendiri
DMCConsulBack DischargeMethodCode = "consul-back" // Konsultasi Balik / Lanjutan
DMCConsulPoly DischargeMethodCode = "consul-poly" // Konsultasi Poliklinik Lain
DMCConsulExecutive DischargeMethodCode = "consul-executive" // Konsultasi Antar Dokter Eksekutif
DMCConsulChDay DischargeMethodCode = "consul-ch-day" // Konsultasi Hari Lain
DMCEmergency DischargeMethodCode = "emergency" // Rujuk IGD
DMCEmergencyCovid DischargeMethodCode = "emergency-covid" // Rujuk IGD Covid
DMCInpatient DischargeMethodCode = "inpatient" // Rujuk Rawat Inap
DMCExtRef DischargeMethodCode = "external" // Rujuk Faskes Lain
DMCDeath DischargeMethodCode = "death" // Meninggal
DMCDeathOnArrival DischargeMethodCode = "death-on-arrival" // Meninggal Saat Tiba
DMCRunAway DischargeMethodCode = "run-away" // Melarikan Diri
TCAmbulance TransportationCode = "ambulance" // Ambulans
TCCar TransportationCode = "car" // Mobil
@@ -66,11 +66,6 @@ const (
OCCHcu OutpatientClassCode = "hcu" // HCU
OCCVk OutpatientClassCode = "vk" // Verlos kamer
CSCLab CheckupScopeCode = "lab" // Laboratorium
CSCMLab CheckupScopeCode = "mic-lab" // Microbacterial Laboratorium
CSCPLab CheckupScopeCode = "pa-lab" // Patology Anatomy Laboratorium
CSCRad CheckupScopeCode = "radiology" // Radiology
ACCReg AmbulatoryClassCode = "reg" // Regular
// ACCRehab ACCRme AmbulatoryClassCode = "rme" // Rehab Medik
// ACCCad AmbulatoryClassCode = "chemo-adm" // Chemotherapy
@@ -0,0 +1,72 @@
package chemo_protocol
import (
"net/http"
rw "github.com/karincake/risoles"
sf "github.com/karincake/semprit"
// ua "github.com/karincake/tumpeng/auth/svc"
e "simrs-vx/internal/domain/main-entities/chemo-protocol"
u "simrs-vx/internal/use-case/main-use-case/chemo-protocol"
)
type myBase struct{}
var O myBase
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
dto := e.CreateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
res, err := u.Create(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
dto := e.ReadListDto{}
sf.UrlQueryParam(&dto, *r.URL)
res, err := u.ReadList(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.ReadDetailDto{}
sf.UrlQueryParam(&dto, *r.URL)
dto.Id = uint16(id)
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.UpdateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -84,11 +84,16 @@ func (obj myBase) Verify(w http.ResponseWriter, r *http.Request) {
}
dto := e.VerifyDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
authInfo, err := pa.GetAuthInfo(r)
if err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
}
dto.AuthInfo = *authInfo
dto.Status_Code = erc.DVCVerified
res, err := u.Verify(dto)
@@ -1,4 +1,4 @@
package device
package consultation
import (
"net/http"
@@ -0,0 +1,72 @@
package controlletter
import (
"net/http"
rw "github.com/karincake/risoles"
sf "github.com/karincake/semprit"
// ua "github.com/karincake/tumpeng/auth/svc"
e "simrs-vx/internal/domain/main-entities/control-letter"
u "simrs-vx/internal/use-case/main-use-case/control-letter"
)
type myBase struct{}
var O myBase
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
dto := e.CreateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
res, err := u.Create(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
dto := e.ReadListDto{}
sf.UrlQueryParam(&dto, *r.URL)
res, err := u.ReadList(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.ReadDetailDto{}
sf.UrlQueryParam(&dto, *r.URL)
dto.Id = uint16(id)
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.UpdateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint(id)
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.DeleteDto{}
dto.Id = uint(id)
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,21 +33,21 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
sf.UrlQueryParam(&dto, *r.URL)
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -55,19 +55,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,7 +33,7 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
id := rw.ValidateInt(w, "code", r.PathValue("code"))
if id <= 0 {
return
}
@@ -44,7 +44,7 @@ func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
id := rw.ValidateInt(w, "code", r.PathValue("code"))
if id <= 0 {
return
}
@@ -59,7 +59,7 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
id := rw.ValidateInt(w, "code", r.PathValue("code"))
if id <= 0 {
return
}
@@ -26,10 +26,15 @@ func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
if err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
}
dto := e.CreateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
if valid := validateRequestCreate(w, dto); !valid {
return
}
dto.AuthInfo = *authInfo
res, err := u.Create(dto)
rw.DataResponse(w, res, err)
@@ -61,3 +61,21 @@ func validateRequestCheckIn(w http.ResponseWriter, i e.CheckinDto) (valid bool)
return true
}
func validateRequestCreate(w http.ResponseWriter, i e.CreateDto) (valid bool) {
switch {
case i.Class_Code == ere.ECAmbulatory:
// field allocatedVisitCount required if ambulatory visitMode_Code is adm
if ere.AmbulatoryClassCode(*i.SubClass_Code) == ere.ACCRehab && *i.VisitMode_Code == ere.VMCAdm {
if *i.AllocatedVisitCount == 0 {
rw.DataResponse(w, nil, d.FieldError{
Code: dataValidationFail,
Message: "allocatedVisitCount required",
})
return
}
}
}
return true
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
+24 -17
View File
@@ -9,7 +9,9 @@ import (
ambulancetransportrequest "simrs-vx/internal/interface/main-handler/ambulance-transport-req"
auth "simrs-vx/internal/interface/main-handler/authentication"
chemo "simrs-vx/internal/interface/main-handler/chemo"
chemoprotocol "simrs-vx/internal/interface/main-handler/chemo-protocol"
consultation "simrs-vx/internal/interface/main-handler/consultation"
controlletter "simrs-vx/internal/interface/main-handler/control-letter"
counter "simrs-vx/internal/interface/main-handler/counter"
deviceorder "simrs-vx/internal/interface/main-handler/device-order"
deviceorderitem "simrs-vx/internal/interface/main-handler/device-order-item"
@@ -33,6 +35,7 @@ import (
soapi "simrs-vx/internal/interface/main-handler/soapi"
/******************** actor ********************/
doctor "simrs-vx/internal/interface/main-handler/doctor"
employee "simrs-vx/internal/interface/main-handler/employee"
nurse "simrs-vx/internal/interface/main-handler/nurse"
@@ -93,6 +96,7 @@ import (
specialistposition "simrs-vx/internal/interface/main-handler/specialist-position"
subspecialist "simrs-vx/internal/interface/main-handler/subspecialist"
subspecialistposition "simrs-vx/internal/interface/main-handler/subspecialist-position"
therapyprotocol "simrs-vx/internal/interface/main-handler/therapy-protocol"
unit "simrs-vx/internal/interface/main-handler/unit"
unitposition "simrs-vx/internal/interface/main-handler/unit-position"
uom "simrs-vx/internal/interface/main-handler/uom"
@@ -251,10 +255,13 @@ func SetRoutes() http.Handler {
"PATCH /{id}/reject": chemo.O.Reject,
})
hc.RegCrud(r, "/v1/control-letter", controlletter.O)
hc.RegCrud(r, "/v1/internal-reference", internalreference.O)
hc.RegCrud(r, "/v1/ambulance-transport-req", ambulancetransportrequest.O)
hc.RegCrud(r, "/v1/responsible-doctor-hist", responsibledoctorhist.O)
hc.RegCrud(r, "/v1/adm-employee-hist", admemployeehist.O)
hc.RegCrud(r, "/v1/therapy-protocol", therapyprotocol.O)
hc.RegCrud(r, "/v1/chemo-protocol", chemoprotocol.O)
/******************** actor ********************/
hc.RegCrud(r, "/v1/person", person.O)
@@ -262,8 +269,8 @@ func SetRoutes() http.Handler {
hc.RegCrud(r, "/v1/person-contact", personcontact.O)
hc.RegCrud(r, "/v1/person-insurance", personinsurance.O)
hc.RegCrud(r, "/v1/employee", employee.O)
hc.RegCrud(r, "/v1/doctor", doctor.O)
hc.RegCrud(r, "/v1/nurse", nurse.O)
hc.RegCrudByCode(r, "/v1/doctor", doctor.O)
hc.RegCrudByCode(r, "/v1/nurse", nurse.O)
hc.RegCrud(r, "/v1/nutritionist", nutritionist.O)
hc.RegCrud(r, "/v1/pharmacist", pharmacist.O)
hk.GroupRoutes("/v1/user", r, hk.MapHandlerFunc{
@@ -287,40 +294,40 @@ func SetRoutes() http.Handler {
})
/******************** sources ********************/
hc.RegCrud(r, "/v1/division", division.O)
hc.RegCrud(r, "/v1/division-position", divisionposition.O)
hc.RegCrud(r, "/v1/installation", installation.O)
hc.RegCrud(r, "/v1/unit", unit.O)
hc.RegCrudByCode(r, "/v1/division", division.O)
hc.RegCrudByCode(r, "/v1/division-position", divisionposition.O)
hc.RegCrudByCode(r, "/v1/installation", installation.O)
hc.RegCrudByCode(r, "/v1/unit", unit.O)
hc.RegCrudByCode(r, "/v1/installation-position", installationposition.O)
hc.RegCrudByCode(r, "/v1/unit-position", unitposition.O)
hc.RegCrudByCode(r, "/v1/specialist", specialist.O)
hc.RegCrudByCode(r, "/v1/subspecialist", subspecialist.O)
hc.RegCrudByCode(r, "/v1/specialist-position", specialistposition.O)
hc.RegCrudByCode(r, "/v1/subspecialist-position", subspecialistposition.O)
hc.RegCrudByCode(r, "/v1/infra", infra.O)
hc.RegCrud(r, "/v1/pharmacy-company", pharmacycompany.O)
hc.RegCrud(r, "/v1/diagnose-src", diagnosesrc.O)
hc.RegCrud(r, "/v1/procedure-src", proceduresrc.O)
hc.RegCrud(r, "/v1/uom", uom.O)
hc.RegCrud(r, "/v1/item", item.O)
hc.RegCrudByCode(r, "/v1/item", item.O)
hc.RegCrud(r, "/v1/item-price", itemprice.O)
hc.RegCrud(r, "/v1/infra", infra.O)
hc.RegCrud(r, "/v1/medicine-group", medicinegroup.O)
hc.RegCrud(r, "/v1/medicine-method", medicinemethod.O)
hc.RegCrud(r, "/v1/mcu-src-category", mcusrccategory.O)
hc.RegCrud(r, "/v1/mcu-src", mcusrc.O)
hc.RegCrud(r, "/v1/ethnic", ethnic.O)
hc.RegCrud(r, "/v1/insurance-company", insurancecompany.O)
hc.RegCrud(r, "/v1/medicine", medicine.O)
hc.RegCrud(r, "/v1/device", device.O)
hc.RegCrud(r, "/v1/material", material.O)
hc.RegCrudByCode(r, "/v1/medicine", medicine.O)
hc.RegCrudByCode(r, "/v1/device", device.O)
hc.RegCrudByCode(r, "/v1/material", material.O)
hc.RegCrud(r, "/v1/doctor-fee", doctorfee.O)
hc.RegCrud(r, "/v1/medical-action-src", medicalactionsrc.O)
hc.RegCrud(r, "/v1/medical-action-src-item", medicalactionsrcitem.O)
hc.RegCrud(r, "/v1/language", language.O)
hc.RegCrud(r, "/v1/specialist", specialist.O)
hc.RegCrud(r, "/v1/subspecialist", subspecialist.O)
hc.RegCrud(r, "/v1/mcu-sub-src", mcusubsrc.O)
hc.RegCrud(r, "/v1/vehicle", vehicle.O)
hc.RegCrud(r, "/v1/vehicle-hist", vehiclehist.O)
hc.RegCrud(r, "/v1/edu-assessment", eduassesment.O)
hc.RegCrud(r, "/v1/installation-position", installationposition.O)
hc.RegCrud(r, "/v1/unit-position", unitposition.O)
hc.RegCrud(r, "/v1/specialist-position", specialistposition.O)
hc.RegCrud(r, "/v1/subspecialist-position", subspecialistposition.O)
hc.RegCrud(r, "/v1/village", village.O)
hc.RegCrud(r, "/v1/district", district.O)
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,7 +33,7 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
id := rw.ValidateInt(w, "code", r.PathValue("code"))
if id <= 0 {
return
}
@@ -44,7 +44,7 @@ func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
id := rw.ValidateInt(w, "code", r.PathValue("code"))
if id <= 0 {
return
}
@@ -59,7 +59,7 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
id := rw.ValidateInt(w, "code", r.PathValue("code"))
if id <= 0 {
return
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,21 +33,21 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
sf.UrlQueryParam(&dto, *r.URL)
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -55,19 +55,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,21 +33,21 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
sf.UrlQueryParam(&dto, *r.URL)
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -55,19 +55,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -0,0 +1,73 @@
package therapy_protocol
import (
"net/http"
rw "github.com/karincake/risoles"
sf "github.com/karincake/semprit"
// ua "github.com/karincake/tumpeng/auth/svc"
e "simrs-vx/internal/domain/main-entities/therapy-protocol"
u "simrs-vx/internal/use-case/main-use-case/therapy-protocol"
)
type myBase struct{}
var O myBase
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
dto := e.CreateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
res, err := u.Create(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
dto := e.ReadListDto{}
sf.UrlQueryParam(&dto, *r.URL)
res, err := u.ReadList(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.ReadDetailDto{}
sf.UrlQueryParam(&dto, *r.URL)
dto.Id = uint(id)
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.UpdateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint(id)
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.DeleteDto{}
dto.Id = uint(id)
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,19 +33,19 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -53,19 +53,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -33,21 +33,21 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.ReadDetailDto{}
sf.UrlQueryParam(&dto, *r.URL)
dto.Id = uint16(id)
dto.Code = &code
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
@@ -55,19 +55,19 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
dto.Code = code
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
code := rw.ValidateString(w, "code", r.PathValue("code"))
if code == "" {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
dto.Code = &code
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -5,7 +5,10 @@ import (
admemployeehist "simrs-vx/internal/domain/main-entities/adm-employee-hist"
ambulancetransportreq "simrs-vx/internal/domain/main-entities/ambulance-transport-req"
ambulatory "simrs-vx/internal/domain/main-entities/ambulatory"
antibioticinuse "simrs-vx/internal/domain/main-entities/antibiotic-in-use"
antibioticsrccategory "simrs-vx/internal/domain/main-entities/antibiotic-src-category"
appointment "simrs-vx/internal/domain/main-entities/appointment"
authpartner "simrs-vx/internal/domain/main-entities/auth-partner"
chemo "simrs-vx/internal/domain/main-entities/chemo"
chemoprotocol "simrs-vx/internal/domain/main-entities/chemo-protocol"
consultation "simrs-vx/internal/domain/main-entities/consultation"
@@ -90,6 +93,7 @@ import (
unitposition "simrs-vx/internal/domain/main-entities/unit-position"
uom "simrs-vx/internal/domain/main-entities/uom"
user "simrs-vx/internal/domain/main-entities/user"
userfes "simrs-vx/internal/domain/main-entities/user-fes"
vehicle "simrs-vx/internal/domain/main-entities/vehicle"
vehiclehist "simrs-vx/internal/domain/main-entities/vehicle-hist"
village "simrs-vx/internal/domain/main-entities/village"
@@ -103,7 +107,9 @@ import (
func getMainEntities() []any {
return []any{
&authpartner.AuthPartner{},
&user.User{},
&userfes.UserFes{},
&division.Division{},
&divisionposition.DivisionPosition{},
&installation.Installation{},
@@ -175,6 +181,8 @@ func getMainEntities() []any {
&mcuorderitem.McuOrderItem{},
&mcusubsrc.McuSubSrc{},
&mcuordersubitem.McuOrderSubItem{},
&antibioticsrccategory.AntibioticSrcCategory{},
&antibioticinuse.AntibioticInUse{},
&consultation.Consultation{},
&chemo.Chemo{},
&midwife.Midwife{},
+7 -7
View File
@@ -13,13 +13,13 @@ type AuthInfo struct {
User_Name string
User_ContractPosition_code string
Employee_Position_Code *string
Employee_Id *int
Doctor_Id *int
Nurse_Id *int
Midwife_Id *int
Nutritionist_Id *int
Laborant_Id *int
Pharmachist_Id *int
Employee_Id *uint
Doctor_Code *string
Nurse_Code *string
Midwife_Code *string
Nutritionist_Code *string
Laborant_Code *string
Pharmachist_Code *string
Intern_Position_Code *string
Roles []string
// User_DivisionPositions []DivisionPosition

Some files were not shown because too many files have changed in this diff Show More