Skip to content

Commit

Permalink
fixed bug in json parser quick
Browse files Browse the repository at this point in the history
  • Loading branch information
ppazos committed Mar 23, 2023
1 parent de19216 commit d0452d6
Show file tree
Hide file tree
Showing 8 changed files with 7,736 additions and 20 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 1.8.30
version = 1.8.31
group = com.cabolabs
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-1.8.25.jar" com.cabolabs.openehr.opt.Main $1 $2 $3 $4 $5 $6 $7
java -cp "./lib/*:$GROOVY_HOME/lib/*:build/libs/opt-1.8.30.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 @@ -945,6 +945,7 @@ class OpenEhrJsonParserQuick {
json.context, compo
)

compo.content = []
json.content.eachWithIndex { content_item, i ->
type = content_item._type
if (!type)
Expand All @@ -953,8 +954,6 @@ class OpenEhrJsonParserQuick {
}
method = 'parse'+ type

compo.content = []

compo.content.add(
this."$method"(
content_item, compo
Expand Down Expand Up @@ -1467,6 +1466,7 @@ class OpenEhrJsonParserQuick {

String type, method

section.items = []
json.items.eachWithIndex { content_item, i ->

type = content_item._type
Expand All @@ -1478,10 +1478,7 @@ class OpenEhrJsonParserQuick {

method = 'parse'+ type

if (!section.items) section.items = []

section.items.add(

this."$method"(
content_item, section
)
Expand Down Expand Up @@ -1556,13 +1553,12 @@ class OpenEhrJsonParserQuick {

String type, method

h.events = []
json.events.eachWithIndex { event, i ->

type = event._type
method = 'parse'+ type

if (!h.events) h.events = []

h.events.add(
this."$method"(
event, h
Expand Down Expand Up @@ -1707,10 +1703,9 @@ class OpenEhrJsonParserQuick {
ins.wf_definition = this.parseDV_PARSABLE(json.wf_definition)


ins.activities = []
json.activities.eachWithIndex { js_activity, i ->

if (!ins.activities) ins.activities = []

ins.activities.add(
this.parseACTIVITY(
js_activity, ins
Expand Down Expand Up @@ -1831,6 +1826,7 @@ class OpenEhrJsonParserQuick {

String type, method

t.items = []
json.items.eachWithIndex { item, i ->

type = item._type
Expand All @@ -1840,8 +1836,6 @@ class OpenEhrJsonParserQuick {
}
method = 'parse'+ type

if (!t.items) t.items = []

t.items.add(
this."$method"(
item, t
Expand All @@ -1858,10 +1852,9 @@ class OpenEhrJsonParserQuick {

this.fillLOCATABLE(l, json, parent)

l.items = []
json.items.eachWithIndex { element, i ->

if (!l.items) l.items = []

l.items.add(
this.parseELEMENT(
element, l
Expand All @@ -1880,14 +1873,13 @@ class OpenEhrJsonParserQuick {

String type, method

// FIXME: rows are CLUSTERS, we don't need to get the dynamic method
t.rows = []
json.rows.each { item ->

// FIXME: rows are CLUSTERS, we don't need to get the dynamic method
type = item._type
method = 'parse'+ type

if (!t.rows) t.rows = []

t.rows.add(
this."$method"(
item, t
Expand Down Expand Up @@ -1919,6 +1911,7 @@ class OpenEhrJsonParserQuick {

String type, method

c.items = []
json.items.eachWithIndex { item, i ->

type = item._type
Expand All @@ -1928,8 +1921,6 @@ class OpenEhrJsonParserQuick {
}
method = 'parse'+ type

if (!c.items) c.items = []

c.items.add(this."$method"(item, c))
}

Expand Down
Loading

0 comments on commit d0452d6

Please sign in to comment.