Implementing XDS.b profiles

Introduction

Iguana simplifies a developer’s life when dealing with XDS.b and it’s inherent complexities. No doubt that working with XDS.b can seem a daunting task at first. However, with these helpful modules any Iguana developer will feel comfortable in dealing with the challenges that XDS.b may present.

To help you get started, we’ve put the necessary material to get fully functioning XDS.b transactions that represent the core set when exchanging electronic medical records with HIE systems. Besides implementation how-to’s with sample XDS.b transactions for both document source and consumer scenarios, we’ve also provided the necessary testing links to NIST’s online servers to validate the XDS.b transactions.

In the next two pages we cover the core foundation XDS.b transactions that involve the exchange of medical documents between two systems from the actor perspective.

Document Source (ITI-41) [top]

Let’s begin by creating and configuring the channel that will show how easy it is to put a document into an XDS.b server.

Implementing our solution

  1. Download these files:
  2. From the Dashboard, click Add Channel. The Add Channel dialog appears.
  3. Select the following components:
    • Source = LLP Listener
    • Destination = To Translator
  4. Click the Configure Channel button. The Configure New Channel window appears.
  5. Click the Channel tab and enter the following information:
    • Channel Name = XDS.b ITI-41 PNR
    • Description = XDS.b ITI-41 transaction sample channel demonstrating Provide and Register document set IHE profile
  6. We are going to leave the other channel component settings as their defaults, so simply click the Add Channel button. The channel is created and several warnings appear. Don’t worry! This is just Iguana reminding us that before we can run the channel, we’ll need to commit at least one milestone. We’ll perform this step shortly.
  7. In the Destination tab, click the Edit Script hyperlink to launch the Translator.
  8. In the dialog that appears, select Import project from zip file and enable Import sample data.
  9. Click the Choose File button and browse to select the project file you’ve just downloaded (XDS_b_ITI_41_PNR_To_Translator.zip).
  10. Click Import. Iguana loads the project (including code and modules that you’ve also downloaded).
  11. Commit your first milestone.

Done!

How it Works

Let’s walk through the code to see how it works.

    1. Starting with the main function we can see that there are only five steps beginning at line 8 where a Lua table, ‘PNR’, is created to contain the XDS.b ITI-41 transaction message content that will be sent to an HIE supporting XDS.b transactions:
      local PNR = require 'xds_b.pnr.model'
    2. Next, we simply map the data into our newly created Lua table ‘PNR’ beginning with ‘FillAttachments’ followed by ‘FillSubmissionSet’ and ending with ‘FillDocumentEntries’:
         FillAttachments(PNR)
         FillSubmissionSet(PNR)   
         FillDocumentEntries(PNR)
    3. The third step is where the magic happens. Since we’ve completed the mapping process, it is now time to create the SOAP message (Yes, XDS.b is based on the SOAP messaging protocol) consisting of the header and body. This is done on line 24 where we call the function ‘xds_b.pnr.simpleapi.make()’ passing in the Lua table ‘PNR’ as shown below:
      local HTTPHeaders, Body = xds_b.pnr.simpleapi.make(PNR)
    4. On our fourth step we send our ITI-41 transaction to NIST’s test server located at ‘http://ihexds.nist.gov:12080/tf6/services/xdsrepositoryb’:
      local Response, Status = net.http.post{
            url=PNR.url, 
            headers=HTTPHeaders, 
            body=Body, 
            live=true}
    5. Finally, we check the response that came back from the XDS.b server.
      return Status, xds_b.pnr.simpleapi.parseResponse{response=Response}

Congrats, you’re done! You’ve just completed an XDS.b ITI-41 Provide and Register Document Set transaction in five easy steps.

What’s Next?

Well, now that we’ve put a document into an XDS.b server, the next step is to get that document out of the server.

Document Consumer (ITI-43 & ITI-18) [top]

As before, we’ll begin by creating and configuring the channel that will show how easy it is to get a document out of an XDS.b server.

Implementing our solution

  1. Download these files:
  2. From the Dashboard, click Add Channel. The Add Channel dialog appears.
  3. Select the following components:
    • Source = From Translator
    • Destination = LLP Client
  4. Click the Configure Channel button. The Configure New Channel window appears.
  5. Click the Channel tab and enter the following information:
    • Channel Name = XDS.b ITI-43 RDS
    • Description = XDS.b ITI-43 transaction sample channel demonstrating Retrieve document set IHE profile
  6. We are going to leave the other channel component settings as their defaults, so simply click the Add Channel button. The channel is created and several warnings appear. Don’t worry! This is just Iguana reminding us that before we can run the channel, we’ll need to commit at least one milestone. We’ll perform this step shortly.
  7. In the Destination tab, click the Edit Script hyperlink to launch the Translator.
  8. In the dialog that appears, select Import project from zip file and enable Import sample data.
  9. Click the Choose File button and browse to select the project file you’ve just downloaded (XDS_b_ITI_43_RDS_From_Translator.zip).
  10. Click Import. Iguana loads the project (including code and modules that you’ve also downloaded).
  11. Commit your first milestone.

Done!

How it Works

Let’s walk through the code to see how it works.

  1. Starting with the main function we can see that there are only four steps beginning at line 8 where we create the header and body of the SOAP request that is sent to the XDS.b server. In the sample code below we’ve hard-coded the document retrieve parameters (repositoryId and documentId). In a real world scenario these parameters would be passed in from a system retrieving a document.
    local HTTPHeaders, PackagedBody = xds_b.ret.simpleapi.make{
          repositoryId='1.3.6.1.4.1.21367.2011.2.3.7', 
          documentId='1.42.20130705031122.190'}
  2. Next, we post the request to the XDS.b server (NIST’s test server for this example) saving the server’s response and status.
       FillAttachments(PNR)
       FillSubmissionSet(PNR)   
       FillDocumentEntries(PNR)
  3. The third step is to parse the response into format that we can pass later into the into the queue :local HTTPHeaders, Body = xds_b.pnr.simpleapi.make(PNR)
  4. Final step is to verify that the response was successful and if so we pass it into the message queue.
    local Response, Status = net.http.post{
          url=PNR.url, 
          headers=HTTPHeaders, 
          body=Body, 
          live=true}

You’re done! You’ve just completed an XDS.b ITI-43 Retrieve Document Set transaction in four simple steps.

Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.