Beispiel #1
0
        internal Dictionary <string, RadiologyReport> toImagingExamIds(string response)
        {
            if (String.IsNullOrEmpty(response))
            {
                return(null);
            }
            Dictionary <string, RadiologyReport> result = new Dictionary <string, RadiologyReport>();

            string[] rex = StringUtils.split(response, StringUtils.CRLF);
            rex = StringUtils.trimArray(rex);
            for (int i = 0; i < rex.Length; i++)
            {
                RadiologyReport newReport = new RadiologyReport();
                string[]        flds      = StringUtils.split(rex[i], StringUtils.CARET);
                newReport.AccessionNumber = newReport.getAccessionNumber(flds[2], flds[4], DateFormat.VISTA);
                newReport.Id          = flds[1];
                newReport.Timestamp   = flds[2];
                newReport.Title       = flds[3];
                newReport.CaseNumber  = flds[4];
                newReport.Status      = flds[5];
                newReport.Exam        = new ImagingExam();
                newReport.Exam.Status = (flds[8].Split(new char[] { '~' }))[1]; // e.g. 9~COMPLETE
                // maybe map some more fields? lot's of stuff being returned by RPC. For example:
                //ANN ARBOR VAMC;506
                //^6899085.8548-1
                //^3100914.1451
                //^TIBIA & FIBULA 2 VIEWS
                //^794
                //^Verified
                //^
                //^878633
                //^9~COMPLETE
                //^AA RADIOLOGY,AA
                //^RAD~GENERAL RADIOLOGY
                //^
                //^73590
                //^20323714
                //^N
                //^
                //^
                result.Add(newReport.AccessionNumber, newReport);
            }
            return(result);
        }
Beispiel #2
0
        internal RadiologyReport[] toRadiologyReports(string response)
        {
            if (response == "")
            {
                return null;
            }
            string[] lines = StringUtils.split(response, StringUtils.CRLF);
            ArrayList lst = new ArrayList();
            RadiologyReport rec = null;
            for (int i = 0; i < lines.Length; i++)
            {
                if (lines[i] == "")
                {
                    continue;
                }
                string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
                if (flds[1] == "[+]")
                {
                    lst.Add(rec);
                    continue;
                }
                int fldnum = Convert.ToInt32(flds[0]);
                switch (fldnum)
                {
                    // TODO
                    // need to consider the following case:
                    //1^NH CAMP PENDLETON;NH CAMP PENDLETON <--- not a recognized site code, should add to site 200
                    //2^05/24/2010 12:26
                    //3^L-SPINE, SERIES (3)
                    // lots more stuff in between
                    //10^[+]
                    case 1:
                        //if (rec != null)
                        //{
                        //    lst.Add(rec);
                        //}
                        rec = new RadiologyReport();
                        string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON);
                        if (parts.Length == 2)
                        {
                            rec.Facility = new SiteId(parts[1], parts[0]);
                        }
                        else if (flds[1] != "")
                        {
                            rec.Facility = new SiteId(cxn.DataSource.SiteId.Id, flds[1]);
                        }
                        else
                        {
                            rec.Facility = cxn.DataSource.SiteId;
                        }
                        break;
                    case 2:
                        if (flds.Length == 2)
                        {
                            rec.Timestamp = VistaTimestamp.toUtcFromRdv(flds[1]);
                        }
                        break;
                    case 3:
                        if (flds.Length == 2)
                        {
                            rec.Title = flds[1];
                        }
                        break;
                    case 4:
                        if (flds.Length == 2)
                        {
                            rec.Status = flds[1];
                        }
                        break;
                    case 5:
                        if (flds.Length == 2)
                        {
                            rec.CaseNumber = flds[1];
                            rec.AccessionNumber = rec.getAccessionNumber(rec.Timestamp, rec.CaseNumber, DateFormat.ISO);
                        }
                        break;
                    case 6:
                        if (flds.Length == 2)
                        {
                            rec.Text += flds[1] + '\n';
                        }
                        break;
                        //case 7:
                        //    if (flds.Length == 2)
                        //    {
                        //        rec.Impression += flds[1] + '\n';
                        //    }
                        //    break;
                        //case 8:
                        //    if (flds.Length == 2)
                        //    {
                        //        rec.Text += flds[1] + '\n';
                        //    }
                        //    break;
                }
            }
            //if (rec != null)
            //{
            //    lst.Add(rec);
            //}

            return (RadiologyReport[])lst.ToArray(typeof(RadiologyReport));
        }
Beispiel #3
0
 internal Dictionary<string, RadiologyReport> toImagingExamIds(string response)
 {
     if (String.IsNullOrEmpty(response))
     {
         return null;
     }
     Dictionary<string, RadiologyReport> result = new Dictionary<string, RadiologyReport>();
     string[] rex = StringUtils.split(response, StringUtils.CRLF);
     rex = StringUtils.trimArray(rex);
     for (int i = 0; i < rex.Length; i++)
     {
         RadiologyReport newReport = new RadiologyReport();
         string[] flds = StringUtils.split(rex[i], StringUtils.CARET);
         newReport.AccessionNumber = newReport.getAccessionNumber(flds[2], flds[4], DateFormat.VISTA);
         newReport.Id = flds[1];
         newReport.Timestamp = flds[2];
         newReport.Title = flds[3];
         newReport.CaseNumber = flds[4];
         newReport.Status = flds[5];
         newReport.Exam = new ImagingExam();
         newReport.Exam.Status = (flds[8].Split(new char[] { '~' }))[1]; // e.g. 9~COMPLETE
         // maybe map some more fields? lot's of stuff being returned by RPC. For example:
         //ANN ARBOR VAMC;506
         //^6899085.8548-1
         //^3100914.1451
         //^TIBIA & FIBULA 2 VIEWS
         //^794
         //^Verified
         //^
         //^878633
         //^9~COMPLETE
         //^AA RADIOLOGY,AA
         //^RAD~GENERAL RADIOLOGY
         //^
         //^73590
         //^20323714
         //^N
         //^
         //^
         result.Add(newReport.AccessionNumber, newReport);
     }
     return result;
 }
Beispiel #4
0
        internal RadiologyReport[] toRadiologyReports(string response)
        {
            if (response == "")
            {
                return(null);
            }
            string[]        lines = StringUtils.split(response, StringUtils.CRLF);
            ArrayList       lst   = new ArrayList();
            RadiologyReport rec   = null;

            for (int i = 0; i < lines.Length; i++)
            {
                if (lines[i] == "")
                {
                    continue;
                }
                string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
                if (flds[1] == "[+]")
                {
                    lst.Add(rec);
                    continue;
                }
                int fldnum = Convert.ToInt32(flds[0]);
                switch (fldnum)
                {
                // TODO
                // need to consider the following case:
                //1^NH CAMP PENDLETON;NH CAMP PENDLETON <--- not a recognized site code, should add to site 200
                //2^05/24/2010 12:26
                //3^L-SPINE, SERIES (3)
                // lots more stuff in between
                //10^[+]
                case 1:
                    //if (rec != null)
                    //{
                    //    lst.Add(rec);
                    //}
                    rec = new RadiologyReport();
                    string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON);
                    if (parts.Length == 2)
                    {
                        rec.Facility = new SiteId(parts[1], parts[0]);
                    }
                    else if (flds[1] != "")
                    {
                        rec.Facility = new SiteId(cxn.DataSource.SiteId.Id, flds[1]);
                    }
                    else
                    {
                        rec.Facility = cxn.DataSource.SiteId;
                    }
                    break;

                case 2:
                    if (flds.Length == 2)
                    {
                        rec.Timestamp = VistaTimestamp.toUtcFromRdv(flds[1]);
                    }
                    break;

                case 3:
                    if (flds.Length == 2)
                    {
                        rec.Title = flds[1];
                    }
                    break;

                case 4:
                    if (flds.Length == 2)
                    {
                        rec.Status = flds[1];
                    }
                    break;

                case 5:
                    if (flds.Length == 2)
                    {
                        rec.CaseNumber      = flds[1];
                        rec.AccessionNumber = rec.getAccessionNumber(rec.Timestamp, rec.CaseNumber, DateFormat.ISO);
                    }
                    break;

                case 6:
                    if (flds.Length == 2)
                    {
                        rec.Text += flds[1] + '\n';
                    }
                    break;
                    //case 7:
                    //    if (flds.Length == 2)
                    //    {
                    //        rec.Impression += flds[1] + '\n';
                    //    }
                    //    break;
                    //case 8:
                    //    if (flds.Length == 2)
                    //    {
                    //        rec.Text += flds[1] + '\n';
                    //    }
                    //    break;
                }
            }
            //if (rec != null)
            //{
            //    lst.Add(rec);
            //}

            return((RadiologyReport[])lst.ToArray(typeof(RadiologyReport)));
        }