Transferring Manual Data Collection to SQL Database

Electronic medical records are a modern data minefield. These medical records must be processed and sent yearly to Medicare from any medical institution that wishes to collect full payment for services. This is a massive undertaking every year for most clinics and one whose labor can be greatly reduced with the right data management tools - aka SQL Developer.

**Below can be seen the process used for my clinic - dummy data is used here.**

The final datatable is comprised of three sets of comma-delimited data retrieved from the medical practice's electronic records auditing system.
The first and second set of data can be seen here:

From the first dataset we will be selecting columns: APPTDATE, PATIENT (as FIRSTNAME and LASTNAME), INVOICE and INS (divided at the "|" mark into PRIMARYINS and SECONDARYINS).
From the second data set we will select the SERVICECODES (divided at the "|" mark into CPT1, CPT2, CPT3 and CPT4).


From the third data set we take BIRTHDAY, joining on both FIRSTNAME and LASTNAME.


Next comes a good deal of data manipulation that further lowers the amount of time a person must manually sift through the data: we remove all unnecessary codes and insurances that Medicare does not want to receive in the data, we realign the columns to pull the null cells towards the end of the row and we delete all rows empty of codes or insurance.

And finally, in this dummy data, we're only left with one row that fits our criteria. With the real office data, we have sifted through a massive year's worth of data in seconds and have thousands of rows all presenting the data needed properly to immediately send off to Medicare.