Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Consider pruning console.log's #44

Open
douglascalhoun opened this issue Apr 24, 2014 · 0 comments
Open

Consider pruning console.log's #44

douglascalhoun opened this issue Apr 24, 2014 · 0 comments

Comments

@douglascalhoun
Copy link

Some might be for error logging, but many seem crufty...

Searching 466 files for "console.log"

/Users/doug/Desktop/JNC8/README.md:
   45  - In order to ensure that our D3 visualizations were compatible, we used a build of D3 called R2D3. The downside of R2D3 is that it has more limited features than D3. We also weren't able to use powerful D3 libraries like C3. So it takes a bit longer to do visualizations in IE8 than it would in other browsers. 
   46  
   47: - IE8 doesn't include console.log or .indexOf, and requires some special configuration of AngularJS to ensure compatibility.
   48  
   49  

/Users/doug/Desktop/JNC8/route-handler.js:
   40      // send res.redirect to '/new with information'
   41      if(req.query.uid) {
   42:       console.log(req.query.uid);
   43        res.redirect('/app/#/returning?uid='+req.query.uid);
   44      } else {
   45:       console.log("Serving a vanilla GET to '/'")
   46        res.redirect('/app');
   47      }
   ..
   49  
   50    app.get('/db/returning', function(req, res) {
   51:     console.log('get db/returning');
   52      var query = db.makeUserQuery(req.query.uid);
   53:     console.log('db returning query', query);
   54      db.queryHelper(query, function(err, rows) {
   55        if(err) {
   ..
   63    //The SQL database stores any information that must be persisted but cannot be written back to the EMR
   64    app.get('/db/encounters',  function(req, res){
   65:     console.log('get db/encounters');
   66      var ptId = req.query.ptId;
   67      var orgIdString;
   ..
  107    // standalone users and moxe users at the end of a patient encounter 
  108    app.post('/db/encounters', function(req, res){
  109:     console.log('post db/encounters');
  110  
  111      //convert each target into a string that can be inserted into the database 
  ...
  129        //emailHashString is the same as emailHash, but not stringified
  130        var emailHashString = encrypt.makeEmailHash(ptId);
  131:       console.log('typeof emailHashString', typeof emailHashString);
  132      } else {
  133        var emailHashString = undefined;
  ...
  139      }
  140  
  141:     console.log('emailHash after encrypt', emailHash);
  142:     console.log('ptId', ptId);
  143:     console.log('orgId', orgId);
  144      var query = 'INSERT INTO dbo.encounters (ptId, orgId, emails, emailHash, encounterDate, curBP, curTargetBP, curMeds, age, race, hasCKD, hasDiabetes) VALUES (' + ptId + ',' + orgId + ',' + emails + ',' + emailHash + ',' + encounterDate + ',' + curBP + ',' + curTargetBP +',' + curMeds +',' + age + ',' + race +',' + hasCKD +',' + hasDiabetes +')';
  145  
  146:     console.log('query', query);
  147  
  148      //get user email in format that can be used in smtp request made
  ...
  151      // var returnLink = "http://jnc8app.azurewebsites.net?uid=" + emailHashString;
  152      var returnLink = "http://localhost:8000?uid=" + emailHashString;
  153:     console.log('emailHash', emailHash)
  154      db.queryHelper(query, function(err, data){
  155        if(err) {
  156:         console.log(err);
  157          res.send(err);
  158        } else {

/Users/doug/Desktop/JNC8/server.js:
   10  app.listen(port);
   11  
   12: console.log('Server now listening on port ' + port);
   13  

/Users/doug/Desktop/JNC8/app/bower_components/aight/examples/d3.html:
  167        var bg = d3.select("#bg-color")
  168          .style("background-color", "red");
  169:       console.log("red?", bg.style("background-color"));
  170  
  171        bg = d3.select("#bg-position")
  172          .style("background-position", "bottom right");
  173:       console.log("bottom right?", bg.style("background-position"));
  174  
  175        bg = d3.select("#bg-image")
  176          .style("background-position", "bottom left")
  177          .style("background-image", "url(http://www.imagemagick.org/Usage/formats/a.png)");
  178:       console.log("bottom left?", bg.style("background-position"));
  179:       console.log("a.png?", bg.style("background-image"));
  180  
  181      })();

/Users/doug/Desktop/JNC8/app/bower_components/angular/angular.js:
 4271   * @param {object} document jQuery wrapped document.
 4272   * @param {function()} XHR XMLHttpRequest constructor.
 4273:  * @param {object} $log console.log or an object with the same interface.
 4274   * @param {object} $sniffer $sniffer service
 4275   */
 ....
 5407   * function linkingFn(scope, elm, attrs, ctrl) {
 5408   *   // get the attribute value
 5409:  *   console.log(attrs.ngModel);
 5410   *
 5411   *   // change the attribute
 ....
 5414   *   // observe changes to interpolated attribute
 5415   *   attrs.$observe('ngModel', function(value) {
 5416:  *     console.log('ngModel has changed value to ' + value);
 5417   *   });
 5418   * }
 ....
 9761      function consoleLog(type) {
 9762        var console = $window.console || {},
 9763:           logFn = console[type] || console.log || noop,
 9764            hasApply = false;
 9765  
 9766        // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.
 9767:       // The reason behind this is that console.log has type "object" in IE8...
 9768        try {
 9769          hasApply = !!logFn.apply;
 ....
 9781  
 9782        // we are IE which either doesn't have window.console => this is noop and we do nothing,
 9783:       // or we are IE where console.log doesn't have apply so we log at least first 2 args
 9784        return function(arg1, arg2) {
 9785          logFn(arg1, arg2 == null ? '' : arg2);
 ....
 21446    if (window.angular.bootstrap) {
 21447      //AngularJS is already loaded, so we can return here...
 21448:     console.log('WARNING: Tried to load angular more than once.');
 21449      return;
 21450    }

/Users/doug/Desktop/JNC8/app/bower_components/angular/angular.min.js:
  207  c[u],w(e,d)==h){k=q(e,d);break}}else d[m]=c[h],n&&(d[n]=h),k=q(e,d);1<x[0].length&&x[0][1].id!==h&&(x[0][1].selected=!1)}g.$setViewValue(k)})});g.$render=h;e.$watch(h)}if(l[1]){var p=l[0];l=l[1];var r=h.multiple,t=h.ngOptions,u=!1,w,v=y(U.createElement("option")),C=y(U.createElement("optgroup")),A=v.clone();h=0;for(var x=f.children(),D=x.length;h<D;h++)if(""===x[h].value){w=u=x.eq(h);break}p.init(l,u,A);r&&(l.$isEmpty=function(a){return!a||0===a.length});t?n(e,f,l):r?m(e,f,l):k(e,f,l,p)}}}}],hd=["$interpolate",
  208  function(a){var c={addOption:C,removeOption:C};return{restrict:"E",priority:100,compile:function(d,e){if(E(e.value)){var g=a(d.text(),!0);g||e.$set("value",d.text())}return function(a,d,e){var k=d.parent(),m=k.data("$selectController")||k.parent().data("$selectController");m&&m.databound?d.prop("selected",!1):m=c;g?a.$watch(g,function(a,c){e.$set("value",a);a!==c&&m.removeOption(c);m.addOption(a)}):m.addOption(e.value);d.on("$destroy",function(){m.removeOption(e.value)})}}}}],gd=aa({restrict:"E",
  209: terminal:!0});O.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((Ga=O.jQuery)?(y=Ga,D(Ga.fn,{scope:Ja.scope,isolateScope:Ja.isolateScope,controller:Ja.controller,injector:Ja.injector,inheritedData:Ja.inheritedData}),Ab("remove",!0,!0,!1),Ab("empty",!1,!1,!1),Ab("html",!1,!1,!0)):y=N,Ea.element=y,Zc(Ea),y(U).ready(function(){Wc(U,$b)}))})(window,document);!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}</style>');
  210  //# sourceMappingURL=angular.min.js.map
  211  

/Users/doug/Desktop/JNC8/app/bower_components/jquery/jquery-migrate.js:
   18  
   19  // Show a message on the console so devs know we're active
   20: if ( !jQuery.migrateMute && window.console && console.log ) {
   21:  console.log("JQMIGRATE: Logging is active");
   22  }
   23  

/Users/doug/Desktop/JNC8/app/bower_components/jquery/jquery-migrate.min.js:
    1  /*! jQuery Migrate v1.1.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
    2: jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){o[n]||(o[n]=!0,e.migrateWarnings.push(n),t.console&&console.warn&&!e.migrateMute&&(console.warn("JQMIGRATE: "+n),e.migrateTrace&&console.trace&&console.trace()))}function a(t,a,o,i){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(i),o},set:function(e){r(i),o=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=o}var o={};e.migrateWarnings=[],!e.migrateMute&&t.console&&console.log&&console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){o={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var i=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",i||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,o,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(i?a in i:e.isFunction(e.fn[a])))?e(t)[a](o):("type"===a&&o!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,o=e.prop(t,r);return o===!0||"boolean"!=typeof o&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,o))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^(?:[^<]*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;e.fn.init=function(t,n,a){var o;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(o=y.exec(t))&&o[1]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(e.trim(t),n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,o,i=this[0];return!i||"events"!==t||1!==arguments.length||(a=e.data(i,t),o=e._data(i,t),a!==n&&a!==o||o===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),o)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,o,i){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),o)for(c=function(e){return!e.type||j.test(e.type)?i?i.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(o.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,C=e.fn.live,S=e.fn.die,T="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",M=RegExp("\\b(?:"+T+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,o){e!==document&&M.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,o)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,o=t.guid||e.guid++,i=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%i;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=o;a.length>i;)a[i++].guid=o;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),C?C.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),S?S.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||M.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(T.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
    3  //@ sourceMappingURL=dist/jquery-migrate.min.map

/Users/doug/Desktop/JNC8/app/bower_components/jquery/build/release-notes.js:
   38               if ( !cur || cur !== cat ) {
   39                   if ( cur ) {
   40:                      console.log("</ul>");
   41                   }
   42                   cur = cat;
   43:                  console.log( "<h3>" + cat.charAt(0).toUpperCase() + cat.slice(1) + "</h3>" );
   44:                  console.log("<ul>");
   45               }
   46  
   47:              console.log(
   48                   "  <li><a href=\"http://bugs.jquery.com/ticket/" + match[1] + "\">#" +
   49                   match[1] + ": " + match[2] + "</a></li>"
   ..
   52       }
   53       if ( cur ) {
   54:          console.log("</ul>");
   55       }
   56  

/Users/doug/Desktop/JNC8/app/bower_components/jquery/build/release.js:
  101   pkg = JSON.parse( fs.readFileSync( "package.json" ) );
  102  
  103:  console.log( "Current version is " + pkg.version + "; generating release " + releaseVersion );
  104   version = pkg.version.match( rsemver );
  105   oldver = ( +version[1] ) * 10000 + ( +version[2] * 100 ) + ( +version[3] )
  ...
  141           die( error + stderr );
  142       }
  143:      console.log( stdout );
  144       next();
  145   }, false );
  ...
  229  
  230  function updatePackageVersion( ver ) {
  231:  console.log( "Updating package.json version to " + ver );
  232   pkg.version = ver;
  233   if ( !debug ) {
  ...
  238  function makeArchive( cdn, files, fn ) {
  239   if ( isBeta ) {
  240:      console.log( "Skipping archive creation for " + cdn + "; " + releaseVersion + " is beta" );
  241       process.nextTick( fn );
  242       return;
  243   }
  244  
  245:  console.log( "Creating production archive for " + cdn );
  246  
  247   var archive = archiver( "zip" ),
  ...
  273  
  274  function copy( oldFile, newFile, skip ) {
  275:  console.log( "Copying " + oldFile + " to " + newFile );
  276   if ( !skip ) {
  277       fs.writeFileSync( newFile, fs.readFileSync( oldFile, "utf8" ) );
  ...
  285  function exec( cmd, args, fn, skip ) {
  286   if ( skip ) {
  287:      console.log( "# " + cmd + " " + args.join(" ") );
  288       fn( "", "", "" );
  289   } else {
  290:      console.log( cmd + " " + args.join(" ") );
  291       child.execFile( cmd, args, { env: process.env },
  292           function( err, stdout, stderr ) {
  ...
  307  function dieIfReal( msg ) {
  308   if ( debug ) {
  309:      console.log ( "DIE: " + msg );
  310   } else {
  311       die( msg );

/Users/doug/Desktop/JNC8/app/bower_components/jquery/test/networkerror.html:
   22           url: '/',
   23           error: function() {
   24:              console.log( "abort", arguments );
   25           }
   26       }).abort();
   ..
   28           url: '/',
   29           error: function() {
   30:              console.log( "complete", arguments );
   31           }
   32       });

/Users/doug/Desktop/JNC8/app/bower_components/jquery/test/unit/ajax.js:
 1352           success = true;
 1353       } catch ( e ) {
 1354:          console.log( e );
 1355       }
 1356       ok( success, "context with circular reference did not generate an exception" );

/Users/doug/Desktop/JNC8/app/js/app.js:
   13  
   14  .config(['$routeProvider', function($routeProvider) {
   15:   console.log('config called');
   16  
   17    $routeProvider.when('/moxe', {
   ..
   20        setUpApp: function(startup){
   21          // setUpApp isn't passed into the controller because the pt factory is updated with side effects
   22:         console.log("setUpApp");
   23          return startup.initializeMoxe();
   24        }
   ..
   33          // setUpApp variable isn't passed into the dataEntry controller because the pt model properties are
   34          // defined by side effects of startup.initializeReturning
   35:         console.log("Set up app for returning user.");
   36          return startup.initializeReturning();
   37        }

/Users/doug/Desktop/JNC8/app/js/controllers.js:
  106      }
  107      db.addEncounter(pt.ids, encounter, function(data){
  108:       console.log(data);
  109      }); 
  110      $scope.saveToDBCalled = true;

/Users/doug/Desktop/JNC8/app/js/directives.js:
   90              scope.goodRxErr = true;
   91            }
   92:           console.log("Error status: " + scope.err);
   93          });
   94        }
   ..
  110          //todo - refactor renderGraph so that pt arrays (bps, targetBPs, encounterDates) are used for graph data instead of 'data'
  111          var data = graphHelpers.parseBPData(pt);
  112:         console.log('data', data)
  113  
  114          var margins = [30, 30, 30, 40];
  ...
  117          var timeScale = graphHelpers.getTimeScale(data[0].encounterDate, data[data.length-1].encounterDate);
  118  
  119:          console.log('timeScale', timeScale);
  120  
  121          var x = d3.time.scale()
  ...
  250            if(!pt.targetBPs) {
  251              algorithm.methods.runAlgorithm(pt);
  252:             console.log(pt);
  253            }
  254          $timeout(function() {
  255:           console.log('running the timeout');
  256            scope.$watch('targetSys', function(newVal, oldVal) {
  257:             // console.log('targetSys changed.');
  258              renderGraph(scope);
  259              graphHelpers.removeFirstGraphChild();

/Users/doug/Desktop/JNC8/app/js/services.js:
   13        ptIdentifier.orgId = $rootScope.orgId;
   14  
   15:       console.log('initializeMoxe called');
   16        var sid = $location.$$search.sid;
   17        return $http({
   ..
   28            ptData.substrate = response[0];
   29            ptData.db = response[1];
   30:           console.log('substrate', ptData.substrate);
   31:           console.log('db', ptData.db);
   32          });
   33        });
   ..
   41        ptIdentifier.ptId = null;
   42  
   43:       console.log('initializeReturning called');
   44        
   45        var result = $q["all"]([db.getUserByHash(uid)]);
   ..
   47        return result.then(function(response) {
   48          $rootScope.showSplash = false;
   49:         console.log(response);
   50          ptData.db = response[0];
   51:         console.log('db', ptData.db);
   52        });
   53      };
   ..
   96      var addEncounter = function(ptIdentifier, encounter, callback) {
   97  
   98:       console.log('addEncounter called');
   99:       console.log('ptEncounter', encounter);
  100:       console.log('ptIdentifier', ptIdentifier);
  101        return $http({
  102          url: '/db/encounters',
  ...
  113        })
  114        .error(function(data, status, headers, config) {
  115:         console.log('error data', data);
  116        });
  117      };
  ...
  134  
  135      var getPatientData = function(patientId, callback){
  136:       console.log('into getPatientData');
  137  
  138        var result = $q["all"]({
  ...
  156  
  157      var getSubstrateData = function(type, patientId, justCurrentMeds){
  158:       console.log('getting ' + type + ' data');
  159  
  160      //medications and problems endpoints have slightly different request format
  ...
  405  
  406        for(var i = 0; i < props.length; i++){
  407:         console.log('check', props[i], props[i] === undefined);
  408          if(props[i] === undefined){
  409            return false;
  ...
  436      //get data from moxe user 
  437      if(startup.ptData.substrate){
  438:       console.log('substrate data');
  439        var substrateData = startup.ptData.substrate;
  440        var problems = substrateHelpers.getProblems(substrateData.problems);
  ...
  464      //get data from current user of standalone app, or moxe user 
  465      if(startup.ptData.db && startup.ptData.db.length){
  466:       console.log('Theoretical dbData: ', startup.ptData.db);
  467        var dbData = startup.ptData.db;
  468  
  ...
  498      }else{
  499        //app does not allow user to enter encounter date
  500:       console.log('first time user');
  501        pt.encounterDates = [new Date()];
  502        pt.curDate = pt.encounterDates[pt.encounterDates.length - 1];
  ...
  567  
  568      var getTimeScale = function(dateOne, dateTwo) {
  569:       console.log('dateOne', dateOne);
  570:       console.log('dateTwo', dateTwo)
  571        if(dateOne instanceof Date && dateTwo instanceof Date) {
  572          var dayLengthMs = 86400000;

/Users/doug/Desktop/JNC8/app/lib/algorithm_jnc8.js:
   54  
   55    runAlgorithm: function(pt){
   56:     console.log('pt', pt);
   57      var algoResults = {};
   58      pt.curTargetBP = algorithm.methods.generateTarget(pt);
   ..
   62      algoResults.recs = algorithm.methods.generateRecs(pt);
   63  
   64:     console.log('algoResults', algoResults);
   65      return algoResults; 
   66    },
   ..
   76          // set curTargetBP by age and diabetes/CKD logic
   77          if(!pt.hasDiabetes && !pt.hasCKD && pt.age >= 60) {
   78:           console.log('curTargetBP for people >60 with no diabetes or CKD');
   79            return {
   80              systolic: 150,
   ..
   82            };
   83          }else{
   84:           console.log('other curTargetBP');
   85            return {
   86              systolic: 140,
   ..
  100  
  101      pt.curTargetBP = pt.curTargetBP;
  102:     console.log('curTarget', pt.curTargetBP);
  103  
  104      var filterDrugs = function(curMeds){
  ...
  110  
  111      var drugsatMax = function(curMeds){
  112:       console.log('curMeds');
  113        return _.every(curMeds, function(med){
  114          return med.atMax;
  ...
  185      for (var i = 0; i < curMeds.length; i++) {
  186        if(curMeds[i].className === 'ACEI' || curMeds[i].className === 'ARB'){
  187:         console.log('acei false');
  188          possibleNextMeds.ACEI = false;
  189          possibleNextMeds.ARB = false;
  190        }
  191        if(curMeds[i].className === 'CCB'){
  192:         console.log('ccb false');
  193          possibleNextMeds.CCB = false;
  194        }
  195        if(curMeds[i].className === 'Thiazide'){
  196:         console.log('thiazide false');
  197          possibleNextMeds.Thiazide = false;
  198        }
  199      }
  200:     console.log('possible', possibleNextMeds)
  201  
  202      for(var med in possibleNextMeds){

/Users/doug/Desktop/JNC8/bower_components/aight/examples/d3.html:
  167        var bg = d3.select("#bg-color")
  168          .style("background-color", "red");
  169:       console.log("red?", bg.style("background-color"));
  170  
  171        bg = d3.select("#bg-position")
  172          .style("background-position", "bottom right");
  173:       console.log("bottom right?", bg.style("background-position"));
  174  
  175        bg = d3.select("#bg-image")
  176          .style("background-position", "bottom left")
  177          .style("background-image", "url(http://www.imagemagick.org/Usage/formats/a.png)");
  178:       console.log("bottom left?", bg.style("background-position"));
  179:       console.log("a.png?", bg.style("background-image"));
  180  
  181      })();

/Users/doug/Desktop/JNC8/bower_components/angular/angular.js:
 4268   * @param {object} document jQuery wrapped document.
 4269   * @param {function()} XHR XMLHttpRequest constructor.
 4270:  * @param {object} $log console.log or an object with the same interface.
 4271   * @param {object} $sniffer $sniffer service
 4272   */
 ....
 5404   * function linkingFn(scope, elm, attrs, ctrl) {
 5405   *   // get the attribute value
 5406:  *   console.log(attrs.ngModel);
 5407   *
 5408   *   // change the attribute
 ....
 5411   *   // observe changes to interpolated attribute
 5412   *   attrs.$observe('ngModel', function(value) {
 5413:  *     console.log('ngModel has changed value to ' + value);
 5414   *   });
 5415   * }
 ....
 9840      function consoleLog(type) {
 9841        var console = $window.console || {},
 9842:           logFn = console[type] || console.log || noop,
 9843            hasApply = false;
 9844  
 9845        // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.
 9846:       // The reason behind this is that console.log has type "object" in IE8...
 9847        try {
 9848          hasApply = !!logFn.apply;
 ....
 9860  
 9861        // we are IE which either doesn't have window.console => this is noop and we do nothing,
 9862:       // or we are IE where console.log doesn't have apply so we log at least first 2 args
 9863        return function(arg1, arg2) {
 9864          logFn(arg1, arg2 == null ? '' : arg2);
 ....
 21548    if (window.angular.bootstrap) {
 21549      //AngularJS is already loaded, so we can return here...
 21550:     console.log('WARNING: Tried to load angular more than once.');
 21551      return;
 21552    }

/Users/doug/Desktop/JNC8/bower_components/angular/angular.min.js:
  209  c[v],w(e,d)==h){k=q(e,d);break}}else d[m]=c[h],n&&(d[n]=h),k=q(e,d);1<x[0].length&&x[0][1].id!==h&&(x[0][1].selected=!1)}g.$setViewValue(k)})});g.$render=k;e.$watch(k)}if(m[1]){var p=m[0];m=m[1];var r=k.multiple,u=k.ngOptions,D=!1,x,t=y(U.createElement("option")),C=y(U.createElement("optgroup")),w=t.clone();k=0;for(var v=f.children(),E=v.length;k<E;k++)if(""===v[k].value){x=D=v.eq(k);break}p.init(m,D,w);r&&(m.$isEmpty=function(a){return!a||0===a.length});u?n(e,f,m):r?l(e,f,m):h(e,f,m,p)}}}}],hd=["$interpolate",
  210  function(a){var c={addOption:w,removeOption:w};return{restrict:"E",priority:100,compile:function(d,e){if(F(e.value)){var g=a(d.text(),!0);g||e.$set("value",d.text())}return function(a,d,e){var h=d.parent(),l=h.data("$selectController")||h.parent().data("$selectController");l&&l.databound?d.prop("selected",!1):l=c;g?a.$watch(g,function(a,c){e.$set("value",a);a!==c&&l.removeOption(c);l.addOption(a)}):l.addOption(e.value);d.on("$destroy",function(){l.removeOption(e.value)})}}}}],gd=aa({restrict:"E",
  211: terminal:!0});O.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((Fa=O.jQuery)?(y=Fa,E(Fa.fn,{scope:Ia.scope,isolateScope:Ia.isolateScope,controller:Ia.controller,injector:Ia.injector,inheritedData:Ia.inheritedData}),Db("remove",!0,!0,!1),Db("empty",!1,!1,!1),Db("html",!1,!1,!0)):y=M,Qa.element=y,Zc(Qa),y(U).ready(function(){Wc(U,cc)}))})(window,document);!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}</style>');
  212  //# sourceMappingURL=angular.min.js.map
  213  

/Users/doug/Desktop/JNC8/server/controllers/db-helpers.js:
   42             var request = new Request(query, function(err, rowCount, rows) {
   43               if (err) {
   44:                console.log('Request error: ' + err);
   45                 callback(err);
   46               } else {
   47:                console.log('Successful request. Returning ' + rowCount + ' rows...');
   48:                console.log(rows);
   49                   rows = parseData(rows);
   50                 callback(err, rows);
   ..
   54           connection.execSql(request);
   55       } else {
   56:          console.log(err);
   57       }
   58   });

/Users/doug/Desktop/JNC8/server/routes/route-handler.js:
   30  
   31    app.get('/db/returning', function(req, res) {
   32:     console.log('get db/returning');
   33      var query = dbHelp.makeUserQuery(req.query.uid);
   34:     console.log('db returning query', query);
   35      dbHelp.queryHelper(query, function(err, rows) {
   36        if(err) {
   ..
   78    // standalone users and moxe users at the end of a patient encounter 
   79    app.post('/db/encounters', function(req, res){
   80:     console.log('post db/encounters');
   81      // there must be a better way to do this... pulling data from the req object and normalizing it
   82      var stringifyParams = function(params) {
   ..
   99        //emailHashString is the same as emailHash, but not stringified
  100        var emailHashString = encrypt.makeEmailHash(ptId);
  101:       console.log('typeof emailHashString', typeof emailHashString);
  102      } else {
  103        var emailHashString = undefined;
  ...
  109      }
  110  
  111:     console.log('emailHash after encrypt', emailHash);
  112:     console.log('ptId', ptId);
  113:     console.log('orgId', orgId);
  114      var query = 'INSERT INTO dbo.encounters (ptId, orgId, emails, emailHash, encounterDate, curBP, curTargetBP, curMeds, age, race, hasCKD, hasDiabetes) VALUES (' + ptId + ',' + orgId + ',' + emails + ',' + emailHash + ',' + encounterDate + ',' + curBP + ',' + curTargetBP +',' + curMeds +',' + age + ',' + race +',' + hasCKD +',' + hasDiabetes +')';
  115  
  116:     console.log('query', query);
  117  
  118      var messageRecipient = req.body.encounter.emails[0];
  119:     console.log('Sending an email to ' + messageRecipient);
  120      email.sendNewUserMail(messageRecipient, emailHashString);
  121  
  ...
  123      dbHelp.queryHelper(query, function(err, data){
  124        if(err) {
  125:         console.log(err);
  126          res.send("There was an error:" + err);
  127        } else {

/Users/doug/Desktop/JNC8/server/util/email.js:
   13       });
   14  
   15:  console.log('SMTP Configured');
   16  
   17   // Message object
   ..
   24   };
   25  
   26:  console.log('Sending Mail');
   27   transport.sendMail(message, function(error){
   28       if(error){
   29:          console.log('Error occured');
   30:          console.log(error.message);
   31           return;
   32       }
   33:      console.log('Message sent successfully!');
   34  
   35       // if you don't want to use this transport object anymore, uncomment following line

/Users/doug/Desktop/JNC8/server/util/encrypt.js:
   25  
   26  exports.signUrl = function(queryString, secret) {
   27:  console.log(route);
   28    var hmac = crypto.createHmac('sha256', api.goodRx.secret);
   29    hmac.update(queryString);
   ..
   38   hash.update(salt);
   39   var safeHash = makeUrlSafe(hash.digest('base64'));
   40:  console.log(safeHash);
   41   return safeHash;
   42  };

/Users/doug/Desktop/JNC8/server/util/saml.js:
   11  exports.getClaimsDetails = function(err, profile) {
   12   if(err) {
   13:      console.log('SAML parse error in getClaimsDetails: ', err);
   14   } else {
   15       var claimsDetails = {}

/Users/doug/Desktop/JNC8/test/unit/algorithm_jnc8_spec.js:
  259  
  260      var algoGeneratedRecs = algorithm.methods.generateRecs(pt);
  261:     console.log(algoGeneratedRecs);
  262  
  263      expect(algoGeneratedRecs.recMsg).toEqual(algorithm.opts.recMessages.allFollowUpVisits + " " + algorithm.opts.recMessages.referralVisit);

/Users/doug/Desktop/JNC8/utility/email.js:
   28   smtpTransport.sendMail(emailOptions, function(error, response) {
   29       if(error) {
   30:          console.log(error);
   31       } else {
   32:          console.log('Message sent: ' + response.message);
   33       }
   34       smtpTransport.close();

/Users/doug/Desktop/JNC8/utility/encrypt.js:
   25  
   26  exports.signUrl = function(queryString, secret) {
   27:  console.log(route);
   28    var hmac = crypto.createHmac('sha256', api.goodRx.secret);
   29    hmac.update(queryString);
   ..
   38   hash.update(salt);
   39   var safeHash = makeUrlSafe(hash.digest('base64'));
   40:  console.log(safeHash);
   41   return safeHash;
   42  };

/Users/doug/Desktop/JNC8/utility/saml.js:
   11  exports.getClaimsDetails = function(err, profile) {
   12   if(err) {
   13:      console.log('SAML parse error in getClaimsDetails: ', err);
   14   } else {
   15       var claimsDetails = {}

126 matches across 29 files
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant