toUtcString() public static method

public static toUtcString ( string vistaTS ) : string
vistaTS string
return string
        internal IndexedHashtable toChemHemSpecimens(string[] response, ref string fromDate, ref string toDate)
        {
            IndexedHashtable result = new IndexedHashtable(response.Length);

            for (int i = 0; i < response.Length; i++)
            {
                string[]    flds     = StringUtils.split(response[i], StringUtils.CARET);
                LabSpecimen specimen = new LabSpecimen();
                specimen.Id             = flds[0];
                specimen.ReportDate     = VistaTimestamp.toUtcString(flds[2]);
                specimen.CollectionDate = VistaTimestamp.toUtcString(flds[1]);
                if (i == 0)
                {
                    fromDate = specimen.CollectionDate;
                }
                if (i == response.Length - 1)
                {
                    toDate = specimen.CollectionDate;
                }
                specimen.Name            = flds[3];
                specimen.AccessionNumber = flds[4];
                if (flds.Length > 6)
                {
                    specimen.Site = flds[5];
                }
                if (flds.Length > 7)
                {
                    specimen.Facility = new SiteId(flds[7], flds[6]);
                }
                string key = flds[1] + '^' + flds[4];
                result.Add(key, specimen);
            }
            return(result);
        }
Beispiel #2
0
        public string getTimestamp()
        {
            MdoQuery request  = buildGetTimestampRequest();
            string   response = (string)cxn.query(request);

            return(VistaTimestamp.toUtcString(response));
        }
Beispiel #3
0
        internal ProstheticClaim[] toProstheticClaims(string[] response)
        {
            if (response == null || response.Length == 0)
            {
                return(null);
            }
            List <ProstheticClaim> lst = new List <ProstheticClaim>(response.Length);

            for (int i = 0; i < response.Length; i++)
            {
                if (response[i] == "")
                {
                    continue;
                }
                response[i] = response[i].Replace("&#94;", "^");
                string[] flds = response[i].Split(new char[] { '^' });
                if (flds.Length == 0)
                {
                    continue;
                }
                ProstheticClaim claim = new ProstheticClaim();
                claim.Id = flds[0];
                if (flds.Length > 1)
                {
                    claim.PatientId = flds[1];
                }
                if (flds.Length > 2)
                {
                    claim.PatientName = flds[2];
                }
                if (flds.Length > 3)
                {
                    claim.EpisodeDate = VistaTimestamp.toUtcString(flds[3]);
                }
                if (flds.Length > 4)
                {
                    claim.ItemId = flds[4];
                }
                if (flds.Length > 5)
                {
                    claim.Timestamp = VistaTimestamp.toUtcString(flds[5]);
                }
                if (flds.Length > 6)
                {
                    claim.LastEditTimestamp = VistaTimestamp.toUtcString(flds[6]);
                }
                lst.Add(claim);
            }
            return((ProstheticClaim[])lst.ToArray());
        }
        internal VitalSign[] toLatestVitalSigns(string response)
        {
            if (!cxn.IsConnected)
            {
                throw new NotConnectedException();
            }

            if (response == "")
            {
                return(null);
            }
            string[]  lines    = StringUtils.split(response, StringUtils.CRLF);
            ArrayList lst      = new ArrayList(lines.Length);
            string    category = "Vital Signs";

            for (int i = 0; i < lines.Length; i++)
            {
                if (lines[i] == "")
                {
                    continue;
                }
                string[]        flds            = StringUtils.split(lines[i], StringUtils.CARET);
                ObservationType observationType = null;
                if (flds[1] == "T")
                {
                    observationType = new ObservationType(flds[0], category, "Temperature");
                }
                else if (flds[1] == "P")
                {
                    observationType = new ObservationType(flds[0], category, "Pulse");
                }
                else if (flds[1] == "R")
                {
                    observationType = new ObservationType(flds[0], category, "Respiration");
                }
                else if (flds[1] == "BP")
                {
                    observationType = new ObservationType(flds[0], category, "Blood Pressure");
                }
                else if (flds[1] == "HT")
                {
                    observationType = new ObservationType(flds[0], category, "Height");
                }
                else if (flds[1] == "WT")
                {
                    observationType = new ObservationType(flds[0], category, "Weight");
                }
                else if (flds[1] == "PN")
                {
                    observationType = new ObservationType(flds[0], category, "Pain");
                }
                if (observationType == null)
                {
                    continue;
                }
                VitalSign observation = new VitalSign();
                observation.Type   = observationType;
                observation.Value1 = flds[4];
                if (flds.Length == 6)
                {
                    observation.Value2 = flds[5];
                }
                observation.Timestamp = VistaTimestamp.toUtcString(flds[3]);
                lst.Add(observation);
            }
            return((VitalSign[])lst.ToArray(typeof(VitalSign)));
        }
        internal ChemHemReport toChemHemReport(string response, ref string nextDate)
        {
            if (String.IsNullOrEmpty(response))
            {
                return(null);
            }

            string[] lines = StringUtils.split(response, StringUtils.CRLF);
            lines = StringUtils.trimArray(lines);
            string[] flds = StringUtils.split(lines[0], StringUtils.CARET);
            nextDate = flds[2];
            if (flds[1] != "CH")
            {
                return(null);
            }
            if (lines.Length == 1)
            {
                return(null);
            }
            int           ntests = Convert.ToInt16(flds[0]);
            ChemHemReport rpt    = new ChemHemReport();

            rpt.Id        = flds[2] + '^' + flds[5];
            rpt.Timestamp = flds[2];
            rpt.Specimen  = new LabSpecimen();
            rpt.Specimen.CollectionDate  = VistaTimestamp.toUtcString(flds[2]);
            rpt.Specimen.Name            = flds[4];
            rpt.Specimen.AccessionNumber = flds[5];
            rpt.Author      = new Author();
            rpt.Author.Name = flds[6];

            int lineIdx = 1;

            for (lineIdx = 1; lineIdx <= ntests; lineIdx++)
            {
                LabResult lr = new LabResult();
                flds = StringUtils.split(lines[lineIdx], StringUtils.CARET);
                if (flds.Length < 6)
                {
                    continue;
                }
                lr.Test = new LabTest();

                lr.Test.Id        = flds[0];
                lr.Test.Name      = flds[1];
                lr.Value          = flds[2].Trim();
                lr.BoundaryStatus = flds[3];
                lr.Test.Units     = flds[4].Trim();
                lr.Test.RefRange  = flds[5];

                // MHV patch - probably no one needs this
                lr.LabSiteId = cxn.DataSource.SiteId.Id;

                rpt.AddResult(lr);
            }

            rpt.Comment = "";
            while (lineIdx < lines.Length)
            {
                rpt.Comment += lines[lineIdx++].TrimStart() + "\r\n";
            }

            return(rpt);
        }