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

ELM Annotations Data Duplication #86

Closed
alexanderelliott121 opened this issue Feb 28, 2017 · 5 comments
Closed

ELM Annotations Data Duplication #86

alexanderelliott121 opened this issue Feb 28, 2017 · 5 comments
Assignees
Labels

Comments

@alexanderelliott121
Copy link

alexanderelliott121 commented Feb 28, 2017

I'm on the MITRE Bonnie team. I'm currently trying to create an html representation of the CQL that will have the appropriate data to enable logic highlighting.
My current attempts to derive cql from the XML ELM's annotations run into issues with duplicated information.

Does a strategy currently exist for re-creating CQL from the XML annotations and ignoring the duplication? If not, is this something that can be resolved during CQL-to-ELM generation?

Examples from CMS177:

  1. Element references duplicated in full.
    This snippet from the MDD Diagnosis annotation fully reproduces the contents of the MDD Encounter element. See references 58 and 48 below.

    In addition, reference 48 contains the following:
    "MDD Encounter" Encounter such that Diagnosis.prevalencePeriod overlaps Encounter.relevantPerioddefine "MDD Encounter":

    See bolded portion. This line seems incorrectly formatted, with the define statement being appended where it shouldn't be.

  <annotation xsi:type="a:Annotation">
    <a:s r="58">define "MDD Encounter": distinct (["Encounter, Performed": "Office Visit"] union ["Encounter, Performed": "Outpatient Consultation"] union ["Encounter, Performed": "Face-to-Face Interaction"] union ["Encounter, Performed": "Psych Visit - Diagnostic Evaluation"] union ["Encounter, Performed": "Psych Visit - Family Psychotherapy"] union ["Encounter, Performed": "Psych Visit - Psychotherapy"] union ["Encounter, Performed": "Psychoanalysis"]) Encounter    where Encounter.relevantPeriod during "Measurement Period"</a:s>
  </annotation>
<a:s r="49">                       
  <a:s r="48">"MDD Encounter" Encounter     such that Diagnosis.prevalencePeriod overlaps Encounter.relevantPerioddefine "MDD Encounter":
    <a:s r="47">distinct
      <a:s r="46">                                
        <a:s r="41">(
          <a:s r="40">                                      
            <a:s r="38">                                         
              <a:s r="36">                                            
                <a:s r="34">                                                
                  <a:s r="32">                                                  
                    <a:s r="30">                                                     
                      <a:s r="28">["Encounter, Performed": "Office Visit"]
                      </a:s> union
                    <a:s r="29">["Encounter, Performed": "Outpatient Consultation"]
                  </a:s>                                                  
                </a:s> union
              <a:s r="31">["Encounter, Performed": "Face-to-Face Interaction"]
            </a:s>                                               
          </a:s> union
        <a:s r="33">["Encounter, Performed": "Psych Visit - Diagnostic Evaluation"]
      </a:s>                                            
    </a:s> union
  <a:s r="35">["Encounter, Performed": "Psych Visit - Family Psychotherapy"]
</a:s>
  1. Annotations associated with certain clauses will contain summary lines either before or after the relevant child elements.
<annotation xsi:type="a:Annotation">
               <a:s r="70">
                 define "Age Demographic":
                 <a:s r="69">
                   <a:s r="63">
                     AgeInYearsAt(start of "Measurement Period") &gt;=
                     <a:s r="61">AgeInYearsAt(
                       <a:s r="60">start of
                         <a:s r="59">"Measurement Period"</a:s>
                       </a:s>
                       )
                     </a:s>
                      &gt;=
                     <a:s r="62">6</a:s>
                   </a:s>
                       and
                   <a:s r="68">
                     AgeInYearsAt(start of "Measurement Period") &lt;
                     <a:s r="66">
                       AgeInYearsAt(
                       <a:s r="65">
                         start of
                         <a:s r="64">"Measurement Period"</a:s>
                       </a:s>)
                     </a:s>
                      &lt;
                     <a:s r="67">17</a:s>
                   </a:s>
                 </a:s>
               </a:s>
             </annotation>

So you have AgeInYearsAt(start of "Measurement Period") which is then duplicated. This is also seen with less, lessorequal, equal, greaterorequal and equal type elements.

<a:s r="82">define "Suicide Risk":
  <a:s r="81">
    <a:s r="72">
      <a:s r="71">["Intervention, Performed": "Suicide Risk Assessment"]</a:s>
      Intervention
    </a:s>
                <a:s r="80">with
                  <a:s r="74">
                    <a:s r="73">"MDD Encounter"</a:s>
                    Encounter
                  </a:s>
                       such that
                  <a:s r="76">
                    <a:s r="75">Intervention</a:s>
                    .relevantPeriod
                  </a:s>
                   during
                  <a:s r="78">
                    <a:s r="77">Encounter</a:s>
                    .relevantPeriod
                  </a:s>
                  <a:s r="79">during</a:s>
                   Encounter.relevantPeriod
                </a:s>
              </a:s>
            </a:s>

Here we see the “during Encounter.relevantPeriod” clause duplicated in two different ways.

Thank you for your help.

@alexanderelliott121
Copy link
Author

I've tried to upload the relevant files but keep running into errors. Please email me if you want them.

@brynrhodes
Copy link
Member

I've noticed this as well as part of working on getting Annotations to serialize correctly to JSON, so I'm working on this, should have a fix soon.

@brynrhodes brynrhodes self-assigned this Mar 2, 2017
@alexanderelliott121
Copy link
Author

alexanderelliott121 commented Mar 16, 2017

Hi Bryn,
I'm curious if there is a rough ETA on this? My own work is dependent on it, and if its a low priority it might make sense for me to take a stab at it.

@brynrhodes
Copy link
Member

Apologies for the delay here, I got distracted, trying to get back to this. I've pushed a branch (fix-annotations) that has debugging statements that I've been using to track down the issue, you're welcome to take a look, the more eyes on it the better.

It's clear what's happening, the narrative tracking that "paints" the text to use in the span isn't properly accounting for cases when the parse tree jumps forward and then back (as in a binary infix operator).

That's as far as I got before I got distracted, I'll get back to it as soon as I can, but posting the branch so you can take a look too if you want.

brynrhodes added a commit that referenced this issue Mar 21, 2017
… as duplicate outputs by removing span links to local ids. Will log as a new issue and wait for feedback that these are required before pursuing any further.
@brynrhodes
Copy link
Member

This issue was corrected by pull request #94 and the fix will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants