addisclinic/mobile-dispatch-server

Notifications Endpoint

Opened this issue · 3 comments

We want to have an endpoint on the MDS for the client where the client can - for a given patient ID and timestamp - get all notifications (responses, diagnoses, etc) for a patient since that timestamp.

This will involve the client submitting a request to the MDS, the MDS parsing client-request and generating a request to OpenMRS via API for notifications for patient. All filtering, parsing should be done in MDS for now. However, in future we may want to provide functionality for a client to request all notifications for all patients, etc.

In an ideal world when a notification is generated it would push to the client (instead of current design which requires client to pull from OpenMRS through MDS). This could be possible with OpenMRS configuration but need to investigate. Ultimately for now we want to be able to generate a JSON response back to the client with structure:

{  
"status" : "OK"
"mds_id" : "3456"
"patient_id": "33333"
"timestamp" : "mm/dd/yyyy : mm:ss"
"procedure_id":  "5555555",
"message" : "Take 2 Aspirin..............blah blah blah"
}

if status == "FAIL" , then re-use "message" attribute for failure msg
(eventually we may want to provide specific error codes in the response which give detailed information on the failure (authentication, server down, patient doesn't exist, etc).

@tribbettz @phileo I don't care how we store it in the MDS, but we should probably pass the "timestamp" field as a unix timestamp in the response payload and as the "timestamp" parameter in the GET requestsfor new notifications. It's just cleaner. Agreed?

yes, sounds good to me. Might I suggest that the work to support returning all notifications for a list of patient be done in a separate ticket so as to keep things simple with this ticket. @tribbettz @zhalloran

Yup sounds great guys. Zack if you want to add another ticket or I can
that's fine. Awesome!
On May 11, 2016 10:31 PM, "Phileo" notifications@github.com wrote:

yes, sounds good to me. Might I suggest that the work to support returning
all notifications for a list of patient be done in a separate ticket so as
to keep things simple with this ticket. @tribbettz
https://github.com/tribbettz @zhalloran https://github.com/zhalloran


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#21 (comment)