From 7d6e8cc6874ae3bba81691719d8d628e2de77fcf Mon Sep 17 00:00:00 2001 From: sindhu Date: Tue, 21 May 2024 08:36:17 +0700 Subject: [PATCH] step 7 : move kartu kontrol ke public --- handlers/public/kartukontrol.handlers.go | 69 ++ handlers/routes.go | 6 + services/public/kartukontrol.services.go | 112 ++++ views/public/kartukontrol/kartukontrol.templ | 247 +++++++ .../public/kartukontrol/kartukontrol_templ.go | 612 ++++++++++++++++++ 5 files changed, 1046 insertions(+) create mode 100644 handlers/public/kartukontrol.handlers.go create mode 100644 services/public/kartukontrol.services.go create mode 100644 views/public/kartukontrol/kartukontrol.templ create mode 100644 views/public/kartukontrol/kartukontrol_templ.go diff --git a/handlers/public/kartukontrol.handlers.go b/handlers/public/kartukontrol.handlers.go new file mode 100644 index 0000000..62b6eee --- /dev/null +++ b/handlers/public/kartukontrol.handlers.go @@ -0,0 +1,69 @@ +package public_handlers + +import ( + "cpone/models" + "cpone/utils" + kartukontrol "cpone/views/public/kartukontrol" + + "github.com/a-h/templ" + "github.com/labstack/echo/v4" + "go.uber.org/zap" +) + +type KartuKontrolService interface { + GetkartuKontrolById(nomorRegistrasi string) ([]models.KartuKontrolModel, error) +} + +func NewKartuKontrolHandler(us KartuKontrolService) *KartuKontrolHandler { + return &KartuKontrolHandler{ + KartuKontrolService: us, + } +} + +type KartuKontrolHandler struct { + KartuKontrolService KartuKontrolService +} + +func (lh *KartuKontrolHandler) HandlerShowKartuKontrol(c echo.Context) error { + + nomorRegistrasi := c.Param("nomorRegistrasi") + // nomorRegistrasi := "1" + logger, _ := zap.NewProduction() + defer logger.Sync() + + dataKartuKontrol, err := lh.KartuKontrolService.GetkartuKontrolById(nomorRegistrasi) + + if err != nil { + logger.Info("Error", + zap.Any("Error", err), + zap.Any("prm", nomorRegistrasi), + ) + return err + } + logger.Info("SHOW DATA KARTU KONTROL handler", + zap.Any("return", dataKartuKontrol), + zap.Any("prm", nomorRegistrasi), + ) + + var si templ.Component + var isShowSurveyMcu bool = true + + if isShowSurveyMcu { + si = kartukontrol.ShowKartuKontrol("Kartu Kontrol", kartukontrol.MainContentKartuKontrolLayout(dataKartuKontrol, "/modalsurveykartukontrol", "load delay:3s", "modalWordingSurveyMcu"), kartukontrol.CssKartuKontrol(), kartukontrol.JsKartuKontrol()) + } else { + si = kartukontrol.ShowKartuKontrol("Kartu Kontrol", + kartukontrol.MainContentKartuKontrolLayout(dataKartuKontrol, "", "", "modalWordingSurveyMcu"), kartukontrol.CssKartuKontrol(), kartukontrol.JsKartuKontrol()) + } + + return utils.View(c, si) +} + +func (lh *KartuKontrolHandler) HandlerShowWordingModalSurveyMcu(c echo.Context) error { + + // var dataKartuKontrol []models.KartuKontrolModel + si := kartukontrol.ShowKartuKontrol( + "Kartu Kontrol", + kartukontrol.ModalMcuWordingShow("modalWordingSurveyMcu", "Silahkan isi questioner untuk membantu peningkatan layanan kami. Terima kasih."), kartukontrol.CssKartuKontrol(), kartukontrol.JsKartuKontrol()) + + return utils.View(c, si) +} diff --git a/handlers/routes.go b/handlers/routes.go index bd6c055..49f1ee7 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -70,6 +70,12 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) { public.GET("landingpage", lh.ShowLandingPage) loginHdr := public_handlers.NewLoginHandler(l) public.GET("login", loginHdr.HandlerShowLogin) + + // kartu kontrol + publicKartuKontrolServices := public_services.NewServicesKartuKontrol(appStore) + publicKartuKontrolhandlers := public_handlers.NewKartuKontrolHandler(publicKartuKontrolServices) + public.GET("kartukontrol/:nomorRegistrasi", publicKartuKontrolhandlers.HandlerShowKartuKontrol) + public.GET("modalsurveykartukontrol", publicKartuKontrolhandlers.HandlerShowWordingModalSurveyMcu) } func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { public := app.Group("/corp") diff --git a/services/public/kartukontrol.services.go b/services/public/kartukontrol.services.go new file mode 100644 index 0000000..2116280 --- /dev/null +++ b/services/public/kartukontrol.services.go @@ -0,0 +1,112 @@ +package public_services + +import ( + "cpone/db" + "cpone/models" + + "go.uber.org/zap" +) + +func NewServicesKartuKontrol(uStore db.AppStore) *ServicesKartuKontrol { + + return &ServicesKartuKontrol{ + KartuKontrolStore: uStore, + } +} + +type ServicesKartuKontrol struct { + KartuKontrolStore db.AppStore +} + +func (su *ServicesKartuKontrol) GetkartuKontrolById(nomorRegistrasi string) ([]models.KartuKontrolModel, error) { + + logger, _ := zap.NewProduction() + defer logger.Sync() + logger.Info("QUERY SEARCH GET KARTU KONTROL", + zap.String("query search", ""), + ) + + dataPasien := []models.DataPasien{ + { + NomorRegistrasi: "00234", + NomorLab: "LA90002", + NamaPasien: "Hendra Setiawan", + TanggalLahir: "2000-01-01", + Umur: "24 tahun", + JenisKelamin: "Laki-laki", + NamaDivisi: "Development", + NamaCompany: "PT. Sadhana Abiyasa Sampoerna", + }, + } + + dataPemeriksaanList := []models.DataPemeriksaanList{ + {NamaPemeriksaanList: "Hematologi Lengkap"}, + {NamaPemeriksaanList: "Urine Lengkap"}, + {NamaPemeriksaanList: "ACG"}, + {NamaPemeriksaanList: "Treadmill"}, + {NamaPemeriksaanList: "Pemeriksaan Fisik"}, + {NamaPemeriksaanList: "Hematologi Lengkap"}, + {NamaPemeriksaanList: "Urine Lengkap"}, + {NamaPemeriksaanList: "ACG"}, + {NamaPemeriksaanList: "Treadmill"}, + {NamaPemeriksaanList: "Pemeriksaan Fisik"}, + {NamaPemeriksaanList: "Hematologi Lengkap"}, + {NamaPemeriksaanList: "Urine Lengkap"}, + {NamaPemeriksaanList: "ACG"}, + {NamaPemeriksaanList: "Treadmill"}, + {NamaPemeriksaanList: "Pemeriksaan Fisik"}, + {NamaPemeriksaanList: "Hematologi Lengkap"}, + {NamaPemeriksaanList: "Urine Lengkap"}, + {NamaPemeriksaanList: "ACG"}, + {NamaPemeriksaanList: "Treadmill"}, + {NamaPemeriksaanList: "Pemeriksaan Fisik"}, + } + + dataPemeriksaanPengambilanSample := []models.DataPemeriksaanPengambilanSample{ + { + NamaPemeriksaanPengambilanSample: "Laboratorium", + SampleTypeListData: []models.SampleTypeList{ + { + SampleTypeName: "Darah", + SampleTypeDateTime: "15-05-2024 10:00", + SampleTypeStatus: "Sudah", + }, + { + SampleTypeName: "Urine", + SampleTypeDateTime: "15-05-2024 10:00", + SampleTypeStatus: "Sudah", + }, + }, + }, + { + NamaPemeriksaanPengambilanSample: "Rontgen", + SampleTypeListData: []models.SampleTypeList{ + { + SampleTypeName: "Thorax AP (PCR)", + SampleTypeDateTime: "", + SampleTypeStatus: "Sudah", + }, + }, + }, + { + NamaPemeriksaanPengambilanSample: "Elektromedis", + SampleTypeListData: []models.SampleTypeList{ + { + SampleTypeName: "ECG", + SampleTypeStatus: "Belum", + SampleTypeDateTime: "", + }, + }, + }, + } + + kartuKontrol := []models.KartuKontrolModel{ + { + KartuKontrolDataPasienList: dataPasien, + KartuKontrolDataPemeriksaanList: dataPemeriksaanList, + KartuKontrolDataPemeriksaanPengambilanSample: dataPemeriksaanPengambilanSample, + }, + } + + return kartuKontrol, nil +} diff --git a/views/public/kartukontrol/kartukontrol.templ b/views/public/kartukontrol/kartukontrol.templ new file mode 100644 index 0000000..9bfbe08 --- /dev/null +++ b/views/public/kartukontrol/kartukontrol.templ @@ -0,0 +1,247 @@ +package public_kartukontrol + +import ( + "cpone/models" + "cpone/layout" +) + +templ MainContentKartuKontrolLayout(dataKartuKontrol []models.KartuKontrolModel, hxGet string, hxTrigger string, idModal string) { +
+
+ if len(dataKartuKontrol) > 0 { + @ContentDataPasienList(dataKartuKontrol[0].KartuKontrolDataPasienList) + @ContentPemeriksaanLayout(dataKartuKontrol[0].KartuKontrolDataPemeriksaanList, dataKartuKontrol[0].KartuKontrolDataPemeriksaanPengambilanSample) + } +
+
+ @ModalMcuWordingProcessShow(hxTrigger, hxGet, idModal) +} + +templ ContentDataPasienList(dataPasienList []models.DataPasien) { + +
+
+
+

Data Pasien

+
+
+
No Registrasi
+
{ dataPasienList[0].NomorRegistrasi }
+
+
+
Nomor Lab
+
{ dataPasienList[0].NomorLab }
+
+
+
Nama Pasien
+
{ dataPasienList[0].NamaPasien }
+
+
+
Tanggal Lahir / Umur
+
{ dataPasienList[0].TanggalLahir } / { dataPasienList[0].Umur }
+
+
+
Jenis Kelamin
+
{ dataPasienList[0].JenisKelamin }
+
+
+
Divisi
+
{ dataPasienList[0].NamaDivisi }
+
+
+
Company
+
{ dataPasienList[0].NamaCompany }
+
+
+ +} + +templ ContentPemeriksaanLayout(dataPemeriksaanList []models.DataPemeriksaanList, dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) { +
+ @ContentPemeriksaanList(dataPemeriksaanList) +
+ @ContentPengambilanSampleList(dataPemeriksaanPengambilanSample) +} + +templ ContentPemeriksaanList(dataPemeriksaan []models.DataPemeriksaanList) { +
+
Daftar Pemeriksaan
+ if len(dataPemeriksaan) > 0 { + + } else { +
Belum Ada Daftar Pemeriksaan
+ } +
+} + +templ ContentPengambilanSampleList(dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) { +
+
+ +
Pemeriksaan / Pengambilan Sample
+ if len(dataPemeriksaanPengambilanSample) > 0 { + for _, v := range dataPemeriksaanPengambilanSample { +
+
{ v.NamaPemeriksaanPengambilanSample }
+ if len(v.SampleTypeListData) > 0 { +
    + for _, k := range v.SampleTypeListData { +
  • +
    +
    +
    { k.SampleTypeName }
    + if len(k.SampleTypeDateTime) > 0 { + { k.SampleTypeDateTime } + } +
    +
    + { k.SampleTypeStatus } +
    +
    +
  • + } +
+ } else { +
Belum Ada Data Pengambilan Sample
+ } +
+ } + } else { +
Belum Ada Data Pemeriksaan & Pengambilan Sample
+ } + +
+
+
+} + +templ ModalMcuWordingProcessShow(hxTrigger string, hxGet string, idModal string) { +
+
+} + +templ ModalMcuWordingShow(idModal string, messageWording string) { + + + +} + +templ CssKartuKontrol() { + + + + +} + +templ JsKartuKontrol() { +} + +templ ShowKartuKontrol(title string, cmp templ.Component, css templ.Component, js templ.Component) { + @layout.PlaygroundLayout(title, css, js) { + @cmp + } +} diff --git a/views/public/kartukontrol/kartukontrol_templ.go b/views/public/kartukontrol/kartukontrol_templ.go new file mode 100644 index 0000000..e568e54 --- /dev/null +++ b/views/public/kartukontrol/kartukontrol_templ.go @@ -0,0 +1,612 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package public_kartukontrol + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/layout" + "cpone/models" +) + +func MainContentKartuKontrolLayout(dataKartuKontrol []models.KartuKontrolModel, hxGet string, hxTrigger string, idModal string) 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_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(dataKartuKontrol) > 0 { + templ_7745c5c3_Err = ContentDataPasienList(dataKartuKontrol[0].KartuKontrolDataPasienList).Render(ctx, templ_7745c5c3_Buffer) + 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 = ContentPemeriksaanLayout(dataKartuKontrol[0].KartuKontrolDataPemeriksaanList, dataKartuKontrol[0].KartuKontrolDataPemeriksaanPengambilanSample).Render(ctx, templ_7745c5c3_Buffer) + 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 = ModalMcuWordingProcessShow(hxTrigger, hxGet, idModal).Render(ctx, templ_7745c5c3_Buffer) + 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 ContentDataPasienList(dataPasienList []models.DataPasien) 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Data Pasien

No Registrasi
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NomorRegistrasi) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 29, Col: 42} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Nomor Lab
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NomorLab) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 33, Col: 35} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Nama Pasien
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NamaPasien) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 37, Col: 37} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Tanggal Lahir / Umur
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].TanggalLahir) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 41, Col: 39} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + 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(dataPasienList[0].Umur) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 41, Col: 68} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Jenis Kelamin
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].JenisKelamin) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 45, Col: 39} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Divisi
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NamaDivisi) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 49, Col: 37} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Company
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NamaCompany) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 53, Col: 38} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + 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 + }) +} + +func ContentPemeriksaanLayout(dataPemeriksaanList []models.DataPemeriksaanList, dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) 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_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ContentPemeriksaanList(dataPemeriksaanList).Render(ctx, templ_7745c5c3_Buffer) + 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 = ContentPengambilanSampleList(dataPemeriksaanPengambilanSample).Render(ctx, templ_7745c5c3_Buffer) + 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 ContentPemeriksaanList(dataPemeriksaan []models.DataPemeriksaanList) 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_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Daftar Pemeriksaan
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(dataPemeriksaan) > 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("
Belum Ada Daftar Pemeriksaan
") + 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 + }) +} + +func ContentPengambilanSampleList(dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) 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_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Pemeriksaan / Pengambilan Sample
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(dataPemeriksaanPengambilanSample) > 0 { + for _, v := range dataPemeriksaanPengambilanSample { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(v.NamaPemeriksaanPengambilanSample) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 89, Col: 46} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + 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 len(v.SampleTypeListData) > 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, k := range v.SampleTypeListData { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var16 string + templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(k.SampleTypeName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 96, Col: 34} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) + 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 len(k.SampleTypeDateTime) > 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var17 string + templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(k.SampleTypeDateTime) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 98, Col: 70} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) + 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 = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var18 string + templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(k.SampleTypeStatus) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 102, Col: 122} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) + 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 = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Belum Ada Data Pengambilan Sample
") + 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 + } + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Belum Ada Data Pemeriksaan & Pengambilan Sample
") + 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 + }) +} + +func ModalMcuWordingProcessShow(hxTrigger string, hxGet string, idModal string) 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_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = 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) + } + return templ_7745c5c3_Err + }) +} + +func ModalMcuWordingShow(idModal string, messageWording string) 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_Var23 := templ.GetChildren(ctx) + if templ_7745c5c3_Var23 == nil { + templ_7745c5c3_Var23 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Perhatian

Loading...
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var25 string + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(messageWording) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 151, Col: 22} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) + 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 + }) +} + +func CssKartuKontrol() 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_Var26 := templ.GetChildren(ctx) + if templ_7745c5c3_Var26 == nil { + templ_7745c5c3_Var26 = 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) + } + return templ_7745c5c3_Err + }) +} + +func JsKartuKontrol() 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_Var27 := templ.GetChildren(ctx) + if templ_7745c5c3_Var27 == nil { + templ_7745c5c3_Var27 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func ShowKartuKontrol(title string, cmp templ.Component, css templ.Component, js 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_Var28 := templ.GetChildren(ctx) + if templ_7745c5c3_Var28 == nil { + templ_7745c5c3_Var28 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var29 := 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) + } + templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var29), templ_7745c5c3_Buffer) + 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 + }) +}