add entity for vehicle, vehicle-hist, ambulancetransportreq
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
-- Create "AmbulanceTransportReq" table
|
||||
CREATE TABLE "public"."AmbulanceTransportReq" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Patient_Id" bigint NULL,
|
||||
"Diagnoses" character varying(1024) NULL,
|
||||
"RequestData" timestamptz NULL,
|
||||
"UsageDate" timestamptz NULL,
|
||||
"Address" character varying(100) NULL,
|
||||
"RtRw" character varying(10) NULL,
|
||||
"Province_Code" character varying(2) NULL,
|
||||
"Regency_Code" character varying(4) NULL,
|
||||
"District_Code" character varying(6) NULL,
|
||||
"Village_Code" character varying(10) NULL,
|
||||
"Facility_Code" character varying(10) NULL,
|
||||
"Needs_Code" character varying(10) NULL,
|
||||
"Contact_Name" character varying(100) NULL,
|
||||
"Contact_Relationship_Code" character varying(10) NULL,
|
||||
"Contact_PhoneNumber" character varying(20) NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "fk_AmbulanceTransportReq_District" FOREIGN KEY ("District_Code") REFERENCES "public"."District" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_AmbulanceTransportReq_Patient" FOREIGN KEY ("Patient_Id") REFERENCES "public"."Patient" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_AmbulanceTransportReq_Province" FOREIGN KEY ("Province_Code") REFERENCES "public"."Province" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_AmbulanceTransportReq_Regency" FOREIGN KEY ("Regency_Code") REFERENCES "public"."Regency" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_AmbulanceTransportReq_Village" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||
);
|
||||
-- Create "Vehicle" table
|
||||
CREATE TABLE "public"."Vehicle" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Type_Code" text NULL,
|
||||
"PoliceNumber" text NULL,
|
||||
"FrameNumber" text NULL,
|
||||
"RegNumber" text NULL,
|
||||
"AvailableStatus" boolean NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "VehicleHist" table
|
||||
CREATE TABLE "public"."VehicleHist" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Vehicle_Id" bigint NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Data" text NULL,
|
||||
"Crud_Code" text NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "fk_VehicleHist_Vehicle" FOREIGN KEY ("Vehicle_Id") REFERENCES "public"."Vehicle" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||
);
|
||||
@@ -1,4 +1,4 @@
|
||||
h1:qfP77w9XYWpAFDON1lo+vpqIYCSiPkVEyHXcYFC52Hk=
|
||||
h1:5BOKtrJDl7mHDO/coJzV0ot0hVU9OVg5eP5Wg+zsIGo=
|
||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||
@@ -44,5 +44,6 @@ h1:qfP77w9XYWpAFDON1lo+vpqIYCSiPkVEyHXcYFC52Hk=
|
||||
20251014063537.sql h1:VZLXol0PTsTW21Epg6vBPsztWkDtcxup9F/z88EGgIg=
|
||||
20251014063720.sql h1:2HVUyCV0ud3BJJDH2GEKZN/+IWLFPCsN1KqhP6csO14=
|
||||
20251015045455.sql h1:MeLWmMhAOAz8b15Dd7IAQnt6JxjSml02XCXK22C0Lpg=
|
||||
20251016010845.sql h1:MSUh26glEDyZ5BFiteYOm9mUCWw7aG9vv5TxYY+EidU=
|
||||
20251016011023.sql h1:8oUBzIpzAYTo03yex+wLKacv32YjXmn4MsXtBFiQtzY=
|
||||
20251016010845.sql h1:4BncQdDOasRZJkzVJrSJJA7091A9VPNVx/faUCUPhBM=
|
||||
20251016011023.sql h1:9JB9eFZKURK5RoCVDKR6glSvdJ8NTXrN7K/4q51zkz4=
|
||||
20251016062912.sql h1:v21euwdu/4JCN3E2LFO4Iav4d7FEiAVH0dyEltmIeMw=
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package ambulance_transport_req
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eds "simrs-vx/internal/domain/main-entities/district"
|
||||
ept "simrs-vx/internal/domain/main-entities/patient"
|
||||
epr "simrs-vx/internal/domain/main-entities/province"
|
||||
erg "simrs-vx/internal/domain/main-entities/regency"
|
||||
evl "simrs-vx/internal/domain/main-entities/village"
|
||||
"time"
|
||||
|
||||
eren "simrs-vx/internal/domain/references/encounter"
|
||||
erp "simrs-vx/internal/domain/references/person"
|
||||
)
|
||||
|
||||
type AmbulanceTransportReq struct {
|
||||
ecore.Main
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ept.Patient `json:"patient,omitempty" gorm:"foreignKey:Patient_Id;references:Id"`
|
||||
|
||||
Diagnoses *string `json:"diagnoses" gorm:"size:1024"`
|
||||
RequestData *time.Time `json:"requestData"`
|
||||
UsageDate *time.Time `json:"usageDate"`
|
||||
|
||||
Address *string `json:"address" gorm:"size:100"`
|
||||
RtRw *string `json:"rtRw" gorm:"size:10"`
|
||||
|
||||
Province_Code *string `json:"province_code" gorm:"size:2"`
|
||||
Province *epr.Province `json:"province,omitempty" gorm:"foreignKey:Province_Code;references:Code"`
|
||||
|
||||
Regency_Code *string `json:"regency_code" gorm:"size:4"`
|
||||
Regency *erg.Regency `json:"regency,omitempty" gorm:"foreignKey:Regency_Code;references:Code"`
|
||||
|
||||
District_Code *string `json:"district_code" gorm:"size:6"`
|
||||
District *eds.District `json:"district,omitempty" gorm:"foreignKey:District_Code;references:Code"`
|
||||
|
||||
Village_Code *string `json:"village_code" gorm:"size:10"`
|
||||
Village *evl.Village `json:"village,omitempty" gorm:"foreignKey:Village_Code;references:Code"`
|
||||
|
||||
Facility_Code *eren.AmbulanceFacilityCode `json:"facility_code" gorm:"size:10"`
|
||||
Needs_Code *eren.AmbulanceNeedsCode `json:"needs_code" gorm:"size:10"`
|
||||
Contact_Name *string `json:"contact_name" gorm:"size:100"`
|
||||
Contact_Relationship_Code *erp.RelationshipCode `json:"contact_relationship_code" gorm:"size:10"`
|
||||
Contact_PhoneNumber *string `json:"contact_phoneNumber" gorm:"size:20"`
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package vehicle_hist
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ev "simrs-vx/internal/domain/main-entities/vehicle"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type VehicleHist struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Vehicle_Id *uint `json:"vehicle_id"`
|
||||
Vehicle *ev.Vehicle `json:"vehicle,omitempty" gorm:"foreignKey:Vehicle_Id;references:Id"`
|
||||
Date *time.Time `json:"date"`
|
||||
Data *string `json:"data"`
|
||||
Crud_Code *erc.CrudCode `json:"crud_code"`
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package vehicle
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ercl "simrs-vx/internal/domain/references/clinical"
|
||||
)
|
||||
|
||||
type Vehicle struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Type_Code *ercl.VehicleTypeCode `json:"type_code"`
|
||||
PoliceNumber *string `json:"policeNumber"`
|
||||
FrameNumber *string `json:"frameNumber"`
|
||||
RegNumber *string `json:"regNumber"`
|
||||
AvailableStatus bool `json:"availableStatus"`
|
||||
}
|
||||
@@ -10,6 +10,8 @@ type (
|
||||
HeadToToeCode string
|
||||
McuUrgencyLevelCode string
|
||||
SoapiTypeCode string
|
||||
MedicalAction string
|
||||
VehicleTypeCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -101,6 +103,16 @@ const (
|
||||
STCEarlyRehab SoapiTypeCode = "early-rehab" // Kajian Awal Rehab Medik
|
||||
STCFunc SoapiTypeCode = "function" // Assessment Fungsi
|
||||
STCProgress SoapiTypeCode = "progress" // CPPT
|
||||
|
||||
MAChemo MedicalAction = "chemo"
|
||||
MAHemo MedicalAction = "hemo"
|
||||
MAThalasemia MedicalAction = "thalasemia"
|
||||
MAEchocardio MedicalAction = "echocardio"
|
||||
MASpirometry MedicalAction = "spirometry"
|
||||
|
||||
VTCAmbulance VehicleTypeCode = "ambulance" // Ambulans
|
||||
VTCTransport VehicleTypeCode = "transport" // Transport
|
||||
VTCHearse VehicleTypeCode = "hearse" // Jenazah
|
||||
)
|
||||
|
||||
type Soapi struct {
|
||||
|
||||
@@ -14,6 +14,7 @@ type (
|
||||
PaymentMethodCode string
|
||||
DataAvailabilityCode string
|
||||
DataVerifiedCode string
|
||||
CrudCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -91,6 +92,10 @@ const (
|
||||
PMCInsurance PaymentMethodCode = "insurance" // Asuransi
|
||||
PMCMembership PaymentMethodCode = "membership" // Member
|
||||
|
||||
CCCreate CrudCode = "c" // Create
|
||||
CCRead CrudCode = "r" // Read
|
||||
CCUpdate CrudCode = "u" // Update
|
||||
CCDelete CrudCode = "d" // Delete
|
||||
)
|
||||
|
||||
func GetDayCodes() map[DayCode]string {
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
package encounter
|
||||
|
||||
type (
|
||||
EncounterClassCode string
|
||||
QueueStatusCode string
|
||||
DischargeMethodCode string
|
||||
TransportationCode string
|
||||
PersonConditionCode string
|
||||
EmergencyClassCode string
|
||||
OutpatientClassCode string
|
||||
CheckupScopeCode string
|
||||
AmbulatoryClassCode string
|
||||
InpatientClassCode string
|
||||
UploadCode string
|
||||
ChemoClassCode string
|
||||
EncounterClassCode string
|
||||
QueueStatusCode string
|
||||
DischargeMethodCode string
|
||||
TransportationCode string
|
||||
PersonConditionCode string
|
||||
EmergencyClassCode string
|
||||
OutpatientClassCode string
|
||||
CheckupScopeCode string
|
||||
AmbulatoryClassCode string
|
||||
InpatientClassCode string
|
||||
UploadCode string
|
||||
ChemoClassCode string
|
||||
AmbulanceFacilityCode string
|
||||
AmbulanceNeedsCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -82,6 +84,12 @@ const (
|
||||
|
||||
CCCAdm ChemoClassCode = "adm" // Administrasi
|
||||
CCCAct ChemoClassCode = "act" // Tindakan
|
||||
|
||||
AFCStd AmbulanceFacilityCode = "std" // Standar
|
||||
AFCIcu AmbulanceFacilityCode = "icu" // ICU
|
||||
|
||||
ANCAssist AmbulanceNeedsCode = "assist" // Dengan Pendampingan
|
||||
ANCNonassist AmbulanceNeedsCode = "non-assist" // Tanpa Pendampingan
|
||||
)
|
||||
|
||||
func (ec EncounterClassCode) Code() string {
|
||||
|
||||
@@ -2,6 +2,7 @@ package migration
|
||||
|
||||
import (
|
||||
adime "simrs-vx/internal/domain/main-entities/adime"
|
||||
ambulancetransportreq "simrs-vx/internal/domain/main-entities/ambulance-transport-req"
|
||||
ambulatory "simrs-vx/internal/domain/main-entities/ambulatory"
|
||||
appointment "simrs-vx/internal/domain/main-entities/appointment"
|
||||
chemo "simrs-vx/internal/domain/main-entities/chemo"
|
||||
@@ -75,6 +76,8 @@ import (
|
||||
unit "simrs-vx/internal/domain/main-entities/unit"
|
||||
uom "simrs-vx/internal/domain/main-entities/uom"
|
||||
user "simrs-vx/internal/domain/main-entities/user"
|
||||
vehicle "simrs-vx/internal/domain/main-entities/vehicle"
|
||||
vehiclehist "simrs-vx/internal/domain/main-entities/vehicle-hist"
|
||||
village "simrs-vx/internal/domain/main-entities/village"
|
||||
|
||||
///BPJS
|
||||
@@ -163,5 +166,8 @@ func getMainEntities() []any {
|
||||
&internalreference.InternalReference{},
|
||||
&vclaimsephist.VclaimSepHist{},
|
||||
&vclaimsepprint.VclaimSepPrint{},
|
||||
&vehicle.Vehicle{},
|
||||
&vehiclehist.VehicleHist{},
|
||||
&ambulancetransportreq.AmbulanceTransportReq{},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user