/// <summary>
        /// Opens the claim grid view.
        /// </summary>
        /// <param name="claimId">The claim identifier.</param>
        /// <param name="currentDateTime">The current date time.</param>
        /// <returns></returns>
        public ActionResult ClaimNote(long claimId, string currentDateTime)
        {
            ClaimNotesContainer claimNote = new ClaimNotesContainer {
                ClaimId = claimId, CurrentDateTime = currentDateTime, UserName = GetCurrentUserName(), FacilityName = GetCurrentFacilityName()
            };
            ClaimNotesContainer responseClaimNote = PostApiResponse <ClaimNotesContainer>(Constants.ClaimSelection, Constants.GetClaimNotes, claimNote);

            if (responseClaimNote != null && responseClaimNote.ClaimNotes.Count > 0)
            {
                responseClaimNote.ClaimId = claimId;
                return(View(responseClaimNote));
            }
            return(View(new ClaimNotesContainer
            {
                ClaimId = claimId, ClaimNotes = new List <ClaimNote>()
            }
                        ));
        }
        public void GetClaimNotesTest()
        {
            var repository = new Mock <IClaimSelectorRepository>();
            ClaimNotesContainer claimNoteContainerInput = new ClaimNotesContainer
            {
                ClaimId      = 421569877,
                UserName     = "******",
                FacilityName = "Baxter"
            };
            ClaimNotesContainer claimNoteContainerOutput = new ClaimNotesContainer
            {
                ClaimId      = 421569877,
                UserName     = "******",
                FacilityName = "Baxter",
                ClaimNotes   = new List <ClaimNote>
                {
                    new ClaimNote
                    {
                        ClaimId       = 421569877,
                        ClaimNoteText = "hi there",
                        ShortDateTime = DateTime.Now.ToShortDateString()
                    },
                    new ClaimNote
                    {
                        ClaimId       = 421569877,
                        ClaimNoteText = "sggfdgdfgdfgdfgdf",
                        ShortDateTime = DateTime.Now.ToShortDateString()
                    }
                }
            };

            repository.Setup(x => x.GetClaimNotes(claimNoteContainerInput)).Returns(claimNoteContainerOutput);
            var mockAdjudicationEngine = new Mock <IAdjudicationEngine>();
            ClaimSelectorLogic target  = new ClaimSelectorLogic(repository.Object, mockAdjudicationEngine.Object);
            var result = target.GetClaimNotes(claimNoteContainerInput);

            Assert.AreEqual(result.ClaimNotes.Count, claimNoteContainerOutput.ClaimNotes.Count);
            Assert.AreEqual(result.ClaimId, claimNoteContainerOutput.ClaimId);
        }
        /// <summary>
        /// Gets the claim notes.
        /// </summary>
        /// <param name="claimNotesContainer">The claim notes container.</param>
        /// <returns></returns>
        public ClaimNotesContainer GetClaimNotes(ClaimNotesContainer claimNotesContainer)
        {
            ClaimNotesContainer claimNoteContainer = new ClaimNotesContainer();
            List <ClaimNote>    claimNotes         = new List <ClaimNote>();

            //Checks if input request is not null
            if (claimNotesContainer != null)
            {
                _databaseCommand = _databaseObj.GetStoredProcCommand("GetClaimNotes");
                // Pass parameters to Stored Procedure(i.e., @ParamName), add values for
                _databaseObj.AddInParameter(_databaseCommand, "@ClaimID ", DbType.Int64, claimNotesContainer.ClaimId);
                _databaseObj.AddInParameter(_databaseCommand, "@UserName", DbType.String, claimNotesContainer.UserName.ToTrim());
                _databaseObj.AddInParameter(_databaseCommand, "@FacilityName", DbType.String, claimNotesContainer.FacilityName);

                // Retrieve the results of the Stored Procedure in Datatable
                DataSet claimtNotesDataSet = _databaseObj.ExecuteDataSet(_databaseCommand);

                if (claimtNotesDataSet.IsTableDataPopulated(0))
                {
                    DataRowCollection claimNoteDataRowCollection = claimtNotesDataSet.Tables[0].Rows;

                    claimNotes = (from DataRow row in claimNoteDataRowCollection
                                  select new ClaimNote
                    {
                        ClaimId = GetValue <long>(row["ClaimID"], typeof(long)),
                        ClaimNoteText = GetStringValue(row["ClaimNoteText"]),
                        ClaimNoteId = GetValue <long>(row["ClaimNoteID"], typeof(long)),
                        UserName = GetStringValue(row["UserName"]),
                        ShortDateTime = Convert.ToDateTime(
                            Utilities.GetLocalTimeString(claimNotesContainer.CurrentDateTime,
                                                         Convert.ToDateTime(row["InsertDate"].ToString()))).ToString(Constants.DateTimeFormatWithSecond),
                    }).ToList();
                }
            }
            claimNoteContainer.ClaimNotes = claimNotes;
            //returns response to Business layer
            return(claimNoteContainer);
        }
示例#4
0
 /// <summary>
 /// Gets the claim notes.
 /// </summary>
 /// <param name="claimNotesContainer">The claim notes container.</param>
 /// <returns></returns>
 public ClaimNotesContainer GetClaimNotes(ClaimNotesContainer claimNotesContainer)
 {
     return(_claimSelectorRepository.GetClaimNotes(claimNotesContainer));
 }
 public ClaimNotesContainer GetClaimNotes(ClaimNotesContainer claimNotesContainer)
 {
     return(_claimSelectorLogic.GetClaimNotes(claimNotesContainer));
 }