<commit_before>/**
 * Created by marcybautista on 9/19/15.
 */

'use strict';

var requestFactory = require('../node_modules/watson-developer-cloud/lib/requestwrapper');

var url = "https://api.infermedica.com/v1/"



function InferenfenceEngineAPI(){


}

module.exports = function getDiagnosis(params, callback){

    params = params || {};

    var parameters = {
        options: {
            url: url+'/diagnosis',
            method: 'POST',
            json: true,
            path: params,
            formData: params
        },
        requiredParams: ['app_id', 'app_key'],
        defaultOptions: this._options
    };
    return requestFactory(parameters, callback);

};

module.export = function getObservationBySymptoms(params,phrase,callback) {

    var parameters = {
        options: {
            url: url+'/lookup?phrase='+phrase,
            method: 'GET',
            json: true,
            path: params,
            qs: pick(params, ['client_id'])
        },
        requiredParams: ['app_id', 'app_key'],
        defaultOptions: this._options
    };
    return requestFactory(parameters, callback);
};


<commit_msg>New Conversation Rule for doctor and patient<commit_after>/**
 * Created by marcybautista on 9/19/15.
 */

'use strict';

var request= require('request');

var url = "https://api.infermedica.com/v1/"



function InferenceEngineAPI(){


}

InferenceEngineAPI.prototype.getDiagnosis = function (params,callback) {

    params = params || {};

    var parameters = {
        options: {
            url: 'https://api.infermedica.com/v1/diagnosis',
            method: 'POST',
            json: true,
            body: params.body,
            headers : {
                app_id: params.app_id,
                app_key: params.app_key
            }
        },
        requiredParams: ['app_id', 'app_key'],
        defaultOptions: this._options
    };

    return request(parameters.options,callback);
    //return requestFactory(parameters, callback);

};

InferenceEngineAPI.prototype.getObservation = function(params,phrase,callback){

    params = params || {};

    var parameters = {
        options: {
            url: 'https://api.infermedica.com/v1/lookup?phrase='+phrase,
            method: 'GET',
            json: true,
            headers : {
                app_id: params.app_id,
                app_key: params.app_key
            }
        },
        requiredParams: ['app_id', 'app_key'],
        defaultOptions: this._options
    };


    return request(parameters.options,callback);
}


module.exports = InferenceEngineAPI;
{'fraction_non_alphanumeric': 0.12790697674418605, 'fraction_numerical': 0.005426356589147287, 'mean_word_length': 2.1668711656441717, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '7538400', 'n_tokens_mistral': 768, 'n_tokens_neox': 730, 'n_words': 148}