Inheritance: AbstractTaggedArrayTO
Exemplo n.º 1
0
 public TaggedAppointmentArrays(IndexedHashtable t)
 {
     if (t.Count == 0)
     {
         return;
     }
     arrays = new TaggedAppointmentArray[t.Count];
     for (int i = 0; i < t.Count; i++)
     {
         if (t.GetValue(i) == null)
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i));
         }
         else if (MdwsUtils.isException(t.GetValue(i)))
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i), (Exception)t.GetValue(i));
         }
         else if (t.GetValue(i).GetType().IsArray)
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i), (Appointment[])t.GetValue(i));
         }
         else
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i), (Appointment)t.GetValue(i));
         }
     }
     count = t.Count;
 }
 public TaggedAppointmentArrays(IndexedHashtable t)
 {
     if (t == null || t.Count == 0)
     {
         return;
     }
     arrays = new TaggedAppointmentArray[t.Count];
     for (int i = 0; i < t.Count; i++)
     {
         if (t.GetValue(i) == null)
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i));
         }
         else if (MdwsUtils.isException(t.GetValue(i)))
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i), (Exception)t.GetValue(i));
         }
         else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable))
         {
             IList <Appointment> temp = ((System.Collections.Hashtable)t.GetValue(i))["appointments"] as IList <Appointment>;
             if (temp == null || temp.Count == 0)
             {
                 arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i));
             }
             else
             {
                 Appointment[] ary = new Appointment[temp.Count];
                 temp.CopyTo(ary, 0);
                 arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i), ary);
             }
         }
         else if (t.GetValue(i).GetType().IsArray)
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i), (Appointment[])t.GetValue(i));
         }
         else
         {
             arrays[i] = new TaggedAppointmentArray((string)t.GetKey(i), (Appointment)t.GetValue(i));
         }
     }
     count = t.Count;
 }
Exemplo n.º 3
0
        public TaggedAppointmentArray getPendingAppointments(string startDate)
        {
            TaggedAppointmentArray result = new TaggedAppointmentArray();

            if (!_mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (String.IsNullOrEmpty(startDate))
            {
                result.fault = new FaultTO("Missing startDate");
            }

            if (result.fault != null)
            {
                return result;
            }

            try
            {
                IList<Appointment> appts = new EncounterApi().getPendingAppointments(_mySession.ConnectionSet.BaseConnection, startDate);
                result = new TaggedAppointmentArray(_mySession.ConnectionSet.BaseConnection.DataSource.SiteId.Id, appts);
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }

            return result;
        }
Exemplo n.º 4
0
        public TaggedAppointmentArray getAppointmentsFromSite(
            string pwd, string sitecode, string mpiPid)
        {
            TaggedAppointmentArray result = new TaggedAppointmentArray();

            if (String.IsNullOrEmpty(sitecode))
            {
                result.fault = new FaultTO("Missing sitecode");
            }
            else if (String.IsNullOrEmpty(mpiPid))
            {
                result.fault = new FaultTO("Missing mpiPid");
            }
            if (result.fault != null)
            {
                return result;
            }

            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...
                EncounterApi api = new EncounterApi();
                Appointment[] appts = api.getAppointments(mySession.ConnectionSet.getConnection(sitecode));
                for (int i = 0; i < appts.Length; i++)
                {
                    appts[i].Status = undecodeApptStatus(appts[i].Status);
                }
                result = new TaggedAppointmentArray(sitecode, appts);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            finally
            {
                mySession.close();
            }
            return result;
        }