add entity sync

This commit is contained in:
vanilia
2025-12-09 15:30:29 +07:00
parent 68b52e55e3
commit 591f6e6311
7 changed files with 217 additions and 2 deletions
@@ -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")
);
@@ -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=
@@ -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"
}
@@ -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"
}
@@ -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"`
}
@@ -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"`
}
@@ -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{},
}
}