/// <summary> /// Count recent activity /// </summary> public static int CountRecentActivity(TimeSpan since) { try { ClientRegistryAdminInterfaceClient client = new ClientRegistryAdminInterfaceClient(); DateTime high = DateTime.Now, low = DateTime.Now.Subtract(since); TimestampSet1 sinceRange = new TimestampSet1() { part = new TimestampPart1[] { new TimestampPart1() { value = low, type = TimestampPartType1.LowBound }, new TimestampPart1() { value = high, type = TimestampPartType1.HighBound } } }; return(client.GetRecentActivity(sinceRange, 0, 0, true).count); } catch (Exception e) { return(0); } }
/// <summary> /// Get recent changes /// </summary> public static Models.PatientMatch[] GetRecentActivity(TimeSpan since, int offset, int count) { try { ClientRegistryAdminInterfaceClient client = new ClientRegistryAdminInterfaceClient(); DateTime high = DateTime.Now, low = DateTime.Now.Subtract(since); TimestampSet1 sinceRange = new TimestampSet1() { part = new TimestampPart1[] { new TimestampPart1() { value = low, type = TimestampPartType1.LowBound }, new TimestampPart1() { value = high, type = TimestampPartType1.HighBound } } }; var registrations = client.GetRecentActivity(sinceRange, offset, count, false); ClientRegistryAdmin.Models.PatientMatch[] retVal = new PatientMatch[registrations.count]; for (int i = 0; i < registrations.registration.Length; i++) { ClientRegistryAdmin.Models.PatientMatch pm = ConvertRegistrationEvent(registrations.registration[i]); // Address? retVal[offset + i] = pm; } return(retVal); } catch { return(null); } }