Beispiel #1
0
        public AppointmentTypeArray getAppointmentTypes(string target)
        {
            AppointmentTypeArray result = new AppointmentTypeArray();

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

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

            try
            {
                IList <AppointmentType> types = new EncounterApi().getAppointmentTypes(_mySession.ConnectionSet.BaseConnection, target);
                result = new AppointmentTypeArray(types);
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }

            return(result);
        }
        public IList <AppointmentTypeTO> getAppointmentTypes(string target)
        {
            string appointmentTypesResponse  = makeRequest(String.Format("/appointmentTypes/{0}?token={1}", target, _cookie));
            AppointmentTypeArray      result = JsonConvert.DeserializeObject <AppointmentTypeArray>(appointmentTypesResponse);
            IList <AppointmentTypeTO> list   = new List <AppointmentTypeTO>();

            foreach (AppointmentTypeTO type in result.appointmentTypes)
            {
                list.Add(type);
            }
            return(list);
        }
Beispiel #3
0
        /// <summary>
        /// Returns a list of the valid appointment types that can be scheduled. The list begins at the alphabetical search point of target
        /// </summary>
        /// <param name="target">The alphabetical start point for the appointment type search</param>
        /// <returns>IList of AppointmentTypeTO</returns>
        public IList <AppointmentTypeTO> getAppointmentTypes(string target)
        {
            AppointmentTypeArray apptTypes = _svc.getAppointmentTypes(target);

            if (apptTypes.fault != null)
            {
                throw new ApplicationException(apptTypes.fault.message);
            }
            IList <AppointmentTypeTO> result = new List <AppointmentTypeTO>();

            foreach (AppointmentTypeTO apptType in apptTypes.appointmentTypes)
            {
                result.Add(apptType);
            }
            return(result);
        }