add tab kesimpulan

This commit is contained in:
2024-06-13 23:06:55 +07:00
parent 16de8d4493
commit 2f651cba3d
18 changed files with 1012 additions and 18 deletions

View File

@@ -8,6 +8,7 @@ import (
"cpone/services"
"cpone/utils"
corporate_mcudetail "cpone/views/corporate/mcu"
corporate_tabmcudetail "cpone/views/corporate/mcu/mcutab"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
@@ -31,6 +32,9 @@ func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
title := "PT. Sadhana Abiyasa Sampoerna"
id := c.Param("id")
logger.Info("params", zap.Any("id", id))
user, err := services.GetUserLogin()
if err != nil {
defer logger.Sync()
@@ -51,9 +55,11 @@ func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error {
content := corporate_mcudetail.McuDetailScreen(
breadcrumb,
corporate_mcudetail.TabViewMcuDetail(),
corporate_mcudetail.TabViewMcuDetail(id),
)
css := corporate_mcudetail.CSSMcuDetail(
corporate_tabmcudetail.CssKesimpulan(),
)
css := corporate_mcudetail.CSSMcuDetail()
js := corporate_mcudetail.JSMcuDetail()
view := corporate_mcudetail.ShowMcuDetail(

View File

@@ -0,0 +1,76 @@
package mcu_corporate_handlers
import (
"cpone/models"
"cpone/utils"
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
"fmt"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type TabKesimpulanServices interface {
GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error)
}
type TabKesimpulanHandler struct {
TabKesimpulanServices TabKesimpulanServices
}
func NewTabKesimpulanHandler(us TabKesimpulanServices) *TabKesimpulanHandler {
return &TabKesimpulanHandler{
TabKesimpulanServices: us,
}
}
func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
tableID := utils.GenerateRandomID("tablebody")
id := c.Param("id")
dataLab, err := tkh.TabKesimpulanServices.GetListKesimpulanLab(id)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST LAB",
zap.Any("error", err),
)
fmt.Println(dataLab)
return err
}
tableComponentLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
dataNonLab, err := tkh.TabKesimpulanServices.GetListKesimpulanNonLab(id)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST NON LAB",
zap.Any("error", err),
)
fmt.Println(dataNonLab)
return err
}
tableComponentNonLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
dataFisik, err := tkh.TabKesimpulanServices.GetListKesimpulanFisik(id)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST FISIK",
zap.Any("error", err),
)
fmt.Println(dataFisik)
return err
}
tableComponentFisik := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
content := corporate_mcudetail.MainKesimpulan(
tableID,
tableComponentLab,
tableComponentNonLab,
tableComponentFisik,
)
return utils.View(c, content)
}

View File

@@ -31,6 +31,9 @@ func (dmcu *DetailMcuHandler) HandleShowDetailMcuScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
title := "PT. Sadhana Abiyasa Sampoerna"
id := c.Param("id")
logger.Info("params", zap.Any("id", id))
user, err := services.GetUserLogin()
if err != nil {
defer logger.Sync()
@@ -51,7 +54,7 @@ func (dmcu *DetailMcuHandler) HandleShowDetailMcuScreen(c echo.Context) error {
content := dev_detailmcu.DetailMcuScreen(
breadcrumb,
dev_detailmcu.TabViewDetailMcu(),
dev_detailmcu.TabViewDetailMcu(id),
)
css := dev_detailmcu.CSSDetailMcu()
js := dev_detailmcu.JSDetailMcu()

View File

@@ -3,10 +3,12 @@ package handlers
import (
client_handlers "cpone/handlers/client"
corporate_handlers "cpone/handlers/corporate"
mcu_corporate_handlers "cpone/handlers/corporate/mcudetail"
dev_handlers "cpone/handlers/dev"
public_handlers "cpone/handlers/public"
client_services "cpone/services/client"
corporate_services "cpone/services/corporate"
mcu_corporate_services "cpone/services/corporate/mcudetail"
dev_services "cpone/services/dev"
public_services "cpone/services/public"
@@ -115,6 +117,10 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
mcudHandr := corporate_handlers.NewMcuDetailHandler(mcudServ)
corp.GET("/dashboard_pic/detail/:id", mcudHandr.HandlerShowMcuDetailScreen)
kesimpulanSrv := mcu_corporate_services.NewTabKesimpulanServices(appStore)
kesimpulanHdr := mcu_corporate_handlers.NewTabKesimpulanHandler(kesimpulanSrv)
corp.GET("/dashboard_pic/detail/:id/tabkesimpulan", kesimpulanHdr.HandleShowTabKesimpulanScreen)
patientHandler := corporate_handlers.NewPatientHandler(l)
corp.GET("/patient", patientHandler.ShowPatient)
}