In the last article I covered the basic menses of using PDQm together with MHD equally an API to an XCPD/XCA environment. This is the clas...
In the last article I covered the basic menses of using PDQm together with MHD equally an API to an XCPD/XCA environment. This is the classic intention of the electrical flow IHE Profiles.
But, the reality of XCA communities are that
The reality is that the fourth dimension betwixt a Consumer asking a PDQm regain request, together with getting ALL of the results from ALL of the communities, mightiness live many minutes. Yes, many minutes. That long of a fourth dimension betwixt a RESTful GET (query) together with the reply is unusual. Influenza A virus subtype H5N1 typical http RESTful api toolkit probable doesn't hold off that long.
One solution is to only brand certain all your Consumer implementations hold off a really long fourth dimension earlier giving upward together with assuming their Responder/InitiatingGateway infrastructure has failed them. How long to wait? This mightiness live a value populated somewhere, similar the CapabilityStatement on the Responder, or inwards a Service directory.
But that is non friendly to the user. You mightiness live able to acquire the Consumer software to hold off many minutes, but at that topographic point is probable a human waiting that long too. It is possible to flow each number dorsum equally they decease available, to the Consumer. I am non certain what that looks like. To flow the results would also require the pattern of the Consumer software to live expecting streamed results. Meaning it doesn't hold off for the whole http reply earlier it starts looking at what it does have... Again, non a friendly solution.
Lastly the Responder/InitiatingGateway must cause got a blocking thread for this many minutes too, taking upward precious resources on the middleware.
Some of these problems are http RESTful, but most of them are full general problems that be fifty-fifty inwards the classic XCPD/XCA basis using SOAP.
FHIR has a solution scope to live used... Subscription.... With Subscription the Consumer creates a Subscription resources alongside the subscription criteria equal to the PDQm enquiry it mightiness otherwise do. The Consumer gets notified equally information matching that Subscription becomes available.
The typical use-case for Subscription is to register a subscription for novel information that mightiness appear inwards the futurity equally created past times person else. In the use-case I am describing hither it is equally an Asynchronous machinery for a ready of transactions (XCPD). In my example the creation of the Subscription is a trigger to starting fourth dimension unopen to backend XCPD discovery. Once all of that XCPD regain is done, together with hence the Subscription is useless. So the halt of the Subscription is unlike than typical use-case for Subscription.
I worked alongside a developer who implemented this equally an internal API to their implementation that interfaces alongside the eHealth Exchange (Sequoia Network). Where at that topographic point are good over 100 partners, together with unopen to partners accept many minutes to respond. The number was a much to a greater extent than responsive application behavior, inwards that example a web-interface. In fact the whole response-time from starting fourth dimension to consummate complete was faster equally the critical processing could plough over off during what would usually live hold off time, rather than doing critical processing afterwards all the network interactions happened. So double win!
This looks to a greater extent than busy, together with it is.. but the waiting is betwixt the gaps. The best business office of this approach is that the "new results - ping 1234" volition plough over off in 1 lawsuit for each Patient gibe found, together with volition plough over off when that gibe is available. Thus the Consumer software volition acquire of matches from fast partners actually fast. The Consumer tin together with hence starting fourth dimension doing something correct then, similar minimally displaying the results. Unlike the classic solution that prevents the Consumer from knowing anything until everything is known.
+------------------------+
title PDQm Subscription -- XCA
participant Consumer
participant Responder
participant InitiatingGateway
participant RespondingGateway
note correct of Consumer
based on unopen to demand a patient is of interest
end Federal Reserve annotation over
Consumer->+Responder: Create Subsubscription
note correct of Consumer
Simply movement the PDQm search on Patient
into the Subscription criteria:
Subscription.criteria = Patient? blah
Subscription.channel = websockets
end note
Responder->Responder: banking concern check if valid request
Responder->InitiatingGateway: starting fourth dimension discovery
activate InitiatingGateway
Responder->Consumer: Subscription Create success = 1234
Consumer->Responder: Open Web-Sockets channel
note correct of Consumer
endpoint of Web-Sockets is identified
in CapabilityStatement on Responder
uses websocket extension
end note
Consumer-->Responder: link this websocket to subscription -- bind 1234
Responder-->Consumer: successful link to subscription -- jump 1234
loop for --ALL-- Partners inwards Community
note correct of InitiatingGateway
Design backend to live most responsive:
Could live thread pool, could live lawsuit driven
Might role XCPD synchronous or asynchronous
end note
activate InitiatingGateway
InitiatingGateway->+RespondingGateway: XCPD Patient Discovery
RespondingGateway->-InitiatingGateway: flora patient alpha @ beta community
InitiatingGateway-->Responder: shop number inwards cache
activate Responder
deactivate InitiatingGateway
end loop
Responder-->Consumer: novel results - ping 1234
deactivate Responder
activate Consumer
note correct of Consumer
normal PDQm query
plus Consumer remembers the fourth dimension it terminal queried
Find Patient?blah&_lastupdated=time
end note
Consumer->+Responder: PDQm Patient?blah&_lastupdated=time
Responder->-Consumer: results from Cache
note correct of Responder
cached entries returned
can live maintained or flushed
end note
deactivate Consumer
InitiatingGateway->Responder: notice all Partners cause got responded, or timeout
deactivate InitiatingGateway
note correct of InitiatingGateway
Given no to a greater extent than tin plough over off together with hence done
end note
Responder->Consumer: Close web-socket
Consumer->Responder: Update Subscription(1234) inactivae
deactivate Responder
note correct of Consumer
at whatever fourth dimension Consumer tin inactivate
end note
note correct of Responder
take downward web-socket if all the same up
flush cache
end note
But, the reality of XCA communities are that
- You probable cause got hundreds of communities to probe
- Some of those communities volition live fast, unopen to volition live slow
- Some communities volition live downward together with never respond
The reality is that the fourth dimension betwixt a Consumer asking a PDQm regain request, together with getting ALL of the results from ALL of the communities, mightiness live many minutes. Yes, many minutes. That long of a fourth dimension betwixt a RESTful GET (query) together with the reply is unusual. Influenza A virus subtype H5N1 typical http RESTful api toolkit probable doesn't hold off that long.
One solution is to only brand certain all your Consumer implementations hold off a really long fourth dimension earlier giving upward together with assuming their Responder/InitiatingGateway infrastructure has failed them. How long to wait? This mightiness live a value populated somewhere, similar the CapabilityStatement on the Responder, or inwards a Service directory.
But that is non friendly to the user. You mightiness live able to acquire the Consumer software to hold off many minutes, but at that topographic point is probable a human waiting that long too. It is possible to flow each number dorsum equally they decease available, to the Consumer. I am non certain what that looks like. To flow the results would also require the pattern of the Consumer software to live expecting streamed results. Meaning it doesn't hold off for the whole http reply earlier it starts looking at what it does have... Again, non a friendly solution.
Lastly the Responder/InitiatingGateway must cause got a blocking thread for this many minutes too, taking upward precious resources on the middleware.
Some of these problems are http RESTful, but most of them are full general problems that be fifty-fifty inwards the classic XCPD/XCA basis using SOAP.
FHIR has a solution scope to live used... Subscription.... With Subscription the Consumer creates a Subscription resources alongside the subscription criteria equal to the PDQm enquiry it mightiness otherwise do. The Consumer gets notified equally information matching that Subscription becomes available.
The typical use-case for Subscription is to register a subscription for novel information that mightiness appear inwards the futurity equally created past times person else. In the use-case I am describing hither it is equally an Asynchronous machinery for a ready of transactions (XCPD). In my example the creation of the Subscription is a trigger to starting fourth dimension unopen to backend XCPD discovery. Once all of that XCPD regain is done, together with hence the Subscription is useless. So the halt of the Subscription is unlike than typical use-case for Subscription.
I worked alongside a developer who implemented this equally an internal API to their implementation that interfaces alongside the eHealth Exchange (Sequoia Network). Where at that topographic point are good over 100 partners, together with unopen to partners accept many minutes to respond. The number was a much to a greater extent than responsive application behavior, inwards that example a web-interface. In fact the whole response-time from starting fourth dimension to consummate complete was faster equally the critical processing could plough over off during what would usually live hold off time, rather than doing critical processing afterwards all the network interactions happened. So double win!
This looks to a greater extent than busy, together with it is.. but the waiting is betwixt the gaps. The best business office of this approach is that the "new results - ping 1234" volition plough over off in 1 lawsuit for each Patient gibe found, together with volition plough over off when that gibe is available. Thus the Consumer software volition acquire of matches from fast partners actually fast. The Consumer tin together with hence starting fourth dimension doing something correct then, similar minimally displaying the results. Unlike the classic solution that prevents the Consumer from knowing anything until everything is known.
Note I used web-sockets here, which does require a the Consumer to enquiry afterwards each notification. There are other Subscription types that tin locomote past times the information back. I haven't experienced them, together with don't run into much written near them.
Here is the source for the UML diagram that tin live used at https://websequencediagrams.com
+------------------------+
title PDQm Subscription -- XCA
participant Consumer
participant Responder
participant InitiatingGateway
participant RespondingGateway
note correct of Consumer
based on unopen to demand a patient is of interest
end Federal Reserve annotation over
Consumer->+Responder: Create Subsubscription
note correct of Consumer
Simply movement the PDQm search on Patient
into the Subscription criteria:
Subscription.criteria = Patient? blah
Subscription.channel = websockets
end note
Responder->Responder: banking concern check if valid request
Responder->InitiatingGateway: starting fourth dimension discovery
activate InitiatingGateway
Responder->Consumer: Subscription Create success = 1234
Consumer->Responder: Open Web-Sockets channel
note correct of Consumer
endpoint of Web-Sockets is identified
in CapabilityStatement on Responder
uses websocket extension
end note
Consumer-->Responder: link this websocket to subscription -- bind 1234
Responder-->Consumer: successful link to subscription -- jump 1234
loop for --ALL-- Partners inwards Community
note correct of InitiatingGateway
Design backend to live most responsive:
Could live thread pool, could live lawsuit driven
Might role XCPD synchronous or asynchronous
end note
activate InitiatingGateway
InitiatingGateway->+RespondingGateway: XCPD Patient Discovery
RespondingGateway->-InitiatingGateway: flora patient alpha @ beta community
InitiatingGateway-->Responder: shop number inwards cache
activate Responder
deactivate InitiatingGateway
end loop
Responder-->Consumer: novel results - ping 1234
deactivate Responder
activate Consumer
note correct of Consumer
normal PDQm query
plus Consumer remembers the fourth dimension it terminal queried
Find Patient?blah&_lastupdated=time
end note
Consumer->+Responder: PDQm Patient?blah&_lastupdated=time
Responder->-Consumer: results from Cache
note correct of Responder
cached entries returned
can live maintained or flushed
end note
deactivate Consumer
InitiatingGateway->Responder: notice all Partners cause got responded, or timeout
deactivate InitiatingGateway
note correct of InitiatingGateway
Given no to a greater extent than tin plough over off together with hence done
end note
Responder->Consumer: Close web-socket
Consumer->Responder: Update Subscription(1234) inactivae
deactivate Responder
note correct of Consumer
at whatever fourth dimension Consumer tin inactivate
end note
note correct of Responder
take downward web-socket if all the same up
flush cache
end note



COMMENTS