PDF documents are used by many organizations to both display and print health care claim forms like CMS-1500 and UB-04. Fillable PDF documents, also called PDF forms, are used to allow users the both view and edit documents before saving or printing. PDF forms are sometimes displayed directly in internet browsers.
EDI data from an 837 Professional EDI document, for example, represents a health care claim and can be used to initially populate fields in PDF claim forms. Users can then edit the fields, save or print the PDF claim as needed.
This blog will demonstrate how to take data from an 837 Professional EDI file and populate a fillable CMS-1500 PDF form.
Step 1 Loading the 837 Professional claim file into memory
The first step is loading the 837 Professional file into memory. We’ll use EDIValidator to accomplish this. Once the data is loaded we’ll use Typed Documents to get the data we need.
EDIValidator validate = new EDIValidator();
ediValidator.EDIFile = “EDIFiles\\sampleEDIFile.txt”;
Typed5010Document doc = new Typed5010Document(ediValidator.EDILightWeightDocument);
Step 3 Use the information from Step 2 to fill the fillable CMS-1500 PDF form
How is this accomplished? Each fillable PDF form has a collection of fields/value pairs that can be set. We’ll use a free .Net library called iText. iText allows us to get and set the fields. Each fillable PDF form will have different names for their fields. You should iterate over the fields and verify that you are setting the correct field.
In our example the field we want to set is called ‘doc_name’.
// Create a PdfReader and PdfWriter instance
var fields = form.GetFormFields();
fields[“doc_name”] = box33Data;