encounter mapping

This commit is contained in:
vanilia
2025-11-20 14:16:08 +07:00
parent 9a056701c6
commit 46d0c17669
12 changed files with 714 additions and 40 deletions
@@ -2,6 +2,7 @@ package patient
import (
"net/http"
pa "simrs-vx/internal/lib/auth"
rw "github.com/karincake/risoles"
sf "github.com/karincake/semprit"
@@ -19,10 +20,17 @@ type myBase struct{}
var O myBase
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
authInfo, err := pa.GetAuthInfo(r)
if err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
}
dto := e.CreateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.AuthInfo = *authInfo
res, err := u.Create(dto)
rw.DataResponse(w, res, err)
}