public HttpResponseMessage GetVitals(string id) { _icu = _con.Resolve <ICUDBMySQLRepoInterfaceLib.IICUDBRepo>(); try { return(Request.CreateResponse(HttpStatusCode.OK, _icu.GetVitals(id))); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex)); } }
public HttpResponseMessage Put(string id, [FromBody] ICUStatu patientstatus) { _icu = _con.Resolve <ICUDBMySQLRepoInterfaceLib.IICUDBRepo>(); var entity = _icu.UpdatePatientStatus(id, patientstatus); if (entity == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "patient with id" + id + "Is not found")); } else { return(Request.CreateResponse(HttpStatusCode.OK, "models details successfully updated ")); } }
[HttpPost]//Adding customer details public HttpResponseMessage Post([FromBody] ICUStatu registerpatient) { _icu = _con.Resolve <ICUDBMySQLRepoInterfaceLib.IICUDBRepo>(); var entity = _icu.AddPatient(registerpatient); if (entity == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Patient not admitted ")); } else { return(Request.CreateResponse(HttpStatusCode.OK, "Patient admitted ")); } }
public void DischargePatient(string id, int bedno) { _db = _con.Resolve <ICUDBMySQLRepoInterfaceLib.IICUDBRepo>(); _db.DischargePatient(id, bedno); }