This section introduces the various engines the Gazelle team has put in place to validate the Clinical documents.
The following graph based on a slide from René Spronk (Ringholm bv), summarizes the CDA Validation options.
René Spronk wrote an excellent white paper on MIF, we recommend its reading in order to better understand the concepts. The definition extracted from that white paper states : "The Model Interchange Format (MIF) is a set of XML formats used to support the storage and exchange of HL7 version 3 artefacts as part of the HL7 Development Framework. It is the pre-publication format of HL7 v3 artefacts used by tooling. It is also the formal definition of the HL7 metamodel. The MIF can be transformed into derived forms such as UML/XMI or OWL."
We use the tool H3ET writen by JivaMedical (http://www.jivamedical.com/hl7-v3/h3et-product-overview-2.html). The jar can be downloaded from page Eclipse Instance Editor at the following URL :
This page describes how to perform a CDA document validation using the SChematron Validator tool which have been developed for the gazelle project :
CDA documents validation is performed using Schematrons. A Schematrons defines the requirements to be tested in a CDA document. Note that there are some other ways to perform CDA content validation. For instance on can use the CDA Tools from OHT. More information about the CDA tool can be found here.
Due to limitation in time, we have not yet used the CDA Tools from OHT, however this tool is in our pipe line and we are investigating its use.
There are different ways to validating CDA documents using the :
The Schematrons used by the EVS are available for download from the External Validation Service Front End GUI, under the menu : schematrons. The rest of this section is of interest for the readers who would like to understand the mechanism of creating a Schematron or reusing the templates that are available on the forge in order to develop validation Schematron for other CDA documents.
The sources of Schematrons are available on the INRIA forge. Note that
Here is the URL pointing the location of the Schematron project repository, you can use svn to import the project into your workspace.
To perform a validation of any of the documents which Schematron is available, you need to execute two actions :
To generate the "dist" folder you need to run the 'make-dist.sh' script, this shell script is classified under '/workspace/schematron/epSOS/tools'.
To run this script :
~/workspace/schematron/epSOS/tools$ ./make_dist.sh
After been generated the "dist" folder will contain the final preprocessed Schematrons which will be used to validate your documents.
You will notice that the CDA Schematrons are divided into two kind
Now that the Schematrons are available in the "dist", the validation of a document is done thanks to the 'validate.sh' script, this shell script is classified under '/workspace/schematron/epSOS/tools'.
To run this script :
~/workspace/schematron/epSOS/tools$ ./validate.sh ../dist/cda/pivot/ePrescription.sch ../src/cda/samples/ePrescription/ePSample.xml
The first argument of the 'validate.sh' script will be the preprocessed Schematron and the second argument will be the document to validate. The example above shows the command to validate an ePrescription sample with the ePrescription schematron.
The result of the validation will figure in the "test-doc.svrl" file, you'll just need to open that file to see the result.
In order to make the result of the validation more readable, a transformation from 'svrl' to 'html' is done in the 'validate.sh' script which will out come with an html file : 'results.html'.
Here below the overall architecture of the project :
The main used folders are :
src:Contains the necessary files for the validation of CDA, SAML, ATNA and PRPA documents.
Each of these folders (cda, saml, audit...) is organized as follows :
table_data : Contains xml files that list the codes used for the validation.
tools : Contains all the libraries used to perfom the preprocessing of the Schematrons and the validation of the documents.
This script is placed under '/workspace/schematron/epSOS/tools'.
The main goal of this script is to preprocess the developed Schematrons available under '/workspace/schematron/epSOS/src/*/sch' in order to build a consolidated one and make them available in the "dist" folder under '/workspace/schematron/epSOS/dist/'.
The preprocessing conssist mainly on :
This script is placed under '/workspace/schematron/epSOS/tools'.
The main goal of this script is to validate an xml documents thanks to a schematron.
Schematron validation takes four XSLT stages :
The result of the validation is placed in the 'test-doc.svrl' file under '/workspace/schematron/epSOS/tools'.
The main goal of inclusion is to merge a number of XML information sets into a single composite infoset. In this project the inclusion is used to merge all the required schematron for the validation of a document in one Schematron file.
For example : An epSOS ePrescription document like all the CDA documents, contains different set of clinical informations. Every set of informations is represented by a 'templateId'. Every 'templateId' plays the role of a reference for the schematrons.
Almost every set of informations represented by a 'templateId' have a Schematron able of validating it.
Knowing that the ePrescription document (templateId 1.3.6.1.4.1.12559.11.10.1.3.1.1.1) must contain a Prescription Section (templateId 1.3.6.1.4.1.12559.11.10.1.3.1.2.1), and the Prescription Section, for his turn, shall include a Prescription Item Entry Content Module (templateId 1.3.6.1.4.1.12559.11.10.1.3.1.3.2)...The ePrescription Schematron which will be able to validate an ePrescription document, must include the Prescription Section schematron, and that last shall include the Prescription Item Entry Content Module schematron.
A FreeMind map available in '/workspace/schematron/epSOS/docs' describe all the set up inclusion for the CDA documents.
Issues on CDA Schematrons can be reported in the Gazelle issue tracker available here.
A Schematron specifies the checks to be performed on the tested CDA document, those tests are in fact a set of declarations for a process, it act like (test this, tell me that!). To perform the schematron's specifications, a Schematron processor is necessary :
In order to get your Schematron up and running we propose two environments that you can download from Oxygen web site:
More informations about the Oxygen XML Editor are here.
The basic Schematronbuilding blocks are :
A phase is used to activate patterns (templates) so that they can perform a validation. To activate a pattern you simply need to declare it in a phase.
ex: Activating the pattern which id = p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-errors.
<phase id="all"> <active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-errors"/></phase>
In our case we create two kind of phases that we called 'all' and 'no-codes'. The phase we called 'all' is intended to perform a global validation, and so we have to declare in this phase all the patterns included by the Schematron (errors + warnings + notes + codes). On the other hand, the phase we called 'no-codes' is intended to perform a validation without using pivot codes, and so we have to declare in this phase all the patterns except the ones validating the pivot codes (errors + warnings + notes).
<phase id="all">
<active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-errors"/>
<active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-warnings"/>
<active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-notes"/>
<active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-codes"/>
</phase>
<phase id="no-codes">
<active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-errors"/>
<active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-warnings"/>
<active pattern="p-1.3.6.1.4.1.12559.11.10.1.3.1.1.2-notes"/>
</phase>
The CDA templates performing pivot codes validation are placed under "schematron/epSOS/src/cda/sch/templates/codes".
The default Phase parameter "defaultPhase" defined in the Schematron is the one responsible of choosing which phase to perform while validation. We manipulate this parameter in the 'Make_dist' script in order to generate :
The main goal of inclusion is to merge a number of XML information sets into a single composite infoset.
In our case we use inclusion to merge all included patterns into a one final Schematron.
<xi:include parse="xml" href="templates/errors/1.3.6.1.4.1.12559.11.10.1.3.1.1.1.sch" xpointer="xmlns(x=http://purl.oclc.org/dsdl/schematron) xpointer(//x:pattern)">
<xi:fallback>
<!-- xi:include error : file not found : templates/errors/1.3.6.1.4.1.12559.11.10.1.3.1.1.1.sch -->
</xi:fallback>
</xi:include>
The example shows the syntaxe we use to include the patterns available in the template "1.3.6.1.4.1.12559.11.10.1.3.1.1.1.sch" into the Schematrons who initiated this command.
PS: In order to use inclusion, you shall declare the following name space : "xmlns:xi="http://www.w3.org/2003/XInclude"
The CDA model based validation is a tool to validate CDA documents based on model specification. The validation can be done from the EVSClient or from a webservice of validation. Actual online validators are BASIC-CDA and XD-LAB validator. You can use the tool to validate the conformance of CDA document with various specifications.
You can access to the validator from http://gazelle.ihe.net/EVSClient/home.seam. Then from the menu, you go to menu -->IHE -->CDA --> CDA Validation.
For ASIP or epSOS the path to the validation page are respectively :
The following screen capture shows the CDA document validation page.
The tool offers the possibility to perform both a schematron and/or a model based validation. Here in this page we concentrate on the Model Based CDA Validation. For more information about Schematron validation of CDA document please refer to :
In order to validate a CDA document you first need to click on the Add.. button and upload the document to validate.
Then you need to select the validator to use in the listboxes. You need to select at least one of them.
To actually perform the validation you need to click on the "Validate" button.
The validation process checks that :
To track the error, you can go directly to its location on the XML file by clicking on the picture link (green arrow), as it it shown on the figures above and below :
When you click there, you go directly to the XML view of the document CDA, and you can see the error, warning or notification message by setting the cursor on the picture that appear on the XML :
You can access to all validated CDA document by going to the menu HL7--> CDA --> Validated CDA :
Here you can search for CDA validated using the model based tools. You have to use the attribute Model Based Validator, like this :
The validation of CDA document based on model specification can be done using an online webservice. This web service is :
http://gazelle.ihe.net/CDAGenerator-CDAGenerator-ejb/CDAValidatorWS?wsdl.
This web service contains an important method for validation of CDA document, which is : validateCDADocument.