Merge pull request #215 from dikstub-rssa/feat/chemo-plan
Feat/chemo plan
This commit is contained in:
@@ -11,13 +11,14 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Parent_Id *uint `json:"parent_id"`
|
||||
SeriesNumber *uint16 `json:"seriesNumber"`
|
||||
CycleNumber *uint `json:"cycleNumber"`
|
||||
PlanDate *time.Time `json:"planDate"`
|
||||
RealizationDate *time.Time `json:"realizationDate"`
|
||||
Notes *string `json:"notes"`
|
||||
Status ere.StatusProtocolChemo `json:"status"`
|
||||
Parent_Id *uint `json:"parent_id"`
|
||||
SeriesNumber *uint16 `json:"seriesNumber"`
|
||||
CycleNumber *uint `json:"cycleNumber"`
|
||||
PlanDate *time.Time `json:"planDate"`
|
||||
RealizationDate *time.Time `json:"realizationDate"`
|
||||
Notes *string `json:"notes"`
|
||||
Status *ere.StatusProtocolChemo `json:"status"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -32,17 +33,27 @@ type FilterDto struct {
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type FailDto struct {
|
||||
Id uint `json:"id"`
|
||||
Reasons string `json:"reasons" validate:"required"`
|
||||
}
|
||||
type FailReason struct {
|
||||
Date *time.Time `json:"date"`
|
||||
FailReason string `json:"failReason"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -53,15 +64,15 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
||||
Protocol_Id *uint `json:"protocol_id"`
|
||||
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
||||
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
||||
PlanDate *time.Time `json:"planDate"`
|
||||
RealizationDate *time.Time `json:"realizationDate"`
|
||||
Notes *string `json:"notes"`
|
||||
Status ere.StatusProtocolChemo `json:"status"`
|
||||
Reasons *string `json:"reasons"`
|
||||
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
||||
Protocol_Id *uint `json:"protocol_id"`
|
||||
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
||||
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
||||
PlanDate *time.Time `json:"planDate"`
|
||||
RealizationDate *time.Time `json:"realizationDate"`
|
||||
Notes *string `json:"notes"`
|
||||
Status *ere.StatusProtocolChemo `json:"status"`
|
||||
Reasons *string `json:"reasons"`
|
||||
}
|
||||
|
||||
func (d ChemoPlan) ToResponse() ResponseDto {
|
||||
|
||||
@@ -11,15 +11,15 @@ import (
|
||||
|
||||
type ChemoPlan struct {
|
||||
ecore.Main
|
||||
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
||||
Protocol_Id *uint `json:"protocol_id"`
|
||||
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
||||
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
||||
PlanDate *time.Time `json:"planDate"`
|
||||
RealizationDate *time.Time `json:"realizationDate"`
|
||||
Notes *string `json:"notes"`
|
||||
Status ere.StatusProtocolChemo `json:"status"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Reasons *string `json:"reasons"` // json
|
||||
Parent_Id *uint `json:"parent_id"` // chemo.Id
|
||||
Protocol_Id *uint `json:"protocol_id"`
|
||||
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
|
||||
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
|
||||
PlanDate *time.Time `json:"planDate"`
|
||||
RealizationDate *time.Time `json:"realizationDate"`
|
||||
Notes *string `json:"notes"`
|
||||
Status *ere.StatusProtocolChemo `json:"status"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Reasons *string `json:"reasons"` // json
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package chemo_protocol
|
||||
|
||||
import (
|
||||
eus "simrs-vx/internal/domain/main-entities/user"
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
// std
|
||||
"time"
|
||||
|
||||
@@ -11,19 +13,25 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
|
||||
ec "simrs-vx/internal/domain/main-entities/chemo"
|
||||
ep "simrs-vx/internal/domain/main-entities/chemo-plan"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Chemo_Id *uint `json:"chemo_id"`
|
||||
Patient_Weight *float32 `json:"patient_weight"`
|
||||
Patient_Height *float32 `json:"patient_height"`
|
||||
Diagnoses *string `json:"diagnoses"`
|
||||
Interval *uint `json:"interval"`
|
||||
Cycle *uint `json:"cycle"`
|
||||
Series *uint16 `json:"series"`
|
||||
StartDate *time.Time `json:"startDate"`
|
||||
EndDate *time.Time `json:"endDate"`
|
||||
Status_Code erc.DataVerifiedCode `json:"-"`
|
||||
Encounter_Id *uint `json:"encounter_id" validate:"required"`
|
||||
Chemo_Id *uint `json:"chemo_id" validate:"required"`
|
||||
Patient_Weight *float32 `json:"patient_weight"`
|
||||
Patient_Height *float32 `json:"patient_height"`
|
||||
Diagnoses *string `json:"diagnoses" validate:"required"`
|
||||
Interval *uint `json:"interval" validate:"required"`
|
||||
Cycle *uint `json:"cycle" validate:"required"`
|
||||
Series *uint16 `json:"series" validate:"required"`
|
||||
StartDate *time.Time `json:"startDate"`
|
||||
EndDate *time.Time `json:"endDate"`
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
ChemoPlans *[]ep.CreateDto `json:"chemoPlans" validate:"required"`
|
||||
|
||||
Id *uint `json:"-"`
|
||||
Status_Code erc.DataVerifiedCode `json:"-"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -33,21 +41,29 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Chemo_Id *uint `json:"chemo-id"`
|
||||
Chemo_Id *uint `json:"chemo-id"`
|
||||
Patient_Id *uint `json:"patient-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type VerifyDto struct {
|
||||
Id uint `json:"id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"-"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -58,32 +74,42 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Chemo_Id *uint `json:"chemo_id"`
|
||||
Chemo *ec.Chemo `json:"chemo,omitempty"`
|
||||
Patient_Weight *float32 `json:"patient_weight"`
|
||||
Patient_Height *float32 `json:"patient_height"`
|
||||
Diagnoses *string `json:"diagnoses"`
|
||||
Interval *uint `json:"interval"`
|
||||
Cycle *uint `json:"cycle"`
|
||||
Series *uint16 `json:"series"`
|
||||
StartDate *time.Time `json:"startDate"`
|
||||
EndDate *time.Time `json:"endDate"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
Chemo_Id *uint `json:"chemo_id"`
|
||||
Chemo *ec.Chemo `json:"chemo,omitempty"`
|
||||
Patient_Weight *float32 `json:"patient_weight"`
|
||||
Patient_Height *float32 `json:"patient_height"`
|
||||
Diagnoses *string `json:"diagnoses"`
|
||||
Interval *uint `json:"interval"`
|
||||
Cycle *uint `json:"cycle"`
|
||||
Series *uint16 `json:"series"`
|
||||
StartDate *time.Time `json:"startDate"`
|
||||
EndDate *time.Time `json:"endDate"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
VerifiedAt *time.Time `json:"verifiedAt"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy_user_id"`
|
||||
VerifiedBy *eus.User `json:"verifiedBy,omitempty"`
|
||||
ChemoPlans *[]ep.ChemoPlan `json:"chemoPlans,omitempty"`
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
}
|
||||
|
||||
func (d ChemoProtocol) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Chemo_Id: d.Chemo_Id,
|
||||
Chemo: d.Chemo,
|
||||
Patient_Weight: d.Patient_Weight,
|
||||
Patient_Height: d.Patient_Height,
|
||||
Diagnoses: d.Diagnoses,
|
||||
Interval: d.Interval,
|
||||
Cycle: d.Cycle,
|
||||
Series: d.Series,
|
||||
StartDate: d.StartDate,
|
||||
EndDate: d.EndDate,
|
||||
Status_Code: d.Status_Code,
|
||||
Chemo_Id: d.Chemo_Id,
|
||||
Chemo: d.Chemo,
|
||||
Patient_Weight: d.Patient_Weight,
|
||||
Patient_Height: d.Patient_Height,
|
||||
Diagnoses: d.Diagnoses,
|
||||
Interval: d.Interval,
|
||||
Cycle: d.Cycle,
|
||||
Series: d.Series,
|
||||
StartDate: d.StartDate,
|
||||
EndDate: d.EndDate,
|
||||
Status_Code: d.Status_Code,
|
||||
VerifiedAt: d.VerifiedAt,
|
||||
VerifiedBy_User_Id: d.VerifiedBy_User_Id,
|
||||
VerifiedBy: d.VerifiedBy,
|
||||
ChemoPlans: d.ChemoPlans,
|
||||
Patient_Id: d.Patient_Id,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -3,6 +3,9 @@ package chemo
|
||||
import (
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
// std
|
||||
"time"
|
||||
|
||||
// internal - lib
|
||||
@@ -21,6 +24,7 @@ type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Class_Code ere.ChemoClassCode `json:"class_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -34,28 +38,32 @@ type FilterDto struct {
|
||||
Status_Code *erc.DataVerifiedCode `json:"status-code"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy-user-id"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
Patient_Id *uint `json:"patient-id"`
|
||||
Class_Code ere.ChemoClassCode `json:"class-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
Includes string `json:"includes"`
|
||||
FilterDto
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type VerifyDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
Bed *string `json:"bed"`
|
||||
Needs *string `json:"needs"`
|
||||
Doctor_Code *string `json:"doctor_code" validate:"required"`
|
||||
NextChemoDate *time.Time `json:"nextChemoDate"`
|
||||
NextChemoDate *time.Time `json:"nextChemoDate" validate:"required"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ type FilterDto struct {
|
||||
MedicalDischargeEducation *string `json:"medicalDischargeEducation"`
|
||||
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
||||
DischargeReason *string `json:"dischargeReason"`
|
||||
ChemoClass *ere.ChemoClassCode `json:"chemo-class"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -130,9 +130,9 @@ const (
|
||||
ETCEncounter EntityTypeCode = "encounter"
|
||||
ETCMCU EntityTypeCode = "mcu"
|
||||
|
||||
SPCComplete StatusProtocolChemo = "complete"
|
||||
SPCPlanned StatusProtocolChemo = "planned"
|
||||
SPCSchedule StatusProtocolChemo = "schedule"
|
||||
SPCComplete StatusProtocolChemo = "complete" // Terealisasi
|
||||
SPCPlanned StatusProtocolChemo = "planned" // Terencana
|
||||
SPCSchedule StatusProtocolChemo = "schedule" // Terjadwal
|
||||
)
|
||||
|
||||
func (ec EncounterClassCode) Code() string {
|
||||
|
||||
Reference in New Issue
Block a user