Skip to content

hank-ai/hankerfaces

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Hankerfaces

Hank.ai Interfaces, Specs, and Conversion utilities
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

This project includes the hank.ai data-exchange specification and examples, conversion classes (python), and resulting 3rd party import examples

Hank.ai JSON Specification:

Built With

Getting Started

To get a local copy up and running follow these steps.

Prerequisites

  • python3 (recommmend using anaconda and a virtual env)

Installation

  1. Clone the repo
    git clone https://github.com/hank-ai/hankerfaces.git
    cd hankerfaces
  2. Install requirements
    pip install requirements.txt

Usage

Abeo Medsuite conversion

  1. define file locations
medsuitespecfp = 'AbeoMedsuite/Abeo Billing Export Layout V1.3_modHank.xlsx'
  1. import and instantiate an instance of the medsuite interface class
from AbeoMedsuite import medsuite
msi = medsuite.MedsuiteInterface()
  1. load the medsuite spec with mappings to hank.ai fields
msi.loadSpec(xlsfilepath=medsuitespecfp)

Process a single example record

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 records together (i.e. batch)

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.")

Painted Horse Incorporated (PHI) conversion:

  1. define file locations
phispecfp = 'PHI/spec.csv'
  1. import and instantiate an instance of the phi interface class
from PHI import paintedhorse
phi = paintedhorse.PaintedHorseInterface()

Process a single example record (hank.ai -> phi)

under development

Process a single example record (phi -> hank.ai)

under development

Sierra Medlink conversion:

  1. define file locations
medlinkspecfp = 'medlink/spec.csv'
  1. import and instantiate an instance of the medlink interface class
from sierra import medlink
smli = medlink.MedlinkInterface()

Process a single example record (hank.ai -> medlink)

under development

Process a single example record (medlink -> hank.ai)

under development

blue9 Neptune conversion:

  1. define file locations
neptunespecfp = 'blue9/spec.csv'
  1. import and instantiate an instance of the neptune interface class
from blue9 import neptune
bni = neptune.NeptuneInterface()

Process a single example record (hank.ai -> neptune)

under development

Process a single example record (neptune -> hank.ai)

under development

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Jack Neil - @realjackneil - [email protected]

Project Link: https://github.com/hank-ai/hankerfaces

Acknowledgements

About

Hank.ai Interface libraries and specs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages