node-simple-normalizer
Node.js library that simplfies normalization of session data from importers into known targets.
Usage
import _ from 'lodash';
import Normalize from '@doc.ai/simple-normalizer';
const targets = Normalize({
// Importer ID which can be retrieved from the package.json name of the importer
"ai.doc.neuron.app.selfie" : {
// Target that can be fulfilled by this importer
// This specific example will extract the latest result
age: results => ({
id: _.get(results, '0.id'),
value: _.get(results, '0.result.age'),
service_source: _.get(results, '0.app'),
omics: _.get(results, '0.omics'),
updatedAt: _.get(results, '0.updatedAt'),
}),
},
"ai.doc.neuron.app.23andme": {
riskOfCancer: results => (GetPredictionOfRiskFromModelService(results)),
}
}, [{... result}])
Authors
- Kartik Thakore - Initial implementation
See also the list of contributors who participated in this project.