|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbe.fgov.ehealth.ehvalidator.core.EhValidator
public class EhValidator
xmlns="http://www.ehealth.fgov.be/standards/kmehr/schema/v1").
A Sumehr, SMF or PMF is considered valid if and only if the validation report contains no lines with Error, Warning messages are allowed.
Depending on the type of file, the result of the validation will be as follows :
| File Type | Validation Result | Comments |
| Any file but a Kmehr Document | Failure | This will generate an EhValidatorXmlValidationException - The file will fail the basic XML checks |
| A Kmehr Document that does not follow the Sumehr or GSMF Standard | Failure | This will produce a validation report containing at least one Error |
| A Sumehr, SMF or PMF Document | Success | This will produce a validation report containing no Error messages. Warning messages may be present. |
| Nested Class Summary | |
|---|---|
static class |
EhValidator.Language
allowed languages. |
static class |
EhValidator.ValidationResult
Validation results. |
| Constructor Summary | |
|---|---|
EhValidator()
|
|
| Method Summary | |
|---|---|
static String |
getHTMLReport(String fileName)
This method performs a validation of the file whose file name is provided as parameter. |
static String |
getHTMLReport(String fileName,
EhValidator.Language language)
This method performs a validation of the file whose file name and language are provided as parameters. |
static String |
getHTMLReport(String fileName,
EhValidator.Language language,
String rules)
This method performs a validation of the file whose file name, language and set of rules are provided as parameters. |
static String |
getHTMLView(String fileName)
This method allows to get the HTML representation of a valid file. |
static String |
getHTMLView(String fileName,
EhValidator.Language language)
This method allows to get the HTML representation of a valid file. |
static String |
getHTMLView(String fileName,
EhValidator.Language language,
String rules)
This method allows to get the HTML representation of a valid file. |
static String |
getXMLReport(String fileName)
This method performs a validation of the file whose file name is provided as parameter. |
static String |
getXMLReport(String fileName,
String rules)
This method performs a validation of the file whose file name and set of rules are provided as parameter. |
static void |
main(String[] args)
This is the main method of the eHealth Validator, used when run in command-line mode. |
static EhValidator.ValidationResult |
validate(String fileName)
|
static EhValidator.ValidationResult |
validate(String fileName,
String rules)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EhValidator()
| Method Detail |
|---|
public static String getHTMLReport(String fileName)
throws SAXException,
FileNotFoundException,
IOException
String containing the validation report in HTML format.
fileName - Name of the file to validate.
String containing the HTML representation of the report.
SAXException
IOException
FileNotFoundException
public static String getHTMLReport(String fileName,
EhValidator.Language language)
throws SAXException,
FileNotFoundException,
IOException
String containing the validation report in HTML format.
fileName - Name of the file to validate.language - Default language for Sumehr visualization.
String containing the HTML representation of the report.
SAXException
IOException
FileNotFoundException
public static String getHTMLReport(String fileName,
EhValidator.Language language,
String rules)
throws SAXException,
FileNotFoundException,
IOException
String containing the validation report in HTML format.
fileName - Name of the file to validate.language - Default language for Sumehr visualization.rules - Set of rules to use for the validation. ("Sumehr" or "PMF" or "SMF")
String containing the HTML representation of the report.
SAXException
IOException
FileNotFoundException
public static String getXMLReport(String fileName)
throws SAXException,
FileNotFoundException,
IOException
String containing the validation report in XML format.
The report uses the following format :
<report>
<header>
<validationResult>
<errors> </errors>
<warnings> </warnings>
</validationResult>
</header>
<messages>
<message>
<type> </type>
<subject> </subject>
<description>
<en> </en>
<fr> </fr>
<nl> </nl>
<de> </de>
</description>
<line> </line>
<col> </col>
<location> </location>
<test> </test>
</message>
...
</messages>
</report>
fileName - Name of the file to validate
String containing an XML representation of the report.
SAXException
IOException
FileNotFoundException
public static String getXMLReport(String fileName,
String rules)
throws SAXException,
FileNotFoundException,
IOException
String containing the validation report in XML format.
The report uses the following format :
<report>
<header>
<validationResult>
<errors> </errors>
<warnings> </warnings>
</validationResult>
</header>
<messages>
<message>
<type> </type>
<subject> </subject>
<description>
<en> </en>
<fr> </fr>
<nl> </nl>
<de> </de>
</description>
<line> </line>
<col> </col>
<location> </location>
<test> </test>
</message>
...
</messages>
</report>
fileName - Name of the file to validate.rules - Set of rules to use for the validation.
String containing an XML representation of the report.
SAXException
IOException
FileNotFoundException
public static String getHTMLView(String fileName)
throws EhValidatorXmlValidationException,
EhValidatorSchematronException,
EhValidatorXsltTransformException,
FileNotFoundException,
IOException,
SAXException
HTML, it returns a String representation of this HTML visualisation.
Use english as default language for visualization.
fileName - Name of the file to view as HTML. It should be valid.
String containing an HTML representation of the file.
EhValidatorXmlValidationException - when the file fails basic schema validation.
EhValidatorSchematronException - when the file is not a valid, and there were issues with the schematron validation.
EhValidatorXsltTransformException - when there was an issue producing the HTML view of the file.
IOException
FileNotFoundException
SAXException
public static String getHTMLView(String fileName,
EhValidator.Language language)
throws EhValidatorXmlValidationException,
EhValidatorSchematronException,
EhValidatorXsltTransformException,
FileNotFoundException,
IOException,
SAXException
HTML, it returns a String representation of this HTML visualisation.
Use Sumehr as default set of rules.
fileName - Name of the file to validate.language - Default language for visualization.
String containing an HTML representation of the file.
EhValidatorXmlValidationException
EhValidatorSchematronException
EhValidatorXsltTransformException
IOException
FileNotFoundException
SAXException
public static String getHTMLView(String fileName,
EhValidator.Language language,
String rules)
throws EhValidatorXmlValidationException,
EhValidatorSchematronException,
EhValidatorXsltTransformException,
FileNotFoundException,
IOException,
SAXException
HTML, it returns a String representation of this HTML visualisation.
fileName - Name of the file to view as HTML. It should be valid.language - Default language for Sumehr visualization.rules - Set of rules to use for the validation. ("Sumehr" or "PMF" or "SMF")
String containing an HTML representation of the file.
EhValidatorXmlValidationException - when the file fails basic schema validation.
EhValidatorSchematronException - when the file is not a valid file, and there were issues with the schematron validation.
EhValidatorXsltTransformException - when there was an issue producing the HTML view of the file.
IOException
FileNotFoundException
SAXException
public static EhValidator.ValidationResult validate(String fileName)
throws EhValidatorXmlValidationException,
EhValidatorSchematronException,
IOException,
SAXException
fileName - Name of the file to validate.
EhValidatorXmlValidationException
EhValidatorSchematronException
IOException
SAXException
public static EhValidator.ValidationResult validate(String fileName,
String rules)
throws EhValidatorXmlValidationException,
EhValidatorSchematronException,
IOException,
SAXException
fileName - Name of the file to validate. It should be a valid Kmehr.rules - Set of rules to use for the validation. ("Sumehr" or "PMF" or "SMF")
boolean containing true if the input file is correct, false otherwise.
EhValidatorXmlValidationException - when the file fails basic schema validation.
EhValidatorSchematronException - when the file is not valid, and there were issues with the schematron validation.
IOException
SAXExceptionpublic static void main(String[] args)
ehvalidator-core-2.1.1.jar [option] [choice] [inputfile]
ehvalidator-core-2.1.1.jar -request xmlreport document.xml
args - The arguments as defined above.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||