Creating ipf validator suite

22 views
Skip to first unread message

jason.co...@gmail.com

unread,
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.

Thanks
Jason

jason.co...@gmail.com

unread,
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

unread,
Aug 17, 2020, 11:34:23 AM8/17/20
to ipf-...@googlegroups.com
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 https://github.com/oehf/ipf/issues/93, in particular at the comment from 15-Mar-2016.  

Best regards
Dmytro


--
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 ipf-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ipf-user/e82cfca7-5ee0-43bb-9d44-9d50c5cef574n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages