add chemoplans entity in chemo protocol
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "ChemoPlan" table
|
||||||
|
ALTER TABLE "public"."ChemoPlan" DROP CONSTRAINT "fk_ChemoPlan_Protocol", ADD CONSTRAINT "fk_ChemoProtocol_ChemoPlans" FOREIGN KEY ("Protocol_Id") REFERENCES "public"."ChemoProtocol" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
h1:2pGamYMy0LEZE7Du/0SEb8z5LrkmpNk199Yw0CJri+M=
|
h1:JgjOL5Bl+2zIlc2E1Lz/LhEJo/IGWouNe79ccswAcq8=
|
||||||
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=
|
||||||
@@ -144,4 +144,5 @@ h1:2pGamYMy0LEZE7Du/0SEb8z5LrkmpNk199Yw0CJri+M=
|
|||||||
20251202160848.sql h1:Kd2/TziKSMezrt4XgbjQcYvY/Lo9rX0qw7/Lz0/oyKk=
|
20251202160848.sql h1:Kd2/TziKSMezrt4XgbjQcYvY/Lo9rX0qw7/Lz0/oyKk=
|
||||||
20251202180207.sql h1:IHmSMIO3ia+YV5GULixbdlV1joaUAWtnjQHPd8+HKiM=
|
20251202180207.sql h1:IHmSMIO3ia+YV5GULixbdlV1joaUAWtnjQHPd8+HKiM=
|
||||||
20251202231005.sql h1:lua0KKoeBptSfs/6ehZE6Azo6YUlNkOJwGFyb1HQWkY=
|
20251202231005.sql h1:lua0KKoeBptSfs/6ehZE6Azo6YUlNkOJwGFyb1HQWkY=
|
||||||
20251205073858.sql h1:GD692c2jC2mFr6esv3eQmxEpWOeIA860TGctwHAldfM=
|
20251205073858.sql h1:Ep03jQ9hJAJILDJfKVcmi3Z6fqmTHSq9gKQtwf070PE=
|
||||||
|
20251205211957.sql h1:RGkuUdSgt8BtypqGpji9VBBi1r85e2ez1aJILTB7zi0=
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
package chemo_plan
|
package chemo_plan
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ecp "simrs-vx/internal/domain/main-entities/chemo-protocol"
|
|
||||||
ere "simrs-vx/internal/domain/references/encounter"
|
|
||||||
// std
|
// std
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
ere "simrs-vx/internal/domain/references/encounter"
|
||||||
|
|
||||||
// internal - domain - main-entities
|
// internal - domain - main-entities
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Parent_Id *uint `json:"parent_id"`
|
Parent_Id *uint `json:"parent_id"`
|
||||||
Protocol_Id *uint `json:"protocol_id"`
|
|
||||||
SeriesNumber *uint16 `json:"seriesNumber"`
|
SeriesNumber *uint16 `json:"seriesNumber"`
|
||||||
CycleNumber *uint `json:"cycleNumber"`
|
CycleNumber *uint `json:"cycleNumber"`
|
||||||
PlanDate *time.Time `json:"planDate"`
|
PlanDate *time.Time `json:"planDate"`
|
||||||
@@ -56,7 +55,6 @@ type ResponseDto struct {
|
|||||||
ecore.Main
|
ecore.Main
|
||||||
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
||||||
Protocol_Id *uint `json:"protocol_id"`
|
Protocol_Id *uint `json:"protocol_id"`
|
||||||
Protocol ecp.ChemoProtocol `json:"protocol,omitempty"`
|
|
||||||
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
||||||
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
||||||
PlanDate *time.Time `json:"planDate"`
|
PlanDate *time.Time `json:"planDate"`
|
||||||
@@ -68,8 +66,6 @@ type ResponseDto struct {
|
|||||||
func (d ChemoPlan) ToResponse() ResponseDto {
|
func (d ChemoPlan) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Parent_Id: d.Parent_Id,
|
Parent_Id: d.Parent_Id,
|
||||||
Protocol_Id: d.Protocol_Id,
|
|
||||||
Protocol: d.Protocol,
|
|
||||||
SeriesNumber: d.SeriesNumber,
|
SeriesNumber: d.SeriesNumber,
|
||||||
CycleNumber: d.CycleNumber,
|
CycleNumber: d.CycleNumber,
|
||||||
PlanDate: d.PlanDate,
|
PlanDate: d.PlanDate,
|
||||||
|
|||||||
@@ -6,15 +6,12 @@ import (
|
|||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||||
|
|
||||||
ere "simrs-vx/internal/domain/references/encounter"
|
ere "simrs-vx/internal/domain/references/encounter"
|
||||||
|
|
||||||
ecp "simrs-vx/internal/domain/main-entities/chemo-protocol"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChemoPlan struct {
|
type ChemoPlan struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
||||||
Protocol_Id *uint `json:"protocol_id"`
|
Protocol_Id *uint `json:"protocol_id"`
|
||||||
Protocol ecp.ChemoProtocol `json:"protocol,omitempty" gorm:"foreignKey:Protocol_Id;references:Id"`
|
|
||||||
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
||||||
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
||||||
PlanDate *time.Time `json:"planDate"`
|
PlanDate *time.Time `json:"planDate"`
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
erc "simrs-vx/internal/domain/references/common"
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
|
|
||||||
ec "simrs-vx/internal/domain/main-entities/chemo"
|
ec "simrs-vx/internal/domain/main-entities/chemo"
|
||||||
|
ecp "simrs-vx/internal/domain/main-entities/chemo-plan"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChemoProtocol struct {
|
type ChemoProtocol struct {
|
||||||
@@ -24,4 +25,5 @@ type ChemoProtocol struct {
|
|||||||
StartDate *time.Time `json:"startDate"`
|
StartDate *time.Time `json:"startDate"`
|
||||||
EndDate *time.Time `json:"endDate"`
|
EndDate *time.Time `json:"endDate"`
|
||||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||||
|
ChemoPlans *[]ecp.ChemoPlan `json:"chemoPlans,omitempty" gorm:"foreignKey:Protocol_Id;references:Id"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user