Skip to content

Commit

Permalink
testing opt complete with participations
Browse files Browse the repository at this point in the history
  • Loading branch information
ppazos committed Nov 27, 2024
1 parent 2e1bc11 commit 0c34012
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 2 deletions.
114 changes: 113 additions & 1 deletion a_opt_complete.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,119 @@
"description": "unknown.context.participations",
"_class": "ObjectNode",
"attributes": [

{
"type": "C_SINGLE_ATTRIBUTE",
"rm_attribute_name": "function",
"children": [
{
"archetype_id": null,
"path": "/context/participations/function",
"type": "C_COMPLEX_OBJECT",
"rm_type_name": "DV_TEXT",
"node_id": null,
"text": "Test all types.context.participations.function",
"description": "unknown.context.participations.function",
"_class": "ObjectNode",
"attributes": [

]
}
]
},
{
"type": "C_SINGLE_ATTRIBUTE",
"rm_attribute_name": "mode",
"children": [
{
"archetype_id": null,
"path": "/context/participations/mode",
"type": "C_COMPLEX_OBJECT",
"rm_type_name": "DV_CODED_TEXT",
"node_id": null,
"text": "Test all types.context.participations.mode",
"description": "unknown.context.participations.mode",
"_class": "ObjectNode",
"attributes": [

]
}
]
},
{
"type": "C_SINGLE_ATTRIBUTE",
"rm_attribute_name": "time",
"children": [
{
"archetype_id": null,
"path": "/context/participations/time",
"type": "C_COMPLEX_OBJECT",
"rm_type_name": "DV_INTERVAL<DV_DATE_TIME>",
"node_id": null,
"text": "Test all types.context.participations.time",
"description": "unknown.context.participations.time",
"_class": "ObjectNode",
"attributes": [
{
"type": "C_SINGLE_ATTRIBUTE",
"rm_attribute_name": "lower",
"children": [
{
"archetype_id": null,
"path": "/context/participations/time/lower",
"type": "C_COMPLEX_OBJECT",
"rm_type_name": "DV_DATE_TIME",
"node_id": null,
"text": "Test all types.context.participations.time.lower",
"description": "unknown.context.participations.time.lower",
"_class": "ObjectNode",
"attributes": [

]
}
]
},
{
"type": "C_SINGLE_ATTRIBUTE",
"rm_attribute_name": "upper",
"children": [
{
"archetype_id": null,
"path": "/context/participations/time/upper",
"type": "C_COMPLEX_OBJECT",
"rm_type_name": "DV_DATE_TIME",
"node_id": null,
"text": "Test all types.context.participations.time.upper",
"description": "unknown.context.participations.time.upper",
"_class": "ObjectNode",
"attributes": [

]
}
]
}
]
}
]
},
{
"type": "C_SINGLE_ATTRIBUTE",
"rm_attribute_name": "performer",
"children": [
{
"archetype_id": null,
"path": "/context/participations/performer",
"type": "C_COMPLEX_OBJECT",
"rm_type_name": "[PARTY_IDENTIFIED, PARTY_RELATED, PARTY_SELF]",
"node_id": null,
"text": "Test all types.context.participations.performer",
"description": "unknown.context.participations.performer",
"_class": "ObjectNode",
"attributes": [

]
}
]
}
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ class OperationalTemplate {
// for instance, a null_flavour could be in the OPT
if (!obn.attributes.find{ it.rmAttributeName == attr })
{
// TODO: support that type could be a list of possible types (inheritance structure only with concrete types), I guess here we should pick one or just add all the alternative types.
if (Model.primitive_types.contains(type))
{
aom_type = 'C_PRIMITIVE_OBJECT'
Expand All @@ -332,6 +333,8 @@ class OperationalTemplate {
obnc = new ObjectNode()
}

println attr

// avoid // on root paths
path_sep = "/"
if (obn.path == "/") path_sep = ""
Expand Down
10 changes: 9 additions & 1 deletion src/main/groovy/com/cabolabs/openehr/rm_1_0_2/Model.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Model {
'location': 'String',
'start_time': 'DV_DATE_TIME',
'end_time': 'DV_DATE_TIME',
'participations': 'PARTICIPATION'
'participations': 'PARTICIPATION' // has many!
],
'ACTION': [
'time': 'DV_DATE_TIME',
Expand Down Expand Up @@ -84,6 +84,14 @@ class Model {
'path': 'String'
],

'PARTICIPATION': [
function: 'DV_TEXT',
mode: 'DV_CODED_TEXT',
time: 'DV_INTERVAL<DV_DATE_TIME>',
// NOTE: in complete() the list in the type is not supported
performer: ['PARTY_IDENTIFIED', 'PARTY_RELATED', 'PARTY_SELF']
],

// DVs: this is for the DV_INTERVAL types here, to complete it's internal structs
// NOTE: need to match specific type of DV_INTERVAL
'DV_INTERVAL<DV_DATE>': [
Expand Down

0 comments on commit 0c34012

Please sign in to comment.