private int[] GetBulkPatientList() { const int PatientBatchSize = 100; bool hasMatches = true; int nextPatientId = 0; List <int> patientIds = new List <int>(); while (hasMatches) { if (_stopping) { return(null); } PatientMatchesResult result = _emisInterface.GetPatientSequence(_sessionId, nextPatientId, PatientBatchSize); hasMatches = result.HasMatches; if (hasMatches) { int[] patientIdsBatch = result .PatientIds .OrderBy(t => t) .ToArray(); patientIds.AddRange(patientIdsBatch); nextPatientId = patientIdsBatch.Last(); } } return(patientIds.ToArray()); }
private int[] GetChangedPatients(DateTime since) { PatientMatchesResult result = _emisInterface.GetChangedPatients(_sessionId, since); if (_stopping) { return(null); } PatientMatchesResult mrResult = _emisInterface.GetChangedPatientsMR(_sessionId, since); return(result .PatientIds .Concat(mrResult.PatientIds) .Distinct() .ToArray()); }
public PatientMatchesResult GetChangedPatientsMR(string sessionId, DateTime fromDate) { const string MethodName = "GetChangedPatientsMR"; object[] parameters = new object[] { sessionId, fromDate.ToString("dd/MM/yyyy") }; PatientMatchesResult result = InvokeMethodWithSingleXmlResult <PatientMatchesResult>(MethodName, parameters); if (result.IsError) { throw CreatePartnerApiException(MethodName, result); } return(result); }
public PatientMatchesResult GetPatientSequence(string sessionId, int startId, int batchSize) { const string MethodName = "GetPatientSequence"; object[] parameters = new object[] { sessionId, startId, batchSize, }; PatientMatchesResult result = InvokeMethodWithSingleXmlResult <PatientMatchesResult>(MethodName, parameters); if (result.IsError) { throw CreatePartnerApiException(MethodName, result); } return(result); }