Skip to content

usnistgov/hl7v2-resources-validation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

hl7v2-resources-validation

Validates HL7 V2 Resources (Profiles, Conformance Contexts, ValueSets) against xsd.

Maven Dependency

	<dependency>
		<groupId>gov.nist.healthcare.resources</groupId>
		<artifactId>validation</artifactId>
		<version>1.0.1</version>
	</dependency>

XSD Folder Format

path_to_folder/
├── Commons.xsd
├── ConformanceContext.xsd
├── Expressions.xsd
├── Profile.xsd
└── ValueSets.xsd

XML Schema repository

https://github.com/Jungyubw/NIST_healthcare_hl7_v2_profile_schema

Create a xml validator instance

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);

Validation Methods

  1. Validate an XML Profile
public List<XMLError> validateProfile(InputStream profile) throws IOException;
  1. Validate an XML ValueSetLibrary
public List<XMLError> validateVocabulary(InputStream valueSetsLibrary) throws IOException;
  1. Validate an XML Constraints
public List<XMLError> validateConstraints(InputStream constraints) throws IOException;

XMLError Model

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);	
	
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%