Esempio n. 1
0
        public void X12ToClaimModelTest()
        {
            Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("OopFactory.X12.Hipaa.Tests.Unit.Claims.TestData.ProfessionalClaim1.txt");

            var service = new ProfessionalClaimToHcfa1500FormTransformation("");

            // send the x12 stream in to obtain a claim object
            var document  = service.Transform837ToClaimDocument(stream);
            var hcfaclaim = service.TransformClaimToHcfa1500(document.Claims.First());

            Assert.AreEqual("SMITH, TED", hcfaclaim.Field02_PatientsName);
            Assert.IsFalse(hcfaclaim.Field01_TypeOfCoverageIsMedicare);
            Assert.IsFalse(hcfaclaim.Field01_TypeOfCoverageIsMedicaid);
            //Assert.AreEqual("1943-05-01T00:00:00", hcfaclaim.Field03_PatientsDateOfBirth);
            Assert.IsFalse(hcfaclaim.Field03_PatientsSexFemale);
            Assert.IsTrue(hcfaclaim.Field03_PatientsSexMale);
            Assert.AreEqual("99213", hcfaclaim.Field24_ServiceLines.First().ProcedureCode);
            Assert.AreEqual("87070", hcfaclaim.Field24_ServiceLines[1].ProcedureCode);
            Assert.AreEqual("99214", hcfaclaim.Field24_ServiceLines[2].ProcedureCode);
            Assert.AreEqual("86663", hcfaclaim.Field24_ServiceLines[3].ProcedureCode);

            /*
             * Assert.AreEqual("BEN KILDARE SERVICE", hcfaclaim.Field32_ServiceFacilityLocation_Name);
             * Assert.AreEqual("234 SEAWAY ST", hcfaclaim.Field32_ServiceFacilityLocation_Street);
             * Assert.AreEqual("MIAMI", hcfaclaim.Field32_ServiceFacilityLocation_City);
             * Assert.AreEqual("FL", hcfaclaim.Field32_ServiceFacilityLocation_State);
             * Assert.AreEqual("2345 OCEAN BLVD", hcfaclaim.Field33_BillingProvider_Street);
             * Assert.AreEqual("MAIMI", hcfaclaim.Field33_BillingProvider_City);
             * Assert.AreEqual("FL", hcfaclaim.Field33_BillingProvider_State);
             * Assert.AreEqual("33111", hcfaclaim.Field33_BillingProvider_Zip);
             */
            Trace.Write(hcfaclaim.Serialize());
        }
Esempio n. 2
0
        public Stream X12ToClaimModel(Stream input)
        {
            var service = new ProfessionalClaimToHcfa1500FormTransformation("");

            // send the x12 stream in to obtain a claim object
            var document  = service.Transform837ToClaimDocument(input);
            var hcfaclaim = service.TransformClaimToHcfa1500(document.Claims.First());

            var xml = hcfaclaim.Serialize();

            return(new MemoryStream(Encoding.UTF8.GetBytes(xml)));
        }
Esempio n. 3
0
        public void X12ToClaimModelTest()
        {
            Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("X12.Hipaa.Tests.Unit.Claims.TestData.ProfessionalClaim1.txt");

            var service = new ProfessionalClaimToHcfa1500FormTransformation(string.Empty);

            // send the x12 stream in to obtain a claim object
            var document  = service.Transform837ToClaimDocument(stream);
            var hcfaclaim = service.TransformClaimToHcfa1500(document.Claims.First());

            Assert.AreEqual("SMITH, TED", hcfaclaim.Field02_PatientsName);
            Assert.IsFalse(hcfaclaim.Field01_TypeOfCoverageIsMedicare);
            Assert.IsFalse(hcfaclaim.Field01_TypeOfCoverageIsMedicaid);
            Assert.IsFalse(hcfaclaim.Field03_PatientsSexFemale);
            Assert.IsTrue(hcfaclaim.Field03_PatientsSexMale);
            Assert.AreEqual("99213", hcfaclaim.Field24_ServiceLines.First().ProcedureCode);
            Assert.AreEqual("87070", hcfaclaim.Field24_ServiceLines[1].ProcedureCode);
            Assert.AreEqual("99214", hcfaclaim.Field24_ServiceLines[2].ProcedureCode);
            Assert.AreEqual("86663", hcfaclaim.Field24_ServiceLines[3].ProcedureCode);
        }
Esempio n. 4
0
        public void X12ToHcfaPdfTest2()
        {
            // Setup to test new HCFA 02/12 form
            var hcfa    = GetHcfa();
            var service = new ProfessionalClaimToHcfa1500FormTransformation(@"..\..\..\tests\OopFactory.X12.Hipaa.Tests.Unit\Claims\TestData\Images\CMS_1500_claim_form_2012-4.gif");

            OopFactory.X12.Hipaa.Claims.Forms.FormDocument form = new OopFactory.X12.Hipaa.Claims.Forms.FormDocument();
            form.Pages.AddRange(service.TransformHcfa1500ToClaimFormFoXml(hcfa));

            var xml = form.Serialize();

            var transformStream = typeof(ClaimTransformationService).Assembly.GetManifestResourceStream("OopFactory.X12.Hipaa.Claims.Services.Xsl.FormDocument-To-FoXml.xslt");

            var transform = new XslCompiledTransform();

            if (transformStream != null)
            {
                transform.Load(XmlReader.Create(transformStream));
            }

            var outputStream = new MemoryStream();

            transform.Transform(XmlReader.Create(new StringReader(xml)), new XsltArgumentList(), outputStream);
            outputStream.Position = 0;

            XmlDocument foDocument = new XmlDocument();

            foDocument.LoadXml(new StreamReader(outputStream).ReadToEnd());

#if DEBUG
            var driver = Fonet.FonetDriver.Make();

            FileStream outputFile = new FileStream("c:\\Temp\\Pdfs\\ProfessionalClaim2.pdf", FileMode.Create, FileAccess.Write);
            driver.Render(foDocument, outputFile);
#endif
        }