Closed Awinja-j closed 6 years ago
@Awinja-Andela I can kind of see what's happening here now.
So as to avoid replication, let's approach this as a doc-type.
When you search using https://api.healthtools/search/wit?q=Dr+Ouma
it then determines the doc type using wit.ai. Make sense?
@DavidLemayian yes. i see. let me try it out.
@DavidLemayian check it out!!!
This is shaping up nicely @Awinja-Andela. Now what I'd like is for determine_doc_type
be the only function wit_ai runs. It should return only the query
and doc_type
. Makes sense?
@DavidLemayian Makes Sense. I have changed it to return query
and doc_type
@DavidLemayian you will see a lot has changed now. wit_ai.py is no more. there's a new function in query.py and run_query fucntion has changed to accomodate the new function And search_api.py no longer checks if doc_type is 'wit'
We are currently using keywords to determine which document type the application should query from, which limits to the application to some words. Wit.ai will identify key words in queries and determine which document type it should query.
This PR therefore introduces:
This task involved:
doctors
,nurses
,clinical-officers
,health-facilities
,nhif-inpatient
,nhif-outpatient
,nhif-outpatient-cs
andquery
wit.ai is suitable for the
/search
endpoint and furtherSMS
functionIt will enable users do searches like:
http://127.0.0.1:5000/search?q=is Doctor Jane Wairimu registered?
or send texts like:
where are civil servants outpatient services offered in kerugoya?
Relevant pivotal tracker stories
https://github.com/CodeForAfricaLabs/HealthTools.API/issues/51