Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations missing from web template when node has been renamed #967

Open
6 tasks
jryd opened this issue Aug 23, 2022 · 1 comment
Open
6 tasks

Annotations missing from web template when node has been renamed #967

jryd opened this issue Aug 23, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jryd
Copy link

jryd commented Aug 23, 2022

Configuration information

  • EHRbase version: 0.21.1
  • openEHR_SDK version: 1.19.0
  • Archie version: 2.0.1
  • PostgreSQL version: PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  • Java Runtime version: Oracle Corporation 11.0.15+10
  • Operating System version: Linux amd64 5.10.104-linuxkit

Steps to reproduce

We've been augmenting our templates with data that we place into annotations.

Related to a past issue #753, these fields used to be missing from the web template when this was fetched via an Ethercis request.

This has since been resolved, but it seems that custom annotations are now missing when a field has been renamed in the template.

Take this OPT for example (Alcohol Consumption Summary)

In it we have 4 fields where we've added a custom annotation called "validation":

<annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0064]/items[at0023, 'Typical consumption']">
      <items id="helpText">UK Standard drink = 8g of alcohol per drink</items>
      <items id="validation">prohibited_if:alcohol_consumption_summary.alcohol_consumption_summary.status.|code,82581004,783261004</items>
  </annotations>
  <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0064]">
      <items id="validation">optional_if:at0089.1,219006|prohibited_if:at0089.1,783261004|prohibited_if:at0089.1,82581004</items>
  </annotations>
  <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0016, 'Quit date']">
      <items id="validation">prohibited_if:alcohol_consumption_summary.alcohol_consumption_summary.status.|code,219006,783261004|date|date_less_than_or_equal_to_now</items>
  </annotations>
  <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0019]">
      <items id="validation">prohibited_if:alcohol_consumption_summary.alcohol_consumption_summary.status.|code,783261004</items>
  </annotations>

These 4 annotation blocks map to the following fields respectively:

  • Typical consumption (renamed from "Typical consumption (alcohol units)")
  • Per episode
  • Quit date (renamed from "Overall quit date")
  • Overall comment

When you fetch the template via a GET request to {base_url}/rest/ecis/v1/template/alcohol_consumption_summary.v0, the custom annotations will come through for nodes where we haven't renamed the field, but will be missing for nodes where we have renamed it.

Interestingly, if we modify the OPT file and remove the custom name from these annotation blocks, the custom annotations will come through correctly:

- <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0064]/items[at0023, 'Typical consumption']">
+ <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0064]/items[at0023]"> 
      <items id="helpText">UK Standard drink = 8g of alcohol per drink</items>
      <items id="validation">prohibited_if:alcohol_consumption_summary.alcohol_consumption_summary.status.|code,82581004,783261004</items>
  </annotations>
  <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0064]">
      <items id="validation">optional_if:at0089.1,219006|prohibited_if:at0089.1,783261004|prohibited_if:at0089.1,82581004</items>
  </annotations>
-  <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0016, 'Quit date']">
+   <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0016]"> 
      <items id="validation">prohibited_if:alcohol_consumption_summary.alcohol_consumption_summary.status.|code,219006,783261004|date|date_less_than_or_equal_to_now</items>
  </annotations>
  <annotations path="[openEHR-EHR-COMPOSITION.lifestyle_factors.v0]/content[openEHR-EHR-EVALUATION.alcohol_consumption_summary.v1]/data[at0001]/items[at0019]">
      <items id="validation">prohibited_if:alcohol_consumption_summary.alcohol_consumption_summary.status.|code,783261004</items>
  </annotations>

Actual result

Custom annotations are missing for nodes that have been renamed.

Expected result (Acceptance Criteria)

Custom annotations should come through regardless of whether the node has been renamed or not.

Definition of Done

  • The defect is checked by an unit or an integration test (Robot)
  • Merge Request approved
  • Unit tests passed
  • Build without errors
  • Release notes prepared
  • No additional runtime warnings
@jryd jryd added the bug Something isn't working label Aug 23, 2022
@vladislavploaia
Copy link
Contributor

Hello @jryd,
Bug reported in Jira for tracking purposes:
https://jira.vitagroup.ag/browse/CDR-520
Reproducible in EHRBase v.0.22.0.

Will let you know once I have any updates about that.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants