fail chemo ongoing

This commit is contained in:
vanilia
2025-12-09 12:11:05 +07:00
parent cef816ecb6
commit 45d883e0b7
10 changed files with 62 additions and 205 deletions

No files matched your search

@@ -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)
}).