A library for parsing machine readable healthcare chargemasters
Project description
chargemaster_parsers
Healthcare Chargemaster Parsers
Goals
The primary objective for now is to process (where available) the outpatient data from chargemasters for healthcare institutions in California. The output should be a collection of objects with a common interface to simplify bulk processing.
Requirements
Python 3.9+
Running Unit tests
Unit tests are implemented in pytest and are located in the src/tests directory. To run, you must first create a virtual environment and install the package (preferably in editable mode for local testing). As an example using the venv module:
cd src
python -m venv venv
venv/scripts/Activate
pip install -e .
Next install pytest
pip install pytest
Then to run the tests:
python -m pytest
Downloading and parsing
To utilize the library for a particular institution:
from chargemaster_parsers.parsers import ChargeMasterParser
# Choose your institution
institution = "scripps"
# Create a parser for it - either use the factory method and give it an
# institution name, or you can import the specific parser subclass you want
#
# from chargemaster_parsers.parsers import ScrippsChargeMasterParser
# parser = ScrippsChargeMasterParser()
parser = ChargeMasterParser.build(institution)
# Download the artifacts however you see fit - note this way requires a lot of
# RAM - you will likely need to store them off to disk. For now make a pretend
# file in memory with io. Note that some institutions may require headers that
# look like a browser or they will fail.
import urllib.request
import io
artifacts = {}
for artifact_url in parser.artifact_urls:
with urllib.request.urlopen(artifact_url) as response:
artifacts[artifact_url] = io.BytesIO(response.read())
# Parse the downloaded artifacts into chargemaster entries
for chargemaster_entry in parser.parse_artifacts(artifacts):
print(chargemaster_entry)
Prior works to reference:
This is certainly not the first, nor will it be the last attempt at this. Many have had similar ideas, though most are ultimately doomed to become out of date.
Some that I've found so far:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chargemaster_parsers-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51835d5becd9ef8f2cd5b79efbd4b16d24137b7bc1a6b6116ba28a479757c919 |
|
MD5 | b905d850cab225c44a3bd2c8879d2646 |
|
BLAKE2b-256 | 9695a79aea9e63c55ae28b3e708b8a3a6c13271ffc5f29764528d8b489b6bde9 |
Hashes for chargemaster_parsers-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcf58e96a5888cdbaa431b7d6abfad7eb81251632140b3b678de6d61fa000305 |
|
MD5 | c4f204bda90e7df37e92456f7494dae9 |
|
BLAKE2b-256 | 0d4cc775dac2441442f3faff329c43f6f3ba79b32104922a03a0794038d4f421 |