public void TestClaimCheckCommand()
        {
            string expected = File.ReadAllText("ClaimCheckCommand.xml");

            var command = new ClaimCheck("example1.com");
            var xml = command.ToXml().InnerXml;

            Assert.AreEqual(expected, xml);
        }
 public ReportItemForProvider(ClaimCheck claim)
 {
     Date_of_service = claim.DateOfServiceProvided.ToString("yyyy-MM-dd HH:mm tt");
     TimeStamp       = claim.DateOfClaimCheck.ToString();
     Member_name     = claim.MemberName;
     Member_number   = claim.MemberName;
     Service_code    = claim.ServiceCode;
     Fee             = claim.Fee.ToString();
 }
Exemplo n.º 3
0
        public void TestClaimCheckCommand()
        {
            string expected = File.ReadAllText("ClaimCheckCommand.xml");

            var command = new ClaimCheck("example1.com");
            var xml     = command.ToXml().InnerXml;

            Assert.AreEqual(expected, xml);
        }
        /// <summary>
        /// Adds claim check entry to the database
        /// </summary>
        /// <param name="providerCode">9 digit provider code</param>
        /// <param name="currentDate">Date of the request</param>
        /// <param name="serviceDate">Date of the service provided</param>
        /// <param name="memberName">Name of the member who get the service</param>
        /// <param name="memberNumber">9 digit member code</param>
        /// <param name="serviceCode">6 digit service code</param>
        /// <param name="fee">Fee to be recorded for confirmation purposes.</param>
        /// <returns>Empty string if successfull or explanation about the error otherwise.</returns>
        public string addClaimCheck(string providerCode, DateTime currentDate, DateTime serviceDate, string memberName, string memberNumber, string serviceCode, decimal fee)
        {
            String result = String.Empty;

            Provider provider = db.Providers
                                .Where(p => p.Code.Equals(providerCode))
                                .FirstOrDefault();

            if (provider == null)
            {
                result = "Invalid provider code.";
                return(result);
            }

            ClaimCheck claimCheck = new ClaimCheck()
            {
                DateOfClaimCheck      = currentDate,
                DateOfServiceProvided = serviceDate,
                MemberName            = memberName,
                MemberNumber          = memberNumber,
                ServiceCode           = serviceCode,
                Fee      = fee,
                Provider = provider
            };

            try
            {
                db.ClaimChecks.Add(claimCheck);
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                result = "An error occurred, " + ex.Message;
            }

            return(result);
        }