Beispiel #1
0
        public static async Task <HttpResponseMessage> HandleDeleteTDMStatus(TDMStatus tdmstatus, TraceWriter log, HttpRequestMessage req)
        {
            bool success = AzureCosmosDbManager.ClearCollection(log);

            if (success)
            {
                var response = new HttpResponseMessage(HttpStatusCode.Accepted);
                return(response);
            }
            else
            {
                var response = new HttpResponseMessage(HttpStatusCode.NotFound);
                return(response);
            }
        }
Beispiel #2
0
        public static async Task <HttpResponseMessage> HandleNewTDMStatus(TDMStatus tdmstatus, TraceWriter log, HttpRequestMessage req)
        {
            //Double check the ID field
            if (String.IsNullOrEmpty(tdmstatus.id))
            {
                tdmstatus.id = tdmstatus.REQID;
            }
            var storedDoc = await AzureCosmosDbManager.AddToCosmosDb(tdmstatus, log);

            if (storedDoc != null)
            {
                log.Info($"New Patient has been stored successfully: {storedDoc.Id}");
            }

            return(req.CreateResponse(HttpStatusCode.OK, "Succesfully added a new TDM Status"));
        }
Beispiel #3
0
        public static async Task <HttpResponseMessage> HandleUpdateTDMStatus(string REQID, TDMStatus tdmstatus, TraceWriter log, HttpRequestMessage req)
        {
            // TO DO:  Implement Update in AzureCosmosDbManager

            string id = await AzureCosmosDbManager.UpdateTDMStatus(REQID, tdmstatus, log);

            log.Info($"Updted TDM Status: {id}");

            return(req.CreateResponse(HttpStatusCode.OK, "Succesfully updated TDM Status"));
        }