public TaggedInpatientStayArray getAdmissions(string sitecode) { TaggedInpatientStayArray result = new TaggedInpatientStayArray(); string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode); if (msg != "OK") { result.fault = new FaultTO(msg); } if (result.fault != null) { return result; } if (sitecode == null) { sitecode = mySession.ConnectionSet.BaseSiteId; } try { AbstractConnection cxn = mySession.ConnectionSet.getConnection(sitecode); EncounterApi api = new EncounterApi(); InpatientStay[] stays = api.getAdmissions(cxn); result = new TaggedInpatientStayArray(sitecode, stays); } catch (Exception e) { result.fault = new FaultTO(e.Message); } return result; }
public TaggedInpatientStayArrays(IndexedHashtable t) { if (t.Count == 0) { return; } arrays = new TaggedInpatientStayArray[t.Count]; for (int i = 0; i < t.Count; i++) { if (t.GetValue(i) == null) { arrays[i] = new TaggedInpatientStayArray((string)t.GetKey(i)); } else if (MdwsUtils.isException(t.GetValue(i))) { arrays[i] = new TaggedInpatientStayArray((string)t.GetKey(i), (Exception)t.GetValue(i)); } else if (t.GetValue(i).GetType().IsArray) { arrays[i] = new TaggedInpatientStayArray((string)t.GetKey(i), (InpatientStay[])t.GetValue(i)); } else { arrays[i] = new TaggedInpatientStayArray((string)t.GetKey(i), (InpatientStay)t.GetValue(i)); } } count = t.Count; }