adjust on several order tables

This commit is contained in:
dpurbosakti
2025-09-17 11:08:38 +07:00
parent e8ff57168c
commit 6b8f84efac
7 changed files with 30 additions and 10 deletions
@@ -0,0 +1,8 @@
-- Modify "MedicationItem" table
ALTER TABLE "public"."MedicationItem" ADD COLUMN "Quantity" numeric NULL;
-- Modify "MedicineMix" table
ALTER TABLE "public"."MedicineMix" ADD COLUMN "Note" text NULL;
-- Modify "Prescription" table
ALTER TABLE "public"."Prescription" ADD COLUMN "Status_Code" text NULL;
-- Modify "PrescriptionItem" table
ALTER TABLE "public"."PrescriptionItem" ADD COLUMN "Quantity" numeric NULL;
@@ -0,0 +1,2 @@
-- Modify "MedicationItem" table
ALTER TABLE "public"."MedicationItem" ADD COLUMN "Note" character varying(1024) NULL;
+4 -2
View File
@@ -1,4 +1,4 @@
h1:lwrJz1Vor7muHsLHihYT704fcsjyX/JmBfRLfg+4PjI=
h1:1QSYLfLrRojOO3SUOR0bOUsv7hWGJxR4mfzv6/P540k=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -7,4 +7,6 @@ h1:lwrJz1Vor7muHsLHihYT704fcsjyX/JmBfRLfg+4PjI=
20250908073839.sql h1:cPk54xjLdMs26uY8ZHjNWLuyfAMzV7Zb0/9oJQrsw04=
20250910055902.sql h1:5xwjAV6QbtZT9empTJKfhyAjdknbHzb15B0Ku5dzqtQ=
20250915123412.sql h1:D83xaU2YlDEd21HLup/YQpQ2easMToYCyy/oK6AFgQs=
20250916043819.sql h1:qcON0PZq3bYL0dWZdDMHEvK9C7oH4JIMh5Il+RWA3UY=
20250916043819.sql h1:ekoTJsBqQZ8G8n0qJ03d13+eoNoc7sAUEQGA5D/CCxk=
20250917040616.sql h1:QFuMvZUCmZPWsjHTdIFOT8P0fzCv3/xP0jGsfVms0aA=
20250917040751.sql h1:/0YgGP0VLK/WGTVi1KUuPQsx7i9O9Em8u/Ec1luYPDo=
@@ -22,4 +22,6 @@ type MedicationItem struct {
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
IsRedeemed bool `json:"isRedeemed"`
Quantity float64 `json:"quantity"`
Note *string `json:"note" gorm:"size:1024"`
}
@@ -5,6 +5,7 @@ import (
)
type MedicineMix struct {
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"size:50"`
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"size:50"`
Note *string `json:"note" gom:"size:1024"`
}
@@ -21,4 +21,5 @@ type PrescriptionItem struct {
Usage float64 `json:"usage"`
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
Quantity float64 `json:"quantity"`
}
@@ -4,14 +4,18 @@ import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
"time"
erc "simrs-vx/internal/domain/references/common"
)
type Prescription struct {
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
IssuedAt *time.Time `json:"issuedAt"`
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code *erc.DataStatusCode `json:"status_code"`
}