From 6dd7b18de668c79f682fca2f7bb966734ce6b430 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Mon, 8 Sep 2025 14:40:03 +0700 Subject: [PATCH] rename column dischargemethod --- cmd/migration/migrations/20250908073811.sql | 2 ++ cmd/migration/migrations/20250908073839.sql | 2 ++ cmd/migration/migrations/atlas.sum | 12 +++++++----- internal/domain/main-entities/encounter/dto.go | 4 ++-- internal/domain/main-entities/encounter/entity.go | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 cmd/migration/migrations/20250908073811.sql create mode 100644 cmd/migration/migrations/20250908073839.sql diff --git a/cmd/migration/migrations/20250908073811.sql b/cmd/migration/migrations/20250908073811.sql new file mode 100644 index 00000000..ead1e965 --- /dev/null +++ b/cmd/migration/migrations/20250908073811.sql @@ -0,0 +1,2 @@ +-- Modify "Encounter" table +ALTER TABLE "public"."Encounter" ADD COLUMN "DischargeMethod_Code" character varying(10) NULL; diff --git a/cmd/migration/migrations/20250908073839.sql b/cmd/migration/migrations/20250908073839.sql new file mode 100644 index 00000000..43710589 --- /dev/null +++ b/cmd/migration/migrations/20250908073839.sql @@ -0,0 +1,2 @@ +-- Modify "Encounter" table +ALTER TABLE "public"."Encounter" DROP COLUMN "DischardeMethod_Code"; diff --git a/cmd/migration/migrations/atlas.sum b/cmd/migration/migrations/atlas.sum index 91349cd8..a10148d8 100644 --- a/cmd/migration/migrations/atlas.sum +++ b/cmd/migration/migrations/atlas.sum @@ -1,5 +1,7 @@ -h1:qEdw2cOowYcLvkC4fcOTQr2KqQIaZa6YYIgj2CgYbkM= -20250904105930.sql h1:Vv4vCurl7m7/ZB6TjRpkubHpQ4RYwSUn0QHdzfoGpzY= -20250904141448.sql h1:FYCHH9Os4KkrZMDu/jR8FMP+wLMRW+Mb0PkLU/9BRDg= -20250908062237.sql h1:oanBpKZd+akPu2I/xYhUSbd0G5tAFbXzKLER/Zs8ENI= -20250908062323.sql h1:miNG9COddXkD1jGTgaROMAZ618eT6oiLGiJhXWnQwhE= +h1:RfbV0C/2ANkgOZBCktEsNtRWKc2wWB6mQfjC2ftWhgc= +20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= +20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= +20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= +20250908062323.sql h1:oXl6Z143tOpIl4EfP4B8JNU8LrMvVmHEtCgAfiB4gs8= +20250908073811.sql h1:UVLw6aJd4hnR1XRab6qew57gj2bqzwyCBP/fDRXbncc= +20250908073839.sql h1:2hBQEuCbIUHi4ybSefQG2ODbROOrlNDz1JwR0ElfFTU= diff --git a/internal/domain/main-entities/encounter/dto.go b/internal/domain/main-entities/encounter/dto.go index fa359ee1..fdbf9ceb 100644 --- a/internal/domain/main-entities/encounter/dto.go +++ b/internal/domain/main-entities/encounter/dto.go @@ -98,7 +98,7 @@ type ResponseDto struct { Appointment_Doctor *ed.Doctor `json:"assignment_doctor,omitempty"` Responsible_Doctor_Id *uint `json:"responsible_doctor_id"` Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty"` - DischardeMethod_Code *ere.DischargeMethodCode `json:"dischardeMethod_code"` + DischargeMethod_Code *ere.DischargeMethodCode `json:"dischargeMethod_code"` RefSource_Name *string `json:"refSource_name"` Appointment_Id *uint `json:"appointment_id"` Appointment *ea.Appointment `json:"appointment,omitempty"` @@ -125,7 +125,7 @@ func (d Encounter) ToResponse() ResponseDto { Appointment_Doctor: d.Appointment_Doctor, Responsible_Doctor_Id: d.Responsible_Doctor_Id, Responsible_Doctor: d.Responsible_Doctor, - DischardeMethod_Code: d.DischardeMethod_Code, + DischargeMethod_Code: d.DischargeMethod_Code, RefSource_Name: d.RefSource_Name, Appointment_Id: d.Appointment_Id, Appointment: d.Appointment, diff --git a/internal/domain/main-entities/encounter/entity.go b/internal/domain/main-entities/encounter/entity.go index 3a6ce0e3..0fde85e3 100644 --- a/internal/domain/main-entities/encounter/entity.go +++ b/internal/domain/main-entities/encounter/entity.go @@ -29,7 +29,7 @@ type Encounter struct { Appointment_Doctor *ed.Doctor `json:"appointment_doctor,omitempty" gorm:"foreignKey:Appointment_Doctor_Id;references:Id"` Responsible_Doctor_Id *uint `json:"responsible_doctor_id"` Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty" gorm:"foreignKey:Responsible_Doctor_Id;references:Id"` - DischardeMethod_Code *ere.DischargeMethodCode `json:"dischardeMethod_code" gorm:"size:10"` + DischargeMethod_Code *ere.DischargeMethodCode `json:"dischargeMethod_code" gorm:"size:10"` RefSource_Name *string `json:"refSource_name" gorm:"size:100"` Appointment_Id *uint `json:"appointment_id"` Appointment *ea.Appointment `json:"appointment,omitempty" gorm:"foreignKey:Appointment_Id;references:Id"`