Skip to content

FHIR subscriptions processing for FHIR Resource Repository of InterSystems IRIS for Health

License

Notifications You must be signed in to change notification settings

dmitry-zasypkin/fhir-subscriptions

Repository files navigation

fhir-subscriptions

FHIR subscriptions processing for FHIR Resource Repository of InterSystems IRIS for Health 2021.1+.

Docker Installation

  1. Clone the repo into any local directory, e.g.:
    $ git clone https://github.com/dmitry-zasypkin/fhir-subscriptions.git
    $ cd fhir-subscriptions
    
  2. Get the images: docker-compose build --pull
  3. Start docker: docker-compose up -d

Host Installation

  1. Clone the repo into any local directory, e.g.:

    C:\Git> git clone https://github.com/dmitry-zasypkin/fhir-subscriptions.git
    

    Or just download repo contents by clicking the green Code button and selecting Download ZIP, then unzip the archive to a directory of your choice.

  2. In IRIS terminal import App.Installer class into USER namespace:

    XXX> zn "USER"
    USER> do $System.OBJ.Load("<full path to fhir-subscriptions repo directory>/Installer.cls", "ck")
    
  3. Run setup() method of App.Installer class passing it the repo directory path, name for the new namespace, web application path for the FHIR endpoint to be created, and other parameters, e.g.:

    zw ##class(App.Installer).setup("C:/Git/fhir-subscriptions", "FHIRSERVER", "/fsub", "isc.ateam.fsub.FSUBInteractionsStrategy", $lb("hl7.fhir.r4.core@4.0.1"), "isc.ateam.fsub.FSUBProduction", "/fsub/mock", "isc.ateam.fsub.mock.DummyRESTHookHandler", $lb("no-payload", "with-payload"), "REST Hook: ")
    

    It will create the specified namespace backed by a set of databases including a separate database for program code. It will then import the source code into the new namespace, setup FHIR endpoint with the specified path, create two Service Registry entries, configure a mock-up service web application, and appoint isc.ateam.fsub.FSUBProduction as the current interoperability production for the namespace. Note that FHIR endpoint is based on the specified custom interactions strategy class isc.ateam.fsub.FSUBInteractionsStrategy.

  4. Start the production in the new namespace either using the command do ##class(Ens.Director).StartProduction() in the same terminal window, or using the Portal.

Testing with Postman

  1. Import FSUB.postman_collection.json file into Postman.
    • Adjust url variable defined for the collection.
    • You may also need to adjust web server port mentioned in channel.endpoint element of Subscription resources within both of POST Subscription requests in the collection.
  2. Post Subscription resource to FHIR Repository using either of POST Subscription requests from the collection. Criteria element of the resource contains the following Search string: Patient?identifier=https://hl7.org/fhir/sid/us-ssn|999-99-9990.
  3. Test subscription processing by posting Patient resource and/or Bundle containing Patient resources using the corresponding requests from the collection. Patient resources with SSN=999-99-9990 will trigger interoperability (Ensemble) session that can be examined in the Portal. E.g.:

Visual Trace

Notification Routing Details

At the moment, only rest-hook channel type has been implemented.

REST Hook notifications are broadcast through business operation components of class isc.ateam.fsub.bo.RESTHookOperation.

For each endpoint URL that can be a notification target, there should be a pre-configured HTTP Service Registry entry and a corresponding operation component in the interoperability production. So that each operation queues notifications destined for a specific endpoint.

Once isc.ateam.fsub.FSUBRouterProcess receives a message containing a Subscription and a set of matching resources, the process extracts target endpoint URL from channel.endpoint element of the Subscription, and looks in the HTTP Service Registry for an entry whose Aliases array contains the URL. If a Service Registry entry is found, the process tries to find the business operation component associated with the entry through ServiceName setting. Finally it routes notification message(s) to the operation.

About

FHIR subscriptions processing for FHIR Resource Repository of InterSystems IRIS for Health

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published