Skip to content

xdm_validation

Bill Majurski edited this page Jun 21, 2016 · 1 revision

This release adds the API call to validate an XDM. The example can be found in

gov.nist.toolkit.itTests.xdm.ValidateXdmSpec.groovy

The SPOCK test used to validate the interface (without showing the setup) is

def 'validate ccda xdm'() {
    when:
    byte[] bytes = this.getClass().getResource('/testdata/xdm/Ccda.zip').bytes
    XdmRequestResource request = new XdmRequestResource()
    request.zip = bytes
    XdmValidator validator = spi.createXdmValidator()
    XdmReport report = validator.validate(request)
    println report.report
    report.items.each { XdmItem item ->
        println item.path
    }

    then:
    report.pass
}

Note that this is writen in Groovy.

The validation call passes the XDM ZIP as a byte array. In return it gets an XdmReport instance which has the interface

    boolean isPass();
    String getReport();
    List<XdmItem> getItems();

The report is the Text version. XdmItem is a mapping from a PATH string (the XDM is a ZIP so its contents are PATH oriented) to a byte array containing the contents. From the example I have in development the following PATHs are present

CDA/
CCDA/HTML/
CCDA/HTML/IMAGES/
CCDA/HTML/IMAGES/DOCS.PNG
CCDA/HTML/IMAGES/LUCY-LOGO.PNG
CCDA/HTML/IMAGES/ORGLOGO.PNG
CCDA/HTML/IMAGES/PAGEBACKGROUND.PNG
CCDA/HTML/IMAGES/PAGEFOOTER.PNG
CCDA/HTML/IMAGES/PAGETOP.PNG
CCDA/HTML/IMAGES/PHR.PNG
CCDA/HTML/STYLE/
CCDA/HTML/STYLE/LUCY.CSS
CCDA/HTML/STYLE/LUCY.XSL
CCDA/IHE_XDM/
CCDA/IHE_XDM/LUCY_0/
CCDA/IHE_XDM/LUCY_0/CCDA_AMBULATORY.XML
CCDA/IHE_XDM/LUCY_0/METADATA.XML
CCDA/INDEX.HTM
CCDA/README.TXT
HTML/
HTML/IMAGES/
HTML/IMAGES/DOCS.PNG
HTML/IMAGES/LUCY-LOGO.PNG
HTML/IMAGES/ORGLOGO.PNG
HTML/IMAGES/PAGEBACKGROUND.PNG
HTML/IMAGES/PAGEFOOTER.PNG
HTML/IMAGES/PAGETOP.PNG
HTML/IMAGES/PHR.PNG
HTML/STYLE/
HTML/STYLE/LUCY.CSS
HTML/STYLE/LUCY.XSL
IHE_XDM/
IHE_XDM/LUCY_0/
IHE_XDM/LUCY_0/CCDA_AMBULATORY.XML
IHE_XDM/LUCY_0/METADATA.XML
INDEX.HTM
README.TXT

The items that end in / should be ignored as they contain no content. They only show the ZIP file hierarchy. This is the typical ZIP way of listing content.

The index.htm, readme.txt, metadata.xml file are obviously of interest. The single document in this XDM is metadata.xml.

The rest of the entries are probably not of interest.

Clone this wiki locally