From a63676e1df888b13343eb39168b7f6dde54e1a6c Mon Sep 17 00:00:00 2001 From: Pieter Bos Date: Tue, 11 Apr 2017 12:25:17 +0200 Subject: [PATCH] Update to version 0.3.7, updating readme with new ArchetypeValidator --- README.md | 22 ++++++++++++++++++++-- build.gradle | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 182623722..4685641b9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ In gradle, include this dependency in your build.gradle: ```gradle dependencies { - compile 'com.nedap.healthcare:archie:0.3.6' + compile 'com.nedap.healthcare:archie:0.3.7' } ``` @@ -24,7 +24,7 @@ or if you use maven, in your pom.xml com.nedap.healthcare archie - 0.3.6 + 0.3.7 ``` @@ -72,6 +72,24 @@ CAttribute attribute = archetype.getDefinition() attribute.getLogicalPath(); // is 'context[systolic]/items' ``` +### Archetype Validation + +After parsing you can check if you archetype is valid. The parser will try to continue parsing as much as possible without throwing Exceptions. This means you will have to check the errors manually. This happens even with some syntax errors, so checking errors is important! + +``` +if(!parser.getErrors().hasNoErrors()) { + parser.getErrors().logToLogger(); +} +``` + +The second round of checks comes after parsing, in the form of running the ArchetypeValidator: + +``` +List messages = new ArchetypeValidator().validate(archetype); +``` + +This runs some basic checks agains the archetype, such as id-code uniqueness, completeness of translations and existence of constrained properties in the reference model. It does not yet check specialization. + ### Serializing Archetype models can be serialized to ADL thanks the the serializer written by @markopi64. To use: diff --git a/build.gradle b/build.gradle index f18050177..d913b32d7 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ apply plugin: 'org.owasp.dependencycheck' //apply plugin: 'io.codearte.nexus-staging' -version = '0.4.0-SNAPSHOT' +version = '0.3.7' group = 'com.nedap.healthcare' archivesBaseName = 'archie'