openemr / app-flutter-openemr

app-flutter-openemr
GNU General Public License v3.0
28 stars 30 forks source link

Medicine recognition #50

Closed viraj-dhanushka closed 3 years ago

viraj-dhanushka commented 3 years ago

This PR is relevant to the issue #26

Here I used firebase_ml_vision plugin.

This plugin uses the capabilities of Firebase ML, which includes all of Firebase's cloud-based ML features, and ML Kit, a standalone library for on-device ML, which can be used with or without Firebase.

NOTE: The below functionality is recorded in a non internet connected environment. So this approach seems to be very suitable for the considering scenario.

Using the live camera

camera

Image Used

937c0e7b052fb528b77ddf8d8249375fd5c85fa3-1110x720

Uploading the Image

upload

Image Used

The-medicine-leaflets-in-concern-No-Name-of-the-Medicine-No-Name-of-the-Medicine-No-Name

im-Amitto commented 3 years ago

@viradhanus we can't use these as test data, can you please try it on an actual medicine box and using a camera instead of gallery.

viraj-dhanushka commented 3 years ago

@im-Amitto actually its working just fine and I did test for few. One is as follows. gel

im-Amitto commented 3 years ago

So what database it use to extract medicine name from random text?

viraj-dhanushka commented 3 years ago

Here only the text recognition part has implemented. The specialty here is, it is an standalone library which can work just fine without a internet connection. The extracting part has to be implemented.

im-Amitto commented 3 years ago

As long as I remember, till now we had 2 text recognition implemented.

  1. OCR which needed the go lang server running
  2. Firebase ml which worked offline as well as online (gives better results when online)

Work which I was expecting: Use any existing option to gain meaningful data out of the extracted text.

viraj-dhanushka commented 3 years ago

@im-Amitto Sure I will try with Firebase ML and update this PR

im-Amitto commented 3 years ago

I think what you did here is working better than what we already have so if you want you can go ahead with this as well but our main goal is to get meaningful data out of the scanned text so feel free to continue in this PR to make it work.

Also, please find and delete any existing code which is not needed when you add it's counter part. We don't need zombie code in or codebase.

viraj-dhanushka commented 3 years ago

@im-Amitto Sure I will improve this with some drug name extracting technique and update this PR.

im-Amitto commented 3 years ago

@bradymiller shared a few good database when I was working on it but I lost that info. Sorry for that. Please have a talk with him, it will help you a lot.

viraj-dhanushka commented 3 years ago

@im-Amitto Thanks a lot for the info. I'll contact @bradymiller . :+1:

bradymiller commented 3 years ago

hi @viradhanus , Check out this api: https://rxnav.nlm.nih.gov/PrescribableAPIs.html#

viraj-dhanushka commented 3 years ago

Thanks a lot @bradymiller

viraj-dhanushka commented 3 years ago

Here I used DailyMed api to extract the drug names. A simple UI is added as follows.

med_recog

im-Amitto commented 3 years ago

Thanks, @viradhanus Let's merge it and call it a kind of prototype.