public TaggedChemHemRptArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedChemHemRptArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i), (ChemHemReport[])t.GetValue(i)); } else { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i), (ChemHemReport)t.GetValue(i)); } } count = t.Count; }
public TaggedChemHemRptArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedChemHemRptArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable)) { IList <ChemHemReport> temp = ((System.Collections.Hashtable)t.GetValue(i))["labs"] as IList <ChemHemReport>; if (temp == null || temp.Count == 0) { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i)); } else { ChemHemReport [] ary = new ChemHemReport[temp.Count]; temp.CopyTo(ary, 0); arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i), ary); } } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i), (ChemHemReport[])t.GetValue(i)); } else { arrays[i] = new TaggedChemHemRptArray((string)t.GetKey(i), (ChemHemReport)t.GetValue(i)); } } count = t.Count; }
public TaggedChemHemRptArray getChemHemReportsByReportDateFromSite( string pwd, string sitecode, string mpiPid, string fromDate, string toDate) { TaggedChemHemRptArray result = new TaggedChemHemRptArray(); if (String.IsNullOrEmpty(sitecode)) { result.fault = new FaultTO("Missing sitecode"); } else if (mpiPid == "") { result.fault = new FaultTO("Missing mpiPid"); } else if (fromDate == "") { result.fault = new FaultTO("Missing fromDate"); } if (result.fault != null) { return result; } if (toDate == "") { toDate = DateTime.Now.ToString("yyyyMMdd"); } AccountLib acctLib = new AccountLib(mySession); try { SiteArray sites = acctLib.patientVisit(pwd, sitecode, mpiPid, false); if (sites.fault != null) { result.fault = sites.fault; return result; } // Get the labs... ChemHemReport[] rpts = ChemHemReport.getChemHemReports(mySession.ConnectionSet.getConnection(sitecode), fromDate, toDate); result = new TaggedChemHemRptArray(sitecode, rpts); } catch (Exception e) { result.fault = new FaultTO(e.Message); } finally { mySession.close(); } return result; }