<commit_before>'use strict';

const Router = require('express').Router;
const rxnormIdHandler = require('../controller/rxnormidhandler');
const DrugSchema = require('../models/drugschema');
let drugRouter = Router();

drugRouter.post('/:drugname', (req, res, next) => {
  let interactions = rxnormIdHandler(req.params.drugname);
  console.log(interactions);
  let newDrug = new DrugSchema({'drug': req.params.drugname, 'interactions': interactions});
  newDrug.save((err, drugData) => {
    if (err) return next(err);
    res.json(drugData);
  });
});


module.exports = drugRouter;<commit_msg>added another note and debugger statement<commit_after>'use strict';

const Router = require('express').Router;
const rxnormIdHandler = require('../controller/rxnormidhandler');
const DrugSchema = require('../models/drugschema');
let drugRouter = Router();

drugRouter.post('/:drugname', (req, res, next) => {
  let interactions = rxnormIdHandler(req.params.drugname);
  //interactions is undefined here because of scope issues at the end of the interactionhandler file.
  debugger;
  console.log(interactions);
  let newDrug = new DrugSchema({'drug': req.params.drugname, 'interactions': interactions});
  newDrug.save((err, drugData) => {
    if (err) return next(err);
    res.json(drugData);
  });
});


module.exports = drugRouter;
{'fraction_non_alphanumeric': 0.15639097744360902, 'fraction_numerical': 0.0, 'mean_word_length': 5.308056872037914, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1597062', 'n_tokens_mistral': 415, 'n_tokens_neox': 397, 'n_words': 96}