add kesimpulan non lab

This commit is contained in:
Hanan Askarim
2024-06-13 18:44:09 +07:00
committed by adibwp
parent fe3cb753b5
commit 988cee93c2
6 changed files with 341 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ import (
type KesimpulanService interface {
GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error)
}
func NewKesimpulanHandler(us KesimpulanService) *KesimpulanHandler {
@@ -28,6 +29,7 @@ func (h *KesimpulanHandler) HandleShowKesimpulanScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
tableID := utils.GenerateRandomID("tablebody")
tableIDNonLab := utils.GenerateRandomID("tablebody")
id := c.Param("id")
// table component
@@ -46,8 +48,25 @@ func (h *KesimpulanHandler) HandleShowKesimpulanScreen(c echo.Context) error {
tableComponentLab := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
// table component non lab
dataNonLab, err := h.KesimpulanService.GetListKesimpulanNonLab(id)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST NON LAB",
zap.Any("error", err),
)
fmt.Println(dataNonLab)
return err
}
logger.Info("CEK DATA",
zap.Any("data lab", dataNonLab))
tableComponentNonLab := dev_kesimpulan.CardTableKesimpulanNonLab("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableIDNonLab)
content := dev_kesimpulan.MainKesimpulan(tableID,
tableComponentLab)
tableIDNonLab,
tableComponentLab,
tableComponentNonLab)
view := dev_kesimpulan.ShowKesimpulan("KESIMPULAN", content, dev_kesimpulan.CssKesimpulan(), dev_kesimpulan.JsKesimpulan())
return utils.View(c, view)