示例#1
0
        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());
        }
示例#2
0
        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());
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }