on going chemo plan
This commit is contained in:
@@ -338,29 +338,3 @@ func (obj myBase) CreateWithPatient(w http.ResponseWriter, r *http.Request) {
|
|||||||
res, err := u.CreateWithPatient(dto)
|
res, err := u.CreateWithPatient(dto)
|
||||||
rw.DataResponse(w, res, err)
|
rw.DataResponse(w, res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj myBase) CreateWithPatient(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.CreateWithPatientDto{}
|
|
||||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate SubClass
|
|
||||||
if err := verifyClassCode(dto.Encounter); err != nil {
|
|
||||||
rw.DataResponse(w, nil, d.FieldError{
|
|
||||||
Code: dataValidationFail,
|
|
||||||
Message: err.Error(),
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
dto.Encounter.AuthInfo = *authInfo
|
|
||||||
dto.Patient.AuthInfo = *authInfo
|
|
||||||
res, err := u.CreateWithPatient(dto)
|
|
||||||
rw.DataResponse(w, res, err)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ func Verify(input e.VerifyDto) (*d.Data, error) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &d.Data{
|
return &d.Data{
|
||||||
|
|||||||
Reference in New Issue
Block a user