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,6 +35,11 @@ func (h Handler) RegisterLab(w http.ResponseWriter, r *http.Request) {
writeLabResponse(w, http.StatusUnprocessableEntity, false, "validation_error", err.Error(), nil)
return
}
// Departemen registrasi ditentukan per instance CPONE melalui .env.
// Payload tetap didukung untuk handler/test lama yang tidak memakai config.
if h.departmentID != "" {
payload["departemen_id"] = h.departmentID
}
validated, validationMessage := validateLabRegistration(payload)
if validationMessage != "" {