Skip to content

Commit

Permalink
fixes #281
Browse files Browse the repository at this point in the history
  • Loading branch information
ppazos committed Nov 2, 2024
1 parent 5d78fd1 commit 513537f
Show file tree
Hide file tree
Showing 5 changed files with 690 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 2.0.2
version = 2.0.3
group = com.cabolabs
2 changes: 1 addition & 1 deletion opt.bat
Original file line number Diff line number Diff line change
@@ -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
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
2 changes: 1 addition & 1 deletion opt.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -2306,21 +2306,24 @@ class RmInstanceGenerator {

def process_attrs = [
'data',
'state'
'state' // NOTE: this is optional!
]

def oa, mattrs
process_attrs.each { attr_name ->

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)
{
Expand All @@ -2335,6 +2338,7 @@ class RmInstanceGenerator {
)
}

// required attribute
oa = o.attributes.find { it.rmAttributeName == 'math_function' }
if (oa)
{
Expand All @@ -2355,6 +2359,8 @@ class RmInstanceGenerator {
)
}

// TODO: if a constraint for sample_count is included, generate a value for it.

return ev
}

Expand Down
Loading

1 comment on commit 513537f

@ppazos
Copy link
Collaborator Author

@ppazos ppazos commented on 513537f Nov 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.