From 00cf74e23823a85ac5ba0c7113e7fe1a05df873e Mon Sep 17 00:00:00 2001 From: Pieter Bos Date: Thu, 1 Feb 2018 14:37:23 +0100 Subject: [PATCH] Make ADLChecker use BMM models --- adlchecker/.gitignore | 1 + .../nedap/archie/adlchecker/AdlChecker.java | 6 +-- adlchecker/testadl | 49 +++++++++++++++++++ 3 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 adlchecker/.gitignore create mode 100644 adlchecker/testadl diff --git a/adlchecker/.gitignore b/adlchecker/.gitignore new file mode 100644 index 000000000..ab6f1518b --- /dev/null +++ b/adlchecker/.gitignore @@ -0,0 +1 @@ +archetypes/ \ No newline at end of file diff --git a/adlchecker/src/main/java/com/nedap/archie/adlchecker/AdlChecker.java b/adlchecker/src/main/java/com/nedap/archie/adlchecker/AdlChecker.java index 31ca51aa5..0468d2dfe 100644 --- a/adlchecker/src/main/java/com/nedap/archie/adlchecker/AdlChecker.java +++ b/adlchecker/src/main/java/com/nedap/archie/adlchecker/AdlChecker.java @@ -15,6 +15,7 @@ import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.Namespace; +import org.openehr.referencemodels.BuiltinReferenceModels; import java.io.File; import java.io.FileInputStream; @@ -65,11 +66,8 @@ private static void validateArchetypes(List directories, boolean printFl e.printStackTrace(); } } - ReferenceModels referenceModels = new ReferenceModels(); - referenceModels.registerModel(ArchieRMInfoLookup.getInstance()); - referenceModels.registerModel(com.nedap.archie.openehrtestrm.TestRMInfoLookup.getInstance()); - repository.compile(referenceModels); + repository.compile(BuiltinReferenceModels.getMetaModels()); System.out.println("step 2: validations"); diff --git a/adlchecker/testadl b/adlchecker/testadl new file mode 100644 index 000000000..38339f3b7 --- /dev/null +++ b/adlchecker/testadl @@ -0,0 +1,49 @@ +archetype (adl_version=2.0.5; rm_release=1.0.2) + openEHR-EHR-SECTION.slot_parent.v1.0.0 + +language + original_language = <[ISO_639-1::en]> + +description + original_author = < + ["name"] = <"Thomas Beale"> + ["organisation"] = <"Ocean Informatics"> + ["email"] = <"thomas.beale@oceaninformatics.com"> + ["date"] = <"14/03/2010"> + > + details = < + ["en"] = < + language = <[ISO_639-1::en]> + purpose = <"Test slot archetype for testing redefnitions and filling"> + > + > + lifecycle_state = <"unmanaged"> + other_details = < + ["regression"] = <"PASS"> + > + +definition + SECTION[id1] matches { -- Slot section + items cardinality matches {1..*; unordered} matches { + allow_archetype OBSERVATION[id2] occurrences matches {0..1} matches { -- Vital signs + include + archetype_id/value matches {/openEHR-EHR-OBSERVATION\.redefine([a-zA-Z0-9_]+)*\.v1/} + exclude + archetype_id/value matches {/.*/} + } + } + } + +terminology + term_definitions = < + ["en"] = < + ["id1"] = < + text = <"Slot section"> + description = <"Slot section"> + > + ["id2"] = < + text = <"Vital signs"> + description = <"Vital signs observations."> + > + > + >