diff --git a/cpone-dashboard/menu/result/query.go b/cpone-dashboard/menu/result/query.go index 1e0d37c..75a608c 100644 --- a/cpone-dashboard/menu/result/query.go +++ b/cpone-dashboard/menu/result/query.go @@ -14,6 +14,7 @@ type ResultRow struct { Tests string FileUrl string ReportDate string + ReportVersion string } type ResultSummary struct { @@ -49,7 +50,13 @@ func GetResultRows(mcuID int) ([]ResultRow, error) { AND p.Published_McuDasboardFileUrl != '' THEN COALESCE(CAST(p.Published_McuDasboardLastUpdated AS CHAR), '') ELSE '' - END AS report_date + END AS report_date, + CASE + WHEN p.Published_McuDasboardFileUrl IS NOT NULL + AND p.Published_McuDasboardFileUrl != '' + THEN COALESCE(CAST(UNIX_TIMESTAMP(p.Published_McuDasboardLastUpdated) AS CHAR), '') + ELSE '' + END AS report_version FROM mcu_patient mp LEFT JOIN published_mcu_dashboard_sync p ON p.Published_McuDasboardT_OrderHeaderID = mp.Mcu_PatientOrderID @@ -67,7 +74,7 @@ func GetResultRows(mcuID int) ([]ResultRow, error) { var result []ResultRow for rows.Next() { var r ResultRow - if err := rows.Scan(&r.NIP, &r.Name, &r.Posisi, &r.PacketCode, &r.PacketName, &r.Tests, &r.FileUrl, &r.ReportDate); err != nil { + if err := rows.Scan(&r.NIP, &r.Name, &r.Posisi, &r.PacketCode, &r.PacketName, &r.Tests, &r.FileUrl, &r.ReportDate, &r.ReportVersion); err != nil { continue } result = append(result, r) diff --git a/cpone-dashboard/templates/result/index.html b/cpone-dashboard/templates/result/index.html index 19c3edc..765cdc2 100644 --- a/cpone-dashboard/templates/result/index.html +++ b/cpone-dashboard/templates/result/index.html @@ -109,7 +109,7 @@
{{.ReportDate | fmtDate}}
{{end}} {{if .FileUrl}} - @@ -145,17 +145,39 @@ {{end}} -{{.ReportDate | fmtDate}}
{{end}} {{if .FileUrl}} - @@ -275,17 +310,17 @@ document.addEventListener('keydown', function(e) { {{end}} -