Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into fix/anything-moko
This commit is contained in:
No files matched your search
@@ -0,0 +1,38 @@
|
|||||||
|
-- Create "AntibioticSrcCategory" table
|
||||||
|
CREATE TABLE "public"."AntibioticSrcCategory" (
|
||||||
|
"Id" serial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Code" character varying(20) NULL,
|
||||||
|
"Name" character varying(50) NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "uni_AntibioticSrcCategory_Code" UNIQUE ("Code")
|
||||||
|
);
|
||||||
|
-- Create "AntibioticSrc" table
|
||||||
|
CREATE TABLE "public"."AntibioticSrc" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Code" character varying(20) NULL,
|
||||||
|
"Name" character varying(50) NULL,
|
||||||
|
"AntibioticSrcCategory_Code" character varying(20) NULL,
|
||||||
|
"Item_Id" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "uni_AntibioticSrc_Code" UNIQUE ("Code"),
|
||||||
|
CONSTRAINT "fk_AntibioticSrc_AntibioticSrcCategory" FOREIGN KEY ("AntibioticSrcCategory_Code") REFERENCES "public"."AntibioticSrcCategory" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_AntibioticSrc_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "AntibioticInUse" table
|
||||||
|
CREATE TABLE "public"."AntibioticInUse" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"McuOrder_Id" bigint NULL,
|
||||||
|
"AntibioticSrc_Id" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_AntibioticInUse_AntibioticSrc" FOREIGN KEY ("AntibioticSrc_Id") REFERENCES "public"."AntibioticSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_AntibioticInUse_McuOrder" FOREIGN KEY ("McuOrder_Id") REFERENCES "public"."McuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "AntibioticSrc" table
|
||||||
|
ALTER TABLE "public"."AntibioticSrc" DROP COLUMN "Item_Id";
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Modify "Doctor" table
|
||||||
|
ALTER TABLE "public"."Doctor" ADD COLUMN "SIP_ExpiredDate" timestamptz NULL, ADD COLUMN "Unit_Code" character varying(10) NULL, ADD COLUMN "Specialist_Code" character varying(10) NULL, ADD COLUMN "Subspecialist_Code" character varying(10) NULL, ADD CONSTRAINT "uni_Doctor_Specialist_Code" UNIQUE ("Specialist_Code"), ADD CONSTRAINT "uni_Doctor_Subspecialist_Code" UNIQUE ("Subspecialist_Code"), ADD CONSTRAINT "uni_Doctor_Unit_Code" UNIQUE ("Unit_Code");
|
||||||
|
-- Modify "Employee" table
|
||||||
|
ALTER TABLE "public"."Employee" ADD COLUMN "Contract_ExpiredDate" timestamptz NULL;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Doctor" table
|
||||||
|
ALTER TABLE "public"."Doctor" DROP CONSTRAINT "uni_Doctor_Specialist_Code", DROP CONSTRAINT "uni_Doctor_Subspecialist_Code", DROP CONSTRAINT "uni_Doctor_Unit_Code";
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
h1:drtrRtMhlNYK0c9wV3CUkJvXwWgrD8xGPPJy9wlcvNA=
|
h1:yLtZj2e+mxp2L0eRUjFUIrC1GID4BB3/8x6LaHS+v10=
|
||||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||||
@@ -68,4 +68,8 @@ h1:drtrRtMhlNYK0c9wV3CUkJvXwWgrD8xGPPJy9wlcvNA=
|
|||||||
20251104042334.sql h1:7PDMWOhmJywolAPKFZ14XaDBeMvcxShaXFN2IemNtzk=
|
20251104042334.sql h1:7PDMWOhmJywolAPKFZ14XaDBeMvcxShaXFN2IemNtzk=
|
||||||
20251104043530.sql h1:qvYVp3ysPf27f1BcoRNCFGovxuVE12lg9d6Xzda6zWU=
|
20251104043530.sql h1:qvYVp3ysPf27f1BcoRNCFGovxuVE12lg9d6Xzda6zWU=
|
||||||
20251104080952.sql h1:avghpv1n3yaCDR/TA0X+hgxDGoLBQGu/GJUwj4VT/Ic=
|
20251104080952.sql h1:avghpv1n3yaCDR/TA0X+hgxDGoLBQGu/GJUwj4VT/Ic=
|
||||||
20251104084135.sql h1:Y4coFrHgDXd/DM8ihEy+qMkOSrO8M4SI4shRCJIiBBA=
|
20251104084135.sql h1:rg+eRE5/5sYWR7z+Xyn0zKw8rr8P/oWxF0xhcNVnNec=
|
||||||
|
20251105044629.sql h1:4NU27HeKUNFsV82LacnwmnCSAH0pSbZR9J9/ZESRs6M=
|
||||||
|
20251105121808.sql h1:fii6LjqWYjrm/pEIqttfvJI6QEUL49gque8wYHh1+yI=
|
||||||
|
20251106035305.sql h1:hRkWZYLQvjmROqlu9xvuXrPQcBKf6yUGTTbSd0lKbmI=
|
||||||
|
20251106040137.sql h1:ifT65MV7h0sws5EGBOGefRqxSaZqapEeupuhHMJipyw=
|
||||||
@@ -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"`
|
||||||
|
}
|
||||||
@@ -6,19 +6,25 @@ import (
|
|||||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Doctor struct {
|
type Doctor struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
Code *string `json:"code" gorm:"unique;size:20"`
|
Code *string `json:"code" gorm:"unique;size:20"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||||
SIP_Number *string `json:"sip_number" gorm:"unique;size:20"`
|
SIP_Number *string `json:"sip_number" gorm:"unique;size:20"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
SIP_ExpiredDate *time.Time `json:"sip_expiredDate"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
Unit_Id *uint16 `json:"unit_id"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
|
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
// Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
|
Specialist_Id *uint16 `json:"specialist_id"`
|
||||||
|
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
|
||||||
|
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
|
||||||
|
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||||
|
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
|
||||||
|
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
|
||||||
}
|
}
|
||||||
@@ -6,15 +6,17 @@ import (
|
|||||||
eu "simrs-vx/internal/domain/main-entities/user"
|
eu "simrs-vx/internal/domain/main-entities/user"
|
||||||
erc "simrs-vx/internal/domain/references/common"
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
erg "simrs-vx/internal/domain/references/organization"
|
erg "simrs-vx/internal/domain/references/organization"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Employee struct {
|
type Employee struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
User_Id *uint `json:"user_id"`
|
User_Id *uint `json:"user_id"`
|
||||||
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"`
|
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"`
|
||||||
Person_Id *uint `json:"person_id"`
|
Person_Id *uint `json:"person_id"`
|
||||||
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"`
|
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"`
|
||||||
Position_Code *erg.EmployeePositionCode `json:"position_code" gorm:"size:20"`
|
Position_Code *erg.EmployeePositionCode `json:"position_code" gorm:"size:20"`
|
||||||
Number *string `json:"number" gorm:"size:20"`
|
Number *string `json:"number" gorm:"size:20"`
|
||||||
Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"`
|
Contract_ExpiredDate *time.Time `json:"contract_expiredDate"`
|
||||||
|
Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,7 @@ type CreateDto struct {
|
|||||||
Number uint8 `json:"number"`
|
Number uint8 `json:"number"`
|
||||||
Temperature float64 `json:"temperature"`
|
Temperature float64 `json:"temperature"`
|
||||||
UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code"`
|
UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code"`
|
||||||
|
Scope_Code ercl.McuScopeCode `json:"scope_code"`
|
||||||
|
|
||||||
pa.AuthInfo
|
pa.AuthInfo
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
ercl "simrs-vx/internal/domain/references/clinical"
|
ercl "simrs-vx/internal/domain/references/clinical"
|
||||||
erc "simrs-vx/internal/domain/references/common"
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
ere "simrs-vx/internal/domain/references/encounter"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type McuOrder struct {
|
type McuOrder struct {
|
||||||
@@ -23,7 +22,7 @@ type McuOrder struct {
|
|||||||
Number uint8 `json:"number"`
|
Number uint8 `json:"number"`
|
||||||
Temperature float64 `json:"temperature"`
|
Temperature float64 `json:"temperature"`
|
||||||
UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code" gorm:"not null;size:15"`
|
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 {
|
func (d McuOrder) IsCompleted() bool {
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package division
|
|||||||
import (
|
import (
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
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 {
|
type CreateDto struct {
|
||||||
Code string `json:"code" validate:"maxLength=20"`
|
Code string `json:"code" validate:"maxLength=20"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
Scope_Code *ere.CheckupScopeCode `json:"scope_code" validate:"maxLength=10"`
|
Scope_Code erc.McuScopeCode `json:"scope_code" validate:"maxLength=10"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -20,10 +20,10 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Scope_Code *ere.CheckupScopeCode `json:"scope-code"`
|
Scope_Code *erc.McuScopeCode `json:"scope-code"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
@@ -48,9 +48,9 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Scope_Code *ere.CheckupScopeCode `json:"scope_code"`
|
Scope_Code erc.McuScopeCode `json:"scope_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d McuSrcCategory) ToResponse() ResponseDto {
|
func (d McuSrcCategory) ToResponse() ResponseDto {
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ package division
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
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 {
|
type McuSrcCategory struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
ecore.SmallMain // adjust this according to the needs
|
||||||
Code string `json:"code" gorm:"unique;size:20"`
|
Code string `json:"code" gorm:"unique;size:20"`
|
||||||
Name string `json:"name" gorm:"size:50"`
|
Name string `json:"name" gorm:"size:50"`
|
||||||
Scope_Code *ere.CheckupScopeCode `json:"scope_code" gorm:"index;size:10"`
|
Scope_Code erc.McuScopeCode `json:"scope_code" gorm:"index;size:10"`
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@ type (
|
|||||||
InstructionCode string
|
InstructionCode string
|
||||||
HeadToToeCode string
|
HeadToToeCode string
|
||||||
McuUrgencyLevelCode string
|
McuUrgencyLevelCode string
|
||||||
|
McuScopeCode string
|
||||||
SoapiTypeCode string
|
SoapiTypeCode string
|
||||||
MedicalAction string
|
MedicalAction string
|
||||||
VehicleTypeCode string
|
VehicleTypeCode string
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ type (
|
|||||||
PersonConditionCode string
|
PersonConditionCode string
|
||||||
EmergencyClassCode string
|
EmergencyClassCode string
|
||||||
OutpatientClassCode string
|
OutpatientClassCode string
|
||||||
CheckupScopeCode string
|
|
||||||
AmbulatoryClassCode string
|
AmbulatoryClassCode string
|
||||||
InpatientClassCode string
|
InpatientClassCode string
|
||||||
UploadCode string
|
UploadCode string
|
||||||
@@ -44,6 +43,7 @@ const (
|
|||||||
DMCExtRef DischargeMethodCode = "external" // Rujuk Faskes Lain
|
DMCExtRef DischargeMethodCode = "external" // Rujuk Faskes Lain
|
||||||
DMCDeath DischargeMethodCode = "death" // Meninggal
|
DMCDeath DischargeMethodCode = "death" // Meninggal
|
||||||
DMCDeathOnArrival DischargeMethodCode = "death-on-arrival" // Meninggal Saat Tiba
|
DMCDeathOnArrival DischargeMethodCode = "death-on-arrival" // Meninggal Saat Tiba
|
||||||
|
DMCRunAway DischargeMethodCode = "run-away" // Melarikan Diri
|
||||||
|
|
||||||
TCAmbulance TransportationCode = "ambulance" // Ambulans
|
TCAmbulance TransportationCode = "ambulance" // Ambulans
|
||||||
TCCar TransportationCode = "car" // Mobil
|
TCCar TransportationCode = "car" // Mobil
|
||||||
@@ -65,11 +65,6 @@ const (
|
|||||||
OCCHcu OutpatientClassCode = "hcu" // HCU
|
OCCHcu OutpatientClassCode = "hcu" // HCU
|
||||||
OCCVk OutpatientClassCode = "vk" // Verlos kamer
|
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
|
ACCReg AmbulatoryClassCode = "reg" // Regular
|
||||||
// ACCRehab ACCRme AmbulatoryClassCode = "rme" // Rehab Medik
|
// ACCRehab ACCRme AmbulatoryClassCode = "rme" // Rehab Medik
|
||||||
// ACCCad AmbulatoryClassCode = "chemo-adm" // Chemotherapy
|
// ACCCad AmbulatoryClassCode = "chemo-adm" // Chemotherapy
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import (
|
|||||||
admemployeehist "simrs-vx/internal/domain/main-entities/adm-employee-hist"
|
admemployeehist "simrs-vx/internal/domain/main-entities/adm-employee-hist"
|
||||||
ambulancetransportreq "simrs-vx/internal/domain/main-entities/ambulance-transport-req"
|
ambulancetransportreq "simrs-vx/internal/domain/main-entities/ambulance-transport-req"
|
||||||
ambulatory "simrs-vx/internal/domain/main-entities/ambulatory"
|
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"
|
appointment "simrs-vx/internal/domain/main-entities/appointment"
|
||||||
chemo "simrs-vx/internal/domain/main-entities/chemo"
|
chemo "simrs-vx/internal/domain/main-entities/chemo"
|
||||||
chemoprotocol "simrs-vx/internal/domain/main-entities/chemo-protocol"
|
chemoprotocol "simrs-vx/internal/domain/main-entities/chemo-protocol"
|
||||||
@@ -175,6 +177,8 @@ func getMainEntities() []any {
|
|||||||
&mcuorderitem.McuOrderItem{},
|
&mcuorderitem.McuOrderItem{},
|
||||||
&mcusubsrc.McuSubSrc{},
|
&mcusubsrc.McuSubSrc{},
|
||||||
&mcuordersubitem.McuOrderSubItem{},
|
&mcuordersubitem.McuOrderSubItem{},
|
||||||
|
&antibioticsrccategory.AntibioticSrcCategory{},
|
||||||
|
&antibioticinuse.AntibioticInUse{},
|
||||||
&consultation.Consultation{},
|
&consultation.Consultation{},
|
||||||
&chemo.Chemo{},
|
&chemo.Chemo{},
|
||||||
&midwife.Midwife{},
|
&midwife.Midwife{},
|
||||||
|
|||||||
@@ -28,4 +28,5 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.McuOrder) {
|
|||||||
data.Temperature = inputSrc.Temperature
|
data.Temperature = inputSrc.Temperature
|
||||||
data.UrgencyLevel_Code = inputSrc.UrgencyLevel_Code
|
data.UrgencyLevel_Code = inputSrc.UrgencyLevel_Code
|
||||||
data.Doctor_Id = inputSrc.Doctor_Id
|
data.Doctor_Id = inputSrc.Doctor_Id
|
||||||
|
data.Scope_Code = inputSrc.Scope_Code
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,8 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Prescription) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data.Encounter_Id = inputSrc.Encounter_Id
|
data.Encounter_Id = inputSrc.Encounter_Id
|
||||||
data.Doctor_Id = inputSrc.Doctor_Id
|
// data.Doctor_Id = inputSrc.Doctor_Id
|
||||||
|
data.Doctor_Id = inputSrc.AuthInfo.Doctor_Id
|
||||||
data.IssuedAt = inputSrc.IssuedAt
|
data.IssuedAt = inputSrc.IssuedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user