This tool automates the downloading and processing of 835 ERA files using the MTF provided CLI tool.
Created by Kevin Xing from Hayat Pharmacy.
Required only for Reports.
- If you just want to download files, you can skip this.
- To get the HTML Reports, install Python 3 from python.org.
- IMPORTANT: During installation, check the box that says "Add Python to PATH".
You need the official CLI tool from the MTF Portal to make this work.
- Log in to the MTF Portal.
- Go to the Developer tab.
- Create an API Key if you haven't already.
- Scroll down and download the CLI Tool (a
.zipfile). - Extract the contents of the zip file into this project folder. Your folder structure should look like this:
Project_Folder/
├── mtf-cli/ <-- This folder comes from the ZIP file
│ ├── bin/
│ ├── node_modules/
│ ├── package.json
│ └── ...
├── 1_Update_And_Report.bat
├── 2_Download_Only.bat
├── api_keys.txt
├── process_835.py
└── run-all-locations.ps1
- Double-click
setup.bat. This will verify your setup and create a configuration file namedapi_keys.txt. - Open
api_keys.txtin a text editor (like Notepad). - Add your Location IDs (e.g., H1, H2) and the API Keys you generated in the portal. Format them exactly like this:
H1
Your-Long-API-Key-Here-For-H1
H2
Your-Long-API-Key-Here-For-H2
Generate the API key for each location you want to download files from via the MTF Portal, under the Developer tab.
Once setup is complete, you can simply double-click these files to run tasks:
1_Update_And_Report.bat(Recommended, Python required)- Downloads new files with today's date for all locations.
- Automatically generates the interactive HTML report.
2_Download_Only.bat- Only downloads new files. Does not generate reports.
3_Regenerate_Report.bat(Python required)- Does not download anything.
- Regenerates the HTML report from files you already have. Use this if you modified the report or want to refresh it.
4_Catch_Up_Last_90_Days.batMFT keeps up to 90 days of data available via the API.- Downloads files from the last 90 days for all locations.
- Use this first to get all data or if the script hasn't been run for a long time.
- Reports: Open the
reports/folder and clickprocessed_835_summary.htmlto view your dashboard. - Downloads: The raw 835 text files are stored in the
downloads/folder, organized by location.
- Window closes immediately? Try running
setup.bat. It will pause and show you if Python or the CLI is missing. - "mtf-cli not found"? Make sure you extracted the zip file correctly so that a folder named
mtf-cliexists right next to the.batfiles. This CLI tool is provided by the MTF Portal under "Developer" tab. Create the API keys there as well, then scroll down to download the CLI tool. I have included everything you need into this codebase. Just make sure the folder structure is correct. - Python not found? If you want reports, ensure Python 3 is installed and added to your PATH. You can verify by opening Command Prompt and typing
python --version. Feel free to reach out to me if you need help!