Validates HL7 V2 Resources (Profiles, Conformance Contexts, ValueSets) against xsd.
<dependency>
<groupId>gov.nist.healthcare.resources</groupId>
<artifactId>validation</artifactId>
<version>1.0.1</version>
</dependency>path_to_folder/
├── Commons.xsd
├── ConformanceContext.xsd
├── Expressions.xsd
├── Profile.xsd
└── ValueSets.xsd
https://github.com/Jungyubw/NIST_healthcare_hl7_v2_profile_schema
Use factory method to create a new instance, path_to_folder is the path to the folder containing xsd files from classloader root.
XMLResourcesValidator validator = XMLResourcesValidator.createValidatorFromClasspath(path_to_folder);- Validate an XML Profile
public List<XMLError> validateProfile(InputStream profile) throws IOException;- Validate an XML ValueSetLibrary
public List<XMLError> validateVocabulary(InputStream valueSetsLibrary) throws IOException;- Validate an XML Constraints
public List<XMLError> validateConstraints(InputStream constraints) throws IOException;public class XMLError {
//-- Getters
public int getLine();
public int getColumn();
public String getMessage();
//-- Setters
public void setLine(int line);
public void setColumn(int column);
public void setMessage(String message);
}