Ejemplo n.º 1
0
        public GetCohortPatientViewResponse GetCohortPatientView(GetCohortPatientViewRequest request)
        {
            IPatientRepository repo = Factory.GetRepository(request, RepositoryType.CohortPatientView);

            GetCohortPatientViewResponse   result            = new GetCohortPatientViewResponse();
            ICollection <SelectExpression> selectExpressions = new List <SelectExpression>();

            // PatientID
            SelectExpression patientSelectExpression = new SelectExpression();

            patientSelectExpression.FieldName       = MECohortPatientView.PatientIDProperty;
            patientSelectExpression.Type            = SelectExpressionType.EQ;
            patientSelectExpression.Value           = request.PatientID;
            patientSelectExpression.ExpressionOrder = 1;
            patientSelectExpression.GroupID         = 1;
            selectExpressions.Add(patientSelectExpression);

            APIExpression apiExpression = new APIExpression();

            apiExpression.Expressions = selectExpressions;

            Tuple <string, IEnumerable <object> > cohortPatientView = repo.Select(apiExpression);

            if (cohortPatientView != null)
            {
                List <CohortPatientViewData> cpd = cohortPatientView.Item2.Cast <CohortPatientViewData>().ToList();
                result.CohortPatientView = cpd[0];
            }

            return(result);
        }
Ejemplo n.º 2
0
 public Tuple <string, IEnumerable <object> > Select(APIExpression expression)
 {
     try
     {
         throw new NotImplementedException();
         // code here //
     }
     catch (Exception) { throw; }
 }
Ejemplo n.º 3
0
        public GetProgramAttributeResponse GetProgramAttributes(GetProgramAttributeRequest request)
        {
            try
            {
                GetProgramAttributeResponse    response          = new GetProgramAttributeResponse();
                ICollection <SelectExpression> selectExpressions = new List <SelectExpression>();

                // PlanElementId
                SelectExpression patientSelectExpression = new SelectExpression();
                patientSelectExpression.FieldName       = MEProgramAttribute.PlanElementIdProperty;
                patientSelectExpression.Type            = SelectExpressionType.EQ;
                patientSelectExpression.Value           = request.PlanElementId;
                patientSelectExpression.ExpressionOrder = 1;
                patientSelectExpression.GroupID         = 1;
                selectExpressions.Add(patientSelectExpression);

                APIExpression apiExpression = new APIExpression();
                apiExpression.Expressions = selectExpressions;

                IProgramRepository repo = Factory.GetRepository(request, RepositoryType.PatientProgramAttribute);//.GetProgramAttributesRepository(request);

                Tuple <string, IEnumerable <object> > result = repo.Select(apiExpression);

                if (result != null)
                {
                    List <ProgramAttributeData> pds = result.Item2.Cast <ProgramAttributeData>().ToList();
                    if (pds.Count > 0)
                    {
                        response.ProgramAttribute = pds.FirstOrDefault();
                    }
                }

                return(response);
            }
            catch (Exception ex)
            {
                throw new Exception("DD:DataProgramManager:GetProgramAttributes()::" + ex.Message, ex.InnerException);
            }
        }
 public Tuple <string, IEnumerable <object> > Select(APIExpression expression)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 Tuple <string, IEnumerable <object> > IRepository.Select(APIExpression expression)
 {
     throw new NotImplementedException();
 }