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

This commit is contained in:
vanilia
2025-11-04 15:45:38 +07:00
7 changed files with 52 additions and 5 deletions
@@ -0,0 +1,2 @@
-- Modify "ControlLetter" table
ALTER TABLE "public"."ControlLetter" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_ControlLetter_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -0,0 +1,17 @@
-- Create "ChemoProtocol" table
CREATE TABLE "public"."ChemoProtocol" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Patient_Weight" numeric NULL,
"Patient_Height" numeric NULL,
"Diagnoses" text NULL,
"Duration" bigint NULL,
"DurationUnit_Code" character varying(10) NULL,
"StartDate" timestamptz NULL,
"EndDate" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ChemoProtocol_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
+5 -3
View File
@@ -1,4 +1,4 @@
h1:DapfqgPn4h3ozXgxIdxW/bzPLHdc//0uHjK+W42/jic=
h1:drtrRtMhlNYK0c9wV3CUkJvXwWgrD8xGPPJy9wlcvNA=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -65,5 +65,7 @@ h1:DapfqgPn4h3ozXgxIdxW/bzPLHdc//0uHjK+W42/jic=
20251102002037.sql h1:lFJbuoZ2LMQnUNGdcwHVY3Xlfslgzu9t2WByT8yfOZI=
20251102091932.sql h1:rmdhb5m+P+fU8jROBZNyeYgZKuQvucsuljXv4ZVzvks=
20251103081637.sql h1:tf3BcwTeIw+oxMEisKDDfyKnBfalTLs8b0PJA8JWYxY=
20251104042334.sql h1:a76eSmiEVviWWjsfAkiriDxRYGhlg8qIjZ2CVQZDnbA=
20251104043530.sql h1:tGP1AhyYzPZAA05IwfJfWWhNISrud3xCmeRFdZ/28SQ=
20251104042334.sql h1:7PDMWOhmJywolAPKFZ14XaDBeMvcxShaXFN2IemNtzk=
20251104043530.sql h1:qvYVp3ysPf27f1BcoRNCFGovxuVE12lg9d6Xzda6zWU=
20251104080952.sql h1:avghpv1n3yaCDR/TA0X+hgxDGoLBQGu/GJUwj4VT/Ic=
20251104084135.sql h1:Y4coFrHgDXd/DM8ihEy+qMkOSrO8M4SI4shRCJIiBBA=
@@ -0,0 +1,21 @@
package chemo_protocol
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/encounter"
"simrs-vx/internal/domain/references/common"
"time"
)
type ChemoProtocol struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Duration *uint `json:"duration"`
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_code" gorm:"size:10"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
}
@@ -4,6 +4,7 @@ import (
"time"
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
es "simrs-vx/internal/domain/main-entities/specialist"
ess "simrs-vx/internal/domain/main-entities/subspecialist"
@@ -20,5 +21,7 @@ type ControlLetter struct {
Specialist *es.Specialist `json:"specialist" gorm:"foreignKey:Specialist_Id;references:Id"`
Subspecialist_Id *uint `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist" gorm:"foreignKey:Subspecialist_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor" gorm:"foreignKey:Doctor_Id;references:Id"`
Date *time.Time `json:"date"`
}
@@ -25,7 +25,7 @@ type TherapyProtocol struct {
Evaluation *string `json:"evaluation" gorm:"size:2048"`
WorkCauseStatus *string `json:"workCauseStatus" gorm:"size:2048"`
Frequency *uint `json:"frequency"`
IntervalUnit_Code *common.TimeUnitCode `json:"intervalUnit_Code" gorm:"size:10"`
IntervalUnit_Code *common.TimeUnitCode `json:"intervalUnit_code" gorm:"size:10"`
Duration *uint `json:"duration"`
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_Code" gorm:"size:10"`
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_code" gorm:"size:10"`
}
@@ -7,6 +7,7 @@ import (
ambulatory "simrs-vx/internal/domain/main-entities/ambulatory"
appointment "simrs-vx/internal/domain/main-entities/appointment"
chemo "simrs-vx/internal/domain/main-entities/chemo"
chemoprotocol "simrs-vx/internal/domain/main-entities/chemo-protocol"
consultation "simrs-vx/internal/domain/main-entities/consultation"
controlletter "simrs-vx/internal/domain/main-entities/control-letter"
counter "simrs-vx/internal/domain/main-entities/counter"
@@ -197,5 +198,6 @@ func getMainEntities() []any {
&vclaimmember.VclaimMember{},
&controlletter.ControlLetter{},
&rehab.Rehab{},
&chemoprotocol.ChemoProtocol{},
}
}