feat (patient): add search
This commit is contained in:
@@ -105,6 +105,15 @@ func SetRoutes() http.Handler {
|
||||
"PATCH /{id}/block": user.O.Block,
|
||||
"PATCH /{id}/active": user.O.Active,
|
||||
})
|
||||
hk.GroupRoutes("/v1/patient", r, hk.MapHandlerFunc{
|
||||
"GET /": patient.O.GetList,
|
||||
"GET /{id}": patient.O.GetDetail,
|
||||
"POST /": patient.O.Create,
|
||||
"PATCH /{id}": patient.O.Update,
|
||||
"DELETE /{id}": patient.O.Delete,
|
||||
"GET /by-identifier": patient.O.Search,
|
||||
})
|
||||
|
||||
hc.RegCrud(r, "/v1/person", person.O)
|
||||
hc.RegCrud(r, "/v1/person-address", personaddress.O)
|
||||
hc.RegCrud(r, "/v1/person-contact", personcontact.O)
|
||||
@@ -113,7 +122,6 @@ func SetRoutes() http.Handler {
|
||||
hc.RegCrud(r, "/v1/nurse", nurse.O)
|
||||
hc.RegCrud(r, "/v1/nutritionist", nutritionist.O)
|
||||
hc.RegCrud(r, "/v1/pharmacist", pharmacist.O)
|
||||
hc.RegCrud(r, "/v1/patient", patient.O)
|
||||
|
||||
/******************** sources ********************/
|
||||
hc.RegCrud(r, "/v1/division", division.O)
|
||||
|
||||
@@ -69,3 +69,10 @@ func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
res, err := u.Delete(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Search(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.SearchDto{}
|
||||
sf.UrlQueryParam(&dto, *r.URL)
|
||||
res, err := u.Search(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user