feat: add CPONE patient registration endpoint

This commit is contained in:
2026-09-07 16:25:32 +07:00
parent aae3c733ae
commit c5a959742b
11 changed files with 665 additions and 79 deletions

View File

@@ -35,7 +35,7 @@ func main() {
}
defer resolver.Close()
handler := apphttp.NewDynamicHandler(cfg.RSCode)
handler := apphttp.NewDynamicHandler(cfg.RSCode, cfg.DepartmentID)
protected := func(handler http.Handler) http.Handler {
return apphttp.BearerAuth(cfg.BearerToken, apphttp.SelectDatabase(resolver, handler))
}
@@ -56,6 +56,7 @@ func main() {
mux.Handle("GET /api/cpone/periode-tarif/{periodeTarifID}", protected(http.HandlerFunc(handler.ListPeriodeTarifLayanan)))
mux.Handle("GET /api/cpone/layanan-mapping-harga", protected(http.HandlerFunc(handler.MappingHarga)))
mux.Handle("POST /api/cpone/patients/medrec", protected(http.HandlerFunc(handler.StoreMedrec)))
mux.Handle("POST /api/cpone/patients/registration", protected(http.HandlerFunc(handler.RegisterPatient)))
mux.Handle("POST /api/cpone/patients/lab-registration", protected(http.HandlerFunc(handler.RegisterLab)))
mux.Handle("POST /api/cpone/patients/lab-registration/{regId}/services", protected(http.HandlerFunc(handler.AddLabServices)))
mux.Handle("POST /api/cpone/patients/lab-registration/{regId}/packages", protected(http.HandlerFunc(handler.AddLabPackage)))