Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into feat/crud

This commit is contained in:
dpurbosakti
2025-08-28 13:14:07 +07:00
24 changed files with 971 additions and 40 deletions
+121
View File
@@ -0,0 +1,121 @@
-- Modify "Item" table
ALTER TABLE "public"."Item" ALTER COLUMN "Stock" TYPE bigint;
-- Create "Device" table
CREATE TABLE "public"."Device" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"Uom_Code" character varying(10) NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Device_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Device_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Device_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "DoctorFee" table
CREATE TABLE "public"."DoctorFee" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Doctor_Id" bigint NULL,
"FeeTypeCode" character varying(11) NULL,
"Price" numeric NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_DoctorFee_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_DoctorFee_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Modify "ItemPrice" table
ALTER TABLE "public"."ItemPrice" ADD COLUMN "InsuranceCompany_Code" character varying(20) NULL, ADD CONSTRAINT "fk_ItemPrice_InsuranceCompany" FOREIGN KEY ("InsuranceCompany_Code") REFERENCES "public"."InsuranceCompany" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create "Material" table
CREATE TABLE "public"."Material" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"Uom_Code" character varying(10) NULL,
"Stock" bigint NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Material_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Material_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Material_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicalActionSrc" table
CREATE TABLE "public"."MedicalActionSrc" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_MedicalActionSrc_Code" UNIQUE ("Code"),
CONSTRAINT "fk_MedicalActionSrc_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicalActionSrcItem" table
CREATE TABLE "public"."MedicalActionSrcItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"MedicalActionSrc_Id" bigint NULL,
"ProcedureSrc_Id" bigint NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MedicalActionSrcItem_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicalActionSrcItem_MedicalActionSrc" FOREIGN KEY ("MedicalActionSrc_Id") REFERENCES "public"."MedicalActionSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicalActionSrcItem_ProcedureSrc" FOREIGN KEY ("ProcedureSrc_Id") REFERENCES "public"."ProcedureSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Medicine" table
CREATE TABLE "public"."Medicine" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"MedicineGroup_Code" character varying(10) NULL,
"MedicineMethod_Code" character varying(10) NULL,
"Uom_Code" character varying(10) NULL,
"Dose" smallint NULL,
"Infra_Id" integer NULL,
"Stock" bigint NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Medicine_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Medicine_Infra" FOREIGN KEY ("Infra_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_MedicineGroup" FOREIGN KEY ("MedicineGroup_Code") REFERENCES "public"."MedicineGroup" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_MedicineMethod" FOREIGN KEY ("MedicineMethod_Code") REFERENCES "public"."MedicineMethod" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicineMix" table
CREATE TABLE "public"."MedicineMix" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id")
);
-- Create "MedicineMixItem" table
CREATE TABLE "public"."MedicineMixItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"MedicineMix_Id" bigint NULL,
"Medicine_Id" bigint NULL,
"Dose" smallint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MedicineMixItem_Medicine" FOREIGN KEY ("Medicine_Id") REFERENCES "public"."Medicine" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicineMixItem_MedicineMix" FOREIGN KEY ("MedicineMix_Id") REFERENCES "public"."MedicineMix" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
+3 -2
View File
@@ -1,4 +1,4 @@
h1:yoZN1lVD6dE66V3FtMcVHtoRtFmu18Ltn5/loput+Ns=
h1:m00Lt6P6Ck2i7UG8WlVBOWl5vmvSQZltNb1O7Z7zM+I=
20250825054027.sql h1:zRUeuuP4bDLf96Cb38D/l9ivBAQC745XRao0rxbzdVI=
20250825060522.sql h1:NiE1fVzydcg8Y8ytSHgt0DkkauQFveNXv42BoG5m+bI=
20250825102900.sql h1:OAUnj87Wz7mrHykX14idePckUmRYa5UH0LylYDL76RI=
@@ -7,4 +7,5 @@ h1:yoZN1lVD6dE66V3FtMcVHtoRtFmu18Ltn5/loput+Ns=
20250827021904.sql h1:pgjwmQS1TxZ977a1tIXKq6pZnGauPrOUxLUTclV+fE4=
20250827024311.sql h1:eTlrQYcHa/jmb3qSZxgTB+7S4IXJ8B4yklUB36iZaDw=
20250827072230.sql h1:BfdTcToEYC8d30BS+1Su5Pz5Ecz8bh74F2j+Bh/r2BM=
20250827083322.sql h1:GhPTHNQGAP13Efly86U7baFFw4l3sz+QV3g3lzeIT9Y=
20250827083322.sql h1:2MErE7W1JTjcxtgKJs/1iEF8kgV6vrcGrDVx/m6LwHQ=
20250828061151.sql h1:cZkYO1VHCc2RtOwP1yesHNG/p+o/zeOAGvqJRU4Q4Xc=
@@ -0,0 +1,79 @@
package device
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
eu "simrs-vx/internal/domain/main-entities/uom"
)
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Item_Id *uint `json:"item_id"`
}
type ReadListDto struct {
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Item_Id *uint `json:"item_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Item_Id *uint `json:"item_id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Uom *eu.Uom `json:"uom,omitempty"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
}
func (d Device) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
Uom_Code: d.Uom_Code,
Uom: d.Uom,
Item_Id: d.Item_Id,
Item: d.Item,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []Device) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,17 @@
package device
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
eu "simrs-vx/internal/domain/main-entities/uom"
)
type Device struct {
ecore.Main // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Uom_Code string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -0,0 +1,80 @@
package doctorfee
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ei "simrs-vx/internal/domain/main-entities/item"
erc "simrs-vx/internal/domain/references/clinical"
)
type CreateDto struct {
Doctor_Id *uint `json:"doctor_id"`
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
Price *float64 `json:"price"`
Item_Id *uint `json:"item_id"`
}
type ReadListDto struct {
Doctor_Id *uint `json:"doctor_id"`
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
Price *float64 `json:"price"`
Item_Id *uint `json:"item_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Doctor_Id *uint `json:"doctor_id"`
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
Price *float64 `json:"price"`
Item_Id *uint `json:"item_id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code"`
Price *float64 `json:"price"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
}
func (d DoctorFee) ToResponse() ResponseDto {
resp := ResponseDto{
Doctor_Id: d.Doctor_Id,
Doctor: d.Doctor,
FeeTypeCode: d.FeeTypeCode,
Price: d.Price,
Item_Id: d.Item_Id,
Item: d.Item,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []DoctorFee) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,18 @@
package doctorfee
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ei "simrs-vx/internal/domain/main-entities/item"
erc "simrs-vx/internal/domain/references/clinical"
)
type DoctorFee struct {
ecore.Main // adjust this according to the needs
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
FeeTypeCode *erc.DoctorFeeTypeCode `json:"feeType_code" gorm:"size:11"`
Price *float64 `json:"price"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
+21 -12
View File
@@ -2,17 +2,20 @@ package itemprice
import (
ecore "simrs-vx/internal/domain/base-entities/core"
eic "simrs-vx/internal/domain/main-entities/insurance-company"
ei "simrs-vx/internal/domain/main-entities/item"
)
type CreateDto struct {
Item_Id *uint `json:"item_id"`
Price float64 `json:"price"`
Item_Id *uint `json:"item_id"`
Price float64 `json:"price"`
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
}
type ReadListDto struct {
Item_Id *uint `json:"item_id"`
Price float64 `json:"price"`
Item_Id *uint `json:"item_id"`
Price float64 `json:"price"`
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
Page int `json:"page"`
PageSize int `json:"page_size"`
@@ -20,9 +23,10 @@ type ReadListDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Item_Id *uint `json:"item_id"`
Price float64 `json:"price"`
Id uint16 `json:"id"`
Item_Id *uint `json:"item_id"`
Price float64 `json:"price"`
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
}
type UpdateDto struct {
@@ -42,15 +46,20 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
Price float64 `json:"price"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
Price float64 `json:"price"`
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code"`
InsuranceCompany *eic.InsuranceCompany `json:"insuranceCompany,omitempty"`
}
func (d ItemPrice) ToResponse() ResponseDto {
resp := ResponseDto{
Item_Id: d.Item_Id,
Price: d.Price,
Item_Id: d.Item_Id,
Item: d.Item,
Price: d.Price,
InsuranceCompany_Code: d.InsuranceCompany_Code,
InsuranceCompany: d.InsuranceCompany,
}
resp.Main = d.Main
return resp
@@ -2,12 +2,15 @@ package itemprice
import (
ecore "simrs-vx/internal/domain/base-entities/core"
eic "simrs-vx/internal/domain/main-entities/insurance-company"
ei "simrs-vx/internal/domain/main-entities/item"
)
type ItemPrice struct {
ecore.Main // adjust this according to the needs
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
Price float64 `json:"price"`
ecore.Main // adjust this according to the needs
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
Price float64 `json:"price"`
InsuranceCompany_Code *uint16 `json:"insuranceCompany_code" gorm:"size:20"`
InsuranceCompany *eic.InsuranceCompany `json:"insuranceCompany,omitempty" gorm:"foreignKey:InsuranceCompany_Code;references:Code"`
}
+20 -20
View File
@@ -7,21 +7,21 @@ import (
)
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
ItemGroup_Code *string `json:"itemGroup_code"`
Uom_Code *string `json:"uom_code"`
Infra_Id *int16 `json:"infra_id"`
Stock *float64 `json:"stock"`
Code string `json:"code"`
Name string `json:"name"`
ItemGroup_Code *string `json:"itemGroup_code"`
Uom_Code *string `json:"uom_code"`
Infra_Id *int16 `json:"infra_id"`
Stock *int `json:"stock"`
}
type ReadListDto struct {
Code string `json:"code"`
Name string `json:"name"`
ItemGroup_Code *string `json:"itemGroup_code"`
Uom_Code *string `json:"uom_code"`
Infra_Id *int16 `json:"infra_id"`
Stock *float64 `json:"stock"`
Code string `json:"code"`
Name string `json:"name"`
ItemGroup_Code *string `json:"itemGroup_code"`
Uom_Code *string `json:"uom_code"`
Infra_Id *int16 `json:"infra_id"`
Stock *int `json:"stock"`
Page int `json:"page"`
PageSize int `json:"page_size"`
@@ -29,13 +29,13 @@ type ReadListDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
ItemGroup_Code *string `json:"itemGroup_code"`
Uom_Code *string `json:"uom_code"`
Infra_Id *int16 `json:"infra_id"`
Stock *float64 `json:"stock"`
Id uint16 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
ItemGroup_Code *string `json:"itemGroup_code"`
Uom_Code *string `json:"uom_code"`
Infra_Id *int16 `json:"infra_id"`
Stock *int `json:"stock"`
}
type UpdateDto struct {
@@ -62,7 +62,7 @@ type ResponseDto struct {
Uom_Code *string `json:"uom_code"`
Uom *eu.Uom `json:"uom,omitempty"`
Infra_Id *int16 `json:"infra_id"`
Stock *float64 `json:"stock"`
Stock *int `json:"stock"`
}
func (d Item) ToResponse() ResponseDto {
+1 -1
View File
@@ -15,5 +15,5 @@ type Item struct {
Uom_Code *string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
Infra_Id *int16 `json:"infra_id"`
Stock *float64 `json:"stock"`
Stock *int `json:"stock"`
}
@@ -0,0 +1,84 @@
package material
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
eu "simrs-vx/internal/domain/main-entities/uom"
)
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
}
type ReadListDto struct {
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Code string `json:"code"`
Name string `json:"name"`
Uom_Code string `json:"uom_code"`
Uom *eu.Uom `json:"uom,omitempty"`
Stock *int `json:"stock"`
Item_Id uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
}
func (d Material) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
Uom_Code: d.Uom_Code,
Uom: d.Uom,
Stock: d.Stock,
Item_Id: d.Item_Id,
Item: d.Item,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []Material) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,18 @@
package material
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
eu "simrs-vx/internal/domain/main-entities/uom"
)
type Material struct {
ecore.Main // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Uom_Code string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
Stock *int `json:"stock"`
Item_Id uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -0,0 +1,77 @@
package medicalactionsrcitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
emas "simrs-vx/internal/domain/main-entities/medical-action-src"
eps "simrs-vx/internal/domain/main-entities/procedure-src"
)
type CreateDto struct {
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
Item_Id *uint `json:"item_id"`
}
type ReadListDto struct {
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
Item_Id *uint `json:"item_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
Item_Id *uint `json:"item_id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
MedicalActionSrc *emas.MedicalActionSrc `json:"medicalActionSrc,omitempty"`
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
ProcedureSrc *eps.ProcedureSrc `json:"procedureSrc,omitempty"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
}
func (d MedicalActionSrcItem) ToResponse() ResponseDto {
resp := ResponseDto{
MedicalActionSrc_Id: d.MedicalActionSrc_Id,
MedicalActionSrc: d.MedicalActionSrc,
ProcedureSrc_Id: d.ProcedureSrc_Id,
ProcedureSrc: d.ProcedureSrc,
Item_Id: d.Item_Id,
Item: d.Item,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []MedicalActionSrcItem) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,18 @@
package medicalactionsrcitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
emas "simrs-vx/internal/domain/main-entities/medical-action-src"
eps "simrs-vx/internal/domain/main-entities/procedure-src"
)
type MedicalActionSrcItem struct {
ecore.Main // adjust this according to the needs
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
MedicalActionSrc *emas.MedicalActionSrc `json:"medicalActionSrc,omitempty" gorm:"foreignKey:MedicalActionSrc_Id;references:Id"`
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
ProcedureSrc *eps.ProcedureSrc `json:"procedureSrc,omitempty" gorm:"foreignKey:ProcedureSrc_Id;references:Id"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -0,0 +1,71 @@
package medicalactionsrc
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
)
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
Item_Id *uint `json:"item_id"`
}
type ReadListDto struct {
Code string `json:"code"`
Name string `json:"name"`
Item_Id *uint `json:"item_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Item_Id *uint `json:"item_id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Code string `json:"code"`
Name string `json:"name"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty"`
}
func (d MedicalActionSrc) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
Item_Id: d.Item_Id,
Item: d.Item,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []MedicalActionSrc) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,14 @@
package medicalactionsrc
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/item"
)
type MedicalActionSrc struct {
ecore.Main // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:20"`
Name string `json:"name" gorm:"size:50"`
Item_Id *uint `json:"item_id"`
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -0,0 +1,74 @@
package medicinemixitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
em "simrs-vx/internal/domain/main-entities/medicine"
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
)
type CreateDto struct {
MedicineMix_Id *uint `json:"medicineMix_id"`
Medicine_Id *uint `json:"medicine_id"`
Dose *uint8 `json:"dose"`
}
type ReadListDto struct {
MedicineMix_Id *uint `json:"medicineMix_id"`
Medicine_Id *uint `json:"medicine_id"`
Dose *uint8 `json:"dose"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
MedicineMix_Id *uint `json:"medicineMix_id"`
Medicine_Id *uint `json:"medicine_id"`
Dose *uint8 `json:"dose"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
MedicineMix_Id *uint `json:"medicineMix_id"`
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
Medicine_Id *uint `json:"medicine_id"`
Medicine *em.Medicine `json:"medicine,omitempty"`
Dose *uint8 `json:"dose"`
}
func (d MedicineMixItem) ToResponse() ResponseDto {
resp := ResponseDto{
MedicineMix_Id: d.MedicineMix_Id,
MedicineMix: d.MedicineMix,
Medicine_Id: d.Medicine_Id,
Medicine: d.Medicine,
Dose: d.Dose,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []MedicineMixItem) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,16 @@
package medicinemixitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
em "simrs-vx/internal/domain/main-entities/medicine"
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
)
type MedicineMixItem struct {
ecore.Main // adjust this according to the needs
MedicineMix_Id *uint `json:"medicineMix_id"`
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
Medicine_Id *uint `json:"medicine_id"`
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
Dose *uint8 `json:"dose"`
}
@@ -0,0 +1,58 @@
package medicinemix
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type CreateDto struct {
Name string `json:"name"`
}
type ReadListDto struct {
Name string `json:"name"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Name string `json:"name"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Name string `json:"name"`
}
func (d MedicineMix) ToResponse() ResponseDto {
resp := ResponseDto{
Name: d.Name,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []MedicineMix) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,10 @@
package medicinemix
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type MedicineMix struct {
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"size:50"`
}
@@ -0,0 +1,113 @@
package medicine
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ein "simrs-vx/internal/domain/main-entities/infra"
eit "simrs-vx/internal/domain/main-entities/item"
emg "simrs-vx/internal/domain/main-entities/medicine-group"
emm "simrs-vx/internal/domain/main-entities/medicine-method"
eu "simrs-vx/internal/domain/main-entities/uom"
)
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
MedicineGroup_Code *string `json:"medicineGroup_code"`
MedicineMethod_Code *string `json:"medicineMethod_code"`
Uom_Code *string `json:"uom_code"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
}
type ReadListDto struct {
Code string `json:"code"`
Name string `json:"name"`
MedicineGroup_Code *string `json:"medicineGroup_code"`
MedicineMethod_Code *string `json:"medicineMethod_code"`
Uom_Code *string `json:"uom_code"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
MedicineGroup_Code *string `json:"medicineGroup_code"`
MedicineMethod_Code *string `json:"medicineMethod_code"`
Uom_Code *string `json:"uom_code"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Code string `json:"code"`
Name string `json:"name"`
MedicineGroup_Code *string `json:"medicineGroup_code"`
MedicineGroup *emg.MedicineGroup `json:"medicineGroup"`
MedicineMethod_Code *string `json:"medicineMethod_code"`
MedicineMethod *emm.MedicineMethod `json:"medicineMethod"`
Uom_Code *string `json:"uom_code"`
Uom *eu.Uom `json:"uom"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Infra *ein.Infra `json:"infra,omitempty"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Item *eit.Item `json:"item,omitempty"`
}
func (d Medicine) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
MedicineGroup_Code: d.MedicineGroup_Code,
MedicineGroup: d.MedicineGroup,
MedicineMethod_Code: d.MedicineMethod_Code,
MedicineMethod: d.MedicineMethod,
Uom_Code: d.Uom_Code,
Uom: d.Uom,
Dose: d.Dose,
Infra_Id: d.Infra_Id,
Infra: d.Infra,
Stock: d.Stock,
Item_Id: d.Item_Id,
Item: d.Item,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []Medicine) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,28 @@
package medicine
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ein "simrs-vx/internal/domain/main-entities/infra"
eit "simrs-vx/internal/domain/main-entities/item"
emg "simrs-vx/internal/domain/main-entities/medicine-group"
emm "simrs-vx/internal/domain/main-entities/medicine-method"
eu "simrs-vx/internal/domain/main-entities/uom"
)
type Medicine struct {
ecore.Main // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
MedicineGroup_Code *string `json:"medicineGroup_code" gorm:"size:10"`
MedicineGroup *emg.MedicineGroup `json:"medicineGroup,omitempty" gorm:"foreignKey:MedicineGroup_Code;references:Code"`
MedicineMethod_Code *string `json:"medicineMethod_code" gorm:"size:10"`
MedicineMethod *emm.MedicineMethod `json:"medicineMethod,omitempty" gorm:"foreignKey:MedicineMethod_Code;references:Code"`
Uom_Code *string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
Dose uint8 `json:"dose"`
Infra_Id *uint16 `json:"infra_id"`
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
Stock *int `json:"stock"`
Item_Id *uint `json:"item_id"`
Item *eit.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
}
@@ -1,7 +1,8 @@
package clinical
type (
CheckupScopeCode string
CheckupScopeCode string
DoctorFeeTypeCode string
)
const (
@@ -9,4 +10,9 @@ const (
CSCMLab CheckupScopeCode = "mic-lab" // Microbacterial Laboratorium
CSCPLab CheckupScopeCode = "pa-lab" // Patology Anatomy Laboratorium
CSCRad CheckupScopeCode = "radiology" // Radiology
DFTCOut DoctorFeeTypeCode = "outpatient" // Rawat Jalan
DFTCInp DoctorFeeTypeCode = "inpatient" // Rawat Inap
DFTCEme DoctorFeeTypeCode = "emergency" // Darurat
DFTCReh DoctorFeeTypeCode = "medic-rehab" // Rehab Medik
)
+16
View File
@@ -6,11 +6,13 @@ import (
"os"
"os/exec"
counter "simrs-vx/internal/domain/main-entities/counter"
device "simrs-vx/internal/domain/main-entities/device"
diagnosesrc "simrs-vx/internal/domain/main-entities/diagnose-src"
district "simrs-vx/internal/domain/main-entities/district"
division "simrs-vx/internal/domain/main-entities/division"
divisionposition "simrs-vx/internal/domain/main-entities/division-position"
doctor "simrs-vx/internal/domain/main-entities/doctor"
doctorfee "simrs-vx/internal/domain/main-entities/doctor-fee"
employee "simrs-vx/internal/domain/main-entities/employee"
ethnic "simrs-vx/internal/domain/main-entities/ethnic"
infra "simrs-vx/internal/domain/main-entities/infra"
@@ -20,10 +22,16 @@ import (
item "simrs-vx/internal/domain/main-entities/item"
itemgroup "simrs-vx/internal/domain/main-entities/item-group"
itemprice "simrs-vx/internal/domain/main-entities/item-price"
material "simrs-vx/internal/domain/main-entities/material"
mcusrc "simrs-vx/internal/domain/main-entities/mcu-src"
mcusrccategory "simrs-vx/internal/domain/main-entities/mcu-src-category"
medicalactionsrc "simrs-vx/internal/domain/main-entities/medical-action-src"
medicalactionsrcitem "simrs-vx/internal/domain/main-entities/medical-action-src-item"
medicine "simrs-vx/internal/domain/main-entities/medicine"
medicinegroup "simrs-vx/internal/domain/main-entities/medicine-group"
medicinemethod "simrs-vx/internal/domain/main-entities/medicine-method"
medicinemix "simrs-vx/internal/domain/main-entities/medicine-mix"
medicinemixitem "simrs-vx/internal/domain/main-entities/medicine-mix-item"
nurse "simrs-vx/internal/domain/main-entities/nurse"
nutritionist "simrs-vx/internal/domain/main-entities/nutritionist"
person "simrs-vx/internal/domain/main-entities/person"
@@ -107,6 +115,14 @@ func GetEntities() []any {
&mcusrc.McuSrc{},
&ethnic.Ethnic{},
&insurancecompany.InsuranceCompany{},
&medicine.Medicine{},
&medicinemix.MedicineMix{},
&medicinemixitem.MedicineMixItem{},
&medicalactionsrc.MedicalActionSrc{},
&medicalactionsrcitem.MedicalActionSrcItem{},
&material.Material{},
&device.Device{},
&doctorfee.DoctorFee{},
}
}