Creating ipf validator suite

Skip to first unread message

Aug 17, 2020, 9:54:32 AM8/17/20
to ipf-user
Good morning,

Do the various ipf validators have a mechanism for generating validation reports, or at least a list of all the errors?  I'm trying to create a stand-alone validation suite that I can use to help trading partners improve their messages.  Here is an example of an iti-38 validator I've created (where stringEntity contains an iti-38 response in xml):

InputStream inputStream = stringEntity.getContent();
JAXBContext jaxbContext = JAXBContext.newInstance(AdhocQueryResponse.class);
AdhocQueryResponse response = (AdhocQueryResponse) jaxbContext.createUnmarshaller().unmarshal(inputStream);

RegistryResponseValidator iti38Validator = new RegistryResponseValidator();
QueryResponse queryResponse = (QueryResponse) EbXML30Converters.convertToQueryResponse(response);
QueryResponseTransformer transformer = new QueryResponseTransformer(new EbXMLFactory30());
EbXMLQueryResponse ebXML = transformer.toEbXML(queryResponse);
iti38Validator.validate(ebXML, XCA.Interactions.ITI_38_ASYNC_RESPONSE);

That only produces the following output on a message I know has multiple errors (confirmed with gazelle - also, it appears like google's 'code' tag isn't a thing anymore).

[main] INFO ca.uhn.hl7v2.VersionLogger - HAPI version is: 2.3
[main] INFO ca.uhn.hl7v2.VersionLogger - Default Structure libraries found for HL7 versions 2.5, 
[main] INFO ca.uhn.hl7v2.util.Home - hapi.home is set to /usr/jtc/validationtester/.

I'm likely engaging the validator wrong, but I'm not sure.


Aug 17, 2020, 11:31:21 AM8/17/20
to ipf-user
Found the issue with the output (using the wrong validator object).  Looks like it throws an exception on the first one, so not going to get the full report.  Thanks.

Dmytro Rud

Aug 17, 2020, 11:34:23 AM8/17/20
Hi Jason

Actually it depends on the validator type.  For example, HL7v3 validators are based on XML Schema and Schematron, and deliver all found errors as a list.  On the contrary, XDS validators operate on POJOs and are designed to be fail-fast, i.e. they stop on the first detected error.  You may also take a look at the discussion in, in particular at the comment from 15-Mar-2016.  

Best regards

You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages