Welcome to Part 2 of “Coding An Electronic EEG Logbook.” In this post, I will outline the dashboard, email notifications, my main SQL table structure, and adding ICD-10 codes.
For my dashboard I used Highcharts. Here is an example of ~6 months of data entered for 2018 displaying the volume of patients from each unit. I have two separate files, one to display the data, and one to query the database.
Highcharts PHP/HTML displaying the chart:
Highcharts PHP data file to run the MYSQL query (See the SQL query highlighted):
Example JSON output:
[[” Program Admit”,466],[“Clinic EEG”,719],[“Clinic JPB PT EEG”,50],[“EEG INPT”,360],[“EEG Other (ISAT\/PET)”,24],[“EEG Program Admit”,318],[“EEG UH 4920”,244],[“EEG UH ICU”,485],[“INPT 5000”,828],[“INPT EEG”,55],[“INPT EEG H8000”,591],[“INPT EEG ICU”,927],[“INPT EEG PICU”,244]]
HTML/JQUERY output column chart displaying unit volume:
Now that you have data coming into your database, you can find scripts online or write your own that will simply query your database with an SQL statement and then email you or others with the results. This can be helpful for daily/weekly/monthly reports. I used the following script to query my database and send monthly results to our accounting team.
Here is a Github link to an example script I used. You will need to set up a CRON job on your webserver. No relation to StudiOwens but I do like the name.
MySql database structure for the EEG Logbook table
You should start off with a unique id for every row, (e.g. id). For the ‘id’ row make it an integer that is set so AUTO_INCREMENT, this will assign it a new unique id number for every entry in the database.
For any file data you wish to upload, like pictures or Word documents, make it a BLOB. In my database I have one medium blob called file_data, this is for uploading the EEG reports.
Adding ICD-10 codes to your database
You can easily download all of the ICD-10 diagnosis codes in a text file from the CMS website here.
Extract and open this file in any text editor like Textwrangler for Mac or Notepad++ for Windows and you will see the entire list. I extracted only the pertinent epilepsy codes from the list and imported them into my SQL database. I use PhpMyAdmin to import and administer my MySQL database.
Example of the ICD-10 codes in a drop-down from our MEG/MSI database:
Stay tuned for Part 3, I’ll upload a demo with anonymous data and talk about putting the database into the cloud for ease of access with secure authentication and HIPAA compliance.