Exemplo n.º 1
0
 private void SetSmokerData(List <BioCheckResponseModel> biocheckResponse, KynLabValues kynLabValues)
 {
     if (kynLabValues != null && kynLabValues.Smoker != null && string.IsNullOrEmpty(kynLabValues.Smoker) && kynLabValues.Smoker == Smoker)
     {
         biocheckResponse.Add(new BioCheckResponseModel("Q60", "true"));
     }
     else
     {
         biocheckResponse.Add(new BioCheckResponseModel("Q60", "false"));
     }
 }
Exemplo n.º 2
0
        public KynLabValues Save(KynLabValues domain, long orgRoleUserId)
        {
            using (var adapter = PersistenceLayer.GetDataAccessAdapter())
            {
                var linqMetaData = new LinqMetaData(adapter);
                var entity       = (from klv in linqMetaData.KynLabValues
                                    where klv.EventCustomerResultId == domain.EventCustomerResultId &&
                                    klv.TestId == domain.TestId
                                    select klv).SingleOrDefault();
                var isNew = true;

                if (entity != null)
                {
                    domain.DataRecorderMetaData = new DataRecorderMetaData
                    {
                        DataRecorderCreator  = new OrganizationRoleUser(entity.CreatedByOrgRoleUserId),
                        DateCreated          = entity.DateCreated,
                        DataRecorderModifier = new OrganizationRoleUser(orgRoleUserId),
                        DateModified         = DateTime.Now
                    };
                    isNew = false;
                }
                else
                {
                    domain.DataRecorderMetaData = new DataRecorderMetaData
                    {
                        DataRecorderCreator = new OrganizationRoleUser(orgRoleUserId),
                        DateCreated         = DateTime.Now
                    };
                }

                entity       = Mapper.Map <KynLabValues, KynLabValuesEntity>(domain);
                entity.IsNew = isNew;

                adapter.SaveEntity(entity, true, false);
                return(Mapper.Map <KynLabValuesEntity, KynLabValues>(entity));
            }
        }
Exemplo n.º 3
0
        private void SetLabValus(List <BioCheckResponseModel> bioCheckResponse, MyBioAssessmentTestResult testResult, KynLabValues kynLabValues, BasicBiometric basicBiometric, Customer customer)
        {
            if (testResult.TotalCholestrol != null)
            {
                if (testResult.TotalCholestrol.Reading != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q11", testResult.TotalCholestrol.Reading)); //;
                }
            }
            if (testResult.Hdl != null)
            {
                if (testResult.Hdl.Reading != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q12", testResult.Hdl.Reading));
                }
                // testResult.HDL.Reading;
            }

            if (testResult.Ldl != null)
            {
                if (testResult.Ldl.Reading != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q13", testResult.Ldl.Reading.Value.ToString()));
                }
                // testResult.LDL.Reading.ToString();
            }

            if (testResult.TcHdlRatio != null)
            {
                if (testResult.TcHdlRatio.Reading != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q14", testResult.TcHdlRatio.Reading.Value.ToString()));
                }
                // testResult.LDL.Reading.ToString();
            }

            if (testResult.Glucose != null)
            {
                if (testResult.Glucose.Reading != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q15", testResult.Glucose.Reading.Value.ToString()));
                }
                // testResult.LDL.Reading.ToString();
            }

            if (testResult.TriGlycerides != null)
            {
                if (testResult.TriGlycerides.Reading != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q16", testResult.TriGlycerides.Reading));
                }
                // testResult.TriGlycerides.Reading;
            }

            if (basicBiometric != null)
            {
                if (basicBiometric.SystolicPressure != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q17", basicBiometric.SystolicPressure.Value.ToString()));
                }

                if (basicBiometric.DiastolicPressure != null)
                {
                    bioCheckResponse.Add(new BioCheckResponseModel("Q18", basicBiometric.DiastolicPressure.Value.ToString()));
                }
            }
            bioCheckResponse.Add(new BioCheckResponseModel("Q19", string.Empty));

            if (kynLabValues != null && kynLabValues.FastingStatus != null && kynLabValues.FastingStatus.Value == (long)FastingStatus.Fasting)
            {
                bioCheckResponse.Add(new BioCheckResponseModel("Q20", "true"));
            }
            else
            {
                bioCheckResponse.Add(new BioCheckResponseModel("Q20", "false"));
            }

            decimal waist = customer.Waist != null ? customer.Waist.Value : 0;

            bioCheckResponse.Add(new BioCheckResponseModel {
                Question = "Q21", Value = waist.ToString()
            });
        }