From b42dca81a5e90b8b8a589df23e1a8d2fba47bb9c Mon Sep 17 00:00:00 2001 From: vanilia Date: Wed, 15 Oct 2025 11:57:12 +0700 Subject: [PATCH 1/2] add column in chemo table --- cmd/main-migration/migrations/20251015045455.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 7 ++++--- internal/domain/main-entities/chemo/entity.go | 2 ++ internal/domain/references/encounter/encounter.go | 4 ++++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 cmd/main-migration/migrations/20251015045455.sql diff --git a/cmd/main-migration/migrations/20251015045455.sql b/cmd/main-migration/migrations/20251015045455.sql new file mode 100644 index 00000000..f2b6be7a --- /dev/null +++ b/cmd/main-migration/migrations/20251015045455.sql @@ -0,0 +1,2 @@ +-- Modify "Chemo" table +ALTER TABLE "public"."Chemo" ADD COLUMN "ClassCode" text NULL; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 77b5524c..e3172704 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:u4hCgNdaO4s4HQqAyPwS2ejbRhJtLvpU/wUJGtGrxsI= +h1:Y15nC3Bp3DWNym7hAvXkF9zFwkHh8nQDpxcNrxQgYhE= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -41,5 +41,6 @@ h1:u4hCgNdaO4s4HQqAyPwS2ejbRhJtLvpU/wUJGtGrxsI= 20251013051438.sql h1:lfSuw5mgJnePBJamvhZ81osFIouXeiIEiSZ/evdwo48= 20251013081808.sql h1:ijgjNX08G6GBjA/ks8EKtb7P7Y7Cg7zbhqEOruGnv6M= 20251014060047.sql h1:0jqj49WTtneEIMQDBoo4c095ZGi8sCrA8NnHBrPU6D8= -20251014063537.sql h1:H9ZLr86pgDcDpRJmTwy8TIOVot9QcN7+i3HwT4Vmi5s= -20251014063720.sql h1:eiHNzJIdBpuazPI5MAgtc3yI83u4SvYyr7dJd3Ptxdo= +20251014063537.sql h1:VZLXol0PTsTW21Epg6vBPsztWkDtcxup9F/z88EGgIg= +20251014063720.sql h1:2HVUyCV0ud3BJJDH2GEKZN/+IWLFPCsN1KqhP6csO14= +20251015045455.sql h1:v120CzYYiFWmW81VmKWsjmjRiBIv5aFnPZXwQaQxqes= diff --git a/internal/domain/main-entities/chemo/entity.go b/internal/domain/main-entities/chemo/entity.go index 2ba83990..f838c27d 100644 --- a/internal/domain/main-entities/chemo/entity.go +++ b/internal/domain/main-entities/chemo/entity.go @@ -9,6 +9,7 @@ import ( eus "simrs-vx/internal/domain/main-entities/user" erc "simrs-vx/internal/domain/references/common" + ere "simrs-vx/internal/domain/references/encounter" ) type Chemo struct { @@ -21,4 +22,5 @@ type Chemo struct { VerifiedBy *eus.User `json:"verifiedBy,omitempty" gorm:"foreignKey:VerifiedBy_User_Id;references:Id"` SrcUnit_Id *uint `json:"src_unit_id"` SrcUnit *eun.Unit `json:"src_unit,omitempty" gorm:"foreignKey:SrcUnit_Id;references:Id"` + ClassCode ere.ChemoClassCode `json:"class_code"` } diff --git a/internal/domain/references/encounter/encounter.go b/internal/domain/references/encounter/encounter.go index 7e6bcf8c..93c49a33 100644 --- a/internal/domain/references/encounter/encounter.go +++ b/internal/domain/references/encounter/encounter.go @@ -12,6 +12,7 @@ type ( AmbulatoryClassCode string InpatientClassCode string UploadCode string + ChemoClassCode string ) const ( @@ -78,6 +79,9 @@ const ( UCPP UploadCode = "person-passport" // Person Passport UCPFC UploadCode = "person-family-card" // Person Family Card UCMIR UploadCode = "mcu-item-result" // Mcu Item Result + + CCCAdm ChemoClassCode = "adm" // Administrasi + CCCAct ChemoClassCode = "act" // Tindakan ) func (ec EncounterClassCode) Code() string { From 0b864d8cd71c2a22f586c93860ce2c7c8bc46eb7 Mon Sep 17 00:00:00 2001 From: vanilia Date: Wed, 15 Oct 2025 12:11:11 +0700 Subject: [PATCH 2/2] resolve typo name class code --- internal/domain/main-entities/chemo/entity.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/domain/main-entities/chemo/entity.go b/internal/domain/main-entities/chemo/entity.go index f838c27d..4052ea72 100644 --- a/internal/domain/main-entities/chemo/entity.go +++ b/internal/domain/main-entities/chemo/entity.go @@ -22,5 +22,5 @@ type Chemo struct { VerifiedBy *eus.User `json:"verifiedBy,omitempty" gorm:"foreignKey:VerifiedBy_User_Id;references:Id"` SrcUnit_Id *uint `json:"src_unit_id"` SrcUnit *eun.Unit `json:"src_unit,omitempty" gorm:"foreignKey:SrcUnit_Id;references:Id"` - ClassCode ere.ChemoClassCode `json:"class_code"` + Class_Code ere.ChemoClassCode `json:"class_code"` }