Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into feat/orders
This commit is contained in:
No files matched your search
@@ -0,0 +1,146 @@
|
|||||||
|
-- Create "DeviceOrder" table
|
||||||
|
CREATE TABLE "public"."DeviceOrder" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Encounter_Id" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_DeviceOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "DeviceOrderItem" table
|
||||||
|
CREATE TABLE "public"."DeviceOrderItem" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"DeviceOrder_Id" bigint NULL,
|
||||||
|
"Device_Id" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_DeviceOrderItem_Device" FOREIGN KEY ("Device_Id") REFERENCES "public"."Device" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_DeviceOrderItem_DeviceOrder" FOREIGN KEY ("DeviceOrder_Id") REFERENCES "public"."DeviceOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "MaterialOrder" table
|
||||||
|
CREATE TABLE "public"."MaterialOrder" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Encounter_Id" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_MaterialOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "MaterialOrderItem" table
|
||||||
|
CREATE TABLE "public"."MaterialOrderItem" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"MaterialOrder_Id" bigint NULL,
|
||||||
|
"Material_Id" bigint NULL,
|
||||||
|
"Count" integer NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_MaterialOrderItem_Material" FOREIGN KEY ("Material_Id") REFERENCES "public"."Material" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_MaterialOrderItem_MaterialOrder" FOREIGN KEY ("MaterialOrder_Id") REFERENCES "public"."MaterialOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "McuOrder" table
|
||||||
|
CREATE TABLE "public"."McuOrder" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Encounter_Id" bigint NULL,
|
||||||
|
"Status_Code" character varying(10) NOT NULL,
|
||||||
|
"Doctor_Id" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_McuOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_McuOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "McuOrderItem" table
|
||||||
|
CREATE TABLE "public"."McuOrderItem" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"McuOrder_Id" bigint NULL,
|
||||||
|
"McuSrc_Id" bigint NULL,
|
||||||
|
"Result" text NULL,
|
||||||
|
"Status_Code" text NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_McuOrderItem_McuOrder" FOREIGN KEY ("McuOrder_Id") REFERENCES "public"."McuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_McuOrderItem_McuSrc" FOREIGN KEY ("McuSrc_Id") REFERENCES "public"."McuSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "Medication" table
|
||||||
|
CREATE TABLE "public"."Medication" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Encounter_Id" bigint NULL,
|
||||||
|
"IssuedAt" timestamptz NULL,
|
||||||
|
"Pharmacist_Id" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_Medication_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_Medication_Pharmacist" FOREIGN KEY ("Pharmacist_Id") REFERENCES "public"."Pharmacist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "MedicationItem" table
|
||||||
|
CREATE TABLE "public"."MedicationItem" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Medication_Id" bigint NULL,
|
||||||
|
"IsMix" boolean NULL,
|
||||||
|
"Medicine_Id" bigint NULL,
|
||||||
|
"MedicineMix_Id" bigint NULL,
|
||||||
|
"Usage" smallint NULL,
|
||||||
|
"Interval" smallint NULL,
|
||||||
|
"IntervalUnit_Code" text NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_MedicationItem_Medication" FOREIGN KEY ("Medication_Id") REFERENCES "public"."Medication" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_MedicationItem_Medicine" FOREIGN KEY ("Medicine_Id") REFERENCES "public"."Medicine" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_MedicationItem_MedicineMix" FOREIGN KEY ("MedicineMix_Id") REFERENCES "public"."MedicineMix" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "MedicationItemDist" table
|
||||||
|
CREATE TABLE "public"."MedicationItemDist" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"MedicationItem_Id" bigint NULL,
|
||||||
|
"DateTime" timestamptz NULL,
|
||||||
|
"Remain" bigint NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_MedicationItemDist_MedicationItem" FOREIGN KEY ("MedicationItem_Id") REFERENCES "public"."MedicationItem" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "Prescription" table
|
||||||
|
CREATE TABLE "public"."Prescription" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Encounter_Id" bigint NULL,
|
||||||
|
"Doctor_Id" bigint NULL,
|
||||||
|
"IssuedAt" timestamptz NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_Prescription_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_Prescription_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
|
-- Create "PrescriptionItem" table
|
||||||
|
CREATE TABLE "public"."PrescriptionItem" (
|
||||||
|
"Id" bigserial NOT NULL,
|
||||||
|
"CreatedAt" timestamptz NULL,
|
||||||
|
"UpdatedAt" timestamptz NULL,
|
||||||
|
"DeletedAt" timestamptz NULL,
|
||||||
|
"Prescription_Id" bigint NULL,
|
||||||
|
"IsMix" boolean NULL,
|
||||||
|
"Medicine_Id" bigint NULL,
|
||||||
|
"MedicineMix_Id" bigint NULL,
|
||||||
|
"Usage" smallint NULL,
|
||||||
|
"Interval" smallint NULL,
|
||||||
|
"IntervalUnit_Code" text NULL,
|
||||||
|
PRIMARY KEY ("Id"),
|
||||||
|
CONSTRAINT "fk_PrescriptionItem_Medicine" FOREIGN KEY ("Medicine_Id") REFERENCES "public"."Medicine" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_PrescriptionItem_MedicineMix" FOREIGN KEY ("MedicineMix_Id") REFERENCES "public"."MedicineMix" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "fk_PrescriptionItem_Prescription" FOREIGN KEY ("Prescription_Id") REFERENCES "public"."Prescription" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
h1:BLtMDgAdnqZbCj3HUbiTlyYtA87C4LcP/uquCbM6GSE=
|
h1:vKW524Os6+DLuWTIk2ogb2LnlRoaYqgz1GLvvmc2KYA=
|
||||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||||
@@ -6,3 +6,4 @@ h1:BLtMDgAdnqZbCj3HUbiTlyYtA87C4LcP/uquCbM6GSE=
|
|||||||
20250908073811.sql h1:m2aNXfnGxnLq1+rVWrh4f60q7fhyhV3gEwNu/OIqQlE=
|
20250908073811.sql h1:m2aNXfnGxnLq1+rVWrh4f60q7fhyhV3gEwNu/OIqQlE=
|
||||||
20250908073839.sql h1:cPk54xjLdMs26uY8ZHjNWLuyfAMzV7Zb0/9oJQrsw04=
|
20250908073839.sql h1:cPk54xjLdMs26uY8ZHjNWLuyfAMzV7Zb0/9oJQrsw04=
|
||||||
20250910055902.sql h1:5xwjAV6QbtZT9empTJKfhyAjdknbHzb15B0Ku5dzqtQ=
|
20250910055902.sql h1:5xwjAV6QbtZT9empTJKfhyAjdknbHzb15B0Ku5dzqtQ=
|
||||||
|
20250915123412.sql h1:CndzsEFauRnieT/Qv/kqZ5Gr49g6f127Tq/fskHAPwg=
|
||||||
@@ -5,16 +5,17 @@ import (
|
|||||||
eme "simrs-vx/internal/domain/main-entities/medication"
|
eme "simrs-vx/internal/domain/main-entities/medication"
|
||||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||||
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Medication_Id *uint `json:"medication_id"`
|
Medication_Id *uint `json:"medication_id"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
// IntervalUnit_Code
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -24,13 +25,13 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Medication_Id *uint `json:"medication_id"`
|
Medication_Id *uint `json:"medication_id"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
// IntervalUnit_Code
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
|
|
||||||
Page int `json:"page"`
|
Page int `json:"page"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
@@ -57,29 +58,30 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Medication_Id *uint `json:"medication_id"`
|
Medication_Id *uint `json:"medication_id"`
|
||||||
Medication *eme.Medication `json:"medication,omitempty"`
|
Medication *eme.Medication `json:"medication,omitempty"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
// IntervalUnit_Code
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d MedicationItem) ToResponse() ResponseDto {
|
func (d MedicationItem) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Medication_Id: d.Medication_Id,
|
Medication_Id: d.Medication_Id,
|
||||||
Medication: d.Medication,
|
Medication: d.Medication,
|
||||||
IsMix: d.IsMix,
|
IsMix: d.IsMix,
|
||||||
Medicine_Id: d.Medicine_Id,
|
Medicine_Id: d.Medicine_Id,
|
||||||
Medicine: d.Medicine,
|
Medicine: d.Medicine,
|
||||||
MedicineMix_Id: d.MedicineMix_Id,
|
MedicineMix_Id: d.MedicineMix_Id,
|
||||||
MedicineMix: d.MedicineMix,
|
MedicineMix: d.MedicineMix,
|
||||||
Usage: d.Usage,
|
Usage: d.Usage,
|
||||||
Interval: d.Interval,
|
Interval: d.Interval,
|
||||||
|
IntervalUnit_Code: d.IntervalUnit_Code,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -5,18 +5,20 @@ import (
|
|||||||
eme "simrs-vx/internal/domain/main-entities/medication"
|
eme "simrs-vx/internal/domain/main-entities/medication"
|
||||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||||
|
|
||||||
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MedicationItem struct {
|
type MedicationItem struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
Medication_Id *uint `json:"medication_id"`
|
Medication_Id *uint `json:"medication_id"`
|
||||||
Medication *eme.Medication `json:"medication,omitempty" gorm:"foreignKey:Medication_Id;references:Id"`
|
Medication *eme.Medication `json:"medication,omitempty" gorm:"foreignKey:Medication_Id;references:Id"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
// IntervalUnit_Code
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
}
|
}
|
||||||
@@ -5,15 +5,17 @@ import (
|
|||||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||||
ep "simrs-vx/internal/domain/main-entities/prescription"
|
ep "simrs-vx/internal/domain/main-entities/prescription"
|
||||||
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Prescription_Id *uint `json:"prescription_id"`
|
Prescription_Id *uint `json:"prescription_id"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadListDto struct {
|
type ReadListDto struct {
|
||||||
@@ -23,12 +25,13 @@ type ReadListDto struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilterDto struct {
|
type FilterDto struct {
|
||||||
Prescription_Id *uint `json:"prescription_id"`
|
Prescription_Id *uint `json:"prescription_id"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
|
|
||||||
Page int `json:"page"`
|
Page int `json:"page"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
@@ -55,28 +58,30 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Prescription_Id *uint `json:"prescription_id"`
|
Prescription_Id *uint `json:"prescription_id"`
|
||||||
Prescription *ep.Prescription `json:"prescription,omitempty"`
|
Prescription *ep.Prescription `json:"prescription,omitempty"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d PrescriptionItem) ToResponse() ResponseDto {
|
func (d PrescriptionItem) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Prescription_Id: d.Prescription_Id,
|
Prescription_Id: d.Prescription_Id,
|
||||||
Prescription: d.Prescription,
|
Prescription: d.Prescription,
|
||||||
IsMix: d.IsMix,
|
IsMix: d.IsMix,
|
||||||
Medicine_Id: d.Medicine_Id,
|
Medicine_Id: d.Medicine_Id,
|
||||||
Medicine: d.Medicine,
|
Medicine: d.Medicine,
|
||||||
MedicineMix_Id: d.MedicineMix_Id,
|
MedicineMix_Id: d.MedicineMix_Id,
|
||||||
MedicineMix: d.MedicineMix,
|
MedicineMix: d.MedicineMix,
|
||||||
Usage: d.Usage,
|
Usage: d.Usage,
|
||||||
Interval: d.Interval,
|
Interval: d.Interval,
|
||||||
|
IntervalUnit_Code: d.IntervalUnit_Code,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -5,18 +5,20 @@ import (
|
|||||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||||
ep "simrs-vx/internal/domain/main-entities/prescription"
|
ep "simrs-vx/internal/domain/main-entities/prescription"
|
||||||
|
|
||||||
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PrescriptionItem struct {
|
type PrescriptionItem struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
Prescription_Id *uint `json:"prescription_id"`
|
Prescription_Id *uint `json:"prescription_id"`
|
||||||
Prescription *ep.Prescription `json:"prescription,omitempty" gorm:"foreignKey:Prescription_Id;references:Id"`
|
Prescription *ep.Prescription `json:"prescription,omitempty" gorm:"foreignKey:Prescription_Id;references:Id"`
|
||||||
IsMix bool `json:"isMix"`
|
IsMix bool `json:"isMix"`
|
||||||
Medicine_Id *uint `json:"medicine_id"`
|
Medicine_Id *uint `json:"medicine_id"`
|
||||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||||
Usage uint8 `json:"usage"`
|
Usage uint8 `json:"usage"`
|
||||||
Interval uint8 `json:"interval"`
|
Interval uint8 `json:"interval"`
|
||||||
// IntervalUnit_Code
|
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user