);
}
@@ -1011,14 +1013,14 @@ function criteriaMissense1Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
-function criteriaMissense2() {
+function criteriaMissense2(unusedCriteria) {
let criteriaList1 = ['PM5'], // array of criteria code handled subgroup of this section
criteriaList2 = ['PS1']; // array of criteria code handled subgroup of this section
return (
);
}
@@ -1035,11 +1037,11 @@ function criteriaMissense2Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
-function criteriaLof1() {
+function criteriaLof1(unusedCriteria) {
let criteriaList1 = ['PVS1']; // array of criteria code handled subgroup of this section
return (
);
}
@@ -1056,11 +1058,11 @@ function criteriaLof1Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
-function criteriaSilentIntron1() {
+function criteriaSilentIntron1(unusedCriteria) {
let criteriaList1 = ['BP7']; // array of criteria code handled subgroup of this section
return (
);
}
@@ -1077,11 +1079,11 @@ function criteriaSilentIntron1Update(nextProps) {
/**
* Code for rendering of this group of interpretation forms
*/
-function criteriaIndel1() {
+function criteriaIndel1(unusedCriteria) {
let criteriaList1 = ['BP3', 'PM4']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -123,11 +124,11 @@ var criteriaGroup1Update = function(nextProps) {
// code for rendering of this group of interpretation forms
-var criteriaGroup2 = function() {
+var criteriaGroup2 = function(unusedCriteria) {
let criteriaList1 = ['BS3', 'PS3']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -248,11 +249,11 @@ var criteriaGroup1Update = function(nextProps) {
// code for rendering of this group of interpretation forms
-var criteriaGroup2 = function() {
+var criteriaGroup2 = function(unusedCriteria) {
let criteriaList1 = ['PS4']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -264,14 +265,14 @@ var criteriaGroup2Update = function(nextProps) {
// code for rendering of this group of interpretation forms
-var criteriaGroup3 = function() {
+var criteriaGroup3 = function(unusedCriteria) {
let criteriaList1 = ['BS4'], // array of criteria code handled subgroup of this section
criteriaList2 = ['PP1']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -283,14 +284,14 @@ var criteriaGroup3Update = function(nextProps) {
// code for rendering of this group of interpretation forms
-var criteriaGroup4 = function() {
+var criteriaGroup4 = function(unusedCriteria) {
let criteriaList1 = ['PM6'], // array of criteria code handled subgroup of this section
criteriaList2 = ['PS2']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -302,14 +303,14 @@ var criteriaGroup4Update = function(nextProps) {
// code for rendering of this group of interpretation forms
-var criteriaGroup5 = function() {
+var criteriaGroup5 = function(unusedCriteria) {
let criteriaList1 = ['BP2'], // array of criteria code handled subgroup of this section
criteriaList2 = ['PM3']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -321,11 +322,11 @@ var criteriaGroup5Update = function(nextProps) {
// code for rendering of this group of interpretation forms
-var criteriaGroup6 = function() {
+var criteriaGroup6 = function(unusedCriteria) {
let criteriaList1 = ['BP5']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -337,11 +338,11 @@ var criteriaGroup6Update = function(nextProps) {
// code for rendering of this group of interpretation forms
-var criteriaGroup7 = function() {
+var criteriaGroup7 = function(unusedCriteria) {
let criteriaList1 = ['PP4']; // array of criteria code handled subgroup of this section
return (
);
};
@@ -354,14 +355,14 @@ var criteriaGroup7Update = function(nextProps) {
/**
* Callback for rendering of this group of interpretation forms
- * Disabling form currently only applies to 'BP6' and 'PP5' if the gene is NEITHER BRCA1 or BRCA2
- * @param {boolean} disableEvalForm - The flag to disable criteria evaluation form
+ * Disabling form currently only applies to 'BP6' and 'PP5'
+ * @param {array} unusedCriteria - An array of criteria that are not active
*/
-var criteriaGroup8 = function(disableEvalForm) {
+var criteriaGroup8 = function(unusedCriteria) {
let criteriaList1 = ['BP6', 'PP5']; // array of criteria code handled subgroup of this section
return (
);
};
diff --git a/src/clincoded/static/components/variant_central/interpretation/shared/form.js b/src/clincoded/static/components/variant_central/interpretation/shared/form.js
index dded30cdf..65598bb9e 100644
--- a/src/clincoded/static/components/variant_central/interpretation/shared/form.js
+++ b/src/clincoded/static/components/variant_central/interpretation/shared/form.js
@@ -35,7 +35,7 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre
criteriaCrossCheck: PropTypes.array, // an array of arrays of criteria codes that are to be checked upon submitForm to make sure there are no more than one 'Met'
interpretation: PropTypes.object, // parent interpretation object
updateInterpretationObj: PropTypes.func, // function from index.js; this function will pass the updated interpretation object back to index.js
- disableEvalForm: PropTypes.bool, // TRUE to disable form elements of Segregation's 'Reputable source' section if the gene is NEITHER BRCA1 or BRCA2
+ unusedCriteria: PropTypes.array, // used to determine whether or not to disable the field
affiliation: PropTypes.object,
session: PropTypes.object,
criteriaEvalNote: PropTypes.func
@@ -158,12 +158,16 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre
// cross check criteria values here (no more than one met per cross-check group); for cross checking within the same form group
var criteriaEvalConflictValues = ['met', 'supporting', 'moderate', 'strong', 'stand-alone', 'very-strong'];
if (this.props.criteriaCrossCheck && this.props.criteriaCrossCheck.length > 0) {
+ // filter out disabled criteria
+ var criteriaCrossCheck = Array.isArray(this.props.unusedCriteria)
+ ? this.props.criteriaCrossCheck.filter(criterion => this.props.unusedCriteria.indexOf(criterion) === -1)
+ : this.props.criteriaCrossCheck;
var criteriaMetNum = 0,
criteriaConflicting = [],
errorMsgCriteria = '',
crossCheckGroup;
- for (var i = 0; i < this.props.criteriaCrossCheck.length; i++) {
- crossCheckGroup = this.props.criteriaCrossCheck[i];
+ for (var i = 0; i < criteriaCrossCheck.length; i++) {
+ crossCheckGroup = criteriaCrossCheck[i];
// reset criteria conflicting array and message when moving to next cross check group
criteriaMetNum = 0;
criteriaConflicting = [];
@@ -231,7 +235,9 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre
}
*/
// UNCOMMENT ABOVE + COMMENT LINE BELOW FOR DISEASE DEPENDENCY RESTRICTION
- submittedCriteria.push(criterion);
+ if (Array.isArray(this.props.unusedCriteria) && this.props.unusedCriteria.indexOf(criterion) === -1) {
+ submittedCriteria.push(criterion);
+ }
});
// do hard-coded check for PM2 vs PS4
// UNCOMMENT BELOW TO RE-ENABLE PM2 vs PS4 CHECK - SEE #1195
@@ -405,10 +411,11 @@ var CurationInterpretationForm = module.exports.CurationInterpretationForm = cre
},
render: function() {
+ const disableSubmit = Array.isArray(this.props.unusedCriteria) && Array.isArray(this.props.criteria) && this.props.criteria.every(criterion => this.props.unusedCriteria.indexOf(criterion) !== -1);
return (