Exemplo n.º 1
0
 public TaggedSurgicalPathologyRptArray(string tag, SurgicalPathologyReport mdo)
 {
     this.tag = tag;
     if (mdo == null)
     {
         this.count = 0;
         return;
     }
     this.rpts    = new SurgicalPathologyRpt[1];
     this.rpts[0] = new SurgicalPathologyRpt(mdo);
     this.count   = 1;
 }
Exemplo n.º 2
0
 public SurgicalPathologyRpt(SurgicalPathologyReport mdo)
 {
     this.id        = mdo.Id;
     this.title     = mdo.Title;
     this.timestamp = mdo.Timestamp;
     if (mdo.Author != null)
     {
         this.author = new AuthorTO(mdo.Author);
     }
     if (mdo.Facility != null)
     {
         this.facility = new TaggedText(mdo.Facility.Id, mdo.Facility.Name);
     }
     if (mdo.Specimen != null)
     {
         this.specimen = new LabSpecimenTO(mdo.Specimen);
     }
     this.clinicalHx  = mdo.ClinicalHx;
     this.description = mdo.Description;
     this.exam        = mdo.Exam;
     this.diagnosis   = mdo.Diagnosis;
     this.comment     = mdo.Comment;
 }
Exemplo n.º 3
0
        internal SurgicalPathologyReport[] toSurgicalPathologyReports(string response)
        {
            if (response == "")
            {
                return(null);
            }
            ArrayList lst = new ArrayList();

            string[] lines = StringUtils.split(response, StringUtils.CRLF);
            lines = StringUtils.trimArray(lines);
            SurgicalPathologyReport rpt = null;
            string specimenName         = "";
            string exam         = "";
            string accessionNum = "";

            for (int i = 0; i < lines.Length; i++)
            {
                string[] flds   = StringUtils.split(lines[i], StringUtils.CARET);
                int      fldnum = Convert.ToInt32(flds[0]);
                switch (fldnum)
                {
                case 1:
                    if (rpt != null)
                    {
                        if (!String.IsNullOrEmpty(specimenName))
                        {
                            specimenName = specimenName.Substring(0, specimenName.Length - 1);
                            rpt.Specimen = new LabSpecimen("", specimenName, "", accessionNum);
                        }
                        if (!String.IsNullOrEmpty(exam))
                        {
                            exam     = exam.Substring(0, exam.Length - 1);
                            rpt.Exam = exam;
                        }
                        lst.Add(rpt);
                    }
                    rpt       = new SurgicalPathologyReport();
                    rpt.Title = "Surgical Pathology Report";
                    if (flds.Length == 2)
                    {
                        string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON);
                        if (parts.Length == 2)
                        {
                            rpt.Facility = new SiteId(parts[0], parts[1]);
                        }
                        else if (flds[1] != "")
                        {
                            rpt.Facility = new SiteId(cxn.DataSource.SiteId.Id, flds[1]);
                        }
                        else
                        {
                            rpt.Facility = cxn.DataSource.SiteId;
                        }
                    }
                    break;

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

                case 3:
                    if (flds.Length == 2)
                    {
                        specimenName += flds[1] + '\n';
                    }
                    break;

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

                case 5:
                    if (flds.Length == 2)
                    {
                        if (!String.IsNullOrEmpty(flds[1].TrimEnd()))
                        {
                            exam += flds[1] + '\n';
                        }
                    }
                    break;
                }
            }

            if (rpt != null)
            {
                lst.Add(rpt);
            }
            return((SurgicalPathologyReport[])lst.ToArray(typeof(SurgicalPathologyReport)));
        }
Exemplo n.º 4
0
        internal SurgicalPathologyReport[] toSurgicalPathologyReports(string response)
        {
            if (response == "")
            {
                return null;
            }
            ArrayList lst = new ArrayList();
            string[] lines = StringUtils.split(response, StringUtils.CRLF);
            lines = StringUtils.trimArray(lines);
            SurgicalPathologyReport rpt = null;
            string specimenName = "";
            string exam = "";
            string accessionNum = "";
            for (int i = 0; i < lines.Length; i++)
            {
                string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
                int fldnum = Convert.ToInt32(flds[0]);
                switch (fldnum)
                {
                    case 1:
                        if (rpt != null)
                        {
                            if (!String.IsNullOrEmpty(specimenName))
                            {
                                specimenName = specimenName.Substring(0, specimenName.Length - 1);
                                rpt.Specimen = new LabSpecimen("", specimenName, "", accessionNum);
                            }
                            if (!String.IsNullOrEmpty(exam))
                            {
                                exam = exam.Substring(0, exam.Length - 1);
                                rpt.Exam = exam;
                            }
                            lst.Add(rpt);
                        }
                        rpt = new SurgicalPathologyReport();
                        rpt.Title = "Surgical Pathology Report";
                        if (flds.Length == 2)
                        {
                            string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON);
                            if (parts.Length == 2)
                            {
                                rpt.Facility = new SiteId(parts[0], parts[1]);
                            }
                            else if (flds[1] != "")
                            {
                                rpt.Facility = new SiteId(cxn.DataSource.SiteId.Id, flds[1]);
                            }
                            else
                            {
                                rpt.Facility = cxn.DataSource.SiteId;
                            }
                        }
                        break;
                    case 2:
                        if (flds.Length == 2)
                        {
                            rpt.Timestamp = VistaTimestamp.toUtcFromRdv(flds[1]);
                        }
                        break;
                    case 3:
                        if (flds.Length == 2)
                        {
                            specimenName += flds[1] + '\n';
                        }
                        break;
                    case 4:
                        if (flds.Length == 2)
                        {
                            accessionNum = flds[1];
                        }
                        break;
                    case 5:
                        if (flds.Length == 2)
                        {
                            if (!String.IsNullOrEmpty(flds[1].TrimEnd()))
                            {
                                exam += flds[1] + '\n';
                            }
                        }
                        break;
                }
            }

            if (rpt != null)
            {
                lst.Add(rpt);
            }
            return (SurgicalPathologyReport[])lst.ToArray(typeof(SurgicalPathologyReport));
        }