Skip to content

Commit

Permalink
scaffold to determine procedure name and price per procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickbahson committed Dec 31, 2019
1 parent 84535c2 commit 36058e0
Show file tree
Hide file tree
Showing 56 changed files with 573 additions and 13,418 deletions.
1 change: 1 addition & 0 deletions nodejsModule/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea
/node_modules
/coverage

Expand Down
6 changes: 6 additions & 0 deletions nodejsModule/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 44 additions & 2 deletions nodejsModule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
const path = require('path')
const fs = require('fs')
let events = require('events')
const url = require('url')
const express = require('express')
const axios = require('axios')
Expand All @@ -12,6 +13,9 @@ const _ = require('lodash')
const cors = require('cors')
const app = express()


let eventEmitter = new events.EventEmitter()

//Database
const sequelize = require('./database/models').sequelize
const Institutions = require('./database/models').Institutions
Expand All @@ -37,6 +41,9 @@ const institutionsService = require('./services/institutionsService')
const fileFolderService = require('./services/fileFolderService')
const proceduresService = require('./services/proceduresService')

// character data match service
const InitDataMatch = require('./services/charMatch/InitDataMatch')


//---------------------------------------------------------------------------------------------------------
/**
Expand Down Expand Up @@ -69,7 +76,7 @@ async function testingConvert() {
* Serves as the homepage
*/
app.get('/', (req, res) => {
const CsvProcessor = require('./services/csvProcessor');
/*const CsvProcessor = require('./services/csvProcessor');
const $processor = new CsvProcessor();
//var $fullpath = $csvPath + '\\' + $filename+".csv";
var $fullpath = 'C:\\xampp\\htdocs\\HospitalPriceSpider\\rawCSVs\\BethesdaHospital_ChargeMaster_AU.csv';
Expand Down Expand Up @@ -109,8 +116,43 @@ app.get('/', (req, res) => {
}
else {
console.log("File not found");
}*/
res.send('Welcome to MedHack Hospital Price Spider.....');
})


// Loops through files (csv) in folders (named)
// identifying procedure name and price(s) values
// and posting that to the procedures table
// also sort files into folders with each type of
// algorithm used to identify each field for further
// cleaning the output
// if you want to contribute from here check __dirname,/services/charMatch folder


app.get('/api/match-field-data', async (req, res, next) => {

try {

let data = await InitDataMatch.initCharacterDataMatch()

if (data) res.send(data)

if (!data) res.send('+++++++Folder might be empty of csv files++++++')

/*console.log('++++++++++MOVING AGAIN what what+++++++++')
console.log('++++++++++MOVING AGAIN what what+++++++++')
console.log(data)
console.log('++++++++++MOVING AGAIN what what+++++++++')
console.log('++++++++++MOVING AGAIN what what+++++++++')*/
next()


} catch (e) {


res.send(e)
}
//res.send('Welcome to MedHack Hospital Price Spider.....');
})


Expand Down
Loading

0 comments on commit 36058e0

Please sign in to comment.