openEHR archetypes in software: examples for CaboLabs' training courses
$ gradle build
NOTE: when running with gradle, the current working directory is ./app not ./ so the path to archetype needs an extra ../ if using relative paths.
$ gradle run --args="parse ../../openEHR-ADL/lib/src/test/resources/archetypes/entry/observation/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl"
$ gradle run --args="traverse src/test/resources/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2.adl"
$ gradle run --args="constraint src/test/resources/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2.adl /data[at0001]/events[at0006]/data[at0003]/items[at0004]/value"
NOTE 1: for data validation the given path should correspond to a data value, usualy a path that constraints an ELEMENT.value attribute in the archetype.
NOTE 2: since a data set should be given, and each data value has different attributes, each data valu has it's own format for providing data:
- DV_QUANTITY:
magnitude|units
(magnitude is a number, units is a string) - DV_ORDINAL:
value
orterminology::code
orvalue|terminology::code
(code is a string, value is a number, terminology is a string) - CODE_PHRASE:
terminology::code
(code and terminology are both strings) - DV_TEXT:
text
(text is a string, should be quoted if it has spaces)
$ gradle run --args="validate src/test/resources/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2.adl /protocol[at0011]/items[at1038]/value 'hello hello'"
$ gradle fatJar
$ java -jar app/build/libs/edu-openehr-archetypes-0.1-all.jar parse app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2.adl
$ java -jar app/build/libs/edu-openehr-archetypes-0.1-all.jar parse app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.pulse.v2.adl
$ java -jar app/build/libs/edu-openehr-archetypes-0.1-all.jar traverse app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.pulse.v2.adl
$ java -jar app/build/libs/edu-openehr-archetypes-0.1-all.jar traverse app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.chest_circumference.v0.adl
$ java -jar app/build/libs/edu-openehr-archetypes-0.1-all.jar constraint app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.chest_circumference.v0.adl /data[at0001]/events[at0014]/math_function/defining_codeCODE_PHRASE <CCodePhrase>
$ java -jar app/build/libs/edu-openehr-archetypes-0.1-all.jar constraint app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.pulse.v2.adl /data[at0002]/events[at0003]/data[at0001]/items[at0004]/value
$ java -jar app/build/libs/edu-openehr-archetypes-0.1-all.jar validate app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.chest_circumference.v0.adl /data[at0001]/events[at0014]/math_function/defining_code openehr::147
$ docker build -t archetypes .
$ docker run -d -t archetypes
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f06838afdb71 archetypes "/__cacert_entrypoin…" 9 minutes ago Up 9 minutes reverent_booth
$ docker exec f06838afdb71 java -jar archetypes/app/build/libs/edu-openehr-archetypes-0.1-all.jar parse /archetypes/app/src/test/resources/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2.adl