servinglynk / hslynk-open-source-docs

Contains wiki documentation, and issue tracker for the HSLynk Open Human Services Data Exchange Platform project. Code is in a different repo: https://github.com/servinglynk/hslynk-open-source . API docs are at https://docs.hslynk.com . General website is at:
http://www.hslynk.com/
Mozilla Public License 2.0
9 stars 3 forks source link

FHIR derived subscription for chronic homelessness = "true" #876

Closed eric-jahn closed 3 years ago

eric-jahn commented 4 years ago

related #852 Use this pub/sub API (following it strictly) to receive notifications of changes in a person's chronic homelessness status: https://www.hl7.org/fhir/subscription.html .

We may have to modify the API signature somewhat to accomplish this, if the specification does not have a way to convey the chronic homelessness status boolean.

I think that one key element of our implementation is to specify what the search criterion for "chronic homelessness" is, in the subscription request body.

from the url above: "The criteria are Search strings that have the same interpretation as if they were appended to the base URL and submitted using the REST API. Note that the search criteria are applied to the new value of the resource. The consequence of this is that there is no notification when a resource is deleted, or when a resource is updated so that it no longer meets the criteria."

With regard to that statement, the base URL and appended part for retrieving the chronic homelessness element would be, for 2020 HMIS,
image. And then within that response is the "chronicHomeless" data element boolean.

So then the request to subscribe would look something like: { "resourceType": "Subscription", "criteria": "v2020/clients​/{clientid}​/enrollments​/{enrollmentid}?chronicHomeless=1&_format=json", "channel": { "type": "rest-hook", "endpoint": "https://somesubcriber.com/on-result", "header": "Authorization: Bearer secret-token-abc-123" } }

And then the asynchronous published responses would be an notification declaring that there is some data to retrieve: this consists of a POST message to alert the subscriber that new results are available - POST https://somesubcriber.com/on-result and the body would consist of: { "resourceType¨: "enrollment" "endpoint": "channel": { "endpoint": "https://hslynk.com/rest/v2020/clients​/{clientid}​/enrollments​/{enrollmentid}", } } .

...and then the subscriber would call the normal GET https://hslynk.com/rest/v2020/clients​/{clientid}​/enrollments​/{enrollmentid} endpoint, to retrieve the new client enrollments where the client with {clientid} is chronically homeless.

image

eric-jahn commented 3 years ago

"I know there is config in the pom.xml for SMTP and some other config for the subscription notifications. "

eric-jahn commented 3 years ago

great example: https://1up.health/dev/doc/fhir-subscription

suryayadavalli commented 3 years ago

Currently working on criteria evaluation. 90% of the task is complete. Will target to finish this by tomorrow.

suryayadavalli commented 3 years ago

Complete. Verified, rolled-out to production. Working with customer on end to end testing. No action items at this point. Closing the issue

Commit ID # https://github.com/servinglynk/hslynk-open-source/commit/82a91f65c1e13a7e7a3795096dd94ebe812e2449 API documentation : https://docs.hslynk.com/?urls.primaryName=Subscription%20Service%20API