public TaggedMicrobiologyRptArray(string tag, MicrobiologyReport mdo) { this.tag = tag; if (mdo == null) { this.count = 0; return; } this.rpts = new MicrobiologyRpt[1]; this.rpts[0] = new MicrobiologyRpt(mdo); this.count = 1; }
public TaggedMicrobiologyRptArray(string tag, MicrobiologyReport[] mdos) { this.tag = tag; if (mdos == null) { this.count = 0; return; } this.rpts = new MicrobiologyRpt[mdos.Length]; for (int i = 0; i < mdos.Length; i++) { this.rpts[i] = new MicrobiologyRpt(mdos[i]); } this.count = rpts.Length; }
public MicrobiologyRpt(MicrobiologyReport 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.comment = mdo.Comment; this.sample = mdo.Sample; this.text = mdo.Text; }
internal MicrobiologyReport[] toMicrobiologyReports(string response) { if (response == "") { return(null); } ArrayList lst = new ArrayList(); string[] lines = StringUtils.split(response, '\n'); lines = StringUtils.trimArray(lines); MicrobiologyReport rpt = null; for (int i = 0; i < lines.Length; i++) { lines[i] = lines[i].Replace("<\\Line>", ""); int firstGT = lines[i].IndexOf(">"); lines[i] = lines[i].Substring(firstGT + 1, lines[i].Length - firstGT - 1); string[] flds = StringUtils.split(lines[i], StringUtils.CARET); if (!StringUtils.isNumeric(flds[0])) // the last two lines appear to be the RPC string and the number of results - just ignoring for now but may be useful later { continue; } int fldnum = Convert.ToInt32(flds[0]); switch (fldnum) { case 1: if (rpt != null) { if (!String.IsNullOrEmpty(rpt.Sample)) { rpt.Sample = rpt.Sample.Substring(0, rpt.Sample.Length - 1); } lst.Add(rpt); } rpt = new MicrobiologyReport(); rpt.Title = "Microbiology Report"; if (flds.Length == 2) { string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON); if (parts.Length == 2) { rpt.Facility = new SiteId(parts[1], parts[0]); } 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) { rpt.Title = flds[1]; } break; case 4: if (flds.Length == 2) { rpt.Sample += flds[1] + '\n'; } break; case 5: if (flds.Length == 2) { rpt.Specimen = new LabSpecimen("", flds[1], "", ""); } break; case 6: if (flds.Length == 2) { rpt.Specimen.AccessionNumber = flds[1]; } break; case 7: if (flds.Length == 2) { rpt.Text += flds[1] + '\n'; } break; } } if (rpt != null) { lst.Add(rpt); } return((MicrobiologyReport[])lst.ToArray(typeof(MicrobiologyReport))); }
internal MicrobiologyReport[] toMicrobiologyReports(string response) { if (response == "") { return(null); } ArrayList lst = new ArrayList(); string[] lines = StringUtils.split(response, StringUtils.CRLF); lines = StringUtils.trimArray(lines); MicrobiologyReport rpt = null; 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(rpt.Sample)) { rpt.Sample = rpt.Sample.Substring(0, rpt.Sample.Length - 1); } lst.Add(rpt); } rpt = new MicrobiologyReport(); rpt.Title = "Microbiology Report"; if (flds.Length == 2) { string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON); if (parts.Length == 2) { rpt.Facility = new SiteId(parts[1], parts[0]); } 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) { rpt.Title = flds[1]; } break; case 4: if (flds.Length == 2) { rpt.Sample += flds[1] + '\n'; } break; case 5: if (flds.Length == 2) { rpt.Specimen = new LabSpecimen("", flds[1], "", ""); } break; case 6: if (flds.Length == 2) { rpt.Specimen.AccessionNumber = flds[1]; } break; case 7: if (flds.Length == 2) { rpt.Text += flds[1] + '\n'; } break; } } if (rpt != null) { lst.Add(rpt); } return((MicrobiologyReport[])lst.ToArray(typeof(MicrobiologyReport))); }
internal MicrobiologyReport[] toMicrobiologyReports(string response) { if (response == "") { return null; } ArrayList lst = new ArrayList(); string[] lines = StringUtils.split(response, StringUtils.CRLF); lines = StringUtils.trimArray(lines); MicrobiologyReport rpt = null; 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(rpt.Sample)) { rpt.Sample = rpt.Sample.Substring(0, rpt.Sample.Length - 1); } lst.Add(rpt); } rpt = new MicrobiologyReport(); rpt.Title = "Microbiology Report"; if (flds.Length == 2) { string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON); if (parts.Length == 2) { rpt.Facility = new SiteId(parts[1], parts[0]); } 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) { rpt.Title = flds[1]; } break; case 4: if (flds.Length == 2) { rpt.Sample += flds[1] + '\n'; } break; case 5: if (flds.Length == 2) { rpt.Specimen = new LabSpecimen("",flds[1],"",""); } break; case 6: if (flds.Length == 2) { rpt.Specimen.AccessionNumber = flds[1]; } break; case 7: if (flds.Length == 2) { rpt.Text += flds[1] + '\n'; } break; } } if (rpt != null) { lst.Add(rpt); } return (MicrobiologyReport[])lst.ToArray(typeof(MicrobiologyReport)); }