Пример #1
0
        public BLModel.RFARequest getRFARequestByID(int _rfaRequestID)
        {
            BLModel.RFARequest _BLRFARequest = Mapper.Map <BLModel.RFARequest>(_rfaRequestRepo.GetById(_rfaRequestID));
            SPImpl             _SPImpl       = new SPImpl();

            _BLRFARequest.RFACPT_NDC = _SPImpl.getRequestCPTNDCCodesByRFARequestID(_rfaRequestID);
            return(_BLRFARequest);
        }
Пример #2
0
        public int updateRFARequest(BLModel.RFARequest _rfaRequest)
        {
            DLModel.RFARequest _rfaRequestDL = Mapper.Map <DLModel.RFARequest>(_rfaRequest);
            _rfaRequestDL.RFARequestDate   = System.DateTime.Now;
            _rfaRequestDL.RFALatestDueDate = GetDueDate(_rfaRequest.RequestTypeID.Value, _rfaRequestDL.RFARequestDate.Value);
            //_rfaRequestRepo.Update(_rfaRequestDL);
            _rfaRequestRepo.Update(_rfaRequestDL, hp => hp.RFAReferralID, hp => hp.RequestTypeID, hp => hp.RFARequestedTreatment, hp => hp.TreatmentCategoryID, hp => hp.TreatmentTypeID, hp => hp.RFAFrequency, hp => hp.RFADuration, hp => hp.RFADurationTypeID, hp => hp.RFAQuantity);

            RFARequestModify _rFARequestModify = _rfaRequestModifyRepo.GetAll(rk => rk.RFARequestID == _rfaRequestDL.RFARequestID).SingleOrDefault();

            if (_rFARequestModify != null)
            {
                _rFARequestModify.RFARequestedTreatment = _rfaRequestDL.RFARequestedTreatment;
                _rfaRequestModifyRepo.Update(_rFARequestModify);
            }
            int _RFARequestID = _rfaRequest.RFARequestID;

            _rfaReferralCPTCodeRepo.Delete(req => req.RFARequestID == _RFARequestID);

            if ((_rfaRequest.RFACPT_NDC != null) && (_rfaRequest.RFACPT_NDC != ""))
            {
                if (_rfaRequest.RFACPT_NDC.Trim().Contains(","))
                {
                    string[] arrcptndcodes;
                    arrcptndcodes = _rfaRequest.RFACPT_NDC.Split(',');
                    foreach (var _arrcptndcodes in arrcptndcodes)
                    {
                        if (_arrcptndcodes.ToString() != "")
                        {
                            DLModel.RFARequestCPTCode _RFARequestCPTCode = new DLModel.RFARequestCPTCode();
                            _RFARequestCPTCode.RFARequestID = _RFARequestID;
                            _RFARequestCPTCode.CPT_NDCCode  = _arrcptndcodes.ToString();
                            addRFARequestCPTCode(_RFARequestCPTCode);
                        }
                    }
                }
                else
                {
                    DLModel.RFARequestCPTCode _RFARequestCPTCode = new DLModel.RFARequestCPTCode();
                    _RFARequestCPTCode.RFARequestID = _RFARequestID;
                    _RFARequestCPTCode.CPT_NDCCode  = _rfaRequest.RFACPT_NDC.ToString().Trim();
                    addRFARequestCPTCode(_RFARequestCPTCode);
                }
            }
            // UpdateRFAReqCertificationNumberByID
            //SPImpl _SPImpl = new SPImpl();
            //_SPImpl.UpdateRFAReqCertificationNumberByID(_RFARequestID);
            return(_RFARequestID);
        }
Пример #3
0
        public void addRFARequest()
        {
            BLModel.RFARequest obj = new BLModel.RFARequest()
            {
                RFAReferralID         = 396,
                RFARequestedTreatment = "asdfasdfsad",
                RFADurationTypeID     = 1,
                RFAFrequency          = 2,
                RequestTypeID         = 2,
                RFADuration           = 2,
                RFAQuantity           = 4,
                TreatmentCategoryID   = 1,
                TreatmentTypeID       = 1,
                RFAStrenght           = "test",
                RFACPT_NDC            = "123",
            };
            var data = _intakeRepository.addRFARequest(obj);

            Assert.IsTrue(data > 0, "failed");
        }
Пример #4
0
        public void updateRFARequest()
        {
            BLModel.RFARequest obj = new BLModel.RFARequest()
            {
                RFAReferralID         = 671,
                RFARequestedTreatment = "asdfasdfsad",
                RFADurationTypeID     = 1,
                RFAFrequency          = 1,
                RequestTypeID         = 2,
                RFADuration           = 1,
                RFAQuantity           = 5,
                TreatmentCategoryID   = 1,
                TreatmentTypeID       = 1,
                RFAStrenght           = "rrrrrr",
                RFACPT_NDC            = "",
                RFARequestID          = 631
            };
            var data = _intakeRepository.updateRFARequest(obj);

            Assert.IsTrue(data > 0, "failed");
        }
Пример #5
0
        public int addRFARequest(BLModel.RFARequest _rfaRequest)
        {
            DLModel.RFARequest _rfaRequestDL = Mapper.Map <DLModel.RFARequest>(_rfaRequest);
            _rfaRequestDL.RFARequestDate   = System.DateTime.Now;
            _rfaRequestDL.RFALatestDueDate = GetDueDate(_rfaRequest.RequestTypeID.Value, _rfaRequestDL.RFARequestDate.Value);
            int _RFARequestID = _rfaRequestRepo.Add(_rfaRequestDL).RFARequestID;

            if ((_rfaRequest.RFACPT_NDC != null) && (_rfaRequest.RFACPT_NDC != ""))
            {
                if (_rfaRequest.RFACPT_NDC.Trim().Contains(","))
                {
                    string[] arrcptndcodes;
                    arrcptndcodes = _rfaRequest.RFACPT_NDC.Split(',');
                    foreach (var _arrcptndcodes in arrcptndcodes)
                    {
                        if (_arrcptndcodes.ToString() != "")
                        {
                            DLModel.RFARequestCPTCode _RFARequestCPTCode = new DLModel.RFARequestCPTCode();
                            _RFARequestCPTCode.RFARequestID = _RFARequestID;
                            _RFARequestCPTCode.CPT_NDCCode  = _arrcptndcodes.ToString();
                            addRFARequestCPTCode(_RFARequestCPTCode);
                        }
                    }
                }
                else
                {
                    DLModel.RFARequestCPTCode _RFARequestCPTCode = new DLModel.RFARequestCPTCode();
                    _RFARequestCPTCode.RFARequestID = _RFARequestID;
                    _RFARequestCPTCode.CPT_NDCCode  = _rfaRequest.RFACPT_NDC.ToString().Trim();
                    addRFARequestCPTCode(_RFARequestCPTCode);
                }
            }
            //UpdateRFAReqCertificationNumberByID
            // SPImpl _SPImpl = new SPImpl();
            // _SPImpl.UpdateRFAReqCertificationNumberByID(_RFARequestID);
            return(_RFARequestID);
        }