Esempio n. 1
0
        private void buttonQuery_Click(object sender, EventArgs e)
        {
            ProgressDialog           dlgProgresss = new ProgressDialog();
            List <WCFPPSInformation> mppsInfo     = null;
            string modality = Modality.Text;
            string status   = Status.Text;

            SearchResults.Items.Clear();
            dlgProgresss.Title       = "Query";
            dlgProgresss.Description = "Getting list of unscheduled mpps";
            dlgProgresss.Action      = () =>
            {
                MPPSQuery query = new MPPSQuery()
                {
                    AccessionNumber = AccessionNumber.Text, RequestedProcedureId = RequestedProcedureId.Text, ScheduledProcedureId = ScheduledProcedureId.Text
                };

                query.Patient = new WCFPatient()
                {
                    PatientID = PatientId.Text, PatientNameGivenName = Firstname.Text, PatientNameFamilyName = Lastname.Text
                };
                query.PPSInfo = new WCFPPSInformation()
                {
                    PerformedStationAETitle = PerformedStationAe.Text, Modality = modality, PerformedProcedureStepStatus = status
                };
                query.PPSInfo.PerformedProcedureStepStartDate = GetDate(StartDateBegin, StartDateEnd);
                query.PPSInfo.PerformedProcedureStepEndDate   = GetDate(EndDateBegin, EndDateEnd);
                mppsInfo = _Client.QueryMPPS(query);
            };

            if (dlgProgresss.ShowDialog(this) == DialogResult.OK)
            {
                foreach (WCFPPSInformation info in mppsInfo)
                {
                    string       patientid = info.Patient != null?info.Patient.PatientID:string.Empty;
                    ListViewItem item      = SearchResults.Items.Add(patientid);

                    if (info.Patient != null)
                    {
                        item.SubItems.Add(info.Patient.PatientNameGivenName + " " + info.Patient.PatientNameFamilyName);
                    }
                    else
                    {
                        item.SubItems.Add(string.Empty);
                    }

                    item.SubItems.Add(info.PerformedProcedureStepStatus);
                    item.SubItems.Add(info.Modality);
                    item.SubItems.Add(info.PerformedProcedureStepID);
                    item.SubItems.Add(info.PerformedStationAETitle);
                    item.SubItems.Add(info.PerformedProcedureStepStartDate.HasValue ? info.PerformedProcedureStepStartDate.Value.Date1.ToString() : string.Empty);
                    item.SubItems.Add(info.PerformedProcedureStepEndDate.HasValue ? info.PerformedProcedureStepEndDate.Value.Date1.ToString() : string.Empty);
                    item.Tag = info;
                }
            }

            if (dlgProgresss.Exception != null)
            {
                string errorMessage = dlgProgresss.Exception.Message;
                if (errorMessage.Contains("There was no endpoint listening at"))
                {
                    string append = string.Format("\n\nThis can happen if the '{0}' listening service is not running.  To start '{0}' listening service:\n* Run 'CSLeadtools.Dicom.Server.Manager_Original.exe'\n* Click the double-green arrow (Start All Servers)", _worklistServer);
                    errorMessage += append;
                }
                Messager.ShowError(this, errorMessage);
            }
        }