Ejemplo n.º 1
0
        public async Task <EmrMatrix> GetCurrentEmrMatrix()
        {
            try
            {
                EmrMatrix currentMatrix = await _unitOfWork.Repository <EmrMatrix>().Get().FirstOrDefaultAsync();

                return(currentMatrix);
            }
            catch (Exception e)
            {
                Log.Error(e.Message);
                return(null);
            }
        }
Ejemplo n.º 2
0
        public async Task <Result <EmrMatrixResponse> > Handle(MatrixCommand request, CancellationToken cancellationToken)
        {
            try
            {
                EmrMatrixService emrMatrixService = new EmrMatrixService(_unitOfWork);
                EmrMatrix        emrMatrix        = await emrMatrixService.GetCurrentEmrMatrix();

                return(Result <EmrMatrixResponse> .Valid(new EmrMatrixResponse()
                {
                    EmrName = emrMatrix.EmrName, EmrVersion = emrMatrix.EmrVersion, LastMoH731RunDate = emrMatrix.LastMoH731RunDate, LastLoginDate = emrMatrix.LastLoginDate
                }));
            }
            catch (Exception e)
            {
                //  Logger.Error($"An error occured while getting patient allergies method");
                return(Result <EmrMatrixResponse> .Invalid(e.Message));
            }
        }