Skip to content

Commit

Permalink
Merge branch 'develop' into feat/DEVSU-2473-hide-sv-burden-by-default
Browse files Browse the repository at this point in the history
  • Loading branch information
kttkjl authored Nov 19, 2024
2 parents fcc5465 + 3e72a3d commit b10c22c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/libs/createReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ const createReportKbMatchSection = async (reportId, modelName, sectionContent, o
variantType: record.variantType,
variantId: record.variantId,
kbVariant: record.kbVariant,
kbVariantId: record.kbVariantId,
};

const statementCopy = {...record};
delete statementCopy.variantType;
delete statementCopy.variantId;
delete statementCopy.kbVariant;
delete statementCopy.kbVariantId;
statementData = [{...statementCopy}];
}

Expand Down
10 changes: 10 additions & 0 deletions app/models/reports/kbMatchJoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ module.exports = (sequelize, Sq) => {
},
},
},
indexes: [
{
name: 'idx_kb_match_id_join',
fields: ['kb_match_id'],
},
{
name: 'idx_kb_matched_statement_id_join',
fields: ['kb_matched_statement_id'],
},
],
},
);
};
4 changes: 4 additions & 0 deletions app/routes/variantText/variantText.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ router.route('/')
delete req.body.project;
delete req.body.template;

if (typeof req.body.cancerType === 'string') {
req.body.cancerType = [req.body.cancerType];
}

await validateAgainstSchema(createSchema, req.body);
} catch (error) {
const message = `Error while validating variant text create request ${error}`;
Expand Down
10 changes: 10 additions & 0 deletions migrations/20241112210700-DEVSU-2457-fix-id-sequence.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
up: async (queryInterface) => {
// eslint-disable-next-line max-len
queryInterface.sequelize.query('SELECT setval(\'reports_kb_matches_id_seq\', (SELECT MAX(id) FROM reports_kb_matches) + 1);');
},

down: async () => {
throw new Error('Not Implemented!');
},
};
14 changes: 14 additions & 0 deletions migrations/20241112211455-DEVSU-2483-add-kb-match-index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
up: async (queryInterface) => {
await queryInterface.addIndex('reports_kb_match_join', ['kb_match_id'], {
name: 'idx_kb_match_id_join',
});
await queryInterface.addIndex('reports_kb_match_join', ['kb_matched_statement_id'], {
name: 'idx_kb_matched_statement_id_join',
});
},

down: async () => {
throw new Error('Not Implemented!');
},
};
1 change: 1 addition & 0 deletions test/testData/mockReportData.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
"variantType": "exp",
"variant": "hash12345678",
"kbVariant": "protein increased expression",
"kbVariantId": "123321",
"category": "cancer predisposition",
"disease": "colorectal cancer",
"relevance": "unfavourable",
Expand Down

0 comments on commit b10c22c

Please sign in to comment.