adjustment ambulatory, emergency, inpatient entity
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- Modify "Emergency" table
|
||||
ALTER TABLE "public"."Emergency" DROP CONSTRAINT "fk_Emergency_Encounter", ADD CONSTRAINT "fk_Encounter_Emergency" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Modify "Inpatient" table
|
||||
ALTER TABLE "public"."Inpatient" DROP CONSTRAINT "fk_Inpatient_Encounter", ADD CONSTRAINT "fk_Encounter_Inpatient" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
@@ -1,4 +1,4 @@
|
||||
h1:eq9RCCa1ej2Ov+qYjL1Pb0AEE3q+W2sHsG2Gg+Qypeg=
|
||||
h1:fy7zM85i70X6PkLcypubf4GA17KSCQpjrSNRRLdWyjM=
|
||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||
@@ -64,4 +64,5 @@ h1:eq9RCCa1ej2Ov+qYjL1Pb0AEE3q+W2sHsG2Gg+Qypeg=
|
||||
20251027091406.sql h1:eCZGtUkxAzEAqpC9UsGpP8Df9mS0DEOqSl885LgqpvM=
|
||||
20251031082443.sql h1:ajvi2G8OGvcmB2pJ1SoX/09ALHLWKNh84RSonVhJqAc=
|
||||
20251031084657.sql h1:86mNMS/oMNhewetTvLMFvEz1J6AANePHkE0fOztqHTM=
|
||||
20251102115856.sql h1:KPtFqdVIsrJq07q/bmyoNMBiZMC5XsQgxi43XmQj1YI=
|
||||
20251102115856.sql h1:H1pqgG/uonIc8iHVZVBR2CLg/iRR4alsvC4Rty/GXH8=
|
||||
20251102141135.sql h1:icypnR4c5x7v6rKZNyhUREh3udLz5iX2yk7yEfRF7xM=
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Basic struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Class_Code ere.EmergencyClassCode `json:"class_code" gorm:"size:10"`
|
||||
}
|
||||
|
||||
func (Basic) TableName() string {
|
||||
return "Emergency"
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package emergency
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
@@ -44,12 +43,14 @@ type MetaDto struct {
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Class_Code ere.EmergencyClassCode `json:"class_code"`
|
||||
}
|
||||
|
||||
func (d Emergency) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{}
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Class_Code: d.Class_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package emergency
|
||||
|
||||
import (
|
||||
eeb "simrs-vx/internal/domain/main-entities/emergency/base"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Emergency struct {
|
||||
eeb.Basic
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Class_Code ere.EmergencyClassCode `json:"class_code" gorm:"size:10"`
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
ea "simrs-vx/internal/domain/main-entities/appointment"
|
||||
edc "simrs-vx/internal/domain/main-entities/death-cause"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
eem "simrs-vx/internal/domain/main-entities/emergency/base"
|
||||
eem "simrs-vx/internal/domain/main-entities/emergency"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
eip "simrs-vx/internal/domain/main-entities/inpatient/base"
|
||||
eip "simrs-vx/internal/domain/main-entities/inpatient"
|
||||
ei "simrs-vx/internal/domain/main-entities/insurance-company"
|
||||
eir "simrs-vx/internal/domain/main-entities/internal-reference"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
@@ -66,8 +66,8 @@ type Encounter struct {
|
||||
DeathCause *edc.DeathCause `json:"deathCause,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
NewStatus bool `json:"newStatus"`
|
||||
Ambulatory *eam.Ambulatory `json:"ambulatory,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Emergency *eem.Basic `json:"emergency,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Inpatient *eip.Basic `json:"inpatient,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Emergency *eem.Emergency `json:"emergency,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Inpatient *eip.Inpatient `json:"inpatient,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Rehab *er.Basic `json:"rehab,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Basic struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Class_Code ere.InpatientClassCode `json:"class_code" gorm:"size:10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
}
|
||||
|
||||
func (Basic) TableName() string {
|
||||
return "Inpatient"
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package inpatient
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
@@ -48,7 +47,6 @@ type MetaDto struct {
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Class_Code ere.InpatientClassCode `json:"class_code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
@@ -57,7 +55,6 @@ type ResponseDto struct {
|
||||
func (d Inpatient) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Class_Code: d.Class_Code,
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra: d.Infra,
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package inpatient
|
||||
|
||||
import (
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eb "simrs-vx/internal/domain/main-entities/inpatient/base"
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Inpatient struct {
|
||||
eb.Basic
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Class_Code ere.InpatientClassCode `json:"class_code" gorm:"size:10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user