diff --git a/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go b/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go index 5b2dbbf..74b6cb1 100644 --- a/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go +++ b/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go @@ -13,6 +13,7 @@ import ( type TabDaftarPesertaServices interface { GetListMcuDaftarPeserta(id string, currentpage int, rowperpage int) ([]models.ModelMcuDaftarPeserta, int, error) + GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) } type TabDaftarPesertaHandlers struct { @@ -68,8 +69,12 @@ func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context) pagination, ) + tabData := []models.TabViewReportMcu{} + tabview := corporate_mcudetail.TabReportView(tabData) + bodymodal := corporate_mcudetail.ModalBody( dialogReportBodyID, + tabview, corporate_mcudetail.JsShowModal(""), ) @@ -146,7 +151,7 @@ func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error { page, "/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage", paginationID, - "#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogReportID, #dialogReportBodyID", + "#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogReportID, #dialogReportBodyID, #currPage"+paginationID, "#contentlayout", "outerHTML", "", "", corporate_mcudetail.BeforeRequestContent(), @@ -171,8 +176,22 @@ func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) erro dialogReportBodyID := c.QueryParam("dialogReportBodyID") logger.Info("params", zap.Any("idx", idx)) + tabData, err := tdp.TabDaftarPesertaServices.GetReportMcu(idx) + if err != nil { + tab := corporate_mcudetail.TabReportView([]models.TabViewReportMcu{}) + mod := corporate_mcudetail.ModalBody( + dialogReportBodyID, + tab, + corporate_mcudetail.JsShowModal(""), + ) + return utils.View(c, mod) + } + + tabcomponent := corporate_mcudetail.TabReportView(tabData) + modalbody := corporate_mcudetail.ModalBody( dialogReportBodyID, + tabcomponent, corporate_mcudetail.JsShowModal("#"+dialogReportID), ) diff --git a/handlers/corporate/patient.handlers.go b/handlers/corporate/patient.handlers.go index 664e86b..9da660b 100644 --- a/handlers/corporate/patient.handlers.go +++ b/handlers/corporate/patient.handlers.go @@ -11,7 +11,6 @@ import ( corporate_patient "cpone/views/corporate/patient" "strconv" - "github.com/a-h/templ" "github.com/labstack/echo/v4" "go.uber.org/zap" ) @@ -19,6 +18,9 @@ import ( type PatientService interface { GetDashboardPatientBreadcrumb(title string) (models.BreadCrumbV1, error) ListingData(search string, date string, patID string, corpId string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error) + GetListtingData(email string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error) + GetPatientData(email string) (string, error) + GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) } func NewPatientHandler(us PatientService) *PatientHandler { @@ -31,16 +33,16 @@ type PatientHandler struct { PatientService PatientService } -func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { +func (ph *PatientHandler) LoadLocalData(c echo.Context) error { logger, _ := zap.NewProduction() - title := "Nanda Arisu" + listID := c.QueryParam("listID") + paginationID := c.QueryParam("paginationID") + dialogID := c.QueryParam("dialogID") + dialogBodyID := c.QueryParam("dialogBodyID") + userEmail := c.QueryParam("userEmail") + logger.Info("params", zap.Any("email", userEmail)) - listID := utils.GenerateRandomID("listid") - paginationID := utils.GenerateRandomID("paginationid") - dialogID := utils.GenerateRandomID("dialogid") - dialogBodyID := utils.GenerateRandomID("dialogbodyid") - - user, err := services.GetUserLogin() + title, err := ph.PatientService.GetPatientData(userEmail) if err != nil { defer logger.Sync() logger.Info("Error get user", zap.Any("error", err)) @@ -54,12 +56,9 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { return err } defer logger.Sync() - - navbaruser := navbarmenu.NavbarWithLogo(user) - sidbaruser := sidebaruserprofile.Navbaruserprofile(user) breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb) - listingdata, totalPage, err := ph.PatientService.ListingData("", "", "108", "40", 1, 5) + listingdata, totalPage, err := ph.PatientService.GetListtingData(userEmail, 1, 5) if err != nil { defer logger.Sync() logger.Info("error get listing data", zap.Any("error", err), zap.Any("total", totalPage)) @@ -69,7 +68,7 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { listID, "/corp/dashboard_pat/open", "#"+dialogBodyID, - "#listID, #paginationID, #dialogID, #dialogBodyID", + "#listID, #paginationID, #dialogID, #dialogBodyID, #userEmail", "outerHTML", ) @@ -78,15 +77,19 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { 1, "/corp/dashboard_pat/changepage", paginationID, - "#listID, #paginationID, #dialogID, #dialogBodyID", - "#"+paginationID, + "#listID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogID, #dialogBodyID, #userEmail", + "#contentlayout", "outerHTML", "", "", corporate_patient.BeforeRequestContent(), corporate_patient.AfterRequestContent(), ) + tabData := []models.TabViewReportMcu{} + tabcomponent := corporate_patient.TabReportView(tabData) + bodyModal := corporate_patient.ModalBody( dialogBodyID, + tabcomponent, corporate_patient.JsShowModal(""), ) @@ -102,27 +105,54 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { "/corp/dashboard_pat/dialog", "#"+dialogBodyID, "outerHTML", - "#listID, #paginationID, #dialogID, #dialogBodyID"+paginationID, + "#listID, #paginationID, #dialogID, #userEmail, #dialogBodyID"+paginationID, dialogID, title, bodyModal, bodyClose, ) + content := corporate_patient.ContentP(listingcomponent, paginationcomponent) + + view := corporate_patient.ContentPage( + breadcrumb, + content, + modalDialog, + ) + + return utils.View(c, view) +} + +func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { + logger, _ := zap.NewProduction() + // userEmail := c.QueryParam("email") + // logger.Info("params", zap.Any("email", userEmail)) + + listID := utils.GenerateRandomID("listid") + paginationID := utils.GenerateRandomID("paginationid") + dialogID := utils.GenerateRandomID("dialogid") + dialogBodyID := utils.GenerateRandomID("dialogbodyid") + + user, err := services.GetUserLogin() + if err != nil { + defer logger.Sync() + logger.Info("Error get user", zap.Any("error", err)) + return err + } + + navbaruser := navbarmenu.NavbarWithLogo(user) + sidbaruser := sidebaruserprofile.Navbaruserprofile(user) + content := corporate_patient.DashboardPat( listID, paginationID, dialogID, dialogBodyID, - breadcrumb, - listingcomponent, - paginationcomponent, - modalDialog, ) css := corporate_patient.CSSDashboardPat() js := corporate_patient.JSDashboardPat() - view := corporate_patient.ShowDashboardPat(title, content, css, js, navbaruser, sidbaruser) + view := corporate_patient.ShowDashboardPat("Dashboard Pasien", content, css, js, navbaruser, sidbaruser) return utils.View(c, view) } @@ -133,8 +163,10 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error { listID := c.QueryParam("listID") paginationID := c.QueryParam("paginationID") dialogBodyID := c.QueryParam("dialogBodyID") + userEmail := c.QueryParam("userEmail") + logger.Info("params", zap.Any("userEmail", userEmail)) - var retval []templ.Component + // var retval []templ.Component page, err := strconv.Atoi(pageparam) if err != nil { defer logger.Sync() @@ -142,7 +174,7 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error { return err } - listData, totalPage, err := ph.PatientService.ListingData("", "", "108", "40", page, 5) + listData, totalPage, err := ph.PatientService.GetListtingData(userEmail, page, 5) if err != nil { defer logger.Sync() logger.Info("error get data listing") @@ -152,7 +184,7 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error { listID, "/corp/dashboard_pat/open", "#"+dialogBodyID, - "#listID, #paginationID, #dialogID, ", + "#listID, #paginationID, #dialogID, #dialogBodyID, #userEmail", "outerHTML", ) @@ -161,16 +193,19 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error { page, "/corp/dashboard_pat/changepage", paginationID, - "#listID, #paginationID, #dialogID, #dialogBodyID, #currPage"+paginationID, - "#"+paginationID, + "#listID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogID, #dialogBodyID, #userEmail, #currPage"+paginationID, + "#contentlayout", "outerHTML", "", "", corporate_patient.BeforeRequestContent(), corporate_patient.AfterRequestContent(), ) - retval = append(retval, listcomponent) - retval = append(retval, paginationcomponent) - return utils.ViewMulti(c, retval) + // retval = append(retval, listcomponent) + // retval = append(retval, paginationcomponent) + // return utils.ViewMulti(c, retval) + + content := corporate_patient.ContentP(listcomponent, paginationcomponent) + return utils.View(c, content) } func (ph *PatientHandler) HandleOpenReport(c echo.Context) error { @@ -181,8 +216,21 @@ func (ph *PatientHandler) HandleOpenReport(c echo.Context) error { dialogBodyID := c.QueryParam("dialogBodyID") logger.Info("params", zap.Any("id", id)) + tabData, err := ph.PatientService.GetReportMcu(id) + if err != nil { + tab := corporate_patient.TabReportView([]models.TabViewReportMcu{}) + mod := corporate_patient.ModalBody( + dialogBodyID, + tab, + corporate_patient.JsShowModal(""), + ) + return utils.View(c, mod) + } + + tabcomponent := corporate_patient.TabReportView(tabData) modalBody := corporate_patient.ModalBody( dialogBodyID, + tabcomponent, corporate_patient.JsShowModal("#"+dialogID), ) diff --git a/handlers/public/login.handlers.go b/handlers/public/login.handlers.go index 57a328d..aef8f8e 100644 --- a/handlers/public/login.handlers.go +++ b/handlers/public/login.handlers.go @@ -33,67 +33,6 @@ func (lh *LoginHandler) HandlerShowLogin(c echo.Context) error { return utils.View(c, si) } -func (lh *LoginHandler) HandlerSignIn(c echo.Context) error { - logger, _ := zap.NewProduction() - - username := c.FormValue("username") - password := c.FormValue("password") - - defer logger.Sync() - logger.Info("Params", zap.Any("username", username), zap.Any("pass", password)) - - resp, err := lh.LoginService.Login(username, password) - if err != nil { - defer logger.Sync() - logger.Info("Error", zap.Error(err)) - - si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin()) - return utils.View(c, si) - } - defer logger.Sync() - - var url string - switch resp.Data.Type { - case "cpone": - url = "/one-ui" - case "pic": - url = "/dashboard_pic" - case "patient": - url = "/home" - default: - url = "/one-ui" - } - - user, err := json.Marshal(resp.Data.User) - if err != nil { - defer logger.Sync() - logger.Info("Error", zap.Error(err)) - - si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin()) - return utils.View(c, si) - } - - userString := string(user) - - storeLocal := ` - - ` - - c.Response().Header().Set("HX-Trigger", "script") - - return c.String(http.StatusOK, storeLocal) -} - func (lh *LoginHandler) HandleSignIn(c echo.Context) error { logger, _ := zap.NewProduction() @@ -141,7 +80,6 @@ func (lh *LoginHandler) HandleSignIn(c echo.Context) error { return utils.View(c, si) } userString := string(user) - store := ` -
diff --git a/layout/layout_dashboard_templ.go b/layout/layout_dashboard_templ.go index e56d98d..0bb58fb 100644 --- a/layout/layout_dashboard_templ.go +++ b/layout/layout_dashboard_templ.go @@ -50,7 +50,7 @@ func DashboardLayout( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/models/mcudaftarpeserta.models.go b/models/mcudaftarpeserta.models.go index 2dc9dbe..24505d5 100644 --- a/models/mcudaftarpeserta.models.go +++ b/models/mcudaftarpeserta.models.go @@ -13,3 +13,15 @@ type ModelMcuDaftarPeserta struct { M_PatientDOB string `db:"M_PatientDOB"` Age string `db:"age"` } + +type ModelMcuPesertaReport struct { + So_ResultEntryID int `db:"So_ResultEntryID"` + So_ResultEntryT_OrderHeaderID int `db:"So_ResultEntryT_OrderHeaderID"` + So_ResultEntryNonlab_TemplateID int `db:"So_ResultEntryNonlab_TemplateID"` + So_ResultEntryNonlab_TemplateName string `db:"So_ResultEntryNonlab_TemplateName"` +} + +type TabViewReportMcu struct { + Name string + Link string +} diff --git a/services/corporate/mcudetail/tabdaftarpeserta.services.go b/services/corporate/mcudetail/tabdaftarpeserta.services.go index 2532fdb..508da0d 100644 --- a/services/corporate/mcudetail/tabdaftarpeserta.services.go +++ b/services/corporate/mcudetail/tabdaftarpeserta.services.go @@ -6,6 +6,7 @@ import ( dbx "cpone/package/database" "fmt" "math" + "strconv" "go.uber.org/zap" ) @@ -72,3 +73,66 @@ func (tdps *TabDaftarPesertaServices) GetListMcuDaftarPeserta(id string, current return listDaftarPeserta, totalPage, nil } + +func (tdps *TabDaftarPesertaServices) GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) { + var ret []models.TabViewReportMcu + var data []models.ModelMcuPesertaReport + var totalData int + + q := ` + SELECT COUNT(*) + FROM so_resultentry + WHERE So_ResultEntryT_OrderHeaderID = ? + AND So_ResultEntryIsActive = 'Y' + ` + if err := dbx.Handlex.Get(&totalData, q, orderheaderID); err != nil { + return ret, fmt.Errorf("error get total mcu report: %v", err) + } + + q = ` + SELECT + So_ResultEntryID, + So_ResultEntryT_OrderHeaderID, + So_ResultEntryNonlab_TemplateID, + So_ResultEntryNonlab_TemplateName + FROM so_resultentry + WHERE So_ResultEntryT_OrderHeaderID = ? + AND So_ResultEntryIsActive = 'Y' + ORDER BY So_ResultEntryNonlab_TemplateID + ` + if err := dbx.Handlex.Select(&data, q, orderheaderID); err != nil { + return ret, err + } + + // Lab + ret = append(ret, models.TabViewReportMcu{Name: "Hasil Laboratorium", Link: "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_test.rptdesign&__format=pdf&PID=" + orderheaderID + "&username=adhi&tm=1717726294764"}) + + // Non-lab + for _, n := range data { + var link models.TabViewReportMcu + + switch n.So_ResultEntryNonlab_TemplateName { + case "ECG": + link.Name = "Elektromedis" + link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_elmd.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764" + case "Thorax PA": + link.Name = "Radiologi" + link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_xray.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764" + case "Fisik Umum": + namaFisik := []string{"Hasil Fisik", "Hasil Pajanan", "Riwayat"} + linkFisik := []string{ + "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764", + "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764", + "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_riwayat.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=riwayat&username=adhi&tm=1717726294764", + } + for i := 0; i < 3; i++ { + ret = append(ret, models.TabViewReportMcu{Name: namaFisik[i], Link: linkFisik[i]}) + } + continue + } + + ret = append(ret, link) + } + + return ret, nil +} diff --git a/services/corporate/patient.services.go b/services/corporate/patient.services.go index 3e24623..86a2882 100644 --- a/services/corporate/patient.services.go +++ b/services/corporate/patient.services.go @@ -6,6 +6,7 @@ import ( dbx "cpone/package/database" "fmt" "math" + "strconv" "go.uber.org/zap" ) @@ -22,6 +23,23 @@ func NewPatientServices(uStore db.AppStore) *PatientServices { } } +func (sp *PatientServices) GetPatientData(email string) (string, error) { + var ret string + prmEmail := "%" + email + "%" + q := ` + SELECT + M_PatientName + FROM m_patient + WHERE M_PatientEmail LIKE ? + AND M_PatientIsActive = 'Y' + ` + if err := dbx.Handlex.Get(&ret, q, prmEmail); err != nil { + return ret, err + } + + return ret, nil +} + func (sp *PatientServices) GetDashboardPatientBreadcrumb(title string) (models.BreadCrumbV1, error) { breadcrumb := models.BreadCrumbV1{ Title: title, @@ -61,9 +79,8 @@ func (sp *PatientServices) ListingData(search string, date string, patID string, WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderLabNumber LIKE ? AND T_OrderHeaderM_PatientID = ? - AND T_OrderHeaderCorporateID = ? ` - if err := dbx.Handlex.Get(&totalData, q, prmSearch, patID, corpId); err != nil { + if err := dbx.Handlex.Get(&totalData, q, prmSearch, patID); err != nil { return nil, 0, fmt.Errorf("error query get total data: %v", err) } @@ -75,15 +92,14 @@ func (sp *PatientServices) ListingData(search string, date string, patID string, T_OrderHeaderM_PatientID, T_OrderHeaderCorporateID, T_OrderHeaderMgm_McuID, - T_OrderHeaderIsActive + T_OrderHeaderIsActive FROM t_orderheader WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderLabNumber LIKE ? AND T_OrderHeaderM_PatientID = ? - AND T_OrderHeaderCorporateID = ? LIMIT ? OFFSET ? ` - if err := dbx.Handlex.Select(&ret, q, prmSearch, patID, corpId, rowperpage, offset); err != nil { + if err := dbx.Handlex.Select(&ret, q, prmSearch, patID, rowperpage, offset); err != nil { return nil, 0, fmt.Errorf("error query get data: %v", err) } logger.Info("response", zap.Any("data", ret)) @@ -91,3 +107,108 @@ func (sp *PatientServices) ListingData(search string, date string, patID string, totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage))) return ret, totalPage, nil } + +func (sp *PatientServices) GetListtingData(email string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error) { + logger, _ := zap.NewProduction() + var ret []models.DashboardPatient + var totalData int + + prmEmail := "%" + email + "%" + offset := (currentpage - 1) * rowperpage + q := ` + SELECT COUNT(*) + FROM m_patient mp + JOIN t_orderheader toh ON toh.T_OrderHeaderM_PatientID = mp.M_PatientID AND toh.T_OrderHeaderIsActive = 'Y' + WHERE mp.M_PatientEmail LIKE ? + AND mp.M_PatientIsActive = 'Y' + ` + if err := dbx.Handlex.Get(&totalData, q, prmEmail); err != nil { + return nil, 0, fmt.Errorf("error query get total data: %v", err) + } + + q = ` + SELECT + toh.T_OrderHeaderID, + toh.T_OrderHeaderDate, + toh.T_OrderHeaderLabNumber, + toh.T_OrderHeaderM_PatientID, + toh.T_OrderHeaderCorporateID, + toh.T_OrderHeaderMgm_McuID, + toh.T_OrderHeaderIsActive + FROM m_patient mp + JOIN t_orderheader toh ON toh.T_OrderHeaderM_PatientID = mp.M_PatientID AND toh.T_OrderHeaderIsActive = 'Y' + WHERE mp.M_PatientEmail LIKE ? + AND mp.M_PatientIsActive = 'Y' + LIMIT ? OFFSET ? + ` + if err := dbx.Handlex.Select(&ret, q, prmEmail, rowperpage, offset); err != nil { + return nil, 0, fmt.Errorf("error query get list data: %v", err) + } + logger.Info("response", zap.Any("data", ret)) + + totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage))) + return ret, totalPage, nil +} + +func (sp *PatientServices) GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) { + var ret []models.TabViewReportMcu + var data []models.ModelMcuPesertaReport + var totalData int + + q := ` + SELECT COUNT(*) + FROM so_resultentry + WHERE So_ResultEntryT_OrderHeaderID = ? + AND So_ResultEntryIsActive = 'Y' + ` + if err := dbx.Handlex.Get(&totalData, q, orderheaderID); err != nil { + return ret, fmt.Errorf("error get total mcu report: %v", err) + } + + q = ` + SELECT + So_ResultEntryID, + So_ResultEntryT_OrderHeaderID, + So_ResultEntryNonlab_TemplateID, + So_ResultEntryNonlab_TemplateName + FROM so_resultentry + WHERE So_ResultEntryT_OrderHeaderID = ? + AND So_ResultEntryIsActive = 'Y' + ORDER BY So_ResultEntryNonlab_TemplateID + ` + if err := dbx.Handlex.Select(&data, q, orderheaderID); err != nil { + return ret, err + } + + // Lab + ret = append(ret, models.TabViewReportMcu{Name: "Hasil Laboratorium", Link: "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_test.rptdesign&__format=pdf&PID=" + orderheaderID + "&username=adhi&tm=1717726294764"}) + + // Non-lab + for _, n := range data { + var link models.TabViewReportMcu + + switch n.So_ResultEntryNonlab_TemplateName { + case "ECG": + link.Name = "Elektromedis" + link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_elmd.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764" + case "Thorax PA": + link.Name = "Radiologi" + link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_xray.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764" + case "Fisik Umum": + namaFisik := []string{"Hasil Fisik", "Hasil Pajanan", "Riwayat"} + linkFisik := []string{ + "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764", + "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764", + "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_riwayat.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=riwayat&username=adhi&tm=1717726294764", + } + for i := 0; i < 3; i++ { + ret = append(ret, models.TabViewReportMcu{Name: namaFisik[i], Link: linkFisik[i]}) + } + continue + } + + ret = append(ret, link) + } + + return ret, nil +} diff --git a/views/corporate/mcu/mcutab/modaldaftarpeserta.templ b/views/corporate/mcu/mcutab/modaldaftarpeserta.templ index 8110607..ca02cc2 100644 --- a/views/corporate/mcu/mcutab/modaldaftarpeserta.templ +++ b/views/corporate/mcu/mcutab/modaldaftarpeserta.templ @@ -1,6 +1,8 @@ package corporate_mcudetail import "cpone/component/modal" +import "cpone/models" +import "strconv" templ DialogReport( IDComponent string, @@ -29,39 +31,11 @@ templ DialogReport( templ ModalBody( IDComponent string, + tabComponent templ.Component, hxOnLoad templ.ComponentScript, ) {
-
- -
-
-
- -
-
- -
-
- -
-
- -
-
+ @tabComponent
} @@ -83,4 +57,68 @@ templ ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID strin > -} \ No newline at end of file +} + +templ TabReportView( + datamcu []models.TabViewReportMcu, +) { +
+ +
+
+ for i, v := range datamcu { + if i == 0 { +
+ +
+ } else { +
+ +
+ } + } +
+} + +//
+// +//
+//
+//
+// +//
+//
+// +//
+//
+// +//
+//
+// +//
+//
\ No newline at end of file diff --git a/views/corporate/mcu/mcutab/modaldaftarpeserta_templ.go b/views/corporate/mcu/mcutab/modaldaftarpeserta_templ.go index 49af687..a13a3f6 100644 --- a/views/corporate/mcu/mcutab/modaldaftarpeserta_templ.go +++ b/views/corporate/mcu/mcutab/modaldaftarpeserta_templ.go @@ -11,6 +11,8 @@ import "io" import "bytes" import "cpone/component/modal" +import "cpone/models" +import "strconv" func DialogReport( IDComponent string, @@ -42,7 +44,7 @@ func DialogReport( var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 18, Col: 28} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 20, Col: 28} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -55,7 +57,7 @@ func DialogReport( var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 19, Col: 34} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 21, Col: 34} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -86,6 +88,7 @@ func DialogReport( func ModalBody( IDComponent string, + tabComponent templ.Component, hxOnLoad templ.ComponentScript, ) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { @@ -111,7 +114,7 @@ func ModalBody( var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 34, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 37, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -126,59 +129,15 @@ func ModalBody( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_history.rptdesign&__format=pdf&PID=5&PPatientID=112&username=adhi&tm=1717726294764") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 53, Col: 188} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + templ_7745c5c3_Err = tabComponent.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\">
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -217,9 +176,9 @@ func ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var11 := templ.GetChildren(ctx) - if templ_7745c5c3_Var11 == nil { - templ_7745c5c3_Var11 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModal(modalID)) @@ -230,8 +189,8 @@ func ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var12 templ.ComponentScript = JsHideModal(modalID) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12.Call) + var templ_7745c5c3_Var8 templ.ComponentScript = JsHideModal(modalID) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -245,3 +204,216 @@ func ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string return templ_7745c5c3_Err }) } + +func TabReportView( + datamcu []models.TabViewReportMcu, +) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i, v := range datamcu { + if i == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +//
+// +//
+//
+//
+// +//
+//
+// +//
+//
+// +//
+//
+// +//
+//
diff --git a/views/corporate/mcu/mcutab/tabledaftarpeserta.templ b/views/corporate/mcu/mcutab/tabledaftarpeserta.templ index 8da3a31..8332ab9 100644 --- a/views/corporate/mcu/mcutab/tabledaftarpeserta.templ +++ b/views/corporate/mcu/mcutab/tabledaftarpeserta.templ @@ -68,7 +68,7 @@ templ ItemRow( - - @ItemAction(v.M_PatientID, + @ItemAction(v.T_OrderHeaderID, hxGet, hxTarget, hxInclude, diff --git a/views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go b/views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go index 0940af6..edcced6 100644 --- a/views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go +++ b/views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go @@ -206,7 +206,7 @@ func ItemRow( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ItemAction(v.M_PatientID, + templ_7745c5c3_Err = ItemAction(v.T_OrderHeaderID, hxGet, hxTarget, hxInclude, diff --git a/views/corporate/patient/listingpatient.templ b/views/corporate/patient/listingpatient.templ index 8f3db54..e4a0c02 100644 --- a/views/corporate/patient/listingpatient.templ +++ b/views/corporate/patient/listingpatient.templ @@ -11,7 +11,7 @@ templ ListingData( hxInclude string, hxSwap string, ) { -
+
for i, d := range data { diff --git a/views/corporate/patient/listingpatient_templ.go b/views/corporate/patient/listingpatient_templ.go index 681a4d7..8ed898c 100644 --- a/views/corporate/patient/listingpatient_templ.go +++ b/views/corporate/patient/listingpatient_templ.go @@ -46,7 +46,7 @@ func ListingData( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"align-items-center pt-8 flex-column\" hx-swap-oob=\"true\">
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"align-items-center py-8 flex-column\">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/corporate/patient/patient.templ b/views/corporate/patient/patient.templ index 37c04f4..ace9061 100644 --- a/views/corporate/patient/patient.templ +++ b/views/corporate/patient/patient.templ @@ -12,12 +12,8 @@ templ DashboardPat( paginationID string, dialogID string, dialogBodyID string, - breadcrumb templ.Component, - listingcomponent templ.Component, - paginationcomponent templ.Component, - modaldialog templ.Component, ) { -
+
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "listID", Name: "listID", Type: "hidden", @@ -34,22 +30,62 @@ templ DashboardPat( Name: "dialogBodyID", Type: "hidden", Value: dialogBodyID}) -
-
- @breadcrumb -
-
-
- @listingcomponent - @paginationcomponent - @modaldialog -
-
- Loading... + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "userEmail", + Name: "userEmail", + Type: "hidden"}) +
+
+
+
+ Loading... +
-
+
+} + +templ ContentPage( + breadcrumb templ.Component, + content templ.Component, + modaldialog templ.Component, +) { + //
+
+
+ @breadcrumb +
+
+
+ @content + @modaldialog +
+
+ Loading... +
+
+
+
+ //
+} + +templ ContentP( + listingcomponent templ.Component, + paginationcomponent templ.Component, +) { +
+ @listingcomponent + @paginationcomponent
} @@ -105,7 +141,18 @@ script AfterRequestContent() { loadingSpinner.classList.add("d-none"); } -templ JSDashboardPat() { +templ JSDashboardPat() { + } templ ShowDashboardPat( diff --git a/views/corporate/patient/patient_templ.go b/views/corporate/patient/patient_templ.go index 429656c..b4c594f 100644 --- a/views/corporate/patient/patient_templ.go +++ b/views/corporate/patient/patient_templ.go @@ -21,10 +21,6 @@ func DashboardPat( paginationID string, dialogID string, dialogBodyID string, - breadcrumb templ.Component, - listingcomponent templ.Component, - paginationcomponent templ.Component, - modaldialog templ.Component, ) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) @@ -38,7 +34,7 @@ func DashboardPat( templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -70,6 +66,53 @@ func DashboardPat( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "userEmail", + Name: "userEmail", + Type: "hidden"}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, AfterRequestContent()) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading...
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func ContentPage( + breadcrumb templ.Component, + content templ.Component, + modaldialog templ.Component, +) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -82,6 +125,58 @@ func DashboardPat( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + templ_7745c5c3_Err = content.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = modaldialog.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading...
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func ContentP( + listingcomponent templ.Component, + paginationcomponent templ.Component, +) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, AfterRequestContent()) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } templ_7745c5c3_Err = listingcomponent.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -90,11 +185,7 @@ func DashboardPat( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = modaldialog.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading...
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -113,9 +204,9 @@ func CSSDashboardPat() templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") @@ -171,11 +262,15 @@ func JSDashboardPat() templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } if !templ_7745c5c3_IsBuffer { _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) } @@ -198,12 +293,12 @@ func ShowDashboardPat( defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var9 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -218,7 +313,7 @@ func ShowDashboardPat( } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = layout.DashboardLayout(title, css, js, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.DashboardLayout(title, css, js, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/corporate/patient/patientmodal.templ b/views/corporate/patient/patientmodal.templ index 7cfff88..af42e03 100644 --- a/views/corporate/patient/patientmodal.templ +++ b/views/corporate/patient/patientmodal.templ @@ -1,6 +1,8 @@ package corporate_patient import "cpone/component/modal" +import "cpone/models" +import "strconv" templ DialogReport( IDComponent string, @@ -29,39 +31,11 @@ templ DialogReport( templ ModalBody( IDComponent string, + tabComponent templ.Component, hxOnLoad templ.ComponentScript, ) {
-
- -
-
-
- -
-
- -
-
- -
-
- -
-
+ @tabComponent
} @@ -83,4 +57,68 @@ templ ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID strin > -} \ No newline at end of file +} + +templ TabReportView( + data []models.TabViewReportMcu, +) { +
+ +
+
+ for i, v := range data { + if i == 0 { +
+ +
+ } else { +
+ +
+ } + } +
+} + +//
+// +//
+//
+//
+// +//
+//
+// +//
+//
+// +//
+//
+// +//
+//
\ No newline at end of file diff --git a/views/corporate/patient/patientmodal_templ.go b/views/corporate/patient/patientmodal_templ.go index affd969..a6695db 100644 --- a/views/corporate/patient/patientmodal_templ.go +++ b/views/corporate/patient/patientmodal_templ.go @@ -11,6 +11,8 @@ import "io" import "bytes" import "cpone/component/modal" +import "cpone/models" +import "strconv" func DialogReport( IDComponent string, @@ -42,7 +44,7 @@ func DialogReport( var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 18, Col: 28} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 20, Col: 28} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -55,7 +57,7 @@ func DialogReport( var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 19, Col: 34} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 21, Col: 34} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -86,6 +88,7 @@ func DialogReport( func ModalBody( IDComponent string, + tabComponent templ.Component, hxOnLoad templ.ComponentScript, ) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { @@ -111,7 +114,7 @@ func ModalBody( var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 34, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 37, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -126,59 +129,15 @@ func ModalBody( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_history.rptdesign&__format=pdf&PID=5&PPatientID=112&username=adhi&tm=1717726294764") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 53, Col: 188} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + templ_7745c5c3_Err = tabComponent.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\">
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -217,9 +176,9 @@ func ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var11 := templ.GetChildren(ctx) - if templ_7745c5c3_Var11 == nil { - templ_7745c5c3_Var11 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModal(modalID)) @@ -230,8 +189,8 @@ func ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var12 templ.ComponentScript = JsHideModal(modalID) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12.Call) + var templ_7745c5c3_Var8 templ.ComponentScript = JsHideModal(modalID) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -245,3 +204,216 @@ func ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string return templ_7745c5c3_Err }) } + +func TabReportView( + data []models.TabViewReportMcu, +) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i, v := range data { + if i == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +//
+// +//
+//
+//
+// +//
+//
+// +//
+//
+// +//
+//
+// +//
+//