getUpdatedFutureAppointments() public method

public getUpdatedFutureAppointments ( AbstractConnection cxn, DateTime updatedSince ) : HashSet>.Dictionary
cxn AbstractConnection
updatedSince DateTime
return HashSet>.Dictionary
Esempio n. 1
0
        public TaggedPatientArrays getPatientsWithUpdatedFutureAppointments(string username, string pwd, string updatedSince)
        {
            TaggedPatientArrays result = new TaggedPatientArrays();
            //if (String.IsNullOrEmpty(username) | String.IsNullOrEmpty(pwd) | String.IsNullOrEmpty(updatedSince))
            //{
            //    result.fault = new FaultTO("Must supply all arguments");
            //}
            try
            {
                EncounterApi api = new EncounterApi();
                DataSource ds = new DataSource { ConnectionString = mySession.MdwsConfiguration.CdwConnectionString };
                AbstractConnection cxn = new gov.va.medora.mdo.dao.sql.cdw.CdwConnection(ds);
                Dictionary<string, HashSet<string>> dict = api.getUpdatedFutureAppointments(cxn, DateTime.Parse(updatedSince));
                result.arrays = new TaggedPatientArray[dict.Keys.Count];
                int arrayCount = 0;

                foreach (string key in dict.Keys)
                {
                    TaggedPatientArray tpa = new TaggedPatientArray(key);
                    tpa.patients = new PatientTO[dict[key].Count];
                    int patientCount = 0;
                    foreach (string patientICN in dict[key])
                    {
                        PatientTO p = new PatientTO { mpiPid = patientICN };
                        tpa.patients[patientCount] = p;
                        patientCount++;
                    }
                    result.arrays[arrayCount] = tpa;
                    arrayCount++;
                }
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return result;
        }