// 0 1 2 3 4 5 6 7 8 911 12 13 14 15 //SAGINAW;655^1^CP ECHO^7586^PR702^MDPS1^^NOV 15,2011@10:15^MACHINE RESULTED^^^^CP ECHO^^864314^12511132 // notes - some procedure records have fewer fields. the result length appears to correspond to the value // in the 5 piece above. i'm sure there is some business rule there about what type of procedure or report // each record has. for now, should be ok since we make sure we have the id before fetching supplementary // note text. in the future, there may be other RPCs that can be invoked based on the other identifiers // that will return an alternate report type. maybe... internal IList <ClinicalProcedure> toClinicalProcedures(string response) { IList <ClinicalProcedure> results = new List <ClinicalProcedure>(); if (String.IsNullOrEmpty(response)) { return(results); } string[] records = StringUtils.split(response, StringUtils.CRLF); if (records == null || records.Length <= 0) { return(results); } for (int i = 0; i < records.Length; i++) { if (String.IsNullOrEmpty(records[i])) { continue; } ClinicalProcedure cp = new ClinicalProcedure(); string[] pieces = StringUtils.split(records[i], StringUtils.CARET); if (pieces.Length >= 1) { string[] siteFields = StringUtils.split(pieces[0], StringUtils.SEMICOLON); cp.Facility = new Site(siteFields[1], siteFields[0]); } if (pieces.Length > 1) { cp.ReportIen = pieces[1]; } if (pieces.Length > 2) { cp.Name = pieces[2]; } if (pieces.Length > 3) { cp.Id = pieces[3]; } if (pieces.Length > 7) { cp.Timestamp = pieces[7]; } if (pieces.Length > 15) { cp.Note = new Note(); cp.Note.Id = pieces[15]; } results.Add(cp); } return(results); }
public ClinicalProcedureTO(ClinicalProcedure mdo) { if (mdo == null) { return; } this.name = mdo.Name; this.timestamp = mdo.Timestamp; this.id = mdo.Id; if (mdo.Facility != null) { this.facility = new SiteTO(mdo.Facility); } if (mdo.Note != null) { this.note = new NoteTO(mdo.Note); } report = mdo.Report; }