diff --git a/cmd/main-migration/migrations/20251209022744.sql b/cmd/main-migration/migrations/20251209022744.sql new file mode 100644 index 00000000..a8a18481 --- /dev/null +++ b/cmd/main-migration/migrations/20251209022744.sql @@ -0,0 +1,2 @@ +-- Modify "ChemoPlan" table +ALTER TABLE "public"."ChemoPlan" ADD COLUMN "Encounter_Id" bigint NULL, ADD CONSTRAINT "fk_ChemoPlan_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 09459c64..ccfdf7cb 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:BsDkwn1AzNdKnOPVb6PkonyiXM7nTdVcjRdw62i/NlQ= +h1:k6jcZ+rtVsLhO+oTPZVfHgwAInujs4C4iXNJlSwwkA8= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -147,4 +147,5 @@ h1:BsDkwn1AzNdKnOPVb6PkonyiXM7nTdVcjRdw62i/NlQ= 20251205073858.sql h1:Ep03jQ9hJAJILDJfKVcmi3Z6fqmTHSq9gKQtwf070PE= 20251205211957.sql h1:zRHcvLY+nfLdUyMcfpgI8vYQcPzJUWbfjkc4cK0QGHU= 20251205214433.sql h1:tgHB/fNy9XwAOWIqNI6GCqGXeJgSuZs2aHiCEj3BHZA= -20251205221124.sql h1:VthPlq3XcQOYz5VsFivb4Wof8jCAG36fAaerKmM4/OA= +20251205221124.sql h1:wl56/lrR14r7LrScEKwTQ3cNE45wh/0Ye3UEM7gfVNg= +20251209022744.sql h1:FayWjHhPEZEIq7KWIYaV/2/cmKB7A4PR3aspXXd6Brs= diff --git a/internal/domain/main-entities/chemo-plan/entity.go b/internal/domain/main-entities/chemo-plan/entity.go index 1f3f3ca5..2dc5a363 100644 --- a/internal/domain/main-entities/chemo-plan/entity.go +++ b/internal/domain/main-entities/chemo-plan/entity.go @@ -1,6 +1,7 @@ package chemo_plan import ( + ee "simrs-vx/internal/domain/main-entities/encounter" "time" ecore "simrs-vx/internal/domain/base-entities/core" @@ -18,4 +19,6 @@ type ChemoPlan struct { RealizationDate *time.Time `json:"realizationDate"` Notes *string `json:"notes"` Status ere.StatusProtocolChemo `json:"status"` + Encounter_Id *uint `json:"encounter_id"` + Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"` }