Created
January 30, 2018 09:00
-
-
Save mdsahib/38d917d591b1a7fb1009c498ea4b90b3 to your computer and use it in GitHub Desktop.
Data generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var faker = require('faker'); | |
var needle = require('needle'); | |
var contentOptions = ["CORRECT","MISSING_MINIMAL_DETAILS", | |
"MISSING_CRITICAL_DETAILS","NOT_ADDRESSED" | |
]; | |
var skillOptions = ["NOT_ADDRESSED", "NEVER", "CONSISTENTLY", "INCONSISTENTLY" ]; | |
var complaintOptions = [ | |
"CORRECT", | |
"INCORRECT" | |
]; | |
var count = 0; | |
function createFeedback() { | |
var schema = { | |
"contentFeedback": { | |
"hpi": faker.helpers.randomize(contentOptions), | |
"pe": faker.helpers.randomize(contentOptions), | |
"ap": faker.helpers.randomize(contentOptions) | |
}, | |
"skillFeedback": { | |
"ableExtrapolate": faker.helpers.randomize(skillOptions), | |
"askSpecificQuestions": faker.helpers.randomize(skillOptions), | |
"completeNotes": faker.helpers.randomize(skillOptions), | |
"filterInformation": faker.helpers.randomize(skillOptions), | |
"infersInformation": faker.helpers.randomize(skillOptions), | |
"multitaskOrUserDowntime": faker.helpers.randomize(skillOptions), | |
"organizeNotes": faker.helpers.randomize(skillOptions), | |
"proofreads": faker.helpers.randomize(skillOptions), | |
"understandColloquialisms": faker.helpers.randomize(skillOptions), | |
"usesShorthand": faker.helpers.randomize(skillOptions), | |
"looksUpInformation": faker.helpers.randomize(skillOptions) | |
}, | |
"complaintFeedback": { | |
"chiefComplaint": faker.helpers.randomize(complaintOptions) | |
}, | |
"submittedAt": faker.random.number({ | |
min: 1, | |
max: 29 | |
}) + "-" + faker.helpers.randomize(["Jan", "Mar", "Feb"]) + "-" + faker.random.number({min: 2015, max: 2017}), | |
"generalFeedback": faker.lorem.paragraphs(), | |
"partnerName": faker.helpers.randomize(["Advensus", "Augmedix", "ContechBPO", "Decipher", "Elico"]), | |
"scribeUID": faker.helpers.randomize(["100111", "110172", "100116", "100156", "100153", "100118"]), | |
"graderUID": faker.helpers.randomize(["100111", "110172", "100116", "100156", "100153", "100118"]), | |
"providerUID": faker.helpers.randomize(["1001-1001", "1001-1002", "1001-1003", "1001-1004", "1001-1004"]), | |
"trainingWeek": faker.helpers.randomize(["Week 1", "Week 3", "Week 5", "Week 7", "Week 8", "Week 14"]), | |
}; | |
console.log(schema); | |
needle.post("https://test.augmedix.com/wfm/api/v1/scribefeedback/", schema, { | |
"headers": { | |
"Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiJhMDQ5MzgxNC05Y2QwLTQxM2UtYWJhYy00NGNhOWU3YzAwMTEiLCJzdWIiOiJiYWhhckBhdWdtZWRpeC5jb20iLCJ0eXBlIjoiU1VQRVJfQURNSU4iLCJpYXQiOjE1MTY5NTAzMTQsImV4cCI6MTUxNzAzNjcxNCwiaWQiOjF9.iKzrm5hR5V7oVU00CpfudW4CrMMw8fE3ZkbaiIMkR_XXNalWixdQyB35OB3dZJ4tddMSSo36nB-Yv9ammDlslw", | |
"Content-type": "application/json" | |
} | |
}, function (err, resp, body) { | |
if(count < 20000){ | |
count++; | |
createFeedback(); | |
console.log("Success" + count); | |
} | |
}) | |
} | |
createFeedback(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment