Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
        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)); }
        }
Пример #4
0
        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)); }
        }
Пример #5
0
        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();
            }
        }
Пример #6
0
 public ActionResult Index(int?id)
 {
     patientPage = GetPatientPage();
     return(View(patientPage));
 }
Пример #7
0
 private void btnPatient_Click(object sender, RoutedEventArgs e)
 {
     PatientPage patientPage = new PatientPage();
     mainFrame.Navigate(patientPage);
 }