Skip to content

Commit

Permalink
centralized rm_attributes_not_int_opt and added missing demographic a…
Browse files Browse the repository at this point in the history
…ttributes
  • Loading branch information
ppazos committed May 22, 2023
1 parent 762146a commit 464bfe8
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 6 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.9
version = 1.9.1
group = com.cabolabs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.cabolabs.openehr.opt.model

// to use the rm_attributes_not_in_opt
import com.cabolabs.openehr.rm_1_0_2.Model

@groovy.util.logging.Log4j
class OperationalTemplate {

Expand Down Expand Up @@ -31,6 +34,7 @@ class OperationalTemplate {
// TODO: this should be RM Version dependent! maybe as external metadata files
// RM attributes that are not in the OPT but also need to be indexed for querying.
// This is like a schema, but is not including the attrs that are on OPTs.
/*
def rm_attributes_not_in_opt = [
'EHR_STATUS': [
'subject': 'PARTY_SELF',
Expand Down Expand Up @@ -80,9 +84,23 @@ class OperationalTemplate {
'ELEMENT': [
'null_flavour': 'DV_CODED_TEXT' // this could be in the opt constraining the possible codes
],
// DEMOGRAPHIC
'PARTY_RELATIONSHIP': [
'source': 'PARTY_REF' // need to support queries over the relationship.source to find all the relationships of an actor
'source': 'PARTY_REF', // need to support queries over the relationship.source to find all the relationships of an actor
'time_validity': 'DV_INTERVAL'
],
'ROLE': [
'time_validity': 'DV_INTERVAL'
],
'CAPABILITY': [
'time_validity': 'DV_INTERVAL'
],
'CONTACT': [
'time_validity': 'DV_INTERVAL'
],
// REF and ID
'PARTY_REF': [
'id': 'OBJECT_VERSION_ID' // NOTE: this is OBJECT_ID but our implementation only allows OBJECT_VERSION_ID here, this should be part of the conformance statement!
],
Expand All @@ -94,6 +112,7 @@ class OperationalTemplate {
'path': 'String'
]
]
*/

/*
* gets a node by template path
Expand Down Expand Up @@ -272,7 +291,8 @@ class OperationalTemplate {
private completeRecursive(ObjectNode obn)
{
// attr name -> type
Map rm_attrs = rm_attributes_not_in_opt[obn.rmTypeName]
//Map rm_attrs = rm_attributes_not_in_opt[obn.rmTypeName]
Map rm_attrs = Model.rm_attributes_not_in_opt[obn.rmTypeName]

def path_sep, aom_type, atnc, obnc

Expand Down
29 changes: 28 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 @@ -6,7 +6,7 @@ package com.cabolabs.openehr.rm_1_0_2
*/
class Model {

private static Map rm_attributes_not_in_opt = [
public static Map rm_attributes_not_in_opt = [
'EHR_STATUS': [
'subject': 'PARTY_SELF',
'is_queryable': 'Boolean',
Expand Down Expand Up @@ -54,6 +54,33 @@ class Model {
],
'ELEMENT': [
'null_flavour': 'DV_CODED_TEXT' // this could be in the opt constraining the possible codes
],

// DEMOGRAPHIC
'PARTY_RELATIONSHIP': [
'source': 'PARTY_REF', // need to support queries over the relationship.source to find all the relationships of an actor
'time_validity': 'DV_INTERVAL'
],
'ROLE': [
'time_validity': 'DV_INTERVAL'
],
'CAPABILITY': [
'time_validity': 'DV_INTERVAL'
],
'CONTACT': [
'time_validity': 'DV_INTERVAL'
],

// REF and ID
'PARTY_REF': [
'id': 'OBJECT_VERSION_ID' // NOTE: this is OBJECT_ID but our implementation only allows OBJECT_VERSION_ID here, this should be part of the conformance statement!
],
'OBJECT_VERSION_ID': [
'value': 'String' // need to query by the PARTY_REF.id by a string criteria
],
'LOCATABLE_REF': [ // to allow to query by locatable_ref id and path, used in INSTRUCTION_DETAILS.instruction_id
'id': 'OBJECT_VERSION_ID',
'path': 'String'
]
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<upper>1</upper>
</occurrences>
<node_id />
<!-- NOTE: the sbuset is url encoded, it's a snomed expression for descedants of 'person in the family' concept -->
<!-- NOTE: the subset is url encoded, it's a snomed expression for descedants of 'person in the family' concept -->
<referenceSetUri>terminology:SNOMED-CT?subset=%3C%3C%20303071001%20%7C%20Person%20in%20the%20family%20%28person%29%20%7C</referenceSetUri>
</children>
</attributes>
Expand Down Expand Up @@ -165,4 +165,4 @@
<items id="text">relationship type</items>
</term_definitions>
</definition>
</template>
</template>

0 comments on commit 464bfe8

Please sign in to comment.