Skip to content

Commit

Permalink
Remove comparators code
Browse files Browse the repository at this point in the history
  • Loading branch information
Brayden Pellegrini committed Nov 14, 2019
1 parent 06b3bea commit 989c03e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 1,713 deletions.
36 changes: 0 additions & 36 deletions app/modules/analysis/routing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ const db = require('../../../models');
const RoutingInterface = require('../../../routes/routingInterface');
const Analysis = require('../analysis.object');

const comparators = require('../../../../database/comparators.json');
const comparatorsV9 = require('../../../../database/comparators.v9.json');

const logger = require('../../../log');

const Patient = require('../../../libs/patient/patient.library');
Expand All @@ -28,8 +25,6 @@ class TrackingRouter extends RoutingInterface {
this.router.param('analysis', analysisMiddleware);
// Setup analysis endpoint
this.analysis();
// Comparators
this.comparators();
// Base Biopsy Endpoints
this.router.route('/')
.get(async (req, res) => {
Expand Down Expand Up @@ -195,37 +190,6 @@ class TrackingRouter extends RoutingInterface {
.delete((req, res) => {
return res.status(204).send();
});

this.router.get('/backfillComparators', async (req, res) => {
let analyses;
try {
analyses = await db.models.pog_analysis.scope('public').findAll({where: {analysis_biopsy: {[Op.ne]: null}}});
} catch (error) {
logger.error(`There was an error while finding all POG analyses ${error}`);
return res.status(500).json({message: 'There was an error while finding all POG analyses'});
}

logger.info(`Found ${analyses.length} entries`);

const updates = [];

try {
const result = await Promise.all(updates.map((update) => {
return db.models.pog_analysis.update(update.data, {where: {ident: update.analysis.ident}});
}));
return res.json(result);
} catch (error) {
logger.error(`Error while trying to backfill biopsy data ${error}`);
return res.status(500).json({message: `Failed to backfill biopsy data: ${error.message}`});
}
});
}

// Comparator Endpoints
comparators() {
this.router.get('/comparators', (req, res) => {
return res.json({v8: comparators, v9: comparatorsV9});
});
}
}

Expand Down
314 changes: 0 additions & 314 deletions database/comparators.json

This file was deleted.

Loading

0 comments on commit 989c03e

Please sign in to comment.