diff --git a/a_opt_complete.json b/a_opt_complete.json index a0f1083..c8ce885 100644 --- a/a_opt_complete.json +++ b/a_opt_complete.json @@ -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", + "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": [ + + ] + } + ] + } ] } ] diff --git a/src/main/groovy/com/cabolabs/openehr/opt/model/OperationalTemplate.groovy b/src/main/groovy/com/cabolabs/openehr/opt/model/OperationalTemplate.groovy index da77a8b..48b149c 100644 --- a/src/main/groovy/com/cabolabs/openehr/opt/model/OperationalTemplate.groovy +++ b/src/main/groovy/com/cabolabs/openehr/opt/model/OperationalTemplate.groovy @@ -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' @@ -332,6 +333,8 @@ class OperationalTemplate { obnc = new ObjectNode() } + println attr + // avoid // on root paths path_sep = "/" if (obn.path == "/") path_sep = "" diff --git a/src/main/groovy/com/cabolabs/openehr/rm_1_0_2/Model.groovy b/src/main/groovy/com/cabolabs/openehr/rm_1_0_2/Model.groovy index 893c0d1..5dbd080 100644 --- a/src/main/groovy/com/cabolabs/openehr/rm_1_0_2/Model.groovy +++ b/src/main/groovy/com/cabolabs/openehr/rm_1_0_2/Model.groovy @@ -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', @@ -84,6 +84,14 @@ class Model { 'path': 'String' ], + 'PARTICIPATION': [ + function: 'DV_TEXT', + mode: 'DV_CODED_TEXT', + time: 'DV_INTERVAL', + // 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': [