diff --git a/cmd/main-migration/migrations/20251209051742.sql b/cmd/main-migration/migrations/20251209051742.sql new file mode 100644 index 00000000..3bfa7734 --- /dev/null +++ b/cmd/main-migration/migrations/20251209051742.sql @@ -0,0 +1,2 @@ +-- Modify "ChemoPlan" table +ALTER TABLE "public"."ChemoPlan" ADD COLUMN "Reasons" text NULL; diff --git a/cmd/main-migration/migrations/20251210145148.sql b/cmd/main-migration/migrations/20251210145148.sql new file mode 100644 index 00000000..6a37b2af --- /dev/null +++ b/cmd/main-migration/migrations/20251210145148.sql @@ -0,0 +1,2 @@ +-- Modify "User" table +ALTER TABLE "public"."User" ALTER COLUMN "Name" TYPE character varying(50); diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 9c137d56..ca21de20 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:B/ZKq0d90aqLf0EvQfND4cd8ZRHcmxfzKF2N1lpSeIs= +h1:nDEuOqs0hKLyxdzKDcaNhEkrmnmbm6o/jgoGigw47bo= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -156,6 +156,8 @@ h1:B/ZKq0d90aqLf0EvQfND4cd8ZRHcmxfzKF2N1lpSeIs= 20251209022744.sql h1:y5/PAiZH/fYCpDJpkQdNRJwWICHH2iNIwM1V+S1P6KA= 20251209025908.sql h1:p3kZA8kyEj+mQZSrdY3k2K1NojQzFJh/MlZJ0Oy6t/k= 20251209030538.sql h1:zltV6/Fu2zJW0/lVBl7MdnWuJcqNTUIRcqYYZ8Fi1wo= -20251209064304.sql h1:Mj6Zh+2b/4AkM1HjnJGjAs788kVN0UaL34jeaKQIjT0= -20251209070128.sql h1:ip4wNCIF/UFQlNo6KpFG87/XA08aG3/Rf5zpxz3xioY= -20251209084929.sql h1:Z5higP1Ecq5UPWhrWZ5UCrxddMNqiJi8PbCNvGBE48A= +20251209051742.sql h1:BBNSmWfkamWrcKdxWjPiBS9yJ8yyQQUQIj3kip53nuE= +20251209064304.sql h1:Xs73yQbuJvuQ0OnW1FAZpeytmUl/bGTlJFrwGOsTF4w= +20251209070128.sql h1:fPGE6xOV6uCiVOqnvwn2L/GsBbgp2wxgmZOhF3bSGGM= +20251209084929.sql h1:u4LPMvkGAH4RfGC2IlBTIm7T7paMHoBSvTQ0w5Br7d0= +20251210145148.sql h1:EWbK5f1QKyhaVsKZfJFunmQuw22Msl0Ox3KQ/uag2bw= diff --git a/cmd/simgos-sync-migration/migrations/20251209083238.sql b/cmd/simgos-sync-migration/migrations/20251209083238.sql new file mode 100644 index 00000000..9e3f07eb --- /dev/null +++ b/cmd/simgos-sync-migration/migrations/20251209083238.sql @@ -0,0 +1,72 @@ +-- Create "DoctorLink" table +CREATE TABLE "public"."DoctorLink" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Simx_Id" bigint NULL, + "Simgos_Id" bigint NULL, + PRIMARY KEY ("Id"), + CONSTRAINT "uni_DoctorLink_Simgos_Id" UNIQUE ("Simgos_Id"), + CONSTRAINT "uni_DoctorLink_Simx_Id" UNIQUE ("Simx_Id") +); +-- Create "DoctorSimgosLog" table +CREATE TABLE "public"."DoctorSimgosLog" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Value" text NULL, + "Date" timestamptz NULL, + "Status" text NULL, + "ErrMessage" text NULL, + PRIMARY KEY ("Id") +); +-- Create "DoctorSimxLog" table +CREATE TABLE "public"."DoctorSimxLog" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Value" text NULL, + "Date" timestamptz NULL, + "Status" text NULL, + "ErrMessage" text NULL, + PRIMARY KEY ("Id") +); +-- Create "NurseLink" table +CREATE TABLE "public"."NurseLink" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Simx_Id" bigint NULL, + "Simgos_Id" bigint NULL, + PRIMARY KEY ("Id"), + CONSTRAINT "uni_NurseLink_Simgos_Id" UNIQUE ("Simgos_Id"), + CONSTRAINT "uni_NurseLink_Simx_Id" UNIQUE ("Simx_Id") +); +-- Create "NurseSimgosLog" table +CREATE TABLE "public"."NurseSimgosLog" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Value" text NULL, + "Date" timestamptz NULL, + "Status" text NULL, + "ErrMessage" text NULL, + PRIMARY KEY ("Id") +); +-- Create "NurseSimxLog" table +CREATE TABLE "public"."NurseSimxLog" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Value" text NULL, + "Date" timestamptz NULL, + "Status" text NULL, + "ErrMessage" text NULL, + PRIMARY KEY ("Id") +); diff --git a/cmd/simgos-sync-migration/migrations/atlas.sum b/cmd/simgos-sync-migration/migrations/atlas.sum index e82a5610..c06e3535 100644 --- a/cmd/simgos-sync-migration/migrations/atlas.sum +++ b/cmd/simgos-sync-migration/migrations/atlas.sum @@ -1,8 +1,9 @@ -h1:6YZBXq/r79I5tuYyY1+CBzhZsSeukHSs8MyHCC5QuV4= +h1:D3uD6s7yxMG7Roi9DCeYuLeRazZmQnd3rHMmUWf6YMM= 20251113035508.sql h1:rjDlu6yDdy5xv6nrCOr7NialrLSLT23pzduYNq29Hf0= 20251114071129.sql h1:Z0GQ5bJo3C+tplaWzxT8n3J9HLkEaVsRVp5nn7bmYow= 20251117041601.sql h1:l/RPG5mObqCSBjO4mzG+wTq2ieSycvlfOSz4czpUdWY= 20251118082246.sql h1:xLUwA+EvKWIg3X/TJvu7rqbtBzONiINfag5NJpMV29E= 20251118082915.sql h1:hP6FmUVFuADIN2cDg2Z1l7Wx7PQRb+IYQDvKD7J8VAM= 20251126115527.sql h1:Bvg+Y7k+h5s+/UaezUyJb7J7uzEJS7U5Z/RoCixcUtI= -20251201093443.sql h1:m18tksKG3OzbkxXkhfKUUqbkxnJ0VBPi3Cw34Tbywyc= +20251201093443.sql h1:dyiD1WzU9D6RjGhF0AtGfGLEsG6yocuk3HbcZWt9ZRQ= +20251209083238.sql h1:83pG5dPfMh8v0QognjeacK6s3fGxQ0nkijxtKL5y3Dc= diff --git a/internal/domain/main-entities/chemo-plan/dto.go b/internal/domain/main-entities/chemo-plan/dto.go index ffd9803f..b2c05a61 100644 --- a/internal/domain/main-entities/chemo-plan/dto.go +++ b/internal/domain/main-entities/chemo-plan/dto.go @@ -61,6 +61,7 @@ type ResponseDto struct { RealizationDate *time.Time `json:"realizationDate"` Notes *string `json:"notes"` Status ere.StatusProtocolChemo `json:"status"` + Reasons *string `json:"reasons"` } func (d ChemoPlan) ToResponse() ResponseDto { diff --git a/internal/domain/main-entities/chemo-plan/entity.go b/internal/domain/main-entities/chemo-plan/entity.go index 2dc5a363..1fef099e 100644 --- a/internal/domain/main-entities/chemo-plan/entity.go +++ b/internal/domain/main-entities/chemo-plan/entity.go @@ -21,4 +21,5 @@ type ChemoPlan struct { Status ere.StatusProtocolChemo `json:"status"` Encounter_Id *uint `json:"encounter_id"` Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"` + Reasons *string `json:"reasons"` // json } diff --git a/internal/domain/main-entities/user/entity.go b/internal/domain/main-entities/user/entity.go index f51dbf14..712a70e1 100644 --- a/internal/domain/main-entities/user/entity.go +++ b/internal/domain/main-entities/user/entity.go @@ -10,7 +10,7 @@ import ( type User struct { ecore.Main // adjust this according to the needs - Name string `json:"name" gorm:"unique;not null;size:25"` + Name string `json:"name" gorm:"unique;not null;size:50"` Password string `json:"password" gorm:"not null;size:255"` Status_Code erc.UserStatusCode `json:"status_code" gorm:"not null;size:10"` ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20"` diff --git a/internal/domain/simgos-entities/m-dokter/entity.go b/internal/domain/simgos-entities/m-dokter/entity.go new file mode 100644 index 00000000..47cbba6f --- /dev/null +++ b/internal/domain/simgos-entities/m-dokter/entity.go @@ -0,0 +1,24 @@ +package m_dokter + +import "time" + +type MDokter struct { + Kddokter uint `gorm:"column:kddokter;primaryKey;autoIncrement" json:"kddokter"` + Kdpoly uint `gorm:"column:kdpoly" json:"kdpoly"` + Namadokter string `gorm:"column:namadokter" json:"namadokter"` + Kdprofesi *uint `gorm:"column:kdprofesi" json:"kdprofesi"` + Namaprofesi *string `gorm:"column:namaprofesi" json:"namaprofesi"` + Aktif uint16 `gorm:"column:aktif" json:"aktif"` + KdSMF *string `gorm:"column:kdsmf" json:"kdsmf"` + KodeDPJP *string `gorm:"column:kode_dpjp" json:"kode_dpjp"` + NIP *string `gorm:"column:nip" json:"nip"` + Kategori *string `gorm:"column:kategori" json:"kategori"` + TglAkhirSIP *time.Time `gorm:"column:tgl_akhir_sip" json:"tgl_akhir_sip"` + NoHP *string `gorm:"column:no_hp" json:"no_hp"` + Email *string `gorm:"column:email" json:"email"` + TglAkhirSPK *time.Time `gorm:"column:tgl_akhir_spk" json:"tgl_akhir_spk"` +} + +func (MDokter) TableName() string { + return "m_dokter" +} diff --git a/internal/domain/simgos-entities/m_perawat/entity.go b/internal/domain/simgos-entities/m_perawat/entity.go new file mode 100644 index 00000000..c110ba11 --- /dev/null +++ b/internal/domain/simgos-entities/m_perawat/entity.go @@ -0,0 +1,52 @@ +package m_perawat + +import ( + "time" +) + +type MPerawat struct { + Idperawat *uint `json:"idperawat" gorm:"column:idperawat;primaryKey"` + NIP string `json:"nip" gorm:"column:nip"` + UnitKerja *uint `json:"unit_kerja" gorm:"column:unit_kerja"` + Ruang *string `json:"ruang" gorm:"column:ruang"` + Nama string `json:"nama" gorm:"column:nama"` + Tempat *string `json:"tempat" gorm:"column:tempat"` + TglLahir *time.Time `json:"tgllahir" gorm:"column:tgllahir"` + JenisKelamin *string `json:"jeniskelamin" gorm:"column:jeniskelamin"` + Alamat *string `json:"alamat" gorm:"column:alamat"` + Kelurahan *string `json:"kelurahan" gorm:"column:kelurahan"` + Kdkecamatan *uint `json:"kdkecamatan" gorm:"column:kdkecamatan"` + Kota *string `json:"kota" gorm:"column:kota"` + KdProvinsi *uint `json:"kdprovinsi" gorm:"column:kdprovinsi"` + NoTelp *string `json:"notelp" gorm:"column:notelp"` + NoKTP *string `json:"noktp" gorm:"column:noktp"` + Status *uint `json:"status" gorm:"column:status"` + Agama *uint `json:"agama" gorm:"column:agama"` + Pendidikan *uint `json:"pendidikan" gorm:"column:pendidikan"` + AlamatKTP *string `json:"alamat_ktp" gorm:"column:alamat_ktp"` + JabFung *string `json:"jabfung" gorm:"column:jabfung"` + JabStruk *string `json:"jabstruk" gorm:"column:jabstruk"` + LamKer *string `json:"lamker" gorm:"column:lamker"` + TemKer *string `json:"temker" gorm:"column:temker"` + TemKer2 *string `json:"temker2" gorm:"column:temker2"` + PelManKep *string `json:"pelmankep" gorm:"column:pelmankep"` + PelTekKepGaw *string `json:"peltekkepgaw" gorm:"column:peltekkepgaw"` + PelTekKepMedah *string `json:"peltekkepmedah" gorm:"column:peltekkepmedah"` + PelTekKepNak *string `json:"peltekkepnak" gorm:"column:peltekkepnak"` + PelTekKepMat *string `json:"peltekkepmat" gorm:"column:peltekkepmat"` + PelTekKepJiwa *string `json:"peltekkepjiwa" gorm:"column:peltekkepjiwa"` + TemKerTuj *string `json:"temkertuj" gorm:"column:temkertuj"` + TemKerTuj2 *string `json:"temkertuj2" gorm:"column:temkertuj2"` + TglMutasi *time.Time `json:"tglmutasi" gorm:"column:tglmutasi"` + Alasan *string `json:"alasan" gorm:"column:alasan"` + TglKeluar *time.Time `json:"tglkeluar" gorm:"column:tglkeluar"` + ProgPendidikan *uint `json:"progpendidikan" gorm:"column:progpendidikan"` + ProgPeng *string `json:"progpeng" gorm:"column:progpeng"` + JabLain *string `json:"jablain" gorm:"column:jablain"` + PPA uint `json:"ppa" gorm:"column:ppa"` + Aktif uint `json:"aktif" gorm:"column:aktif"` +} + +func (MPerawat) TableName() string { + return "m_perawat" +} diff --git a/internal/domain/sync-entities/doctor/entity.go b/internal/domain/sync-entities/doctor/entity.go new file mode 100644 index 00000000..6a112a01 --- /dev/null +++ b/internal/domain/sync-entities/doctor/entity.go @@ -0,0 +1,29 @@ +package doctor + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + erc "simrs-vx/internal/domain/references/common" + "time" +) + +type DoctorLink struct { + ecore.Main + Simx_Id uint `json:"simx_id" gorm:"unique"` + Simgos_Id uint `json:"simgos_id" gorm:"unique"` +} + +type DoctorSimxLog struct { + ecore.Main + Value *string `json:"value"` + Date *time.Time `json:"date"` + Status erc.ProcessStatusCode `json:"status"` + ErrMessage *string `json:"errMessage"` +} + +type DoctorSimgosLog struct { + ecore.Main + Value *string `json:"value"` + Date *time.Time `json:"date"` + Status erc.ProcessStatusCode `json:"status"` + ErrMessage *string `json:"errMessage"` +} diff --git a/internal/domain/sync-entities/nurse/entity.go b/internal/domain/sync-entities/nurse/entity.go new file mode 100644 index 00000000..fdf78d38 --- /dev/null +++ b/internal/domain/sync-entities/nurse/entity.go @@ -0,0 +1,29 @@ +package nurse + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + erc "simrs-vx/internal/domain/references/common" + "time" +) + +type NurseLink struct { + ecore.Main + Simx_Id uint `json:"simx_id" gorm:"unique"` + Simgos_Id uint `json:"simgos_id" gorm:"unique"` +} + +type NurseSimxLog struct { + ecore.Main + Value *string `json:"value"` + Date *time.Time `json:"date"` + Status erc.ProcessStatusCode `json:"status"` + ErrMessage *string `json:"errMessage"` +} + +type NurseSimgosLog struct { + ecore.Main + Value *string `json:"value"` + Date *time.Time `json:"date"` + Status erc.ProcessStatusCode `json:"status"` + ErrMessage *string `json:"errMessage"` +} diff --git a/internal/interface/migration/simgossync-entities.go b/internal/interface/migration/simgossync-entities.go index 2c479521..0480a1e1 100644 --- a/internal/interface/migration/simgossync-entities.go +++ b/internal/interface/migration/simgossync-entities.go @@ -3,9 +3,11 @@ package migration import ( /************** Source ***************/ division "simrs-vx/internal/domain/sync-entities/division" + doctor "simrs-vx/internal/domain/sync-entities/doctor" encounter "simrs-vx/internal/domain/sync-entities/encounter" installation "simrs-vx/internal/domain/sync-entities/installation" internalreference "simrs-vx/internal/domain/sync-entities/internal-reference" + nurse "simrs-vx/internal/domain/sync-entities/nurse" patient "simrs-vx/internal/domain/sync-entities/patient" soapi "simrs-vx/internal/domain/sync-entities/soapi" specialist "simrs-vx/internal/domain/sync-entities/specialist" @@ -42,5 +44,11 @@ func getSyncEntities() []any { &soapi.SoapiLink{}, &soapi.SoapiSimxLog{}, &soapi.SoapiSimgosLog{}, + &doctor.DoctorLink{}, + &doctor.DoctorSimxLog{}, + &doctor.DoctorSimgosLog{}, + &nurse.NurseLink{}, + &nurse.NurseSimxLog{}, + &nurse.NurseSimgosLog{}, } }