+ {shouldProvisionClassification ?
+
+
- {showUnpublish ? 'Unpublish' : 'Publish'} the selected
- Approved Interpretation {showUnpublish ? 'from' : 'to'} the Evidence Repository.
+ Save this Interpretation as Provisional if you have finished all your evaluations and wish to mark it as complete. Once
+ you have saved it as Provisional, you will not be able to undo it, but you will be able to make a new current Provisional Interpretation, archiving the current
+ one, with access to its Evaluation Summary.
- }
-
-
-
-
{showUnpublish ? 'Unpublish Interpretation from' : 'Publish Interpretation to'} the Evidence Repository
-
-
+
+
+
Save Interpretation as Provisional
+
+
-
- : null}
- {!showProvisional && !showApproval && !allowPublishButton ?
-
+ :
+
+
+ The option to save an Interpretation as Provisional will not appear when the saved calculated or modified value
+ is "Likely Pathogenic" or "Pathogenic" and there is no associated disease.
+
+
+ }
+
+ : null}
+ {provisionalVariant && showApproval ?
+
+
- The option to publish an approved interpretation to the Evidence Repository is
- currently only available for VCEPs that have guidelines approved by the Sequence Variant Interpretation Working Group.
+ When ready, you may save this Provisional Interpretation as Approved. Once you have saved it as Approved it will become
+ uneditable, but you will be able to save a new current Approved Interpretation, thus archiving this current one and retaining access to its Evaluation Summary.
- : null}
- {sortedSnapshotList.length ?
-
+
-
Saved Provisional and Approved Interpretation(s)
+ Approve Interpretation
-
+ provisional={provisionalVariant}
+ affiliation={affiliation}
+ updateSnapshotList={this.props.updateSnapshotList}
+ updateProvisionalObj={this.props.updateProvisionalObj}
+ snapshots={sortedSnapshotList}
+ />
- : null}
-
-
-
-
Criteria meeting an evaluation strength
-
-
-
- {tableHeader()}
-
- {sortedEvaluations.met ?
-
- {sortedEvaluations.met.map(function(item, i) {
- return (renderMetCriteriaRow(item, i));
- })}
-
+
+ : null}
+ {provisionalVariant && (showPublish || showUnpublish) ?
+
+
+ {isPublishActive === 'auto' ?
+
+ Publish the current ()
+ Approved Interpretation to the Evidence Repository.
+
:
-
- No criteria meeting an evaluation strength.
-
+
+ {showUnpublish ? 'Unpublish' : 'Publish'} the selected
+ Approved Interpretation {showUnpublish ? 'from' : 'to'} the Evidence Repository.
+
}
-
+
+
+
+
{showUnpublish ? 'Unpublish Interpretation from' : 'Publish Interpretation to'} the Evidence Repository
+
+
+
-
-
+ : null}
+ {!showProvisional && !showApproval && !allowPublishButton ?
+
+
+ The option to publish an approved interpretation to the Evidence Repository is
+ currently only available for VCEPs that have guidelines approved by the Sequence Variant Interpretation Working Group.
+
+
+ : null}
+ {sortedSnapshotList.length ?
+
-
Criteria evaluated as "Not met"
+ Saved Provisional and Approved Interpretation(s)
+
+
+
+
+ : null}
+
+
+
+
Criteria meeting an evaluation strength
+
+ {sortedEvaluations && sortedEvaluations.met && sortedEvaluations.met.length ?
{tableHeader()}
- {sortedEvaluations.not_met ?
-
- {sortedEvaluations.not_met.map(function(item, i) {
- return (renderNotMetCriteriaRow(item, i));
- })}
-
- :
-
- No criteria evaluated as "Not met".
-
- }
+
+ {sortedEvaluations.met.map(function(item, i) {
+ return (renderMetCriteriaRow(item, i));
+ })}
+
-
-
-
-
-
Criteria "Not yet evaluated"
+ :
+
+ No criteria meeting an evaluation strength.
+ }
+
+
+
+
+
Criteria evaluated as "Not met"
+
+ {sortedEvaluations && sortedEvaluations.not_met && sortedEvaluations.not_met.length ?
{tableHeader()}
- {sortedEvaluations.not_evaluated ?
-
- {sortedEvaluations.not_evaluated.map(function(item, i) {
- return (renderNotEvalCriteriaRow(item, i));
- })}
-
- :
-
- No criteria yet to be evaluated.
-
- }
+
+ {sortedEvaluations.not_met.map(function(item, i) {
+ return (renderNotMetCriteriaRow(item, i));
+ })}
+
-
+ :
+
+ No criteria evaluated as "Not met".
+
+ }
+
+
+
+
Criteria "Not yet evaluated"
+
+
+
+ {tableHeader()}
+
+ {sortedEvaluations && sortedEvaluations.not_evaluated && sortedEvaluations.not_evaluated.length ?
+
+ {sortedEvaluations.not_evaluated.map(function(item, i) {
+ return (renderNotEvalCriteriaRow(item, i));
+ })}
+
+ :
+
+ No criteria yet to be evaluated.
+
+ }
+
- :
-
No evaluations found in this interpretation.
- }
+
+
);
}
@@ -1167,180 +1162,3 @@ function getModifiedLevel(entry) {
}
return modifiedLevel;
}
-
-// Function to sort evaluations by criteria strength level
-// Sort Order: very strong or stand alone >> strong >> moderate >> supporting
-// Input: array, interpretation.evaluations
-// output: object as
-// {
-// met: array of sorted met evaluations,
-// not_met: array of sorted not-met evaluations,
-// not_evaluated: array of sorted not-evaluated and untouched objects;
-// untouched obj has only one key:value element (criteria: code)
-// }
-
-function sortByStrength(evaluations) {
- // Get all criteria codes
- let criteriaCodes = Object.keys(evidenceCodes);
-
- let evaluationMet = [];
- let evaluationNotMet = [];
- let evaluationNotEvaluated = [];
-
- for (let evaluation of evaluations) {
- if (evaluation.criteriaStatus === 'met') {
- evaluationMet.push(evaluation);
- criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
- } else if (evaluation.criteriaStatus === 'not-met') {
- evaluationNotMet.push(evaluation);
- criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
- } else {
- evaluationNotEvaluated.push(evaluation);
- criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
- }
- }
-
- // Generate object for earch untouched criteria
- let untouchedCriteriaObjList = [];
- if (criteriaCodes.length) {
- for (let criterion of criteriaCodes) {
- untouchedCriteriaObjList.push({
- criteria: criterion
- });
- }
- }
- // merge not-evaluated and untouched together
- evaluationNotEvaluated = evaluationNotEvaluated.concat(untouchedCriteriaObjList);
-
- let sortedMetList = [];
- let sortedNotMetList = [];
- let sortedNotEvaluatedList = [];
-
- // sort Met
- if (evaluationMet.length) {
- // setup count strength values
- const MODIFIER_VS = 'very-strong';
- const MODIFIER_SA = 'stand-alone';
- const MODIFIER_S = 'strong';
- const MODIFIER_M = 'moderate';
- const MODIFIER_P = 'supporting';
-
- // temp storage
- let vs_sa_level = [];
- let strong_level = [];
- let moderate_level = [];
- let supporting_level = [];
-
- for (let evaluation of evaluationMet) {
- let modified = evaluation.criteriaModifier ? evaluation.criteriaModifier : null;
- if (modified) {
- if (modified === MODIFIER_VS || modified === MODIFIER_SA) {
- vs_sa_level.push(evaluation);
- } else if (modified === MODIFIER_S) {
- strong_level.push(evaluation);
- } else if (modified === MODIFIER_M) {
- moderate_level.push(evaluation);
- } else if (modified === MODIFIER_P) {
- supporting_level.push(evaluation);
- }
- } else {
- if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
- vs_sa_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'S') {
- strong_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'M') {
- moderate_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'P') {
- supporting_level.push(evaluation);
- }
- }
- }
-
- if (vs_sa_level.length) {
- sortedMetList = sortedMetList .concat(vs_sa_level);
- }
- if (strong_level.length) {
- sortedMetList = sortedMetList.concat(strong_level);
- }
- if (moderate_level.length) {
- sortedMetList = sortedMetList.concat(moderate_level);
- }
- if (supporting_level.length) {
- sortedMetList = sortedMetList.concat(supporting_level);
- }
- }
-
- // sort Not-Met
- if (evaluationNotMet.length) {
- // temp storage
- let vs_sa_level = [];
- let strong_level = [];
- let moderate_level = [];
- let supporting_level = [];
-
- for (let evaluation of evaluationNotMet) {
- if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
- vs_sa_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'S') {
- strong_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'M') {
- moderate_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'P') {
- supporting_level.push(evaluation);
- }
- }
-
- if (vs_sa_level.length) {
- sortedNotMetList = sortedNotMetList .concat(vs_sa_level);
- }
- if (strong_level.length) {
- sortedNotMetList = sortedNotMetList.concat(strong_level);
- }
- if (moderate_level.length) {
- sortedNotMetList = sortedNotMetList.concat(moderate_level);
- }
- if (supporting_level.length) {
- sortedNotMetList = sortedNotMetList.concat(supporting_level);
- }
- }
-
- //sort Not-Evaluated and untouched
- if (evaluationNotEvaluated.length) {
- // temp storage
- let vs_sa_level = [];
- let strong_level = [];
- let moderate_level = [];
- let supporting_level = [];
-
- for (let evaluation of evaluationNotEvaluated) {
- if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
- vs_sa_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'S') {
- strong_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'M') {
- moderate_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'P') {
- supporting_level.push(evaluation);
- }
- }
-
- if (vs_sa_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList .concat(vs_sa_level);
- }
- if (strong_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList.concat(strong_level);
- }
- if (moderate_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList.concat(moderate_level);
- }
- if (supporting_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList.concat(supporting_level);
- }
- }
-
- return ({
- met: sortedMetList,
- not_met: sortedNotMetList,
- not_evaluated: sortedNotEvaluatedList
- });
-}
diff --git a/src/clincoded/static/components/variant_central/title.js b/src/clincoded/static/components/variant_central/title.js
index 2f31182e9..955b870f1 100644
--- a/src/clincoded/static/components/variant_central/title.js
+++ b/src/clincoded/static/components/variant_central/title.js
@@ -3,6 +3,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import createReactClass from 'create-react-class';
import _ from 'underscore';
+import ModalComponent from '../../libs/bootstrap/modal';
import { FormMixin, Form, Input } from '../../libs/bootstrap/form';
import { queryKeyValue, editQueryValue, addQueryKey } from '../globals';
import { renderVariantTitle } from '../../libs/render_variant_title';
@@ -69,6 +70,16 @@ var Title = module.exports.Title = createReactClass({
return title;
},
+ handleViewSummaryResponse: function(e, buttonSelected) {
+ this.child.closeModal();
+
+ if (buttonSelected === 'Continue') {
+ this.handleSummaryButtonEvent(e);
+ } else {
+ e.preventDefault(); e.stopPropagation();
+ }
+ },
+
// handler for 'View Summary' & 'Return to Interpretation' button click events
handleSummaryButtonEvent: function(e) {
e.preventDefault(); e.stopPropagation();
@@ -95,9 +106,10 @@ var Title = module.exports.Title = createReactClass({
render() {
const variant = this.props.data;
const interpretation = this.state.interpretation;
+ const provisionalCount = interpretation ? interpretation.provisional_count : 0;
+ const evaluations = interpretation ? interpretation.evaluations : null;
let calculatePatho_button = this.props.interpretationUuid ? true : false;
let summaryButtonTitle = this.state.summaryVisible ? 'Return to Interpretation' : 'View Summary';
-
return (
@@ -109,8 +121,22 @@ var Title = module.exports.Title = createReactClass({
diff --git a/src/clincoded/static/components/variant_interpretation_summary/evaluations.js b/src/clincoded/static/components/variant_interpretation_summary/evaluations.js
index df33d93fd..c8bcf9136 100644
--- a/src/clincoded/static/components/variant_interpretation_summary/evaluations.js
+++ b/src/clincoded/static/components/variant_interpretation_summary/evaluations.js
@@ -2,6 +2,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import * as evidenceCodes from '../variant_central/interpretation/mapping/evidence_code.json';
+import { sortByStrength } from '../../libs/sort_eval_criteria';
class VariantInterpretationSummaryEvaluation extends Component {
constructor(props) {
@@ -10,8 +11,8 @@ class VariantInterpretationSummaryEvaluation extends Component {
render() {
const { interpretation, classification } = this.props;
- let evaluations = interpretation ? interpretation.evaluations : null;
- let sortedEvaluations = evaluations ? sortByStrength(evaluations) : null;
+ let evaluations = interpretation ? interpretation.evaluations : undefined;
+ let sortedEvaluations = sortByStrength(evaluations);
return (
@@ -19,7 +20,7 @@ class VariantInterpretationSummaryEvaluation extends Component {
Criteria meeting an evaluation strength
- {sortedEvaluations && sortedEvaluations.met ?
+ {sortedEvaluations && sortedEvaluations.met && sortedEvaluations.met.length ?
{tableHeader()}
@@ -41,7 +42,7 @@ class VariantInterpretationSummaryEvaluation extends Component {
Criteria evaluated as "Not met"
- {sortedEvaluations && sortedEvaluations.not_met ?
+ {sortedEvaluations && sortedEvaluations.not_met && sortedEvaluations.not_met.length ?
{tableHeader()}
@@ -63,22 +64,22 @@ class VariantInterpretationSummaryEvaluation extends Component {
Criteria "Not yet evaluated"
- {sortedEvaluations && sortedEvaluations.not_evaluated ?
-
-
- {tableHeader()}
-
+
+
+ {tableHeader()}
+
+ {sortedEvaluations && sortedEvaluations.not_evaluated && sortedEvaluations.not_evaluated.length ?
{sortedEvaluations.not_evaluated.map(function(item, i) {
return (renderNotEvalCriteriaRow(item, i));
})}
-
- :
-
- No criteria yet to be evaluated.
-
- }
+ :
+
+ No criteria yet to be evaluated.
+
+ }
+
);
@@ -315,180 +316,3 @@ function getModifiedLevel(entry) {
}
return modifiedLevel;
}
-
-// Function to sort evaluations by criteria strength level
-// Sort Order: very strong or stand alone >> strong >> moderate >> supporting
-// Input: array, interpretation.evaluations
-// output: object as
-// {
-// met: array of sorted met evaluations,
-// not_met: array of sorted not-met evaluations,
-// not_evaluated: array of sorted not-evaluated and untouched objects;
-// untouched obj has only one key:value element (criteria: code)
-// }
-
-function sortByStrength(evaluations) {
- // Get all criteria codes
- let criteriaCodes = Object.keys(evidenceCodes);
-
- let evaluationMet = [];
- let evaluationNotMet = [];
- let evaluationNotEvaluated = [];
-
- for (let evaluation of evaluations) {
- if (evaluation.criteriaStatus === 'met') {
- evaluationMet.push(evaluation);
- criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
- } else if (evaluation.criteriaStatus === 'not-met') {
- evaluationNotMet.push(evaluation);
- criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
- } else {
- evaluationNotEvaluated.push(evaluation);
- criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
- }
- }
-
- // Generate object for earch untouched criteria
- let untouchedCriteriaObjList = [];
- if (criteriaCodes.length) {
- for (let criterion of criteriaCodes) {
- untouchedCriteriaObjList.push({
- criteria: criterion
- });
- }
- }
- // merge not-evaluated and untouched together
- evaluationNotEvaluated = evaluationNotEvaluated.concat(untouchedCriteriaObjList);
-
- let sortedMetList = [];
- let sortedNotMetList = [];
- let sortedNotEvaluatedList = [];
-
- // sort Met
- if (evaluationMet.length) {
- // setup count strength values
- const MODIFIER_VS = 'very-strong';
- const MODIFIER_SA = 'stand-alone';
- const MODIFIER_S = 'strong';
- const MODIFIER_M = 'moderate';
- const MODIFIER_P = 'supporting';
-
- // temp storage
- let vs_sa_level = [];
- let strong_level = [];
- let moderate_level = [];
- let supporting_level = [];
-
- for (let evaluation of evaluationMet) {
- let modified = evaluation.criteriaModifier ? evaluation.criteriaModifier : null;
- if (modified) {
- if (modified === MODIFIER_VS || modified === MODIFIER_SA) {
- vs_sa_level.push(evaluation);
- } else if (modified === MODIFIER_S) {
- strong_level.push(evaluation);
- } else if (modified === MODIFIER_M) {
- moderate_level.push(evaluation);
- } else if (modified === MODIFIER_P) {
- supporting_level.push(evaluation);
- }
- } else {
- if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
- vs_sa_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'S') {
- strong_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'M') {
- moderate_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'P') {
- supporting_level.push(evaluation);
- }
- }
- }
-
- if (vs_sa_level.length) {
- sortedMetList = sortedMetList .concat(vs_sa_level);
- }
- if (strong_level.length) {
- sortedMetList = sortedMetList.concat(strong_level);
- }
- if (moderate_level.length) {
- sortedMetList = sortedMetList.concat(moderate_level);
- }
- if (supporting_level.length) {
- sortedMetList = sortedMetList.concat(supporting_level);
- }
- }
-
- // sort Not-Met
- if (evaluationNotMet.length) {
- // temp storage
- let vs_sa_level = [];
- let strong_level = [];
- let moderate_level = [];
- let supporting_level = [];
-
- for (let evaluation of evaluationNotMet) {
- if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
- vs_sa_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'S') {
- strong_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'M') {
- moderate_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'P') {
- supporting_level.push(evaluation);
- }
- }
-
- if (vs_sa_level.length) {
- sortedNotMetList = sortedNotMetList .concat(vs_sa_level);
- }
- if (strong_level.length) {
- sortedNotMetList = sortedNotMetList.concat(strong_level);
- }
- if (moderate_level.length) {
- sortedNotMetList = sortedNotMetList.concat(moderate_level);
- }
- if (supporting_level.length) {
- sortedNotMetList = sortedNotMetList.concat(supporting_level);
- }
- }
-
- //sort Not-Evaluated and untouched
- if (evaluationNotEvaluated.length) {
- // temp storage
- let vs_sa_level = [];
- let strong_level = [];
- let moderate_level = [];
- let supporting_level = [];
-
- for (let evaluation of evaluationNotEvaluated) {
- if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
- vs_sa_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'S') {
- strong_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'M') {
- moderate_level.push(evaluation);
- } else if (evaluation.criteria[1] === 'P') {
- supporting_level.push(evaluation);
- }
- }
-
- if (vs_sa_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList .concat(vs_sa_level);
- }
- if (strong_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList.concat(strong_level);
- }
- if (moderate_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList.concat(moderate_level);
- }
- if (supporting_level.length) {
- sortedNotEvaluatedList = sortedNotEvaluatedList.concat(supporting_level);
- }
- }
-
- return ({
- met: sortedMetList,
- not_met: sortedNotMetList,
- not_evaluated: sortedNotEvaluatedList
- });
-}
\ No newline at end of file
diff --git a/src/clincoded/static/libs/sort_eval_criteria.js b/src/clincoded/static/libs/sort_eval_criteria.js
new file mode 100644
index 000000000..24031f519
--- /dev/null
+++ b/src/clincoded/static/libs/sort_eval_criteria.js
@@ -0,0 +1,181 @@
+import * as evidenceCodes from '../components/variant_central/interpretation/mapping/evidence_code.json';
+
+/**
+ * Function to sort evaluations by criteria strength level
+ * Sort Order: very strong or stand alone >> strong >> moderate >> supporting
+ *
+ * Ooutput: object as
+ * {
+ * met: array of sorted met evaluations,
+ * not_met: array of sorted not-met evaluations,
+ * not_evaluated: array of sorted not-evaluated and untouched objects;
+ * untouched obj has only one key:value element (criteria: code)
+ * }
+ *
+ * @param {array} evaluations interpretation.evaluations
+ */
+export function sortByStrength(evaluations = []) {
+ // Get all criteria codes
+ let criteriaCodes = Object.keys(evidenceCodes);
+
+ let evaluationMet = [];
+ let evaluationNotMet = [];
+ let evaluationNotEvaluated = [];
+
+ for (let evaluation of evaluations) {
+ if (evaluation.criteriaStatus === 'met') {
+ evaluationMet.push(evaluation);
+ criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
+ } else if (evaluation.criteriaStatus === 'not-met') {
+ evaluationNotMet.push(evaluation);
+ criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
+ } else {
+ evaluationNotEvaluated.push(evaluation);
+ criteriaCodes.splice(criteriaCodes.indexOf(evaluation.criteria), 1);
+ }
+ }
+
+ // Generate object for earch untouched criteria
+ let untouchedCriteriaObjList = [];
+ if (criteriaCodes.length) {
+ for (let criterion of criteriaCodes) {
+ untouchedCriteriaObjList.push({
+ criteria: criterion
+ });
+ }
+ }
+ // merge not-evaluated and untouched together
+ evaluationNotEvaluated = evaluationNotEvaluated.concat(untouchedCriteriaObjList);
+
+ let sortedMetList = [];
+ let sortedNotMetList = [];
+ let sortedNotEvaluatedList = [];
+
+ // sort Met
+ if (evaluationMet.length) {
+ // setup count strength values
+ const MODIFIER_VS = 'very-strong';
+ const MODIFIER_SA = 'stand-alone';
+ const MODIFIER_S = 'strong';
+ const MODIFIER_M = 'moderate';
+ const MODIFIER_P = 'supporting';
+
+ // temp storage
+ let vs_sa_level = [];
+ let strong_level = [];
+ let moderate_level = [];
+ let supporting_level = [];
+
+ for (let evaluation of evaluationMet) {
+ let modified = evaluation.criteriaModifier ? evaluation.criteriaModifier : null;
+ if (modified) {
+ if (modified === MODIFIER_VS || modified === MODIFIER_SA) {
+ vs_sa_level.push(evaluation);
+ } else if (modified === MODIFIER_S) {
+ strong_level.push(evaluation);
+ } else if (modified === MODIFIER_M) {
+ moderate_level.push(evaluation);
+ } else if (modified === MODIFIER_P) {
+ supporting_level.push(evaluation);
+ }
+ } else {
+ if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
+ vs_sa_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'S') {
+ strong_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'M') {
+ moderate_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'P') {
+ supporting_level.push(evaluation);
+ }
+ }
+ }
+
+ if (vs_sa_level.length) {
+ sortedMetList = sortedMetList .concat(vs_sa_level);
+ }
+ if (strong_level.length) {
+ sortedMetList = sortedMetList.concat(strong_level);
+ }
+ if (moderate_level.length) {
+ sortedMetList = sortedMetList.concat(moderate_level);
+ }
+ if (supporting_level.length) {
+ sortedMetList = sortedMetList.concat(supporting_level);
+ }
+ }
+
+ // sort Not-Met
+ if (evaluationNotMet.length) {
+ // temp storage
+ let vs_sa_level = [];
+ let strong_level = [];
+ let moderate_level = [];
+ let supporting_level = [];
+
+ for (let evaluation of evaluationNotMet) {
+ if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
+ vs_sa_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'S') {
+ strong_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'M') {
+ moderate_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'P') {
+ supporting_level.push(evaluation);
+ }
+ }
+
+ if (vs_sa_level.length) {
+ sortedNotMetList = sortedNotMetList .concat(vs_sa_level);
+ }
+ if (strong_level.length) {
+ sortedNotMetList = sortedNotMetList.concat(strong_level);
+ }
+ if (moderate_level.length) {
+ sortedNotMetList = sortedNotMetList.concat(moderate_level);
+ }
+ if (supporting_level.length) {
+ sortedNotMetList = sortedNotMetList.concat(supporting_level);
+ }
+ }
+
+ //sort Not-Evaluated and untouched
+ if (evaluationNotEvaluated.length) {
+ // temp storage
+ let vs_sa_level = [];
+ let strong_level = [];
+ let moderate_level = [];
+ let supporting_level = [];
+
+ for (let evaluation of evaluationNotEvaluated) {
+ if (evaluation.criteria === 'PVS1' || evaluation.criteria === 'BA1') {
+ vs_sa_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'S') {
+ strong_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'M') {
+ moderate_level.push(evaluation);
+ } else if (evaluation.criteria[1] === 'P') {
+ supporting_level.push(evaluation);
+ }
+ }
+
+ if (vs_sa_level.length) {
+ sortedNotEvaluatedList = sortedNotEvaluatedList .concat(vs_sa_level);
+ }
+ if (strong_level.length) {
+ sortedNotEvaluatedList = sortedNotEvaluatedList.concat(strong_level);
+ }
+ if (moderate_level.length) {
+ sortedNotEvaluatedList = sortedNotEvaluatedList.concat(moderate_level);
+ }
+ if (supporting_level.length) {
+ sortedNotEvaluatedList = sortedNotEvaluatedList.concat(supporting_level);
+ }
+ }
+
+ return ({
+ met: sortedMetList,
+ not_met: sortedNotMetList,
+ not_evaluated: sortedNotEvaluatedList
+ });
+}