fail chemo ongoing
This commit is contained in:
@@ -56,11 +56,12 @@ func Create(input e.CreateDto) (*d.Data, error) {
|
||||
|
||||
// update chemoPlan
|
||||
if chemoPlan != nil {
|
||||
chemoPlan.Encounter_Id = input.Encounter_Id
|
||||
if err = ucp.UpdateData(chemoPlan, &event, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// get detail for sync
|
||||
soapiData, err := ReadDetailData(e.ReadDetailDto{
|
||||
Id: data.Id,
|
||||
|
||||
@@ -134,7 +134,7 @@ func getChemo(patientId uint, event *pl.Event) (*ecp.ChemoProtocol, error) {
|
||||
|
||||
tx = tx.Model(&ecp.ChemoProtocol{}).
|
||||
Joins(`"ChemoPlan" cp ON cp."Protocol_Id" = "ChemoProtocol"."Id"`).
|
||||
Where(`"Patient.Id" = ? AND (cp.Status = ? OR cp.Status IS NULL)`, patientId, ere.SPCPlanned).
|
||||
Where(`"Patient.Id" = ? AND cp."Status" = ?`, patientId, ere.SPCPlanned).
|
||||
Preload("ChemoPlans", func(db *gorm.DB) *gorm.DB {
|
||||
return tx.Order(`"Id" ASC`).Limit(1)
|
||||
}).
|
||||
|
||||
Reference in New Issue
Block a user