diff --git a/gradle.properties b/gradle.properties index a86f38a..ed91fb2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 2.0.2 +version = 2.0.3 group = com.cabolabs \ No newline at end of file diff --git a/opt.bat b/opt.bat index 476b8b3..eb450a0 100644 --- a/opt.bat +++ b/opt.bat @@ -1 +1 @@ -java -cp "./lib/*;%GROOVY_HOME%/embeddable/groovy-all-2.4.7.jar;build/libs/opt-2.0.2.jar" com.cabolabs.openehr.opt.Main %1 %2 %3 %4 %5 %6 %7 \ No newline at end of file +java -cp "./lib/*;%GROOVY_HOME%/embeddable/groovy-all-2.4.7.jar;build/libs/opt-2.0.3.jar" com.cabolabs.openehr.opt.Main %1 %2 %3 %4 %5 %6 %7 \ No newline at end of file diff --git a/opt.sh b/opt.sh index 069ab7c..27a4f5e 100755 --- a/opt.sh +++ b/opt.sh @@ -1 +1 @@ -java -cp "./lib/*:$GROOVY_HOME/lib/*:build/libs/opt-2.0.2.jar" com.cabolabs.openehr.opt.Main $1 $2 $3 $4 $5 $6 $7 +java -cp "./lib/*:$GROOVY_HOME/lib/*:build/libs/opt-2.0.3.jar" com.cabolabs.openehr.opt.Main $1 $2 $3 $4 $5 $6 $7 diff --git a/src/main/groovy/com/cabolabs/openehr/opt/instance_generator/RmInstanceGenerator.groovy b/src/main/groovy/com/cabolabs/openehr/opt/instance_generator/RmInstanceGenerator.groovy index 598a6ab..21c4917 100644 --- a/src/main/groovy/com/cabolabs/openehr/opt/instance_generator/RmInstanceGenerator.groovy +++ b/src/main/groovy/com/cabolabs/openehr/opt/instance_generator/RmInstanceGenerator.groovy @@ -2265,8 +2265,8 @@ class RmInstanceGenerator { add_LOCATABLE_elements(o, ev, parent_arch_id) - ev.time = generate_DV_DATE_TIME(null, null) // IM attribute not present in the OPT + ev.time = generate_DV_DATE_TIME(null, null) def process_attrs = [ 'data', @@ -2306,7 +2306,7 @@ class RmInstanceGenerator { def process_attrs = [ 'data', - 'state' + 'state' // NOTE: this is optional! ] def oa, mattrs @@ -2314,13 +2314,16 @@ class RmInstanceGenerator { oa = o.attributes.find { it.rmAttributeName == attr_name } - // in event there are no lists, so the results will be lists of 1 item + // in event there are no lists, so the result will be a list of 1 item mattrs = processAttributeChildren(oa, parent_arch_id) - ev."${oa.rmAttributeName}" = mattrs[0] + if (mattrs) + { + ev."${oa.rmAttributeName}" = mattrs[0] + } } - // TODO: if there is no attribute contraint, the duration generation wont work so we should check that here + // required attribute oa = o.attributes.find { it.rmAttributeName == 'width' } if (oa) { @@ -2335,6 +2338,7 @@ class RmInstanceGenerator { ) } + // required attribute oa = o.attributes.find { it.rmAttributeName == 'math_function' } if (oa) { @@ -2355,6 +2359,8 @@ class RmInstanceGenerator { ) } + // TODO: if a constraint for sample_count is included, generate a value for it. + return ev } diff --git a/src/test/resources/Resultados_de_laboratorio.opt b/src/test/resources/Resultados_de_laboratorio.opt new file mode 100644 index 0000000..b8d9c55 --- /dev/null +++ b/src/test/resources/Resultados_de_laboratorio.opt @@ -0,0 +1,676 @@ + + + \ No newline at end of file