An XCA query transaction in InterSystems products begins with an XDS query request message. Rather than pointing the XDS Document Consumer to a particular repository, the consumer points instead to the XCA Initiating Gateway, which knows about both the local repository and the repositories in other Affinity Domains. The easiest way to set this up is to create a Service Registry entry that contains the URL of the Initiating Gateway service and call it, for example, “XCA.IG.” Then set the XDSbRegistryServiceName setting in your XCA Document Consumer to XCA.IG.
The full XCA query procedure is documented below. The first 3 steps and the last 3 steps occur in a separate session, and are basically identical to an XDS.b query transaction. They are not shown in the diagram.
-
You provide an XDSb.QueryRequestOpens in a new tab message that contains an MPI ID and assigning authority to the XDS.b Document Consumer. The query request also specifies the document type and status (for example “approved”), and may also include a list of filters.
You can obtain the MPI ID through a PIX or PDQ query (described above).
-
The document consumer transforms the message into an IHE “XDSb_QueryRequest” message using the TransformRetrieveToXDSb setting.
-
The document consumer then forwards the query to the XCA Initiating Gateway service that is indicated in the XDSbRegistryServiceName setting. The rest of the procedure takes place in a new session until the document consumer receives its response.
-
The XCA Initiating Gateway service forwards the message to the XCPD Initiating Gateway process named in the XCPDInitiatingGatewayProcess setting.
-
The XCA Initiating Gateway process transforms the message into an IHE “XCA_QueryRequest” message using an internally-specified transform, and forwards it to the XCPD Initiating Gateway process to begin the patient discovery.
-
The XCPD Initiating Gateway process extracts the MPI ID from the request and constructs a Patient Search Request message.
-
The XCPD Initiating Gateway process gets the patient’s demographics by sending the Patient Search Request to the PDQ consumer named in the PDQv3Consumer setting.
-
The PDQ consumer returns the demographics.
-
The XCPD Initiating Gateway process confirms that the <Root> element of the <LivingSubjectID> returned from the PDQ is the same as the assigning authority of the provided MPI ID.
-
The XCPD Initiating Gateway process checks the XCPDQueryServiceNames setting. This setting should contain a comma-separated list of Service Registry entries that point to XCPD Responding Gateway endpoints in other Affinity Domains.
-
The XCPD Initiating Gateway process sends one XCPD Patient Discovery Request to the XCPD Initiating Gateway operation for each known XCPD Responding Gateway.
-
The XCPD Initiating Gateway operation forwards the discovery requests to the XCPD Responding Gateways in the other Affinity Domains. It then returns XCPD Patient Discovery Responses from the XCPD Responding Gateways to the XCPD Initiating Gateway process. Each response contains the MPI IDs and demographics of zero, one, or several possible patients that match the provided demographics. These are exactly like PDQ responses.
-
The XCPD Initiating Gateway process transforms the responses and replaces the Home Community OIDs with Home Community IDs from the OID registry.
-
The XCPD Initiating Gateway process extracts the MPI IDs and Home Communities (assigning authorities) for the unique matches, discarding any that match multiple patients within a Home Community.
-
The XCPD Initiating Gateway process returns an IHE “XCA_QueryResponse” message to the XCA Initiating Gateway process that contains a list of MPI IDs and Home Community IDs, with at most a single entry for each Home Community.
-
The XCA Initiating Gateway process uses the Home Community IDs to get the Home Community OIDs. In order to translate each OID into a URL, the following setup is required:
-
An OID registry entry of type “HomeCommunity” for each Home Community OID.
-
A Service Registry entry for each Home Community that provides the URL of the XCA Responding Gateway actor in that community:
-
Each Service Registry entry must include the OID registry code in the HomeCommunity field. This ties the OID and Service Registry entries together.
-
Each Service Registry entry must include XCA.Query in the Device Function field. This indicates that it is the “XCA query device” for this community.
-
For each match returned by the XCPD Initiating Gateway process, the XCA Initiating Gateway process sends an XCA_QueryRequest message to the XCA Initiating Gateway operation named in the XCAInitiatingGatewayOperation setting.
If there is a value in the XDSbQueryServiceName field, which should point to the local XDS registry, then the XCA Initiating Gateway process also sends an XDSb_QueryRequest to the XCA Initiating Gateway operation. This will trigger a document search in the local XDS registry.
-
The XCA Initiating Gateway operation forwards the query requests to the XCA Responding Gateways (and possibly the local registry). It then returns the query responses from the XCA Responding Gateways (and local registry) to the XCA Initiating Gateway Process. Each response indicates the document metadata and location for each document available for the patient.
-
The XCA Initiating Gateway Process combines the various responses.
-
The XCA Initiating Gateway Process returns an XML message of the “XCA_QueryResponse” variety to the XCA Initiating Gateway service.
-
The XCA Initiating Gateway service returns the combined responses to the XDS.b Document Consumer in the original session in an XML message of the “XDSb_QueryResponse” variety.
-
The document consumer extracts the document metadata from the response using the transformation specified in the TransformToMetadata setting. It then constructs an HS.Message.IHE.XDSb.QueryResponseOpens in a new tab message.
-
The document consumer returns the XDS.b Query ResponseOpens in a new tab message, which contains both the original XCA and XDS.b responses and the extracted metadata. This message can be used to initiate an XCA retrieve, as described in the XCA Retrieve procedure.