Git Product home page Git Product logo

hospital-document-parser's Introduction

Hospital Documents Processing / Processamento de Documentos de Hospitais

For an english readme, click the dropbox below

What does it do?

This project aims to simulate a hospital program that receives images and pdf files from photos their patient's or an employee sends them.

Let's assume 2 test cases, one for a prescription and one for a form with the patient's information.

The prescription should look like this:
“prescription”

The output should be something like this:

{
    "doctor_info": "John Smith, M.D\n2 Non-Important Street,\nNew York, Phone (000)-111-2222",
    "patient_name": "Marta Sharapova",
    "address": "9 tennis court, new Russia, DC",
    "prescription": "Prednisone 20 mg\nLialda 2.4 gram",
    "directions": "Prednisone, Taper 5 mg every 3 days,\nFinish in 2.45 weeks |\nLtalda - take 2 pill everyday for 1 month",
    "refill": "2 times"
}

The patient details form should look like this:
“patient_details” “page2_of_patient_details”

And the result should be:

{
    "issue_date": "17/12/2020",
    "patient_name": "Kathy Crawford",
    "patient_birth_date": "May 6 1972",
    "patient_phone_number": "(737) 988-0851",
    "patient_address": "9264 Ash Dr 95\nNew York City, 10005 '\nUnited States",
    "patient_weight": "95",
    "patient_height": "190",
    "emergency_contact": "Simeone Crawford 9266 Ash Dr\nNew York City, New York, 10005\nome phone United States\n(990) 375-4621\nWork phone",
    "chicken_pox": "IMMUNE",
    "measles": "IMMUNE",
    "hepatitis_b_vaccitation": "Yes",
    "medical_problems": "Migraine",
    "has_insurance": "Yes",
    "insurance_provider": "Random insuarance Company",
    "insurance_policy_number": "7115207313",
    "allergies": "Peanuts",
    "regular_medications": "Triptans",
    "clinic_address": "4789 Bollinger Rd\nJersey City, New Jersey, 07030",
    "Expiry_date": "30 December 2020"
}

Keep in mind those keys could be more segmented, but it is just an idea.

How does it work?

For a satisfactory result the process takes multiple steps:

  1. The first step requires the user to provide the file path and the type of the document. This can be done by running the proper files or you can use one my scripts, which we will talk about later.

  2. If the file is a pdf, the second step will be transforming this pdf into an image(or images).

  3. With the images ready, the program will reprocess the image as it can have shadows, blurs and other things that can make it hard to read the image. The result from the prescription I showed earlier should look like this:

    “processed_img”
  4. With that done, it's time to get the text from that image.

  5. The information is not usefull as it is now, so we will arrange it in an object and remove any noise from it. As the result comes a little dirty like in the text below (taken from the patient details showed early)

Click here to show the extracted text
17/12/2020



Patient Medical Record





Patient Information Birth Date
Kathy Crawford May 6 1972
(737) 988-0851 Weight9264 Ash Dr 95
New York City, 10005 '
United States Height:
190
In Casc of Emergency
a _
Simeone Crawford 9266 Ash Dr
H New York City, New York, 10005
ome phone United States
(990) 375-4621
Work phone
Genera! Medical History
LT

nn
ch LT a

Chicken Pox (Varicella): Measies:

IMMUNE IMMUNE

Have you had the Hepatitis B vaccination?

No

List any Medical Problems (asthma, seizures, headaches):

Migraine






ff Name of Insurance Company:
fs Random insuarance Company
F . Policy Number:

7115207313

Do you have medical insurance?

Yes.

Medical Insurance Details

List any allergies:
Peanuts

List any medication taken regularly:

Triptans



4789 Bollinger Rd
Jersey City, New Jersey, 07030

Expiry Date:
30 December 2020
  1. Done, the Program Should have extracted all the useful data.

How can You test it?

It is quite simple, first you need to clone this repository:
git clone [email protected]:vinisavordelli/Hospital-Document-Parser.git

After that, open the repository you just cloned.

code ./Hospital-Document-Parser

Install the necessery packages

make install

You're all set. I left three make commands ready

make test # Runs all project tests
make start #Starts the API in a localserver
make run #Starts the application through the terminal

Running the Project with make run: <img src="https://user-images.githubusercontent.com/77638347/221332468-e48ebe1d-bd1d-48c2-aab4-939ada9d1cd5.gif" alt= “running the project with make run” width="80%">

Using it with make start and postman: <img src="https://user-images.githubusercontent.com/77638347/221332466-6e601c6e-335c-4783-8109-35bd7890b79b.gif" alt= “Usin it with make start and Postman” width="80%">

hospital-document-parser's People

Contributors

vinisavordelli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.