Inheritance: AbstractTaggedArrayTO
 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 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;
 }
Esempio n. 3
0
        public TaggedHospitalLocationArray getLocations(string sitecode, string target, string direction)
        {
            TaggedHospitalLocationArray result = new TaggedHospitalLocationArray();
            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;
            }

            if (direction == "")
            {
                direction = "1";
            }

            try
            {
                AbstractConnection cxn = mySession.ConnectionSet.getConnection(sitecode);
                EncounterApi api = new EncounterApi();
                HospitalLocation[] locations = api.getLocations(cxn,target,direction);
                result = new TaggedHospitalLocationArray(sitecode,locations);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }