Hank.ai Interfaces, Specs, and Conversion utilities
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
This project includes the hank.ai data-exchange specification and examples, conversion classes (python), and resulting 3rd party import examples
- Hank-AI-BillingandHealthDataExchange-Version-02-022021.JSON (note: best viewed as 'json with comments' in vscode)
To get a local copy up and running follow these steps.
- python3 (recommmend using anaconda and a virtual env)
- Clone the repo
git clone https://github.com/hank-ai/hankerfaces.git cd hankerfaces
- Install requirements
pip install requirements.txt
- define file locations
medsuitespecfp = 'AbeoMedsuite/Abeo Billing Export Layout V1.3_modHank.xlsx'
- import and instantiate an instance of the medsuite interface class
from AbeoMedsuite import medsuite
msi = medsuite.MedsuiteInterface()
- load the medsuite spec with mappings to hank.ai fields
msi.loadSpec(xlsfilepath=medsuitespecfp)
Returns the contents of the Medsuite import file (ascii string with newlines)
sji = msi.hde.sampleJSON() #get an example json from the hankHDE class
msi.loadHankJSON(sji) #load the hank.ai job json
msi.convertFromHank() #convert it to medsuite format
Process MULTIPLE (i.e. batch) hank job jsons at once, grouping outputs by facility code
Load the contents of some hank.ai json examples
import json
exjsonfiles = [
'_hankSpecExamples/example.json',
'_hankSpecExamples/example2.json',
'_hankSpecExamples/example3.json',
'_hankSpecExamples/example4.json'
]
jsonstrings = []
print("Loading hank.ai job jsons ...")
for ejf in exjsonfiles:
print(" -> loading {}".format(ejf))
try:
with open(ejf, 'r') as f:
jsonstrings.append(json.dumps(json.load(f)))
except Exception as e:
print(" -> error ({})".format(e))
print(" -> continuing ...")
print("Done loading.")
Convert the list of loaded json contents into a dictionary of facilitycode:medsuitefilecontents
outdict = msi.convertFromHankBatch(jsonstringlist=jsonstrings)
Iterate over the dictionary and write out to files
print("Writing medsuite import file outputs ...")
for fac, content in outdict.items():
outfilename='medsuiteimport_{}.txt'.format(fac)
with open(outfilename, 'w') as f:
print(" -> writing {}".format(outfilename))
f.write(content)
print("DONE.")
- define file locations
phispecfp = 'PHI/spec.csv'
- import and instantiate an instance of the phi interface class
from PHI import paintedhorse
phi = paintedhorse.PaintedHorseInterface()
under development
under development
- define file locations
medlinkspecfp = 'medlink/spec.csv'
- import and instantiate an instance of the medlink interface class
from sierra import medlink
smli = medlink.MedlinkInterface()
under development
under development
- define file locations
neptunespecfp = 'blue9/spec.csv'
- import and instantiate an instance of the neptune interface class
from blue9 import neptune
bni = neptune.NeptuneInterface()
under development
under development
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Jack Neil - @realjackneil - [email protected]
Project Link: https://github.com/hank-ai/hankerfaces