BDSC-CDS / glowing-bear-medco-bioref

A modification of the MedCo front-end project which brings reference intervals to the rescue. Check the following link for a documentation about the BioRef-specific implementation: https://github.com/CHUV-DS/glowing-bear-medco-bioref/blob/bioref/bioref_doc.md
Mozilla Public License 2.0
0 stars 0 forks source link

Defaults/restored constraints do not show in the "cohort definition" panel of the "Reference Interval Estimation" tab #48

Open JLRaisaro opened 2 years ago

JLRaisaro commented 2 years ago

Screen Shot 2022-08-23 at 10 20 11

JLRaisaro commented 2 years ago

going back and forth between the two tabs fixes the problem. The "None" appears only when you click on the "Run" button the first time and the active tab switches to "Reference Interval Estimation"

nfreundl commented 2 years ago

I am not able to reproduce the bug

nfreundl commented 2 years ago

Ok I produced a similar one by constructing a cohort/filter. I checked the panels definition in the HTTP query and the fields correspond to the panel definition before I clicked the Run button. The problem is happening after the queries are sent to the servers.

nfreundl commented 2 years ago

getConceptFromTreeNode throws an error as its treeNode argument is undefined when it is called in the Reference Interval Estimation, in the situation @JLRaisaro describes. At the cohort definition, this is working fine.

nfreundl commented 2 years ago

The treeNode passed as an argument in generateConstraintFromTreeNode before clicking Run has an appliedConcept attribute, this is not the case when the error occurs

nfreundl commented 2 years ago

Ok it is normal as the modified is passed to getConceptFromTreeNode before its modifier , the problem is that modified one has node type MODIFIER_FOLDER and it seems to lack modifierConcept attribute.

nfreundl commented 2 years ago

The lines who trigger the possibly wrong modifier mechanics are

this.refreshConstraint(this.constraintService.generateConstraint()).subscribe(refreshed => {
            /* There are problems with the current version of the code. Hence it is necessary to use
            * the hackish method refreshConstraint so that the summary of the used constraints is up to date.
            * If a user replaces a concept with another by dropping the selected concept on the
            * previously selected concept in the explore statistics form, the newer concept wont be displayed
            * in the summary of the query. The newer concept will still be sent to the backend because
            * mapConstraint will returned the latest up to date i2b2 tree.
            */
            this.rootConstraint.next(refreshed)
})

at file https://github.com/CHUV-DS/glowing-bear-medco-bioref/blob/dev/src/app/services/explore-statistics.service.ts#:~:text=this.refreshConstraint(this.constraintService.generateConstraint()).subscribe(refreshed%20%3D%3E%20%7B