/// <summary> /// Use this contructor for results from the VPR so only the correct note type is built for a request. "documents" for all notes, "dischargeSummaries" for that specific note type /// </summary> /// <param name="t"></param> /// <param name="noteType"></param> public TaggedNoteArrays(IndexedHashtable t, string noteType) { if (t == null || t.Count == 0) { return; } count = t.Count; arrays = new TaggedNoteArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedNoteArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedNoteArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable)) { if (noteType.Equals("documents")) { buildAllNotes(t, i); } else if (noteType.Equals("dischargeSummaries")) { buildDischargeSummaries(t, i); } } } }
public TaggedMentalHealthInstrumentAdministrationArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedMentalHealthInstrumentAdministrationArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedMentalHealthInstrumentAdministrationArray((string)t.GetKey(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedMentalHealthInstrumentAdministrationArray((string)t.GetKey(i), (MentalHealthInstrumentAdministration[])t.GetValue(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { fault = new FaultTO((Exception)t.GetValue(i)); } else { arrays[i] = new TaggedMentalHealthInstrumentAdministrationArray((string)t.GetKey(i), (List <MentalHealthInstrumentAdministration>)t.GetValue(i)); } } count = t.Count; }
public TaggedImagingExamArrays(IndexedHashtable ihs) { if (ihs == null || ihs.Count <= 0) { return; } this.count = ihs.Count; arrays = new TaggedImagingExamArray[ihs.Count]; for (int i = 0; i < ihs.Count; i++) { if (ihs.GetValue(i) == null) { arrays[i] = new TaggedImagingExamArray((string)ihs.GetKey(i)); } else if (MdwsUtils.isException(ihs.GetValue(i))) { arrays[i] = new TaggedImagingExamArray((string)ihs.GetKey(i), ihs.GetValue(i) as Exception); } else if (ihs.GetValue(i).GetType() == typeof(Hashtable)) { arrays[i] = new TaggedImagingExamArray((string)ihs.GetKey(i), ((Hashtable)ihs.GetValue(i))["radiologyExams"] as IList <ImagingExam>); } } }
public TaggedLabTestArrays(IndexedHashtable labTests) { if (labTests == null || labTests.Count == 0) { return; } arrays = new TaggedLabTestArray[labTests.Count]; for (int i = 0; i < labTests.Count; i++) { string tag = (string)labTests.GetKey(i); if (labTests.GetValue(i) == null) { arrays[i] = new TaggedLabTestArray(tag); } if (labTests.GetValue(i) is IList <LabTest> ) { arrays[i] = new TaggedLabTestArray(tag, (IList <LabTest>)labTests.GetValue(i)); } else if (labTests.GetValue(i) is LabTest[]) { arrays[i] = new TaggedLabTestArray(tag); } else if (labTests.GetValue(i) is LabTest) { arrays[i] = new TaggedLabTestArray(tag); } else { return; } } }
public TaggedProstheticClaimArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedProstheticClaimArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedProstheticClaimArray((string)t.GetKey(i)); } else if (t.GetValue(i).GetType().IsAssignableFrom(typeof(Exception))) { arrays[i] = new TaggedProstheticClaimArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedProstheticClaimArray((string)t.GetKey(i), (ProstheticClaim[])t.GetValue(i)); } else { arrays[i] = new TaggedProstheticClaimArray((string)t.GetKey(i), (ProstheticClaim)t.GetValue(i)); } } count = t.Count; }
public TaggedCytologyRptArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedCytologyRptArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i), (CytologyReport[])t.GetValue(i)); } else { arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i), (CytologyReport)t.GetValue(i)); } } count = t.Count; }
public TaggedImmunizationArrays(IndexedHashtable t) { if (t == null || t.Count == 0) { return; } count = t.Count; arrays = new TaggedImmunizationArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedImmunizationArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedImmunizationArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable)) { arrays[i] = new TaggedImmunizationArray((string)t.GetKey(i), ((System.Collections.Hashtable)t.GetValue(i))["immunizations"] as IList <Immunization>); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedImmunizationArray((string)t.GetKey(i), ((Immunization[])t.GetValue(i)).ToList()); } else if (t.GetValue(i).GetType() == typeof(IList <Immunization>)) { arrays[i] = new TaggedImmunizationArray((string)t.GetKey(i), (IList <Immunization>)t.GetValue(i)); } } }
public TaggedOefOifArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedOefOifArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (MdwsUtils.isException(t.GetValue(i))) { fault = new FaultTO((Exception)t.GetValue(i)); } else if (t.GetValue(i) == null) { arrays[i] = new TaggedOefOifArray((string)t.GetKey(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedOefOifArray((string)t.GetKey(i), (OEF_OIF[])t.GetValue(i)); } else { arrays[i] = new TaggedOefOifArray((string)t.GetKey(i), (OEF_OIF)t.GetValue(i)); } } count = t.Count; }
public TaggedFaultArray(IndexedHashtable ihs) { if (ihs == null || ihs.Count == 0) { return; } IList <TaggedFault> temp = new List <TaggedFault>(); for (int i = 0; i < ihs.Count; i++) { if (MdwsUtils.isException(ihs.GetValue(i))) { temp.Add(new TaggedFault((string)ihs.GetKey(i), (Exception)ihs.GetValue(i))); } } if (temp.Count > 0) { // we want to remove the exceptions from the hashtable because, in container objects, the constructors // for each of the property objects handle exception info. we need to keep the tag though so results collections are consistent foreach (TaggedFault tf in temp) { ihs.Remove(tf.tag); ihs.Add(tf.tag, null); } faults = new TaggedFault[temp.Count]; temp.CopyTo(faults, 0); } }
public TaggedLabReportArrays(IndexedHashtable ihs) { if (ihs == null || ihs.Count == 0) { return; } this.count = ihs.Count; arrays = new TaggedLabReportArray[ihs.Count]; for (int i = 0; i < ihs.Count; i++) { string tag = (string)ihs.GetKey(i); if (ihs.GetValue(i) == null) { arrays[i] = new TaggedLabReportArray(); } else if (MdwsUtils.isException(ihs.GetValue(i))) { arrays[i] = new TaggedLabReportArray(tag, ihs.GetValue(i) as Exception); } else if (ihs.GetValue(i).GetType().Equals(typeof(Hashtable))) { arrays[i] = new TaggedLabReportArray(tag, (IList <LabReport>)((Hashtable)ihs.GetValue(i))["accessions"]); } } }
public static IndexedHashtable execute2(IndexedHashtable cxnTable, string daoName, string methodName, Object[] args) { if (cxnTable == null || cxnTable.Count == 0) { throw new Exception("No connections!"); } int lth = cxnTable.Count; QueryThread[] queries = new QueryThread[lth]; Thread[] threads = new Thread[lth]; for (int i = 0; i < lth; i++) { if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception))) { continue; } Connection cxn = (Connection)cxnTable.GetValue(i); if (!cxn.IsConnected) { continue; } Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName); if (dao == null) { continue; } queries[i] = new QueryThread(dao, methodName, args); threads[i] = new Thread(new ThreadStart(queries[i].execute)); threads[i].Start(); } IndexedHashtable result = new IndexedHashtable(cxnTable.Count); for (int i = 0; i < threads.Length; i++) { if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception))) { result.Add((string)cxnTable.GetKey(i), (Exception)cxnTable.GetValue(i)); continue; } Connection cxn = (Connection)cxnTable.GetValue(i); if (!cxn.IsConnected) { result.Add((string)cxnTable.GetKey(i), new Exception("Source is not connected")); continue; } Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName); if (dao == null) { result.Add((string)cxnTable.GetKey(i), new Exception("Invalid dao: " + daoName)); continue; } threads[i].Join(); result.Add((String)cxnTable.GetKey(i), queries[i].Result); } return result; }
public PatientMedicalRecordTO(IndexedHashtable ihs) { initCollections(); if (ihs == null || ihs.Count == 0) { return; } for (int i = 0; i < ihs.Count; i++) { object key = ihs.GetKey(i); if (!(key is string)) { continue; } string sitecode = key as string; if (!(ihs.GetValue(i) is Hashtable)) { continue; } Hashtable domains = ihs.GetValue(i) as Hashtable; Meds.add(sitecode, domains["meds"] as IList <Medication>); Patient = new PatientTO(domains["demographics"] as Patient); Allergies.add(sitecode, domains["reactions"] as IList <Allergy>); Notes.add(sitecode, domains["documents"] as IList <Note>); Problems.add(sitecode, domains["problems"] as IList <Problem>); Appointments.add(sitecode, domains["appointments"] as IList <Appointment>); ChemHemReports.add(sitecode, domains["labs"] as IList <LabReport>); IList <HealthSummary> healthSummaries = domains["healthFactors"] as IList <HealthSummary>; // TODO - implement the remaining hashtable keys //results.Add("healthFactors", healthSummaries); //results.Add("flags", flags); //results.Add("consults", consults); //results.Add("procedures", null); //results.Add("visits", visits); //results.Add("appointments", appointments); //results.Add("problems", problems); //results.Add("vitals", vitals); //results.Add("labs", labs); //results.Add("immunizations", null); } }
private IndexedHashtable mergeNotesAndDischargeSummaries(IndexedHashtable tNotes, IndexedHashtable tSummaries) { if (tNotes == null) { return(tSummaries); } if (tSummaries == null) { return(tNotes); } IndexedHashtable result = new IndexedHashtable(tNotes.Count + tSummaries.Count); for (int i = 0; i < tNotes.Count; i++) { Note[] notes = (Note[])tNotes.GetValue(i); int notesLength = (notes == null ? 0 : notes.Length); string key = (string)tNotes.GetKey(i); Note[] summaries = (Note[])tSummaries.GetValue(key); int summariesLength = (summaries == null ? 0 : summaries.Length); ArrayList lst = new ArrayList(notesLength + summariesLength); for (int j = 0; j < notesLength; j++) { lst.Add(notes[j]); } for (int j = 0; j < summariesLength; j++) { lst.Add(summaries[j]); } result.Add(key, (Note[])lst.ToArray(typeof(Note))); } return(result); }
public IndexedHashtable connect(AbstractCredentials credentials, AbstractPermission permission, DataSource validationDataSource) { permission.IsPrimary = true; QueryTemplate qt = new ConnectQuery(this); if (validationDataSource == null) { validationDataSource = new DataSource(); } qt.QueryMethod("AbstractConnection", "authorizedConnect", new object[] { credentials, permission, validationDataSource }); IndexedHashtable t = buildResults(); // KLUGE: This is here to make the number of connections come out right. // Note that the first element in the table will be a connection, but // the rest either User or Exception. if (HasBaseConnection && myResults.Count < myCxns.Count) { IndexedHashtable t2 = new IndexedHashtable(myCxns.Count); t2.Add(BaseConnection.DataSource.SiteId.Id, BaseConnection); for (int i = 0; i < t.Count; i++) { t2.Add(t.GetKey(i), t.GetValue(i)); } t = t2; } return(t); }
public IndexedHashtable setLocalPids(ConnectionSet cxns, string mpiPid) { IndexedHashtable result = cxns.query(DAO_NAME, "getLocalPid", new object[] { mpiPid }); for (int i = 0; i < result.Count; i++) { if (result.GetValue(i).GetType().Name.EndsWith("Exception")) { continue; } string siteId = (string)result.GetKey(i); AbstractConnection cxn = cxns.getConnection(siteId); cxn.Pid = (string)result.GetValue(i); } return(result); }
public void addConnections(IndexedHashtable t) { for (int i = 0; i < t.Count; i++) { Connection cxn = (Connection)t.GetValue(i); addConnection(cxn); } }
public PersonArray(IndexedHashtable t) { if (t == null || t.Count == 0) { count = 0; return; } persons = new PersonTO[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) != null) { persons[i] = new PersonTO((Person)t.GetValue(i)); } } count = t.Count; }
public TaggedMedicationArrays(IndexedHashtable t) { if (t == null || t.Count == 0) { return; } arrays = new TaggedMedicationArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedMedicationArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedMedicationArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable)) { IList <Medication> meds = ((System.Collections.Hashtable)t.GetValue(i))["meds"] as IList <Medication>; if (meds == null || meds.Count == 0) { arrays[i] = new TaggedMedicationArray((string)t.GetKey(i)); } else { Medication[] ary = new Medication[meds.Count]; meds.CopyTo(ary, 0); arrays[i] = new TaggedMedicationArray((string)t.GetKey(i), ary); } } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedMedicationArray((string)t.GetKey(i), (Medication[])t.GetValue(i)); } else { arrays[i] = new TaggedMedicationArray((string)t.GetKey(i), (Medication)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 static IndexedHashtable execute2(IndexedHashtable cxnTable, string daoName, string methodName, Object[] args) { if (cxnTable == null || cxnTable.Count == 0) { throw new Exception("No connections!"); } int lth = cxnTable.Count; QueryThread[] queries = new QueryThread[lth]; Thread[] threads = new Thread[lth]; for (int i = 0; i < lth; i++) { if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception))) { continue; } Connection cxn = (Connection)cxnTable.GetValue(i); if (!cxn.IsConnected) { continue; } Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName); if (dao == null) { continue; } queries[i] = new QueryThread(dao, methodName, args); threads[i] = new Thread(new ThreadStart(queries[i].execute)); threads[i].Start(); } IndexedHashtable result = new IndexedHashtable(cxnTable.Count); for (int i = 0; i < threads.Length; i++) { if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception))) { result.Add((string)cxnTable.GetKey(i), (Exception)cxnTable.GetValue(i)); continue; } Connection cxn = (Connection)cxnTable.GetValue(i); if (!cxn.IsConnected) { result.Add((string)cxnTable.GetKey(i), new Exception("Source is not connected")); continue; } Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName); if (dao == null) { result.Add((string)cxnTable.GetKey(i), new Exception("Invalid dao: " + daoName)); continue; } threads[i].Join(); result.Add((String)cxnTable.GetKey(i), queries[i].Result); } return(result); }
public TaggedClinicalProcedureArrays(IndexedHashtable ihs) { if (ihs == null || ihs.Count == 0) { return; } arrays = new TaggedClinicalProcedureArray[ihs.Count]; for (int i = 0; i < ihs.Count; i++) { string tag = (string)ihs.GetKey(i); if (ihs.GetValue(i) == null) { arrays[i] = new TaggedClinicalProcedureArray(tag); } else if (MdwsUtils.isException(ihs.GetValue(i))) { arrays[i] = new TaggedClinicalProcedureArray(tag, (Exception)ihs.GetValue(i)); } else if (ihs.GetValue(i) is Hashtable && ((Hashtable)ihs.GetValue(i)).ContainsKey("ekgs")) { IList <ClinicalProcedure> results = ((Hashtable)ihs.GetValue(i))["ekgs"] as IList <ClinicalProcedure>; arrays[i] = new TaggedClinicalProcedureArray(tag, results); } } }
public void Init(IndexedHashtable mdo) { if (mdo == null) { return; } healthSummaries = new HealthSummaryTO[mdo.Count]; for (int i = 0; i < mdo.Count; i++) { healthSummaries[i] = new HealthSummaryTO((HealthSummary)mdo.GetValue(i), (string)mdo.GetKey(i)); } count = mdo.Count; }
public TaggedPersonArrays(IndexedHashtable t) { if (t.Count == 0) { return; } if (t.Count == 1 && MdwsUtils.isException(t.GetValue(0))) { fault = new FaultTO((Exception)t.GetValue(0)); return; } arrays = new TaggedPersonArray[t.Count]; for (int i = 0; i < t.Count; i++) { string ky = (string)t.GetKey(i); if (t.GetValue(i) == null) { arrays[i] = new TaggedPersonArray(ky); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedPersonArray(ky, (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedPersonArray(ky, (Person[])t.GetValue(i)); } else if (t.GetValue(i).GetType().IsInstanceOfType(new List <Person>())) { arrays[i] = new TaggedPersonArray(ky, (List <Person>)t.GetValue(i)); } else { arrays[i] = new TaggedPersonArray(ky, (Person)t.GetValue(i)); } } count = t.Count; }
internal PatientAssociateArray processContacts(IndexedHashtable t) { ArrayList lst = new ArrayList(); for (int siteIdx = 0; siteIdx < t.Count; siteIdx++) { PatientAssociate[] pas = (PatientAssociate[])t.GetValue(siteIdx); for (int i = 0; i < pas.Length; i++) { lst.Add(pas[i]); } } return(new PatientAssociateArray(lst)); }
internal IndexedHashtable removeDups(IndexedHashtable t) { IndexedHashtable result = new IndexedHashtable(); for (int i = 0; i < t.Count; i++) { string source = (string)t.GetKey(i); if (t.GetValue(i) == null) { result.Add(source, null); continue; } if (t.GetValue(i).GetType().Name.EndsWith("Exception")) { gov.va.medora.mdo.exceptions.MdoException e = new gov.va.medora.mdo.exceptions.MdoException( gov.va.medora.mdo.exceptions.MdoExceptionCode.DATA_INVALID, (Exception)t.GetValue(i)); result.Add(source, e); continue; } List <Person> persons = (List <Person>)t.GetValue(i); List <DemographicsRecord> rex = new List <DemographicsRecord>(persons.Count); Hashtable ht = new Hashtable(persons.Count); foreach (Person p in persons) { PersonTO pto = new PersonTO(p); DemographicsRecord rec = new DemographicsRecord(pto, source); long hashcode = new TOReflection.TOEqualizer(rec).HashCode; if (!ht.ContainsKey(hashcode)) { ht.Add(hashcode, rec); rex.Add(rec); } } result.Add(source, rex); } return(result); }
internal void buildAllNotes(IndexedHashtable ihs, int index) { IList <Note> temp = ((System.Collections.Hashtable)ihs.GetValue(index))["documents"] as IList <Note>; if (temp == null || temp.Count == 0) { arrays[index] = new TaggedNoteArray((string)ihs.GetKey(index)); } else { Note[] ary = new Note[temp.Count]; temp.CopyTo(ary, 0); arrays[index] = new TaggedNoteArray((string)ihs.GetKey(index), ary); } }
public TaggedHospitalLocationArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedHospitalLocationArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedHospitalLocationArray((string)t.GetKey(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedHospitalLocationArray((string)t.GetKey(i), (HospitalLocation[])t.GetValue(i)); } else { arrays[i] = new TaggedHospitalLocationArray((string)t.GetKey(i), (HospitalLocation)t.GetValue(i)); } } count = t.Count; }
public DataSourceArray(IndexedHashtable t) { if (t.Count == 0) { return; } items = new DataSourceTO[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i).GetType().IsAssignableFrom(typeof(Exception))) { fault = new FaultTO((Exception)t.GetValue(i)); } //else if (t.GetValue(i) == null) //{ // items[i] = new TaggedAdtArray((string)t.GetKey(i)); //} else { items[i] = new DataSourceTO((DataSource)t.GetValue(i)); } } count = items.Length; }
public void removeConnection(string siteId) { if (cxnTbl.ContainsKey(siteId)) { Connection cxn = (Connection)cxnTbl.GetValue(siteId); if (cxn.IsConnected) { cxn.disconnect(); } cxnTbl.Remove(siteId); } }
public TaggedNoteArrays(IndexedHashtable t) { if (t == null || t.Count == 0) { return; } arrays = new TaggedNoteArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedNoteArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedNoteArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable)) { IList <Note> temp = ((System.Collections.Hashtable)t.GetValue(i))["documents"] as IList <Note>; if (temp == null || temp.Count == 0) { arrays[i] = new TaggedNoteArray((string)t.GetKey(i)); } else { Note[] ary = new Note[temp.Count]; temp.CopyTo(ary, 0); arrays[i] = new TaggedNoteArray((string)t.GetKey(i), ary); } } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedNoteArray((string)t.GetKey(i), (Note[])t.GetValue(i)); } else { arrays[i] = new TaggedNoteArray((string)t.GetKey(i), (Note)t.GetValue(i)); } } count = t.Count; }
public ZipcodeTO[] getCitiesInState(string stateAbbr) { gov.va.medora.mdo.dao.sql.zipcodeDB.ZipcodeDao dao = new gov.va.medora.mdo.dao.sql.zipcodeDB.ZipcodeDao(mySession.MdwsConfiguration.SqlConnectionString); ZipcodeTO[] result = new ZipcodeTO[1]; result[0] = new ZipcodeTO(); if (String.IsNullOrEmpty(stateAbbr)) { result[0].fault = new FaultTO("Missing state abbreviation"); } else if (stateAbbr.Length != 2) { result[0].fault = new FaultTO("Invalid state abbreviation", "Please supply a valid 2 letter abbreviation"); } if (result[0].fault != null) { return(result); } try { Zipcode[] zips = dao.getCitiesInState(stateAbbr); IndexedHashtable t = new IndexedHashtable(); for (int i = 0; i < zips.Length; i++) { if (!t.ContainsKey(zips[i].City)) { t.Add(zips[i].City, zips[i]); } } result = new ZipcodeTO[t.Count]; for (int i = 0; i < t.Count; i++) { result[i] = new ZipcodeTO((Zipcode)t.GetValue(i)); } } catch (Exception exc) { result[0].fault = new FaultTO(exc); } return(result); }
internal MdoQuery buildGetOrdersRequest(IndexedHashtable t) { VistaQuery vq = new VistaQuery("ORWORR GET4LST"); vq.addParameter(vq.LITERAL, "2"); vq.addParameter(vq.LITERAL, VistaTimestamp.fromDateTime(DateTime.Now)); DictionaryHashList lst = new DictionaryHashList(); for (int i = 0; i < t.Count; i++) { lst.Add(Convert.ToString(i + 1), ((Order)t.GetValue(i)).Id); } vq.addParameter(vq.LIST, lst); return vq; }