beautypg.com

Using the schematron api, Obtaining the factory object, Obtaining the validator object – Sun Microsystems Sun Adapter IP HL 7 User Manual

Page 27: Performing the validation

background image

Using the Schematron API

Perform the following to invoke the schematron API from a Java Collaboration:

Obtaining the Factory Object

Obtaining the Validator Object

Performing the Validation

Obtaining the Factory Object

Below is a sample call to the getSchematronValidatorFactory method.

com.stc.connector.hl7.schematron.SchematronValidatorFactory

factory = com.stc.connector.hl7.schematron.SchematronValidatorFactory.

getSchematronValidatorFactory();

Obtaining the Validator Object

Below is a sample call to the getDefaultValidator method.

com.stc.connector.hl7.schematron.SchematronValidator

validator = factory.getDefaultValidator( domSource );

In the above example, domSource is the DOMSource object of the schematron XML.

Performing the Validation

Below is a sample call to the validate method.

com.stc.connector.hl7.schematron.ValidationOutput

output = validator.validate( dataSrc );

In the above example, dataSrc is the source of the payload. The payload can be an entire V3
XML document or a CDA document.

The ValidationOutput object contains the resulting XML document as well as a method
isValid()

, which returns values when the validation has passed or failed.

Adding and Configuring a TCP/IP HL7 Adapter in a
Connectivity Map

All Adapters contain a set of properties that are unique to that Adapter type. When you add a
TCP/IP HL7 Adapter to a Connectivity Map, you can modify the properties for that specific
Adapter. When you add a TCP/IP HL7 External System in the Project’s Environment, you can
modify the properties for that Adapter type for all Projects that use that Environment.

Adding and Configuring a TCP/IP HL7 Adapter in a Connectivity Map

Sun Adapter for TCP/IP HL7 User's Guide

27

This manual is related to the following products: