merge migration
This commit is contained in:
@@ -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";
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Nurse" table
|
||||||
|
ALTER TABLE "public"."Nurse" ADD COLUMN "Unit_Code" character varying(10) NULL, ADD COLUMN "Infra_Code" character varying(10) NULL;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "SpecialistIntern" table
|
||||||
|
ALTER TABLE "public"."SpecialistIntern" ADD COLUMN "Specialist_Code" character varying(10) NULL, ADD COLUMN "Subspecialist_Code" character varying(10) NULL;
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- Modify "Prescription" table
|
||||||
|
ALTER TABLE "public"."Prescription" ADD COLUMN "Doctor_Code" character varying(20) NULL;
|
||||||
|
-- Modify "Doctor" table
|
||||||
|
ALTER TABLE "public"."Doctor" DROP CONSTRAINT "fk_Doctor_Specialist", DROP CONSTRAINT "fk_Doctor_Subspecialist", DROP CONSTRAINT "fk_Doctor_Unit", DROP COLUMN "Unit_Id", DROP COLUMN "Specialist_Id", DROP COLUMN "Subspecialist_Id", ADD CONSTRAINT "fk_Doctor_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Doctor_Subspecialist" FOREIGN KEY ("Subspecialist_Code") REFERENCES "public"."Subspecialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Doctor_Unit" FOREIGN KEY ("Unit_Code") REFERENCES "public"."Unit" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "Nurse" table
|
||||||
|
ALTER TABLE "public"."Nurse" DROP CONSTRAINT "fk_Nurse_Infra", DROP CONSTRAINT "fk_Nurse_Unit", DROP COLUMN "Unit_Id", DROP COLUMN "Infra_Id", ADD CONSTRAINT "fk_Nurse_Infra" FOREIGN KEY ("Infra_Code") REFERENCES "public"."Infra" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Nurse_Unit" FOREIGN KEY ("Unit_Code") REFERENCES "public"."Unit" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "SpecialistIntern" table
|
||||||
|
ALTER TABLE "public"."SpecialistIntern" DROP CONSTRAINT "fk_SpecialistIntern_Specialist", DROP CONSTRAINT "fk_SpecialistIntern_Subspecialist", DROP COLUMN "Specialist_Id", DROP COLUMN "Subspecialist_Id", ADD CONSTRAINT "fk_SpecialistIntern_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_SpecialistIntern_Subspecialist" FOREIGN KEY ("Subspecialist_Code") REFERENCES "public"."Subspecialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Prescription" table
|
||||||
|
ALTER TABLE "public"."Prescription" DROP CONSTRAINT "fk_Prescription_Doctor", DROP COLUMN "Doctor_Id", ADD CONSTRAINT "fk_Prescription_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- Modify "Specialist" table
|
||||||
|
ALTER TABLE "public"."Specialist" ADD COLUMN "Unit_Code" character varying(10) NULL;
|
||||||
|
-- Modify "SpecialistPosition" table
|
||||||
|
ALTER TABLE "public"."SpecialistPosition" ADD COLUMN "Specialist_Code" character varying(10) NULL;
|
||||||
|
-- Modify "Subspecialist" table
|
||||||
|
ALTER TABLE "public"."Subspecialist" ADD COLUMN "Specialist_Code" character varying(10) NULL;
|
||||||
|
-- Modify "SubspecialistPosition" table
|
||||||
|
ALTER TABLE "public"."SubspecialistPosition" ADD COLUMN "Subspecialist_Code" character varying(10) NULL;
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- Modify "Specialist" table
|
||||||
|
ALTER TABLE "public"."Specialist" DROP CONSTRAINT "fk_Specialist_Unit", DROP COLUMN "Unit_Id", ADD CONSTRAINT "fk_Specialist_Unit" FOREIGN KEY ("Unit_Code") REFERENCES "public"."Unit" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "SpecialistPosition" table
|
||||||
|
ALTER TABLE "public"."SpecialistPosition" DROP CONSTRAINT "fk_SpecialistPosition_Specialist", DROP COLUMN "Specialist_Id", ADD CONSTRAINT "fk_SpecialistPosition_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "Subspecialist" table
|
||||||
|
ALTER TABLE "public"."Subspecialist" DROP CONSTRAINT "fk_Subspecialist_Specialist", DROP COLUMN "Specialist_Id", ADD CONSTRAINT "fk_Subspecialist_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "SubspecialistPosition" table
|
||||||
|
ALTER TABLE "public"."SubspecialistPosition" DROP CONSTRAINT "fk_SubspecialistPosition_Subspecialist", DROP COLUMN "Subspecialist_Id", ADD CONSTRAINT "fk_SubspecialistPosition_Subspecialist" FOREIGN KEY ("Subspecialist_Code") REFERENCES "public"."Subspecialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Modify "Division" table
|
||||||
|
ALTER TABLE "public"."Division" ADD COLUMN "Parent_Code" character varying(10) NULL;
|
||||||
|
-- Modify "DivisionPosition" table
|
||||||
|
ALTER TABLE "public"."DivisionPosition" ADD COLUMN "Division_Code" character varying(10) NULL;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Create index "idx_Division_Code" to table: "Division"
|
||||||
|
CREATE UNIQUE INDEX "idx_Division_Code" ON "public"."Division" ("Code");
|
||||||
|
-- Modify "Division" table
|
||||||
|
ALTER TABLE "public"."Division" DROP CONSTRAINT "uni_Division_Code", DROP CONSTRAINT "fk_Division_Childrens", DROP COLUMN "Parent_Id", ADD CONSTRAINT "fk_Division_Childrens" FOREIGN KEY ("Parent_Code") REFERENCES "public"."Division" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "DivisionPosition" table
|
||||||
|
ALTER TABLE "public"."DivisionPosition" DROP CONSTRAINT "fk_DivisionPosition_Division", DROP COLUMN "Division_Id", ADD CONSTRAINT "fk_DivisionPosition_Division" FOREIGN KEY ("Division_Code") REFERENCES "public"."Division" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Modify "InstallationPosition" table
|
||||||
|
ALTER TABLE "public"."InstallationPosition" ADD COLUMN "Installation_Code" character varying(10) NULL;
|
||||||
|
-- Modify "Unit" table
|
||||||
|
ALTER TABLE "public"."Unit" ADD COLUMN "Installation_Code" character varying(10) NULL;
|
||||||
|
-- Modify "UnitPosition" table
|
||||||
|
ALTER TABLE "public"."UnitPosition" ADD COLUMN "Unit_Code" character varying(10) NULL;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Modify "InstallationPosition" table
|
||||||
|
ALTER TABLE "public"."InstallationPosition" DROP CONSTRAINT "fk_InstallationPosition_Installation", DROP COLUMN "Installation_Id", ADD CONSTRAINT "fk_InstallationPosition_Installation" FOREIGN KEY ("Installation_Code") REFERENCES "public"."Installation" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "Unit" table
|
||||||
|
ALTER TABLE "public"."Unit" DROP CONSTRAINT "fk_Unit_Installation", DROP COLUMN "Installation_Id", ADD CONSTRAINT "fk_Unit_Installation" FOREIGN KEY ("Installation_Code") REFERENCES "public"."Installation" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "UnitPosition" table
|
||||||
|
ALTER TABLE "public"."UnitPosition" DROP CONSTRAINT "fk_UnitPosition_Unit", DROP COLUMN "Unit_Id", ADD CONSTRAINT "fk_UnitPosition_Unit" FOREIGN KEY ("Unit_Code") REFERENCES "public"."Unit" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
-- Create "AuthPartner" table
|
||||||
|
CREATE TABLE "public"."AuthPartner" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Code" character varying(50) NULL,
|
||||||
|
"Name" character varying(100) NULL,
|
||||||
|
"SecretKey" character varying(255) NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "uni_AuthPartner_Code" UNIQUE ("Code"),
|
||||||
|
CONSTRAINT "uni_AuthPartner_Name" UNIQUE ("Name")
|
||||||
|
);
|
||||||
|
-- Create "ExtUser" table
|
||||||
|
CREATE TABLE "public"."ExtUser" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Name" character varying(100) NULL,
|
||||||
|
"AuthPartner_Code" character varying(30) NULL,
|
||||||
|
"User_Name" character varying(50) NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_ExtUser_AuthPartner" FOREIGN KEY ("AuthPartner_Code") REFERENCES "public"."AuthPartner" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_ExtUser_User" FOREIGN KEY ("User_Name") REFERENCES "public"."User" ("Name") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
-- Create "UserFes" table
|
||||||
|
CREATE TABLE "public"."UserFes" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Name" character varying(100) NULL,
|
||||||
|
"AuthPartner_Code" character varying(30) NULL,
|
||||||
|
"User_Name" character varying(50) NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_UserFes_AuthPartner" FOREIGN KEY ("AuthPartner_Code") REFERENCES "public"."AuthPartner" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_UserFes_User" FOREIGN KEY ("User_Name") REFERENCES "public"."User" ("Name") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Drop "ExtUser" table
|
||||||
|
DROP TABLE "public"."ExtUser";
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Room" table
|
||||||
|
ALTER TABLE "public"."Room" ADD COLUMN "Infra_Coode" character varying(10) 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;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Rename a column from "Infra_Coode" to "Infra_Code"
|
||||||
|
ALTER TABLE "public"."Room" RENAME COLUMN "Infra_Coode" TO "Infra_Code";
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Modify "Infra" table
|
||||||
|
ALTER TABLE "public"."Infra" ADD COLUMN "Parent_Code" character varying(10) NULL, ADD COLUMN "Item_Code" character varying(50) NULL;
|
||||||
|
-- Create index "idx_Infra_Code" to table: "Infra"
|
||||||
|
CREATE UNIQUE INDEX "idx_Infra_Code" ON "public"."Infra" ("Code");
|
||||||
|
-- Modify "Room" table
|
||||||
|
ALTER TABLE "public"."Room" DROP CONSTRAINT "fk_Room_Specialist", DROP CONSTRAINT "fk_Room_Subspecialist", DROP CONSTRAINT "fk_Room_Unit", DROP COLUMN "Infra_Id", DROP COLUMN "Unit_Id", DROP COLUMN "Specialist_Id", DROP COLUMN "Subspecialist_Id", ADD CONSTRAINT "fk_Room_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Room_Subspecialist" FOREIGN KEY ("Subspecialist_Code") REFERENCES "public"."Subspecialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Room_Unit" FOREIGN KEY ("Unit_Code") REFERENCES "public"."Unit" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Modify "Nurse" table
|
||||||
|
ALTER TABLE "public"."Nurse" DROP CONSTRAINT "fk_Nurse_Infra";
|
||||||
|
-- Modify "Infra" table
|
||||||
|
ALTER TABLE "public"."Infra" DROP CONSTRAINT "uni_Infra_Code";
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Modify "Nurse" table
|
||||||
|
ALTER TABLE "public"."Nurse" ADD CONSTRAINT "fk_Nurse_Infra" FOREIGN KEY ("Infra_Code") REFERENCES "public"."Infra" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
|
-- Modify "Room" table
|
||||||
|
ALTER TABLE "public"."Room" ADD CONSTRAINT "fk_Room_Infra" FOREIGN KEY ("Infra_Code") REFERENCES "public"."Infra" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Item" table
|
||||||
|
ALTER TABLE "public"."Item" ADD COLUMN "Infra_Code" character varying(10) NULL;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Modify "Device" table
|
||||||
|
ALTER TABLE "public"."Device" ADD COLUMN "Infra_Code" character varying(10) NULL, ADD COLUMN "Item_Code" character varying(50) NULL;
|
||||||
|
-- Modify "Material" table
|
||||||
|
ALTER TABLE "public"."Material" ADD COLUMN "Infra_Code" character varying(10) NULL, ADD COLUMN "Item_Code" character varying(50) NULL;
|
||||||
|
-- Modify "Medicine" table
|
||||||
|
ALTER TABLE "public"."Medicine" ADD COLUMN "Infra_Code" character varying(10) NULL, ADD COLUMN "Item_Code" character varying(50) NULL;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Modify "Infra" table
|
||||||
|
ALTER TABLE "public"."Infra" ALTER COLUMN "Code" SET NOT NULL;
|
||||||
|
-- Modify "Item" table
|
||||||
|
ALTER TABLE "public"."Item" DROP COLUMN "Infra_Id";
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Infra" table
|
||||||
|
ALTER TABLE "public"."Infra" DROP CONSTRAINT "fk_Infra_Childrens", DROP CONSTRAINT "fk_Infra_Item", DROP COLUMN "Parent_Id", ADD CONSTRAINT "fk_Infra_Childrens" FOREIGN KEY ("Parent_Code") REFERENCES "public"."Infra" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Infra_Item" FOREIGN KEY ("Item_Code") REFERENCES "public"."Item" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Infra" table
|
||||||
|
ALTER TABLE "public"."Infra" DROP COLUMN "Item_Id";
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Modify "Ambulatory" table
|
||||||
|
ALTER TABLE "public"."Ambulatory" DROP COLUMN "VisitMode_Code";
|
||||||
|
-- Modify "InternalReference" table
|
||||||
|
ALTER TABLE "public"."InternalReference" ADD COLUMN "Status_Code" text NULL;
|
||||||
|
-- Modify "Rehab" table
|
||||||
|
ALTER TABLE "public"."Rehab" ADD COLUMN "Parent_Encounter_Id" bigint NULL, ADD COLUMN "ExpiredAt" timestamptz NULL, ADD COLUMN "VisitMode_Code" text NULL, ADD COLUMN "Status_Code" text NULL;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Rehab" table
|
||||||
|
ALTER TABLE "public"."Rehab" DROP COLUMN "Doctor_Id";
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
h1:cfOFDnxgOCgOIto2DMofzQkPlSF7P+eTsp8Msr3p8sw=
|
h1:VjwYayb6y4kUl9K9WTTwmXExlHijchOCRwnUYcRlhRI=
|
||||||
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=
|
||||||
@@ -69,5 +69,31 @@ h1:cfOFDnxgOCgOIto2DMofzQkPlSF7P+eTsp8Msr3p8sw=
|
|||||||
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:rg+eRE5/5sYWR7z+Xyn0zKw8rr8P/oWxF0xhcNVnNec=
|
20251104084135.sql h1:rg+eRE5/5sYWR7z+Xyn0zKw8rr8P/oWxF0xhcNVnNec=
|
||||||
20251106054706.sql h1:WIUuH4oOWHkMJwo2OFlwQc+jT+B1xwXauw0+wbgVdnI=
|
20251105044629.sql h1:4NU27HeKUNFsV82LacnwmnCSAH0pSbZR9J9/ZESRs6M=
|
||||||
20251106054849.sql h1:VJHNZBBzNiibsEwvDp90/h3BLOOLx76Pszpl6e/YqvU=
|
20251105121808.sql h1:fii6LjqWYjrm/pEIqttfvJI6QEUL49gque8wYHh1+yI=
|
||||||
|
20251106035305.sql h1:oQ7BwnxPuwY2q98adIVc+lNwL/Sz1OceLJeClDo9/TI=
|
||||||
|
20251106040137.sql h1:ppcqkVoT0o9jZcjI/TN7LuaPxXhJQhnIXEJtloP/46o=
|
||||||
|
20251106041333.sql h1:2JkxyelQ/EeB+boL5bfpnzefw32ttEGKvKchtQjWmAU=
|
||||||
|
20251106042006.sql h1:ruppYa1kAJQUU3ufQBbKGMcXrGbGJJiRPclT+dNc/YQ=
|
||||||
|
20251106050412.sql h1:1002KYtHd8AwrQTMewbs/PPHDylHDghigE/3S7PVdMA=
|
||||||
|
20251106063418.sql h1:jPW/gBnbFl4RO39lQ0ZMDtYA6xbhyD6CgQupT50HmaY=
|
||||||
|
20251106071906.sql h1:leYGKxR3EQn794aOehf0sd/ZPmOnvBMZPy5/anGmRB4=
|
||||||
|
20251106073157.sql h1:KASMzjjjk5UB7Zj8lCRtM1utc4ZnDjlnpZbtTe3vONE=
|
||||||
|
20251106074218.sql h1:Z5q5deOvLaZDPhiVTN9st3/s56RepBa2YOyrMXBdj4A=
|
||||||
|
20251106081846.sql h1:P+VsWwhGt60adDIZuE/Aa38JVp/yX1rnsdpXpxASodw=
|
||||||
|
20251106082844.sql h1:Dmi5A8i9frQZvdXYPwc7f8CisZtBH8liSXq1rI6z1iM=
|
||||||
|
20251106090021.sql h1:4JwdKgO8T46YhyWVJUxpRIwudBDlG8QN1brSOYmgQ20=
|
||||||
|
20251106144745.sql h1:nqnQCzGrVJaq8ilOEOGXeRUL1dolj+OPWKuP8A92FRA=
|
||||||
|
20251107012049.sql h1:Pff4UqltGS3clSlGr0qq8CQM56L29wyxY0FC/N/YAhU=
|
||||||
|
20251107064812.sql h1:GB9a0ZfMYTIoGNmKUG+XcYUsTnRMFfT4/dAD71uCPc4=
|
||||||
|
20251107064937.sql h1:IC5pw1Ifj30hiE6dr5NMHXaSHoQI+vRd40N5ABgBHRI=
|
||||||
|
20251107071420.sql h1:9NO3iyLEXEtWa2kSRjM/8LyzuVIk6pdFL2SuheWjB08=
|
||||||
|
20251107074318.sql h1:7fHbSRrdjOmHh/xwnjCLwoiB5cW5zeH+uxLV0vZbkIA=
|
||||||
|
20251107075050.sql h1:np+3uTOnU9QNtK7Knaw8eRMhkyB9AwrtSNHphOBxbHY=
|
||||||
|
20251107080604.sql h1:cXDBLPJDVWLTG6yEJqkJsOQ7p7VYxLM2SY+mwO8qSHo=
|
||||||
|
20251107081830.sql h1:/S7OQZo4ZnK80t28g/JyiOTZtmWG/dP5Wg2zXNMQ/iE=
|
||||||
|
20251107091033.sql h1:/cbkF1nO/IjNSIfDJJx456KJtQ9rWFXOBFAkR/M2xiE=
|
||||||
|
20251107091209.sql h1:jrLQOUeV8ji2fg0pnEcs1bw4ANUxzTSMXC/rrHLIY+M=
|
||||||
|
20251107091541.sql h1:6UqbhQQRmzA2+eKu5lIvkwOkk+lH70QLZC8Pjpjcq68=
|
||||||
|
20251110012217.sql h1:+4ZcAtlZobLY/iTU1hwVEuqCCYtbiDs2N75jTBz1eQM=
|
||||||
|
20251110012306.sql h1:w3ZvpG2IaS4sZ9WxKcaMAjmy1JhsOPg8zmwjDv4tv7Y=
|
||||||
|
|||||||
@@ -28,9 +28,8 @@ type FilterDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Includes string `json:"includes"`
|
||||||
Includes string `json:"includes"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Encounter_Id *uint `json:"encounter_id"`
|
Encounter_Id *uint `json:"encounter_id"`
|
||||||
Class_Code ere.AmbulatoryClassCode `json:"class_code" validate:"maxLength=10"`
|
Class_Code ere.AmbulatoryClassCode `json:"class_code" validate:"maxLength=10"`
|
||||||
|
VisitMode_Code ere.VisitModeCode `json:"visitMode_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -42,12 +43,16 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Encounter_Id *uint `json:"encounter_id"`
|
Encounter_Id *uint `json:"encounter_id"`
|
||||||
Class_Code ere.AmbulatoryClassCode `json:"class_code"`
|
Class_Code ere.AmbulatoryClassCode `json:"class_code"`
|
||||||
|
VisitMode_Code ere.VisitModeCode `json:"visitMode_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d Ambulatory) ToResponse() ResponseDto {
|
func (d Ambulatory) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{}
|
resp := ResponseDto{
|
||||||
|
Encounter_Id: d.Encounter_Id,
|
||||||
|
Class_Code: d.Class_Code,
|
||||||
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
return resp
|
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 {
|
type VerifyDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id uint16 `json:"id"`
|
||||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||||
|
Bed *string `json:"bed" validate:"required"`
|
||||||
|
Needs *string `json:"needs" validate:"required"`
|
||||||
|
|
||||||
pa.AuthInfo
|
pa.AuthInfo
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
// internal - domain - main-entities
|
// internal - domain - main-entities
|
||||||
|
|
||||||
|
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||||
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"
|
||||||
@@ -23,6 +24,7 @@ type CreateDto struct {
|
|||||||
Unit_Id *uint `json:"unit_id"`
|
Unit_Id *uint `json:"unit_id"`
|
||||||
Specialist_Id *uint `json:"specialist_id"`
|
Specialist_Id *uint `json:"specialist_id"`
|
||||||
Subspecialist_Id *uint `json:"subspecialist_id"`
|
Subspecialist_Id *uint `json:"subspecialist_id"`
|
||||||
|
Doctor_Id *uint `json:"doctor_id"`
|
||||||
Date *time.Time `json:"date"`
|
Date *time.Time `json:"date"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,11 +39,13 @@ type FilterDto struct {
|
|||||||
Unit_Id *uint `json:"unit-id"`
|
Unit_Id *uint `json:"unit-id"`
|
||||||
Specialist_Id *uint `json:"specialist-id"`
|
Specialist_Id *uint `json:"specialist-id"`
|
||||||
Subspecialist_Id *uint `json:"subspecialist-id"`
|
Subspecialist_Id *uint `json:"subspecialist-id"`
|
||||||
|
Doctor_Id *uint `json:"doctor-id"`
|
||||||
Date *time.Time `json:"date"`
|
Date *time.Time `json:"date"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id uint16 `json:"id"`
|
||||||
|
Includes string `json:"includes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
@@ -69,13 +73,15 @@ type MetaDto struct {
|
|||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Encounter_Id *uint `json:"encounter_id"`
|
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_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_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_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"`
|
Date *time.Time `json:"date"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,6 +95,8 @@ func (d ControlLetter) ToResponse() ResponseDto {
|
|||||||
Specialist: d.Specialist,
|
Specialist: d.Specialist,
|
||||||
Subspecialist_Id: d.Subspecialist_Id,
|
Subspecialist_Id: d.Subspecialist_Id,
|
||||||
Subspecialist: d.Subspecialist,
|
Subspecialist: d.Subspecialist,
|
||||||
|
Doctor_Id: d.Doctor_Id,
|
||||||
|
Doctor: d.Doctor,
|
||||||
Date: d.Date,
|
Date: d.Date,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
Uom_Code string `json:"uom_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"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"item_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -32,17 +32,18 @@ type FilterDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ type Device struct {
|
|||||||
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
||||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
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"`
|
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||||
Item_Id *uint `json:"item_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"`
|
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
type Basic struct {
|
type Basic struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
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"`
|
Code string `json:"code" gorm:"unique;size:10"`
|
||||||
Name string `json:"name" gorm:"size:50"`
|
Name string `json:"name" gorm:"size:50"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Division_Id *uint16 `json:"division_id"`
|
Division_Code *string `json:"division_code"`
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -22,26 +22,27 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Division_Id *uint16 `json:"division-id"`
|
Division_Code *string `json:"division-code"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus *bool `json:"head-status"`
|
HeadStatus *bool `json:"head-status"`
|
||||||
Employee_Id *uint `json:"employee-id"`
|
Employee_Id *uint `json:"employee-id"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -52,23 +53,23 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Division_Id *uint16 `json:"division_id"`
|
Division_Code *string `json:"division_code"`
|
||||||
Division *ed.Division `json:"division,omitempty"`
|
Division *ed.Division `json:"division,omitempty"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *ee.Employee `json:"employee,omitempty"`
|
Employee *ee.Employee `json:"employee,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d DivisionPosition) ToResponse() ResponseDto {
|
func (d DivisionPosition) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Division_Id: d.Division_Id,
|
Division_Code: d.Division_Code,
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
HeadStatus: d.HeadStatus,
|
HeadStatus: d.HeadStatus,
|
||||||
Employee_Id: d.Employee_Id,
|
Employee_Id: d.Employee_Id,
|
||||||
Employee: d.Employee,
|
Employee: d.Employee,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
if d.Division != nil {
|
if d.Division != nil {
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ import (
|
|||||||
|
|
||||||
type DivisionPosition struct {
|
type DivisionPosition struct {
|
||||||
eb.Basic
|
eb.Basic
|
||||||
Division *ed.Division `json:"division" gorm:"foreignKey:Division_Id;references:Id"`
|
Division *ed.Division `json:"division" gorm:"foreignKey:Division_Code;references:Code"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
Parent_Id *uint16 `json:"parent_id"`
|
Parent_Code *string `json:"parent_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -20,25 +20,26 @@ 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"`
|
||||||
Parent_Id *uint16 `json:"parent-id"`
|
Parent_Code *string `json:"parent-code"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Includes string `json:"includes"`
|
Includes string `json:"includes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -51,7 +52,7 @@ type ResponseDto struct {
|
|||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Parent_Id *uint16 `json:"parent_id"`
|
Parent_Code *string `json:"parent_code"`
|
||||||
Parent *Division `json:"parent,omitempty"`
|
Parent *Division `json:"parent,omitempty"`
|
||||||
Childrens []Division `json:"childrens,omitempty"`
|
Childrens []Division `json:"childrens,omitempty"`
|
||||||
DivisionPosition []edpb.Basic `json:"divisionPositions,omitempty"`
|
DivisionPosition []edpb.Basic `json:"divisionPositions,omitempty"`
|
||||||
@@ -61,7 +62,7 @@ func (d Division) ToResponse() ResponseDto {
|
|||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
Parent_Id: d.Parent_Id,
|
Parent_Code: d.Parent_Code,
|
||||||
Parent: d.Parent,
|
Parent: d.Parent,
|
||||||
Childrens: d.Childrens,
|
Childrens: d.Childrens,
|
||||||
DivisionPosition: d.DivisionPositions,
|
DivisionPosition: d.DivisionPositions,
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
|
|
||||||
type Division struct {
|
type Division struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
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"`
|
Name string `json:"name" gorm:"size:50"`
|
||||||
Parent_Id *uint16 `json:"parent_id"`
|
Parent_Code *string `json:"parent_code" gorm:"size:10"`
|
||||||
Parent *Division `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
|
Parent *Division `json:"parent" gorm:"foreignKey:Parent_Code;references:Code"`
|
||||||
Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
|
Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Code;references:Code"` // may need references to self
|
||||||
DivisionPositions []edpb.Basic `json:"divisionPositions,omitempty" gorm:"foreignKey:Division_Id;references:Id"`
|
DivisionPositions []edpb.Basic `json:"divisionPositions,omitempty" gorm:"foreignKey:Division_Code;references:Code"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,16 +6,18 @@ 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 CreateDto struct {
|
type CreateDto struct {
|
||||||
Code *string `json:"code" validate:"maxLength=20"`
|
Code *string `json:"code" validate:"maxLength=20"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
IHS_Number *string `json:"ihs_number"`
|
IHS_Number *string `json:"ihs_number"`
|
||||||
SIP_Number *string `json:"sip_number"`
|
SIP_Number *string `json:"sip_number"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
SIP_ExpiredDate *time.Time `json:"sip_expiredDate"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -25,13 +27,14 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Employee_Id *uint `json:"employee-id"`
|
Employee_Id *uint `json:"employee-id"`
|
||||||
IHS_Number *string `json:"ihs-number" validate:"maxLength=20"`
|
IHS_Number *string `json:"ihs-number" validate:"maxLength=20"`
|
||||||
SIP_Number *string `json:"sip-number" validate:"maxLength=20"`
|
SIP_Number *string `json:"sip-number" validate:"maxLength=20"`
|
||||||
Unit_Id *uint `json:"unit-id"`
|
SIP_ExpiredDate *string `json:"sip-expiredDate"`
|
||||||
Specialist_Id *uint16 `json:"specialist-id"`
|
Unit_Code *string `json:"unit-code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist-id"`
|
Specialist_Code *string `json:"specialist-code"`
|
||||||
|
Subspecialist_Code *string `json:"subspecialist-code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
@@ -59,32 +62,32 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *ee.Employee `json:"employee,omitempty"`
|
Employee *ee.Employee `json:"employee,omitempty"`
|
||||||
IHS_Number *string `json:"ihs_number"`
|
IHS_Number *string `json:"ihs_number"`
|
||||||
SIP_Number *string `json:"sip_number"`
|
SIP_Number *string `json:"sip_number"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty"`
|
Unit *eu.Unit `json:"unit,omitempty"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty" `
|
Specialist *es.Specialist `json:"specialist,omitempty" `
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d Doctor) ToResponse() ResponseDto {
|
func (d Doctor) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Employee_Id: d.Employee_Id,
|
Employee_Id: d.Employee_Id,
|
||||||
Employee: d.Employee,
|
Employee: d.Employee,
|
||||||
IHS_Number: d.IHS_Number,
|
IHS_Number: d.IHS_Number,
|
||||||
SIP_Number: d.SIP_Number,
|
SIP_Number: d.SIP_Number,
|
||||||
Unit_Id: d.Unit_Id,
|
Unit_Code: d.Unit_Code,
|
||||||
Unit: d.Unit,
|
Unit: d.Unit,
|
||||||
Specialist_Id: d.Specialist_Id,
|
Specialist_Code: d.Specialist_Code,
|
||||||
Specialist: d.Specialist,
|
Specialist: d.Specialist,
|
||||||
Subspecialist_Id: d.Subspecialist_Id,
|
Subspecialist_Code: d.Subspecialist_Code,
|
||||||
Subspecialist: d.Subspecialist,
|
Subspecialist: d.Subspecialist,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -6,19 +6,21 @@ 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_Code *string `json:"unit_code" gorm:"size:10"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
|
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
|
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"
|
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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ type CreateDto struct {
|
|||||||
Appointment_Id *uint `json:"appointment_id"`
|
Appointment_Id *uint `json:"appointment_id"`
|
||||||
RefTypeCode ere.RefTypeCode `json:"refTypeCode"`
|
RefTypeCode ere.RefTypeCode `json:"refTypeCode"`
|
||||||
NewStatus bool `json:"newStatus"`
|
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
|
pa.AuthInfo
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,15 +9,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=15"`
|
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=15"`
|
||||||
Parent_Id *uint16 `json:"parent_id"`
|
Parent_Code *string `json:"parent_code"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"-"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
Infra_Id *uint16 `json:"-"` // for room
|
Infra_Code *string `json:"infra_code"` // for room
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -32,24 +32,25 @@ type FilterDto struct {
|
|||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup-code"`
|
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup-code"`
|
||||||
Parent_Id *uint16 `json:"parent-id"`
|
Parent_Code *string `json:"parent-code"`
|
||||||
Item_Id *uint `json:"item-id"`
|
Item_Id *string `json:"item-code"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"item_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -63,10 +64,10 @@ type ResponseDto struct {
|
|||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code"`
|
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code"`
|
||||||
Parent_Id *uint16 `json:"parent_id"`
|
Parent_Code *string `json:"parent_code"`
|
||||||
Parent *Infra `json:"parent,omitempty"`
|
Parent *Infra `json:"parent,omitempty"`
|
||||||
Childrens []Infra `json:"childrens,omitempty"`
|
Childrens []Infra `json:"childrens,omitempty"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"item_code"`
|
||||||
Item *ei.Item `json:"item,omitempty"`
|
Item *ei.Item `json:"item,omitempty"`
|
||||||
Rooms []erb.Basic `json:"rooms,omitempty"`
|
Rooms []erb.Basic `json:"rooms,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -76,12 +77,12 @@ func (d Infra) ToResponse() ResponseDto {
|
|||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
InfraGroup_Code: d.InfraGroup_Code,
|
InfraGroup_Code: d.InfraGroup_Code,
|
||||||
Parent_Id: d.Parent_Id,
|
Parent_Code: d.Parent_Code,
|
||||||
Parent: d.Parent,
|
// Parent: d.Parent,
|
||||||
Childrens: d.Childrens,
|
Childrens: d.Childrens,
|
||||||
Item_Id: d.Item_Id,
|
Item_Code: d.Item_Code,
|
||||||
Item: d.Item,
|
Item: d.Item,
|
||||||
Rooms: d.Rooms,
|
Rooms: d.Rooms,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package infra
|
|||||||
import (
|
import (
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||||
ei "simrs-vx/internal/domain/main-entities/item"
|
ei "simrs-vx/internal/domain/main-entities/item"
|
||||||
|
|
||||||
erb "simrs-vx/internal/domain/main-entities/room/base"
|
erb "simrs-vx/internal/domain/main-entities/room/base"
|
||||||
|
|
||||||
ero "simrs-vx/internal/domain/references/organization"
|
ero "simrs-vx/internal/domain/references/organization"
|
||||||
@@ -10,13 +11,13 @@ import (
|
|||||||
|
|
||||||
type Infra struct {
|
type Infra struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
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"`
|
Name string `json:"name" gorm:"size:50"`
|
||||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:15"`
|
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:15"`
|
||||||
Parent_Id *uint16 `json:"parent_id"`
|
Parent_Code *string `json:"parent_code" gorm:"size:10"`
|
||||||
Parent *Infra `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
|
Parent *Infra `json:"parent" gorm:"foreignKey:Parent_Code;references:Code"`
|
||||||
Childrens []Infra `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
|
Childrens []Infra `json:"childrens" gorm:"foreignKey:Parent_Code;references:Code"`
|
||||||
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"`
|
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Code;references:Code"`
|
||||||
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Id"`
|
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Code;references:Code"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Basic struct {
|
type Basic struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
ecore.SmallMain // adjust this according to the needs
|
||||||
Installation_Id *uint16 `json:"installation_id" gorm:"not null"`
|
Installation_Code *string `json:"installation_code" gorm:"size:10"`
|
||||||
Code string `json:"code" gorm:"unique;size:10;not null"`
|
Code string `json:"code" gorm:"unique;size:10;not null"`
|
||||||
Name string `json:"name" gorm:"size:30;not null"`
|
Name string `json:"name" gorm:"size:30;not null"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Basic) TableName() string {
|
func (Basic) TableName() string {
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Installation_Id *uint16 `json:"installation_id" validate:"required"`
|
Installation_Code *string `json:"installation_code" validate:"required"`
|
||||||
Code string `json:"code" validate:"maxLength=10;required"`
|
Code string `json:"code" validate:"maxLength=10;required"`
|
||||||
Name string `json:"name" validate:"maxLength=30;required"`
|
Name string `json:"name" validate:"maxLength=30;required"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -22,26 +22,27 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Installation_Id *uint16 `json:"installation-id"`
|
Installation_Code *string `json:"installation-code"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus *bool `json:"head-status"`
|
HeadStatus *bool `json:"head-status"`
|
||||||
Employee_Id *uint `json:"employee-id"`
|
Employee_Id *uint `json:"employee-id"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -52,24 +53,24 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Installation_Id *uint16 `json:"installation_id"`
|
Installation_Code *string `json:"installation_code"`
|
||||||
Installation *ei.Installation `json:"installation,omitempty"`
|
Installation *ei.Installation `json:"installation,omitempty"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *ee.Employee `json:"employee,omitempty"`
|
Employee *ee.Employee `json:"employee,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d InstallationPosition) ToResponse() ResponseDto {
|
func (d InstallationPosition) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Installation_Id: d.Installation_Id,
|
Installation_Code: d.Installation_Code,
|
||||||
Installation: d.Installation,
|
Installation: d.Installation,
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
HeadStatus: d.HeadStatus,
|
HeadStatus: d.HeadStatus,
|
||||||
Employee_Id: d.Employee_Id,
|
Employee_Id: d.Employee_Id,
|
||||||
Employee: d.Employee,
|
Employee: d.Employee,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ import (
|
|||||||
|
|
||||||
type InstallationPosition struct {
|
type InstallationPosition struct {
|
||||||
eib.Basic // adjust this according to the needs
|
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"`
|
Code string `json:"code" gorm:"unique;size:10"`
|
||||||
Name string `json:"name" gorm:"size:50"`
|
Name string `json:"name" gorm:"size:50"`
|
||||||
EncounterClass_Code ere.EncounterClassCode `json:"encounterClass_code" gorm:"size:10"`
|
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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ type CreateDto struct {
|
|||||||
Name string `json:"name" validate:"maxLength=100"`
|
Name string `json:"name" validate:"maxLength=100"`
|
||||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" validate:"maxLength=10"`
|
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" validate:"maxLength=10"`
|
||||||
Uom_Code *string `json:"uom_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"`
|
Stock *int `json:"stock"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,23 +27,24 @@ type FilterDto struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup-code"`
|
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup-code"`
|
||||||
Uom_Code *string `json:"uom-code"`
|
Uom_Code *string `json:"uom-code"`
|
||||||
Infra_Id *uint16 `json:"infra-id"`
|
Infra_Code *string `json:"infra-code"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -59,7 +60,7 @@ type ResponseDto struct {
|
|||||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code"`
|
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code"`
|
||||||
Uom_Code *string `json:"uom_code"`
|
Uom_Code *string `json:"uom_code"`
|
||||||
Uom *eu.Uom `json:"uom,omitempty"`
|
Uom *eu.Uom `json:"uom,omitempty"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ func (d Item) ToResponse() ResponseDto {
|
|||||||
ItemGroup_Code: d.ItemGroup_Code,
|
ItemGroup_Code: d.ItemGroup_Code,
|
||||||
Uom_Code: d.Uom_Code,
|
Uom_Code: d.Uom_Code,
|
||||||
Uom: d.Uom,
|
Uom: d.Uom,
|
||||||
Infra_Id: d.Infra_Id,
|
Infra_Code: d.Infra_Code,
|
||||||
Stock: d.Stock,
|
Stock: d.Stock,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ type Item struct {
|
|||||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" gorm:"size:15"`
|
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" gorm:"size:15"`
|
||||||
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
||||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
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"`
|
Stock *int `json:"stock"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
Uom_Code string `json:"uom_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"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"item_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -24,28 +24,29 @@ 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"`
|
||||||
Uom_Code string `json:"uom-code"`
|
Uom_Code string `json:"uom-code"`
|
||||||
Infra_Id *uint16 `json:"infra-id"`
|
Infra_Code *string `json:"infra-code"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item-id"`
|
Item_Code *string `json:"item-code"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Id *uint `json:"item_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -56,28 +57,28 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Uom_Code string `json:"uom_code"`
|
Uom_Code string `json:"uom_code"`
|
||||||
Uom *eu.Uom `json:"uom,omitempty"`
|
Uom *eu.Uom `json:"uom,omitempty"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Infra *ein.Infra `json:"infra,omitempty"`
|
Infra *ein.Infra `json:"infra,omitempty"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"item_code"`
|
||||||
Item *ei.Item `json:"item,omitempty"`
|
Item *ei.Item `json:"item,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d Material) ToResponse() ResponseDto {
|
func (d Material) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
Uom_Code: d.Uom_Code,
|
Uom_Code: d.Uom_Code,
|
||||||
Uom: d.Uom,
|
Uom: d.Uom,
|
||||||
Infra_Id: d.Infra_Id,
|
Infra_Code: d.Infra_Code,
|
||||||
Infra: d.Infra,
|
Infra: d.Infra,
|
||||||
Stock: d.Stock,
|
Stock: d.Stock,
|
||||||
Item_Id: d.Item_Id,
|
Item_Code: d.Item_Code,
|
||||||
Item: d.Item,
|
Item: d.Item,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ type Material struct {
|
|||||||
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
||||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
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"`
|
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item_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"`
|
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ type CreateDto struct {
|
|||||||
MedicineMethod_Code *string `json:"medicineMethod_code" validate:"maxLength=10"`
|
MedicineMethod_Code *string `json:"medicineMethod_code" validate:"maxLength=10"`
|
||||||
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
||||||
Dose uint8 `json:"dose"`
|
Dose uint8 `json:"dose"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"item_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -35,25 +35,26 @@ type FilterDto struct {
|
|||||||
MedicineMethod_Code *string `json:"medicineMethod-code"`
|
MedicineMethod_Code *string `json:"medicineMethod-code"`
|
||||||
Uom_Code *string `json:"uom-code"`
|
Uom_Code *string `json:"uom-code"`
|
||||||
Dose uint8 `json:"dose"`
|
Dose uint8 `json:"dose"`
|
||||||
Infra_Id *uint16 `json:"infra-id"`
|
Infra_Code *string `json:"infra-code"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item-id"`
|
Item_Code *string `json:"item-code"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *uint `json:"item_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint `json:"id"`
|
Id *uint `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -73,10 +74,10 @@ type ResponseDto struct {
|
|||||||
Uom_Code *string `json:"uom_code"`
|
Uom_Code *string `json:"uom_code"`
|
||||||
Uom *eu.Uom `json:"uom"`
|
Uom *eu.Uom `json:"uom"`
|
||||||
Dose uint8 `json:"dose"`
|
Dose uint8 `json:"dose"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Infra *ein.Infra `json:"infra,omitempty"`
|
Infra *ein.Infra `json:"infra,omitempty"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item_id"`
|
Item_Code *string `json:"item_code"`
|
||||||
Item *eit.Item `json:"item,omitempty"`
|
Item *eit.Item `json:"item,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,10 +92,10 @@ func (d Medicine) ToResponse() ResponseDto {
|
|||||||
Uom_Code: d.Uom_Code,
|
Uom_Code: d.Uom_Code,
|
||||||
Uom: d.Uom,
|
Uom: d.Uom,
|
||||||
Dose: d.Dose,
|
Dose: d.Dose,
|
||||||
Infra_Id: d.Infra_Id,
|
Infra_Code: d.Infra_Code,
|
||||||
Infra: d.Infra,
|
Infra: d.Infra,
|
||||||
Stock: d.Stock,
|
Stock: d.Stock,
|
||||||
Item_Id: d.Item_Id,
|
Item_Code: d.Item_Code,
|
||||||
Item: d.Item,
|
Item: d.Item,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
|
|||||||
@@ -21,8 +21,10 @@ type Medicine struct {
|
|||||||
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
|
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||||
Dose uint8 `json:"dose"`
|
Dose uint8 `json:"dose"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
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"`
|
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||||
Stock *int `json:"stock"`
|
Stock *int `json:"stock"`
|
||||||
Item_Id *uint `json:"item_id"`
|
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"`
|
Item *eit.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ type CreateDto struct {
|
|||||||
Code *string `json:"code" validate:"maxLength=20"`
|
Code *string `json:"code" validate:"maxLength=20"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -25,8 +25,8 @@ type FilterDto struct {
|
|||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Employee_Id *uint `json:"employee-id"`
|
Employee_Id *uint `json:"employee-id"`
|
||||||
IHS_Number *string `json:"ihs-number"`
|
IHS_Number *string `json:"ihs-number"`
|
||||||
Unit_Id *uint16 `json:"unit-id"`
|
Unit_Code *string `json:"unit-code"`
|
||||||
Infra_Id *uint16 `json:"infra-id"`
|
Infra_Code *string `json:"infra-code"`
|
||||||
}
|
}
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id uint16 `json:"id"`
|
||||||
@@ -56,9 +56,9 @@ type ResponseDto struct {
|
|||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *ee.Employee `json:"employee,omitempty"`
|
Employee *ee.Employee `json:"employee,omitempty"`
|
||||||
IHS_Number *string `json:"ihs_number"`
|
IHS_Number *string `json:"ihs_number"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty"`
|
Unit *eu.Unit `json:"unit,omitempty"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Infra *ei.Infra `json:"infra,omitempty"`
|
Infra *ei.Infra `json:"infra,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,9 +68,9 @@ func (d Nurse) ToResponse() ResponseDto {
|
|||||||
Employee_Id: d.Employee_Id,
|
Employee_Id: d.Employee_Id,
|
||||||
Employee: d.Employee,
|
Employee: d.Employee,
|
||||||
IHS_Number: d.IHS_Number,
|
IHS_Number: d.IHS_Number,
|
||||||
Unit_Id: d.Unit_Id,
|
Unit_Code: d.Unit_Code,
|
||||||
Unit: d.Unit,
|
Unit: d.Unit,
|
||||||
Infra_Id: d.Infra_Id,
|
Infra_Code: d.Infra_Code,
|
||||||
Infra: d.Infra,
|
Infra: d.Infra,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ type Nurse struct {
|
|||||||
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"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Encounter_Id *uint `json:"encounter_id"`
|
Encounter_Id *uint `json:"encounter_id"`
|
||||||
Doctor_Id *uint `json:"doctor_id"`
|
Doctor_Code *string `json:"doctor_code"`
|
||||||
IssuedAt *time.Time `json:"issuedAt"`
|
IssuedAt *time.Time `json:"issuedAt"`
|
||||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ type ReadListDto struct {
|
|||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Encounter_Id *uint `json:"encounter-id"`
|
Encounter_Id *uint `json:"encounter-id"`
|
||||||
Doctor_Id *uint `json:"doctor-id"`
|
Doctor_Code *string `json:"doctor-code"`
|
||||||
IssuedAt *time.Time `json:"issuedAt"`
|
IssuedAt *time.Time `json:"issuedAt"`
|
||||||
Status_Code *erc.DataStatusCode `json:"status-code"`
|
Status_Code *erc.DataStatusCode `json:"status-code"`
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ type ResponseDto struct {
|
|||||||
ecore.Main
|
ecore.Main
|
||||||
Encounter_Id *uint `json:"encounter_id"`
|
Encounter_Id *uint `json:"encounter_id"`
|
||||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||||
Doctor_Id *uint `json:"doctor_id"`
|
Doctor_Code *string `json:"doctor_code"`
|
||||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||||
IssuedAt *time.Time `json:"issuedAt"`
|
IssuedAt *time.Time `json:"issuedAt"`
|
||||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||||
@@ -68,7 +68,7 @@ func (d Prescription) ToResponse() ResponseDto {
|
|||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Encounter_Id: d.Encounter_Id,
|
Encounter_Id: d.Encounter_Id,
|
||||||
Encounter: d.Encounter,
|
Encounter: d.Encounter,
|
||||||
Doctor_Id: d.Doctor_Id,
|
Doctor_Code: d.Doctor_Code,
|
||||||
Doctor: d.Doctor,
|
Doctor: d.Doctor,
|
||||||
IssuedAt: d.IssuedAt,
|
IssuedAt: d.IssuedAt,
|
||||||
Status_Code: d.Status_Code,
|
Status_Code: d.Status_Code,
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ type Prescription struct {
|
|||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
Encounter_Id *uint `json:"encounter_id"`
|
Encounter_Id *uint `json:"encounter_id"`
|
||||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||||
Doctor_Id *uint `json:"doctor_id"`
|
Doctor_Code *string `json:"doctor_code" gorm:"size:20"`
|
||||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||||
IssuedAt *time.Time `json:"issuedAt"`
|
IssuedAt *time.Time `json:"issuedAt"`
|
||||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
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 {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Includes string `json:"includes"`
|
||||||
Includes string `json:"includes"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Basic struct {
|
type Basic struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
ecore.SmallMain // adjust this according to the needs
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
|
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||||
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"`
|
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||||
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"`
|
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Basic) TableName() string {
|
func (Basic) TableName() string {
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -22,10 +22,10 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Infra_Id *uint16 `json:"infra-id"`
|
Infra_Code *string `json:"infra-code"`
|
||||||
Unit_Id *uint16 `json:"unit-id"`
|
Unit_Code *string `json:"unit-code"`
|
||||||
Specialist_Id *uint16 `json:"specialist-id"`
|
Specialist_Code *string `json:"specialist-code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist-id"`
|
Subspecialist_Code *string `json:"subspecialist-code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
@@ -49,26 +49,26 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Infra *ei.Infra `json:"infra,omitempty"`
|
Infra *ei.Infra `json:"infra,omitempty"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty"`
|
Unit *eu.Unit `json:"unit,omitempty"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d Room) ToResponse() ResponseDto {
|
func (d Room) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Infra_Id: d.Infra_Id,
|
Infra_Code: d.Infra_Code,
|
||||||
Infra: d.Infra,
|
Infra: d.Infra,
|
||||||
Unit_Id: d.Unit_Id,
|
Unit_Code: d.Unit_Code,
|
||||||
Unit: d.Unit,
|
Unit: d.Unit,
|
||||||
Specialist_Id: d.Specialist_Id,
|
Specialist_Code: d.Specialist_Code,
|
||||||
Specialist: d.Specialist,
|
Specialist: d.Specialist,
|
||||||
Subspecialist_Id: d.Subspecialist_Id,
|
Subspecialist_Code: d.Subspecialist_Code,
|
||||||
Subspecialist: d.Subspecialist,
|
Subspecialist: d.Subspecialist,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ import (
|
|||||||
|
|
||||||
type Room struct {
|
type Room struct {
|
||||||
ebase.Basic
|
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 {
|
type CreateDto struct {
|
||||||
Person_Id *uint `json:"person_id"`
|
Person_Id *uint `json:"person_id"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
User_Id *uint `json:"user_id"`
|
User_Id *uint `json:"user_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -22,10 +22,10 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Person_Id *uint `json:"person-id"`
|
Person_Id *uint `json:"person-id"`
|
||||||
Specialist_Id *uint16 `json:"specialist-id"`
|
Specialist_Code *string `json:"specialist-code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist-id"`
|
Subspecialist_Code *string `json:"subspecialist-code"`
|
||||||
User_Id *uint `json:"user-id"`
|
User_Id *uint `json:"user-id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
@@ -50,26 +50,26 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Person_Id *uint `json:"person_id"`
|
Person_Id *uint `json:"person_id"`
|
||||||
Person *ep.Person `json:"person,omitempty"`
|
Person *ep.Person `json:"person,omitempty"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||||
User_Id *uint `json:"user_id"`
|
User_Id *uint `json:"user_id"`
|
||||||
User *eu.User `json:"user,omitempty"`
|
User *eu.User `json:"user,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d SpecialistIntern) ToResponse() ResponseDto {
|
func (d SpecialistIntern) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Person_Id: d.Person_Id,
|
Person_Id: d.Person_Id,
|
||||||
Person: d.Person,
|
Person: d.Person,
|
||||||
Specialist_Id: d.Specialist_Id,
|
Specialist_Code: d.Specialist_Code,
|
||||||
Specialist: d.Specialist,
|
Specialist: d.Specialist,
|
||||||
Subspecialist_Id: d.Subspecialist_Id,
|
Subspecialist_Code: d.Subspecialist_Code,
|
||||||
Subspecialist: d.Subspecialist,
|
Subspecialist: d.Subspecialist,
|
||||||
User_Id: d.User_Id,
|
User_Id: d.User_Id,
|
||||||
User: d.User,
|
User: d.User,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SpecialistIntern struct {
|
type SpecialistIntern struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
Person_Id *uint `json:"person_id"`
|
Person_Id *uint `json:"person_id"`
|
||||||
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id"`
|
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_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"`
|
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||||
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"`
|
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
|
||||||
User_Id *uint `json:"user_id"`
|
User_Id *uint `json:"user_id"`
|
||||||
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id"`
|
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
type Basic struct {
|
type Basic struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
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"`
|
Code string `json:"code" gorm:"unique;size:10;not null"`
|
||||||
Name string `json:"name" gorm:"size:30;not null"`
|
Name string `json:"name" gorm:"size:30;not null"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Specialist_Id *uint16 `json:"specialist_id" validate:"required"`
|
Specialist_Code *string `json:"specialist_code" validate:"required"`
|
||||||
Code string `json:"code" validate:"maxLength=10;required"`
|
Code string `json:"code" validate:"maxLength=10;required"`
|
||||||
Name string `json:"name" validate:"maxLength=30;required"`
|
Name string `json:"name" validate:"maxLength=30;required"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -22,26 +22,27 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Specialist_Id *uint16 `json:"specialist-id"`
|
Specialist_Code *string `json:"specialist-code"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus *bool `json:"head-status"`
|
HeadStatus *bool `json:"head-status"`
|
||||||
Employee_Id *uint `json:"employee-id"`
|
Employee_Id *uint `json:"employee-id"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -52,24 +53,24 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *ee.Employee `json:"employee,omitempty"`
|
Employee *ee.Employee `json:"employee,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d SpecialistPosition) ToResponse() ResponseDto {
|
func (d SpecialistPosition) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Specialist_Id: d.Specialist_Id,
|
Specialist_Code: d.Specialist_Code,
|
||||||
Specialist: d.Specialist,
|
Specialist: d.Specialist,
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
HeadStatus: d.HeadStatus,
|
HeadStatus: d.HeadStatus,
|
||||||
Employee_Id: d.Employee_Id,
|
Employee_Id: d.Employee_Id,
|
||||||
Employee: d.Employee,
|
Employee: d.Employee,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ import (
|
|||||||
|
|
||||||
type SpecialistPosition struct {
|
type SpecialistPosition struct {
|
||||||
esb.Basic
|
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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -21,25 +21,26 @@ 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"`
|
||||||
Unit_Id *uint16 `json:"unit-id"`
|
Unit_Code *string `json:"unit-code"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Includes string `json:"includes"`
|
Includes string `json:"includes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -52,7 +53,7 @@ type ResponseDto struct {
|
|||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty"`
|
Unit *eu.Unit `json:"unit,omitempty"`
|
||||||
SpecialistPositions []espb.Basic `json:"specialistPositions,omitempty"`
|
SpecialistPositions []espb.Basic `json:"specialistPositions,omitempty"`
|
||||||
Subspecialists []essb.Basic `json:"subspecialists,omitempty"`
|
Subspecialists []essb.Basic `json:"subspecialists,omitempty"`
|
||||||
@@ -63,7 +64,7 @@ func (d Specialist) ToResponse() ResponseDto {
|
|||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
Unit: d.Unit,
|
Unit: d.Unit,
|
||||||
Unit_Id: d.Unit_Id,
|
Unit_Code: d.Unit_Code,
|
||||||
SpecialistPositions: d.SpecialistPositions,
|
SpecialistPositions: d.SpecialistPositions,
|
||||||
Subspecialists: d.Subspecialists,
|
Subspecialists: d.Subspecialists,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ type Specialist struct {
|
|||||||
ecore.SmallMain // adjust this according to the needs
|
ecore.SmallMain // adjust this according to the needs
|
||||||
Code string `json:"code" gorm:"unique;size:10"`
|
Code string `json:"code" gorm:"unique;size:10"`
|
||||||
Name string `json:"name" gorm:"size:50"`
|
Name string `json:"name" gorm:"size:50"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
|
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||||
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
|
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||||
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
|
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Basic struct {
|
type Basic struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
ecore.SmallMain // adjust this according to the needs
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id" gorm:"not null"`
|
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
|
||||||
Code string `json:"code" gorm:"unique;size:10;not null"`
|
Code string `json:"code" gorm:"unique;size:10;not null"`
|
||||||
Name string `json:"name" gorm:"size:30;not null"`
|
Name string `json:"name" gorm:"size:30;not null"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Basic) TableName() string {
|
func (Basic) TableName() string {
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id" validate:"required"`
|
Subspecialist_Code *string `json:"subspecialist_code" validate:"required"`
|
||||||
Code string `json:"code" validate:"maxLength=10;required"`
|
Code string `json:"code" validate:"maxLength=10;required"`
|
||||||
Name string `json:"name" validate:"maxLength=30;required"`
|
Name string `json:"name" validate:"maxLength=30;required"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -22,26 +22,27 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist-id"`
|
Subspecialist_Code *string `json:"subspecialist-code"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus *bool `json:"head-status"`
|
HeadStatus *bool `json:"head-status"`
|
||||||
Employee_Id *uint `json:"employee-id"`
|
Employee_Id *uint `json:"employee-id"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -52,24 +53,24 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_id"`
|
||||||
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty"`
|
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *ee.Employee `json:"employee,omitempty"`
|
Employee *ee.Employee `json:"employee,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d SubspecialistPosition) ToResponse() ResponseDto {
|
func (d SubspecialistPosition) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Subspecialist_Id: d.Subspecialist_Id,
|
Subspecialist_Code: d.Subspecialist_Code,
|
||||||
Subspecialist: d.Subspecialist,
|
Subspecialist: d.Subspecialist,
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
HeadStatus: d.HeadStatus,
|
HeadStatus: d.HeadStatus,
|
||||||
Employee_Id: d.Employee_Id,
|
Employee_Id: d.Employee_Id,
|
||||||
Employee: d.Employee,
|
Employee: d.Employee,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ import (
|
|||||||
|
|
||||||
type SubspecialistPosition struct {
|
type SubspecialistPosition struct {
|
||||||
esb.Basic
|
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
|
ecore.SmallMain // adjust this according to the needs
|
||||||
Code string `json:"code" gorm:"unique;size:10"`
|
Code string `json:"code" gorm:"unique;size:10"`
|
||||||
Name string `json:"name" gorm:"size:50"`
|
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 {
|
func (Basic) TableName() string {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -20,25 +20,26 @@ 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"`
|
||||||
Specialist_Id *uint16 `json:"specialist-id"`
|
Specialist_Code *string `json:"specialist-code"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Includes string `json:"includes"`
|
Includes string `json:"includes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -49,20 +50,20 @@ 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"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||||
Subspecialist []espb.Basic `json:"subspecialistPositions,omitempty"`
|
Subspecialist []espb.Basic `json:"subspecialistPositions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d Subspecialist) ToResponse() ResponseDto {
|
func (d Subspecialist) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
Specialist_Id: d.Specialist_Id,
|
Specialist_Code: d.Specialist_Code,
|
||||||
Specialist: d.Specialist,
|
Specialist: d.Specialist,
|
||||||
Subspecialist: d.SubspecialistPositions,
|
Subspecialist: d.SubspecialistPositions,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ import (
|
|||||||
|
|
||||||
type Subspecialist struct {
|
type Subspecialist struct {
|
||||||
esb.Basic
|
esb.Basic
|
||||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
|
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||||
SubspecialistPositions []espb.Basic `json:"subspecialistPositions,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"`
|
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 {
|
type Basic struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
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"`
|
Code string `json:"code" gorm:"unique;size:10;not null"`
|
||||||
Name string `json:"name" gorm:"size:30;not null"`
|
Name string `json:"name" gorm:"size:30;not null"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
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"`
|
Code string `json:"code" validate:"maxLength=10;required"`
|
||||||
Name string `json:"name" validate:"maxLength=30;required"`
|
Name string `json:"name" validate:"maxLength=30;required"`
|
||||||
HeadStatus bool `json:"headStatus"`
|
HeadStatus bool `json:"headStatus"`
|
||||||
@@ -22,7 +22,7 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Unit_Id *uint16 `json:"unit-id"`
|
Unit_Code *string `json:"unit-code"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadStatus *bool `json:"head-status"`
|
HeadStatus *bool `json:"head-status"`
|
||||||
@@ -31,17 +31,18 @@ type FilterDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -52,7 +53,7 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Unit *eu.Unit `json:"unit,omitempty"`
|
Unit *eu.Unit `json:"unit,omitempty"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@@ -63,7 +64,7 @@ type ResponseDto struct {
|
|||||||
|
|
||||||
func (d UnitPosition) ToResponse() ResponseDto {
|
func (d UnitPosition) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Unit_Id: d.Unit_Id,
|
Unit_Code: d.Unit_Code,
|
||||||
Unit: d.Unit,
|
Unit: d.Unit,
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ import (
|
|||||||
|
|
||||||
type UnitPosition struct {
|
type UnitPosition struct {
|
||||||
eub.Basic
|
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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Installation_Id *uint16 `json:"installation_id"`
|
Installation_Code *string `json:"installation_code"`
|
||||||
Code string `json:"code" validate:"maxLength=10"`
|
Code string `json:"code" validate:"maxLength=10"`
|
||||||
Name string `json:"name" validate:"maxLength=50"`
|
Name string `json:"name" validate:"maxLength=50"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -20,26 +20,27 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Installation_Id *uint16 `json:"installation-id"`
|
Installation_Code *string `json:"installation-code"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadDetailDto struct {
|
type ReadDetailDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
Installation_Id *uint16 `json:"installation_id"`
|
Installation_Code *string `json:"installation_code"`
|
||||||
Code *string `json:"code"`
|
Code *string `json:"code"`
|
||||||
Includes string `json:"includes"`
|
Includes string `json:"includes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
CreateDto
|
CreateDto
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteDto struct {
|
type DeleteDto struct {
|
||||||
Id uint16 `json:"id"`
|
Id *uint16 `json:"id"`
|
||||||
|
Code *string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MetaDto struct {
|
type MetaDto struct {
|
||||||
@@ -50,19 +51,19 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.SmallMain
|
ecore.SmallMain
|
||||||
Installation_Id *uint16 `json:"installation_id"`
|
Installation_Code *string `json:"installation_code"`
|
||||||
Installation *ei.Installation `json:"installation,omitempty"`
|
Installation *ei.Installation `json:"installation,omitempty"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
UnitPositions []eipb.Basic `json:"unitPositions,omitempty"`
|
UnitPositions []eipb.Basic `json:"unitPositions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d Unit) ToResponse() ResponseDto {
|
func (d Unit) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Installation_Id: d.Installation_Id,
|
Installation_Code: d.Installation_Code,
|
||||||
Code: d.Code,
|
Code: d.Code,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
UnitPositions: d.UnitPositions,
|
UnitPositions: d.UnitPositions,
|
||||||
}
|
}
|
||||||
resp.SmallMain = d.SmallMain
|
resp.SmallMain = d.SmallMain
|
||||||
if d.Installation != nil {
|
if d.Installation != nil {
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Unit struct {
|
type Unit struct {
|
||||||
ecore.SmallMain // adjust this according to the needs
|
ecore.SmallMain // adjust this according to the needs
|
||||||
Installation_Id *uint16 `json:"installation_id"`
|
Installation_Code *string `json:"installation_code" gorm:"size:10"`
|
||||||
Installation *ei.Installation `json:"installation" gorm:"foreignKey:Installation_Id"`
|
Installation *ei.Installation `json:"installation" gorm:"foreignKey:Installation_Code;references:Code"`
|
||||||
Code string `json:"code" gorm:"unique;size:10"`
|
Code string `json:"code" gorm:"unique;size:10"`
|
||||||
Name string `json:"name" gorm:"size:50"`
|
Name string `json:"name" gorm:"size:50"`
|
||||||
Type_Code *ero.UnitTypeCode `json:"type_code"`
|
Type_Code *ero.UnitTypeCode `json:"type_code"`
|
||||||
UnitPositions []eub.Basic `json:"unitPositions,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
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"`
|
||||||
|
}
|
||||||
@@ -24,10 +24,10 @@ type CreateDto struct {
|
|||||||
Employee *EmployeUpdateDto `json:"employee"`
|
Employee *EmployeUpdateDto `json:"employee"`
|
||||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||||
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
|
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
|
||||||
Unit_Id *uint16 `json:"unit_id"`
|
Unit_Code *string `json:"unit_code"`
|
||||||
Infra_Id *uint16 `json:"infra_id"`
|
Infra_Code *string `json:"infra_code"`
|
||||||
Specialist_Id *uint16 `json:"specialist_id"`
|
Specialist_Code *string `json:"specialist_code"`
|
||||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||||
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20"`
|
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user