public async Task <PatientPage> GetPatients(string query, int limit, int skip) { try { List <Patient> collection; if (!String.IsNullOrWhiteSpace(query)) { query = "{'$and':[{'Diagnose':{$exists:true}},{'Diagnose.Symptoms':{$exists:true}}," + query + "]}"; var doc = BsonDocument.Parse(query); collection = await _patients.Find(doc) .Skip(skip) .Limit(limit) .ToListAsync(); } else { collection = await _patients.Find(p => true) .Skip(skip) .Limit(limit) .ToListAsync(); } var patientPage = new PatientPage { Patients = collection.ConvertToDTOExtension().ToList(), Count = Convert.ToInt32(await _patients.CountAsync(new BsonDocument())) }; return(patientPage); } catch (Exception e) { Debug.WriteLine(e.Message); return(null); } }
public async Task <PatientPage> GetPatients(FindPatientModel model, int limit, int skip) { try { List <Patient> collection; if (!String.IsNullOrWhiteSpace(model.PatientId)) { collection = await _patients.Find(p => p.PatientId == model.PatientId) .Skip(skip) .Limit(limit) .ToListAsync(); } else { collection = await _patients.Find(p => p.Name == model.Name).ToListAsync(); } var patientPage = new PatientPage { Patients = collection.ConvertToDTOExtension().ToList(), Count = Convert.ToInt32(await _patients.CountAsync(new BsonDocument())) }; return(patientPage); } catch (Exception e) { Debug.WriteLine(e.Message); return(null); } }
public async Task <IHttpActionResult> GetPatients([FromBody] object body, [FromUri] int limit, [FromUri] int skip) { try { string query = body.ToString(); PatientPage patientPage = await _manager.GetPatients(query, limit, skip); return(patientPage.Patients.Count() > 0 ? Json(patientPage) : (IHttpActionResult)BadRequest("no patients found!")); } catch (Exception ex) { return(InternalServerError(ex)); } }
public async Task <IHttpActionResult> GetPatients([FromUri] string patientId) { try { if (patientId != null) { return(Json(await _manager.GetPatient(patientId))); } PatientPage patientPage = await _manager.GetPatients(new FindPatientModel { PatientId = patientId }); return(patientPage.Patients.Count() > 0 ? Json(patientPage) : (IHttpActionResult)BadRequest("no patients found!")); } catch (Exception ex) { return(InternalServerError(ex)); } }
private void MainForm_Load(object sender, EventArgs e) { Messager.Caption = "C# Modality Worklist WCF Demo"; Text = Messager.Caption; try { _ConfigFile = DicomDemoSettingsManager.GetSettingsFilename("WCFClient"); if (!File.Exists(_ConfigFile)) { DicomDemoSettingsManager.RunPacsConfigDemo(); if (!File.Exists(_ConfigFile)) { Messager.Show(this, "No configuration file.\nApplication cannot continue without configuration", MessageBoxIcon.Warning, MessageBoxButtons.OK); Close(); } } SetServiceClient(); _introductionPage = new IntroductionPage(); _patientPage = new PatientPage(); _imagingServiceRequestPage = new ImagingServiceRequestPage(); _requestedProcedurePage = new RequestedProcedurePage(); _scheduledProcedureStepPage = new ScheduledProcedureStepPage(); wizardSheet.Pages.Add(_introductionPage); wizardSheet.Pages.Add(_patientPage); wizardSheet.Pages.Add(_imagingServiceRequestPage); wizardSheet.Pages.Add(_requestedProcedurePage); wizardSheet.Pages.Add(_scheduledProcedureStepPage); wizardSheet.SetActivePage(0); } catch (Exception ex) { Messager.ShowError(this, ex.Message + "\r\n\r\nApplication will exit."); Application.Exit(); } }
public ActionResult Index(int?id) { patientPage = GetPatientPage(); return(View(patientPage)); }
private void btnPatient_Click(object sender, RoutedEventArgs e) { PatientPage patientPage = new PatientPage(); mainFrame.Navigate(patientPage); }