public async Task <string> RemoveAppointments() { string json = "<b>Appointments with the following ID(s) are deleted: </b>"; try { FHIRService fHIRService = new FHIRService(); JObject jObj = await fHIRService.GetAppointments(); List <Appointment> ApptList = new List <Appointment>(); var entry = jObj["entry"]; var count = entry.Count(); for (int i = 0; i < count; i++) { string apptID = (string)entry[i]["resource"]["id"]; JsonConvert.SerializeObject(await fHIRService.DeleteAppointment(apptID)); json = json + " </br> " + apptID; } // json = JsonConvert.SerializeObject(await fHIRService.DeleteAppointment("82ef6987-c77e-4e26-8559-2b27f73a8ae9")); } catch (Exception ex) { } return(json); }
public async Task <string> GetAppointments() { FHIRService fHIRService = new FHIRService(); string json = JsonConvert.SerializeObject(await fHIRService.GetAppointments()); return(json); }