Implementing XDS.b profiles

Document Source (ITI-41)

Contents

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. Let’s take a look at this next scenario.

Leave A Comment?