Skip to content

Commit

Permalink
Fix archetype id rm model parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbos committed Aug 18, 2021
1 parent 6568e46 commit 56718a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.nedap.archie.rminfo.RMPropertyIgnore;

import javax.annotation.Nullable;
import javax.xml.bind.Unmarshaller;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -251,4 +252,12 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(super.hashCode(), namespace, qualifiedRmEntity, domainConcept, rmOriginator, rmName, rmEntity, specialisation, versionId);
}

// after JAXB unmarshalling, set the field values correctly
public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
if(this.rmName == null) {
parseValue(getValue());
}

}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<composition archetype_node_id="openEHR-EHR-COMPOSITION.test_all_types.v1"
xmlns="http://schemas.openehr.org/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.openehr.org/v1">
<name>
<value>Test all types</value>
</name>
<!-- the following is currently not supported by ARCHIE unmarshalling as of 14.7.2019 -->
<!--<archetype_details>-->
<!--<archetype_id>-->
<!--<value>openEHR-EHR-COMPOSITION.test_all_types.v1</value>-->
<!--</archetype_id>-->
<!--<template_id>-->
<!--<value>test_all_types.en.v1</value>-->
<!--</template_id>-->
<!--<rm_version>1.0.2</rm_version>-->
<!--</archetype_details>-->
<archetype_details>
<archetype_id>
<value>openEHR-EHR-COMPOSITION.test_all_types.v1</value>
</archetype_id>
<template_id>
<value>test_all_types.en.v1</value>
</template_id>
<rm_version>1.0.2</rm_version>
</archetype_details>
<language>
<terminology_id>
<value>ISO_639-1</value>
Expand Down

0 comments on commit 56718a2

Please sign in to comment.