Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Beta UI: Classifications will be displayed as Identifiers too. #32

Open
epuzanov opened this issue Mar 1, 2021 · 2 comments
Open

Beta UI: Classifications will be displayed as Identifiers too. #32

epuzanov opened this issue Mar 1, 2021 · 2 comments

Comments

@epuzanov
Copy link
Contributor

epuzanov commented Mar 1, 2021

In a new 'Beta UI' Classifications will be displayed as Identifiers too.

Expected:
Classifications - contains only codes where isClassification() == true
Identifiers - contains only codes where isClassification() == false

@tylerperyea
Copy link
Collaborator

This is a good point. The invention of the classifications vs identifiers was a rather late addition, and the logic used has just been to look for a "|" character in the comments/code text. The POJO probably abstracted this to that method call, while the beta UI just reinvents that same logic on the client-side. For consistency, we should expose the "isClassification" method of the POJO as a "_"-based property in the JSON (perhaps "_isClassification") and allow the client-side code to use that property.

Long term, really, the CV should categorize the code systems as either identifiers or classifications, and that could be used for the UI.

@epuzanov if you'd like to propose the addition of that new JSON property, I think it should be fairly straight-forward to make the beta UI optionally use that field rather than its current logic.

@epuzanov
Copy link
Contributor Author

epuzanov commented Mar 1, 2021

I think, I found the problem:
https://github.com/ncats/GSRSFrontend/blob/Public_2.6/src/app/core/substance-details/substance-codes/substance-codes.component.ts
Line: 83

Must be something like:
} else if ((!code.comments || code.comments.indexOf('|') < 0) && this.type === 'identifiers') {

or another variant replace lines 81-85 with following code:

if (code.comments && code.comments.indexOf('|') > -1) {
    if (this.type === 'classification') {
        this.codes.push(code);
    }
} else {
    if (this.type === 'identifiers') {
        this.codes.push(code);
    }
}

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

No branches or pull requests

2 participants