Sun Adapter for TCP/IP HL7 Tutorial

Creating and Importing Sample Files

This section provides sample schematron validation and input files, and also gives instructions on importing the validation file for use in the JCD.

Sample Schematron

Below is a sample schematron validation file that checks for the presence of the profileid field in the PRPA_IN403001UV01 OTD.


<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
   <sch:ns prefix="hl7v3" uri="urn:hl7-org:v3"/>
   <sch:pattern name="Check structure">
      <sch:rule context="hl7v3:PRPA_IN403001UV01">
         <sch:assert test="count(hl7v3:profileId) = 1">The profileId should 
           be present. It is missing.</sch:assert>
      </sch:rule>
   </sch:pattern>
</sch:schema>

Sample Input Document


<PRPA_IN403001UV01 xmlns="urn:hl7-org:v3" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="urn:hl7-org:v3 PRPA_IN403001UV01.xsd">
<id root="1.1.2.3.4.6" extension="5929" assigningAuthorityName="Litware Inc."/>
<creationTime value="20050303180027"/>
<versionCode code="V3PR1"/>
<interactionId root="1.1.6.7.8" extension="PRPA_IN403001UV01" 
  assigningAuthorityName="HL7"/>
<profileId root="1.1.1.1"/>
<processingCode code="D"/>
<processingModeCode code="T"/>
<acceptAckCode code="AL"/>
...
...
...

Note –

The above text has been wrapped for display purposes. It contains extra line breaks.


Importing a Schematron XML File

This tutorial includes a JAR file, checkprofileid.jar. which includes the sample schematron validation file described above. Follow this procedure if you want to create your own validation file and package it for the JCD.

ProcedureTo Import a Schematron XML and Add it to the JCD

  1. Create a JAR file containing the schematron validation file in XML format.

  2. Do the following to import the JAR file:

    1. Right-click the schematron project, point to Import, and then select File.

    2. Navigate to and select the JAR file.

    3. Click Select, and then click Import.

      The file now appears in the Projects window beneath the schematron project.

  3. Open the Collaboration in the Collaboration Editor.

  4. On the Collaboration Editor toolbar, click Add JAR.

  5. On the Add/Remove Jar Files dialog box, click Add.

  6. Navigate to and select he JAR file to add, and then click Import.

  7. On the Add/Remove Jar Files dialog box, click Close.