diff --git a/shrine-webclient/src/main/js/client/help/pdf/shrine-client-guide.pdf b/shrine-webclient/src/main/js/client/help/pdf/shrine-client-guide.pdf index 7372b4749..168a492a2 100644 Binary files a/shrine-webclient/src/main/js/client/help/pdf/shrine-client-guide.pdf and b/shrine-webclient/src/main/js/client/help/pdf/shrine-client-guide.pdf differ diff --git a/shrine-webclient/src/main/js/client/js-shrine/dist/app-build.js b/shrine-webclient/src/main/js/client/js-shrine/dist/app-build.js index 55af9d3a5..99c2c1e22 100644 --- a/shrine-webclient/src/main/js/client/js-shrine/dist/app-build.js +++ b/shrine-webclient/src/main/js/client/js-shrine/dist/app-build.js @@ -1,2 +1,2 @@ -"bundle";System.register("includes-polyfill.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("stringIncludesPolyfill",c=function(){String.prototype.includes||(String.prototype.includes=function(a,b){return"number"!=typeof b&&(b=0),!(b+a.length>this.length)&&this.indexOf(a,b)!==-1})}),a("stringIncludesPolyfill",c)}}}),System.register("main.js",["./includes-polyfill"],function(a,b){"use strict";function c(a){a.use.standardConfiguration().developmentLogging().feature("resources").feature("views"),a.start().then(d).then(function(){return a.setRoot("shell")})}var d;return a("configure",c),{setters:[function(a){d=a.stringIncludesPolyfill}],execute:function(){}}}),System.register("resources/converters/box-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("BoxStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return"transform: translate("+String(-100*a)+"%);"},a}()),a("BoxStyleValueConverter",d)}}}),System.register("resources/converters/count-value-converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("CountValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a<0?"10 patients or fewer":a+" +-10 patients"},a}()),a("CountValueConverter",d)}}}),System.register("resources/converters/datetime.value.converter.js",["moment"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[function(a){d=a["default"]}],execute:function(){a("DateTimeValueConverter",e=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return d(a).format("MM/DD/YYYY h:mm:ss a")},a}()),a("DateTimeValueConverter",e)}}}),System.register("resources/converters/result-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=this.isUnresolved(a)?"color:"+this.getColorValue(a):"";return b},a.prototype.isUnresolved=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FINISHED";return!a||a.status!==b},a.prototype.getColorValue=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ERROR",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#00FF00";return a&&a.status!==b?d:c},a}()),a("ResultStyleValueConverter",d)}}}),System.register("resources/converters/result-value.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a?"FINISHED"!==a.status?"":a.count<0?"<=10":a.count:"not available"},a}()),a("ResultValueConverter",d)}}}),System.register("resources/converters/truncate.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("TruncateValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=20;return a.length>b?a.substring(0,b)+"...":a},a}()),a("TruncateValueConverter",d)}}}),function(){var a=System.amdDefine;a("resources/custom/breakdown/breakdown.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/breakdown/breakdown.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l;return{setters:[function(a){f=a.bindable,g=a.customElement}],execute:function(){a("Breakdown",(h=g("breakdown"),l=h((j=function b(){d(this,b),c(this,"data",k,this)},k=e(j.prototype,"data",[f],{enumerable:!0,initializer:null}),i=j))||i)),a("Breakdown",l)}}}),function(){var a=System.amdDefine;a("resources/custom/node-result/error.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/node-result.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-result/node-result.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o,p;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeResult",(k=h("node-result"),p=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
Patient Count: - ${result.count | count}
'})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/queued.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/submitted.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-status/node-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-status/node-status.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeStatus",(k=h("node-status"),o=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
${result.adapterNode}
  ${result.statusMessage}   ERROR: ${result.statusDescription}   ${result.statusMessage}
  ${result.count | count}
Patient Count: - ${result.count | count}
 - ERROR: ${result.statusDescription} - ${result.statusMessage}'})}(),System.register("resources/index.js",[],function(a,b){"use strict";function c(a){var b="converters",c=["box-style.converter","count-value-converter","datetime.value.converter","result-style.converter","result-value.converter","truncate.converter"];a.globalResources.apply(a,c.map(function(a){return"./"+b+"/"+a}));var d="custom",e=["breakdown/breakdown","node-result/node-result","node-status/node-status"];a.globalResources.apply(a,e.map(function(a){return"./"+d+"/"+a}))}return a("configure",c),{setters:[],execute:function(){}}}),System.register("services/queries.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.notifications}],execute:function(){a("QueriesModel",(h=g=function b(a,d,e){var f=this;c(this,b);var g=d,h=40,i=0,j=0,k=null;b.prototype.load=function(){return g.fetchPreviousQueries(f.maxQueriesPerFetch()+f.loadedCount()).then(function(a){return j=a.rowCount,i=a.queryResults.length,a})["catch"](function(a){return console.log(a)}).then(l).then(function(b){k=b,a.publish(e.shrine.queriesReceived,k)})},b.prototype.totalQueries=function(){return j},b.prototype.loadedCount=function(){return i},b.prototype.maxQueriesPerFetch=function(){return h},b.prototype.moreToLoad=function(){return i1&&void 0!==arguments[1]?arguments[1]:6;return new Promise(function(b,c){for(var d=[],e=6,f=a.adapters,g=f.length,h=a.queryResults,i=0;i"})}(),System.register("services/container.js",["ramda"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a}],execute:function(){e=function(){function a(a,b){for(var c=0;c1?f-1:0),h=1;h0?a.count:0:"unavailable"}).join(",")),h=[];c.forEach(function(a,c){h.push.apply(h,[""].concat(Array.from(a).map(function(a){var d=c.split(" ").shift()+","+a,e=b.map(function(b){var d=b.breakdowns,e=void 0===d?[]:d,f=e.find(function(a){var b=a.resultType.i2b2Options.description;a.results;return b===c}),g=f?f.results.find(function(b){return b.dataKey===a}):void 0;return g?g.value>0?g.value:0:"unavailable"});return d+","+e.join(",")})))});var j=""+f+g+h.join("\n");i(j)},i=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.parent;if(void 0!==b){var c="export.csv",d=new Blob([a]),e=void 0!==b.navigator&&void 0!==b.navigator.msSaveOrOpenBlob;if(e)b.navigator.msSaveBlob(d,c);else{var f=b.parent.document.createElement("a");f.href=b.URL.createObjectURL(d,{type:"text/plain"}),f.download=c,document.body.appendChild(f),f.click(),document.body.removeChild(f)}}}}}}),System.register("shell.js",["services/i2b2.pub-sub","services/query-export"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.I2B2PubSub},function(a){e=a.QueryExport}],execute:function(){a("Shell",(g=f=function b(a,d){c(this,b),a.listen(),d.listen()},f.inject=[d,e],h=g)),a("Shell",h)}}}),System.register("views/index.js",[],function(a,b){"use strict";function c(a){var b=["views/query-status/query-status"];a.globalResources.apply(a,b)}return a("configure",c),{setters:[],execute:function(){}}}),function(){var a=System.amdDefine;a("views/mailto/mailto.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/mailto/mailto.service.js",["repository/qep.repository"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g;return{setters:[function(a){d=a.QEPRepository}],execute:function(){a("MailToService",(f=e=function(){function a(b){c(this,a),this.repository=b}return a.prototype.fetchStewardEmail=function(){return this.repository.fetchStewardEmail()},a}(),e.inject=[d],g=f)),a("MailToService",g)}}}),System.register("views/mailto/mailto.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("MailConfig",c={mailto:"mailto:",subject:encodeURIComponent("Question from a SHRINE User"),body:encodeURIComponent("Please enter the suggested information and your question. Your data steward will reply to this email.\n \n\n***Never send patient information, passwords, or other sensitive information by email****\n \nName:\n \nTitle:\n \nUser name (to log into SHRINE):\n \nTelephone Number (optional):\n \nPreferred email address (optional):\n \n\nQuestion or Comment:")}),a("MailConfig",c)}}}),System.register("views/mailto/mailto.js",["views/mailto/mailto.service","views/mailto/mailto.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.MailToService},function(a){e=a.MailConfig}],execute:function(){a("MailTo",(g=f=function(){function a(b,d){c(this,a),this.service=b,this.config=d}return a.prototype.openEmail=function(){var a=this;this.service.fetchStewardEmail().then(function(b){window.top.location="mailto:"+b+"?subject="+a.config.subject+"&body="+a.config.body})},a}(),f.inject=[d,e],h=g)),a("MailTo",h)}}}),function(){var a=System.amdDefine;a("views/query-status/query-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("repository/qep.repository.js",["aurelia-fetch-client","fetch"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.HttpClient},function(a){}],execute:function(){e=function(){function a(a,b){for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:0;return this.http.fetch("qep/queryResults?limit="+a+"&skip="+b,{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchNetworkId=function(a){return this.http.fetch("qep/networkId?queryName='"+a+"'",{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchQuery=function(a,b,c){return this.http.fetch("qep/queryResult/"+a+"?timeoutSeconds="+b+"&afterVersion="+c,{method:"get"}).then(function(a){var b=a.url,c=a.statusText,d=a.status,e=a.ok;return console.log("fetchQuery: "+b+" - "+e+" - "+d+" - "+c),a.json()})["catch"](function(a){return a})},a.prototype.fetchStewardEmail=function(){return this.http.fetch("data?key=stewardEmail",{method:"get"}).then(function(a){return a.json()}).then(function(a){return a.indexOf('"')>0?a.split('"')[1]:a})["catch"](function(){return""})},e(a,[{key:"url",get:function(){var a=document.URL,b=":6443/shrine-metadata/";return a.substring(0,a.lastIndexOf(":"))+b}},{key:"auth",get:function(){var a=sessionStorage.getItem("shrine.auth");return sessionStorage.removeItem("shrine.auth"),a}}]),a}(),f.inject=[d],h=g)),a("QEPRepository",h)}}}),System.register("services/query-status.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.commands,g=a.notifications}],execute:function(){h=Object.assign||function(a){for(var b=1;bthis.length)&&this.indexOf(a,b)!==-1})}),a("stringIncludesPolyfill",c)}}}),System.register("main.js",["./includes-polyfill"],function(a,b){"use strict";function c(a){a.use.standardConfiguration().developmentLogging().feature("resources").feature("views"),a.start().then(d).then(function(){return a.setRoot("shell")})}var d;return a("configure",c),{setters:[function(a){d=a.stringIncludesPolyfill}],execute:function(){}}}),System.register("resources/converters/box-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("BoxStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return"transform: translate("+String(-100*a)+"%);"},a}()),a("BoxStyleValueConverter",d)}}}),System.register("resources/converters/count-value-converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("CountValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a<0?"10 patients or fewer":a+" +-10 patients"},a}()),a("CountValueConverter",d)}}}),System.register("resources/converters/datetime.value.converter.js",["moment"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[function(a){d=a["default"]}],execute:function(){a("DateTimeValueConverter",e=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return d(a).format("MM/DD/YYYY h:mm:ss a")},a}()),a("DateTimeValueConverter",e)}}}),System.register("resources/converters/result-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=this.isUnresolved(a)?"color:"+this.getColorValue(a):"";return b},a.prototype.isUnresolved=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FINISHED";return!a||a.status!==b},a.prototype.getColorValue=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ERROR",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#00FF00";return a&&a.status!==b?d:c},a}()),a("ResultStyleValueConverter",d)}}}),System.register("resources/converters/result-value.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a?"FINISHED"!==a.status?"":a.count<0?"<=10":a.count:"not available"},a}()),a("ResultValueConverter",d)}}}),System.register("resources/converters/truncate.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("TruncateValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=20;return a.length>b?a.substring(0,b)+"...":a},a}()),a("TruncateValueConverter",d)}}}),function(){var a=System.amdDefine;a("resources/custom/breakdown/breakdown.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/breakdown/breakdown.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l;return{setters:[function(a){f=a.bindable,g=a.customElement}],execute:function(){a("Breakdown",(h=g("breakdown"),l=h((j=function b(){d(this,b),c(this,"data",k,this)},k=e(j.prototype,"data",[f],{enumerable:!0,initializer:null}),i=j))||i)),a("Breakdown",l)}}}),function(){var a=System.amdDefine;a("resources/custom/node-result/error.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/node-result.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-result/node-result.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o,p;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeResult",(k=h("node-result"),p=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
Patient Count: - ${result.count | count}
'})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/queued.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/submitted.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-status/node-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-status/node-status.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeStatus",(k=h("node-status"),o=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
${result.adapterNode}
  ${result.statusMessage}   ERROR: ${result.statusDescription}   ${result.statusMessage}
  ${result.count | count}
Patient Count: - ${result.count | count}
 - ERROR: ${result.statusDescription} - ${result.statusMessage}'})}(),System.register("resources/index.js",[],function(a,b){"use strict";function c(a){var b="converters",c=["box-style.converter","count-value-converter","datetime.value.converter","result-style.converter","result-value.converter","truncate.converter"];a.globalResources.apply(a,c.map(function(a){return"./"+b+"/"+a}));var d="custom",e=["breakdown/breakdown","node-result/node-result","node-status/node-status"];a.globalResources.apply(a,e.map(function(a){return"./"+d+"/"+a}))}return a("configure",c),{setters:[],execute:function(){}}}),System.register("services/queries.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.notifications}],execute:function(){a("QueriesModel",(h=g=function b(a,d,e){var f=this;c(this,b);var g=d,h=40,i=0,j=0,k=null;b.prototype.load=function(){return g.fetchPreviousQueries(f.maxQueriesPerFetch()+f.loadedCount()).then(function(a){return j=a.rowCount,i=a.queryResults.length,a})["catch"](function(a){return console.log(a)}).then(l).then(function(b){k=b,a.publish(e.shrine.queriesReceived,k)})},b.prototype.totalQueries=function(){return j},b.prototype.loadedCount=function(){return i},b.prototype.maxQueriesPerFetch=function(){return h},b.prototype.moreToLoad=function(){return i1&&void 0!==arguments[1]?arguments[1]:6;return new Promise(function(b,c){for(var d=[],e=6,f=a.adapters,g=f.length,h=a.queryResults,i=0;i"})}(),System.register("services/container.js",["ramda"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a}],execute:function(){e=function(){function a(a,b){for(var c=0;c1?f-1:0),h=1;h0?a.count:0:"unavailable"}).join(",")),h=[];c.forEach(function(a,c){h.push.apply(h,[""].concat(Array.from(a).map(function(a){var d=c.split(" ").shift()+","+a,e=b.map(function(b){var d=b.breakdowns,e=void 0===d?[]:d,f=e.find(function(a){var b=a.resultType.i2b2Options.description;a.results;return b===c}),g=f?f.results.find(function(b){return b.dataKey===a}):void 0;return g?g.value>0?g.value:0:"unavailable"});return d+","+e.join(",")})))});var j=""+f+g+h.join("\n");i(j)},i=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.parent;if(void 0!==b){var c="export.csv",d=new Blob([a]),e=void 0!==b.navigator&&void 0!==b.navigator.msSaveOrOpenBlob;if(e)b.navigator.msSaveBlob(d,c);else{var f=b.parent.document.createElement("a");f.href=b.URL.createObjectURL(d,{type:"text/plain"}),f.download=c,b.document.body.appendChild(f),f.click(),b.document.body.removeChild(f)}}}}}}),System.register("shell.js",["services/i2b2.pub-sub","services/query-export"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.I2B2PubSub},function(a){e=a.QueryExport}],execute:function(){a("Shell",(g=f=function b(a,d){c(this,b),a.listen(),d.listen()},f.inject=[d,e],h=g)),a("Shell",h)}}}),System.register("views/index.js",[],function(a,b){"use strict";function c(a){var b=["views/query-status/query-status"];a.globalResources.apply(a,b)}return a("configure",c),{setters:[],execute:function(){}}}),function(){var a=System.amdDefine;a("views/mailto/mailto.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/mailto/mailto.service.js",["repository/qep.repository"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g;return{setters:[function(a){d=a.QEPRepository}],execute:function(){a("MailToService",(f=e=function(){function a(b){c(this,a),this.repository=b}return a.prototype.fetchStewardEmail=function(){return this.repository.fetchStewardEmail()},a}(),e.inject=[d],g=f)),a("MailToService",g)}}}),System.register("views/mailto/mailto.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("MailConfig",c={mailto:"mailto:",subject:encodeURIComponent("Question from a SHRINE User"),body:encodeURIComponent("Please enter the suggested information and your question. Your data steward will reply to this email.\n \n\n***Never send patient information, passwords, or other sensitive information by email****\n \nName:\n \nTitle:\n \nUser name (to log into SHRINE):\n \nTelephone Number (optional):\n \nPreferred email address (optional):\n \n\nQuestion or Comment:")}),a("MailConfig",c)}}}),System.register("views/mailto/mailto.js",["views/mailto/mailto.service","views/mailto/mailto.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.MailToService},function(a){e=a.MailConfig}],execute:function(){a("MailTo",(g=f=function(){function a(b,d){c(this,a),this.service=b,this.config=d}return a.prototype.openEmail=function(){var a=this;this.service.fetchStewardEmail().then(function(b){window.top.location="mailto:"+b+"?subject="+a.config.subject+"&body="+a.config.body})},a}(),f.inject=[d,e],h=g)),a("MailTo",h)}}}),function(){var a=System.amdDefine;a("views/query-status/query-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("repository/qep.repository.js",["aurelia-fetch-client","fetch"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.HttpClient},function(a){}],execute:function(){e=function(){function a(a,b){for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:0;return this.http.fetch("qep/queryResults?limit="+a+"&skip="+b,{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchNetworkId=function(a){return this.http.fetch("qep/networkId?queryName='"+a+"'",{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchQuery=function(a,b,c){return this.http.fetch("qep/queryResult/"+a+"?timeoutSeconds="+b+"&afterVersion="+c,{method:"get"}).then(function(a){var b=a.url,c=a.statusText,d=a.status,e=a.ok;return console.log("fetchQuery: "+b+" - "+e+" - "+d+" - "+c),a.json()})["catch"](function(a){return a})},a.prototype.fetchStewardEmail=function(){return this.http.fetch("data?key=stewardEmail",{method:"get"}).then(function(a){return a.json()}).then(function(a){return a.indexOf('"')>0?a.split('"')[1]:a})["catch"](function(){return""})},e(a,[{key:"url",get:function(){var a=document.URL,b=":6443/shrine-metadata/";return a.substring(0,a.lastIndexOf(":"))+b}},{key:"auth",get:function(){var a=sessionStorage.getItem("shrine.auth");return sessionStorage.removeItem("shrine.auth"),a}}]),a}(),f.inject=[d],h=g)),a("QEPRepository",h)}}}),System.register("services/query-status.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.commands,g=a.notifications}],execute:function(){h=Object.assign||function(a){for(var b=1;b1?g-1:0),i=1;i'})}(),System.register("views/query-viewer/context-menu/context-menu.js",["aurelia-framework","aurelia-event-aggregator","common/shrine.messages"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l,m,n;return{setters:[function(a){f=a.bindable},function(a){g=a.EventAggregator},function(a){h=a.commands}],execute:function(){a("ContextMenu",(l=k=function b(a,c){var e=this;d(this,b),m.call(this),b.prototype.cloneQuery=function(b){a.publish(c.i2b2.cloneQuery,b),e.context["class"]="hide"},b.prototype.renameQuery=function(b){a.publish(c.i2b2.renameQuery,b),e.context["class"]="hide"},b.prototype.flagQuery=function(b){a.publish(c.i2b2.flagQuery,b),e.context["class"]="hide"},b.prototype.unflagQuery=function(b){a.publish(c.i2b2.unflagQuery,b),e.context["class"]="hide"}},k.inject=[g,h],m=function(){c(this,"context",j,this)},i=l,j=e(i.prototype,"context",[f],{enumerable:!0,initializer:null}),n=i)),a("ContextMenu",n)}}}),System.register("views/query-viewer/date.converter.js",["moment"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[function(a){d=a["default"]}],execute:function(){a("DateValueConverter",e=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return d(a).format("MM/DD/YYYY")},a}()),a("DateValueConverter",e)}}}),function(){var a=System.amdDefine;a("views/query-viewer/paginator/paginator.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/paginator/paginator.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l;return{setters:[function(a){f=a.bindable}],execute:function(){g=function(){function a(a,b){for(var c=0;cb?b:a,this.element.dispatchEvent(new CustomEvent("paginator-click",{detail:{index:this.index},bubbles:!0,cancelable:!0}))}}]),a}(),j.inject=[Element],h=k,i=e(h.prototype,"pages",[f],{enumerable:!0,initializer:null}),l=h)),a("Paginator",l)}}}),function(){var a=System.amdDefine;a("views/query-viewer/query-status/query-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/query-status/query-status.js",["aurelia-framework","ramda"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l,m;return{setters:[function(a){f=a.bindable},function(a){g=a}],execute:function(){a("QueryStatus",(k=j=function(){function a(b){d(this,a),l.call(this),this.floor=b.floor}return a.prototype.attached=function(){var a=75,b=g.curry(function(a,b,c,d){return a(d/c*b)})(this.floor,a,this.status.total),c=this.status,d=b(c.finished),e=b(c.error);this.readyOffset=100-d,this.errorOffset=this.readyOffset-e,this.finished=c.finished,this.error=c.error,this.pending=c.total-(c.finished+c.error),this.total=c.total},a}(),j.inject=[Math],l=function(){c(this,"status",i,this)},h=k,i=e(h.prototype,"status",[f],{enumerable:!0,initializer:null}),m=h)),a("QueryStatus",m)}}}),System.register("views/query-viewer/query-viewer.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("QueryViewerConfig",c={maxNodesPerScreen:10,maxQueriesPerScroll:40}),a("QueryViewerConfig",c)}}}),function(){var a=System.amdDefine;a("views/query-viewer/query-viewer.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/scroll.service.js",["ramda","common/container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("ScrollService",(g=f=function b(){c(this,b)},f.either=d.curry(function(a,b,c){return e.of(d.prop(a,c)||b)}),f.target=function(a,b){return h.either("target",b,b).chain(function(b){return h.either(a,0,b)})},f.clientHeight=function(a){return h.target("clientHeight",a)},f.scrollHeight=function(a){return h.target("scrollHeight",a)},f.scrollTop=function(a){return h.target("scrollTop",a)},f.userScroll=function(a){return h.clientHeight(a).map(function(b){return b+h.scrollTop(a).value})},f.scrollRatio=function(a){return h.userScroll(a).map(function(b){return b/h.scrollHeight(a).value})},h=g)),a("ScrollService",h)}}}),System.register("views/query-viewer/query-viewer.js",["aurelia-event-aggregator","common/queries.model","./scroll.service","common/shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QueriesModel},function(a){f=a.ScrollService},function(a){g=a.notifications,h=a.commands}],execute:function(){a("QueryViewer",(j=i=function(){function a(b,d,e,g){var h=this;c(this,a),a.prototype.init=function(){h.pageIndex=0,h.showLoader=!0,h.vertStyle="v-min",h.runningQueryName=null},this.init(),a.prototype.setToPage=function(a){h.pageIndex=a,h.page=h.pages[h.pageIndex]};var i=function(a){return 1===f.scrollRatio(a).value};a.prototype.onScroll=function(a){i(a)&&!h.loadingInfiniteScroll&&d.moreToLoad()&&(h.loadingInfiniteScroll=!0,d.load())},a.prototype.publishError=function(a,c){return a.stopPropagation(),b.publish(g.i2b2.showError,c)},a.prototype.getContext=function(a,b,c){return{x:a.pageX,y:a.pageY,"class":"show",query:b,isCount:void 0!==c,count:c}},b.subscribe(e.i2b2.historyRefreshed,function(){return d.load()}),b.subscribe(e.i2b2.tabMax,function(){return h.vertStyle="v-full"}),b.subscribe(e.i2b2.tabMin,function(){return h.vertStyle="v-min"}),b.subscribe(e.i2b2.queryStarted,function(a){return h.runningQueryName=a}),b.subscribe(e.shrine.queriesReceived,function(a){h.pages=a,h.page=h.pages[0],h.runningQueryName=null,h.loadingInfiniteScroll=!1,h.showLoader=!1})}return a.prototype.updatePage=function(a){a.stopPropagation();var b=event.detail.index;this.page=this.pages[b]},a}(),i.inject=[d,e,g,h],k=j)),a("QueryViewer",k)}}}),function(){var a=System.amdDefine;a("views/query-viewer/result-row/loading-bar/loading-bar.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/result-row/loading-bar/loading-bar.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i;return{setters:[function(a){f=a.bindable}],execute:function(){a("LoadingBar",(g=function b(){d(this,b),c(this,"status",h,this)},h=e(g.prototype,"status",[f],{enumerable:!0,initializer:null}),i=g)),a("LoadingBar",i)}}}),function(){var a=System.amdDefine;a("views/query-viewer/result-row/loading-bar/row-loader.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return""})}(); \ No newline at end of file diff --git a/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js b/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js index 5efad75a9..3dcb76f1d 100644 --- a/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js +++ b/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js @@ -1,140 +1,140 @@ System.register(['./pub-sub'], function (_export, _context) { "use strict"; var PubSub, QueryExport, convertObjectToCSV, exportIEWebkitGecko; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } return { setters: [function (_pubSub) { PubSub = _pubSub.PubSub; }], execute: function () { _export('QueryExport', QueryExport = function (_PubSub) { _inherits(QueryExport, _PubSub); function QueryExport() { _classCallCheck(this, QueryExport); for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) { rest[_key] = arguments[_key]; } return _possibleConstructorReturn(this, _PubSub.call.apply(_PubSub, [this].concat(rest))); } QueryExport.prototype.listen = function listen() { this.subscribe(this.commands.shrine.exportResult, convertObjectToCSV); }; return QueryExport; }(PubSub)); _export('QueryExport', QueryExport); convertObjectToCSV = function convertObjectToCSV(d) { var nodes = d.nodes.sort(); var m = new Map(); var desc = function desc(_ref) { var description = _ref.resultType.i2b2Options.description; return description; }; var brdSort = function brdSort(a, b) { return desc(a) <= desc(b) ? -1 : 1; }; nodes.forEach(function (_ref2) { var _ref2$breakdowns = _ref2.breakdowns, breakdowns = _ref2$breakdowns === undefined ? [] : _ref2$breakdowns; breakdowns.sort(brdSort).forEach(function (_ref3) { var _m$get; var description = _ref3.resultType.i2b2Options.description, results = _ref3.results; return m.has(description) ? (_m$get = m.get(description)).add.apply(_m$get, results.map(function (r) { return r.dataKey; }).sort()) : m.set(description, new Set(results.map(function (r) { return r.dataKey; }).sort())); }); }); var line1 = 'SHRINE QUERY RESULTS (OBFUSCATED PATIENT COUNTS),' + [''].concat(nodes.map(function (n) { return n.adapterNode; }).join(',')); var line2 = '\nAll Patients,' + [''].concat(nodes.map(function (n) { return n.count ? n.count > 0 ? n.count : 0 : 'unavailable'; }).join(',')); var result = []; m.forEach(function (v, k) { result.push.apply(result, [''].concat(Array.from(v).map(function (s) { var title = k.split(' ').shift() + ',' + s; var values = nodes.map(function (_ref4) { var _ref4$breakdowns = _ref4.breakdowns, breakdowns = _ref4$breakdowns === undefined ? [] : _ref4$breakdowns; var b = breakdowns.find(function (_ref5) { var description = _ref5.resultType.i2b2Options.description, results = _ref5.results; return description === k; }); var r = b ? b.results.find(function (r) { return r.dataKey === s; }) : undefined; return !r ? 'unavailable' : r.value > 0 ? r.value : 0; }); return title + ',' + values.join(","); }))); }); var csv = '' + line1 + line2 + result.join('\n'); exportIEWebkitGecko(csv); }; exportIEWebkitGecko = function exportIEWebkitGecko(csv) { var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.parent; if (context === undefined) return; var filename = "export.csv"; var blob = new Blob([csv]); var isIE = context.navigator !== undefined && context.navigator.msSaveOrOpenBlob !== undefined; if (isIE) context.navigator.msSaveBlob(blob, filename);else { var a = context.parent.document.createElement('a'); a.href = context.URL.createObjectURL(blob, { type: "text/plain" }); a.download = filename; - document.body.appendChild(a); + context.document.body.appendChild(a); a.click(); - document.body.removeChild(a); + context.document.body.removeChild(a); } }; } }; }); //# sourceMappingURL=query-export.js.map diff --git a/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js.map b/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js.map index 299a4d69f..b131565b4 100644 --- a/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js.map +++ b/shrine-webclient/src/main/js/client/js-shrine/dist/services/query-export.js.map @@ -1 +1 @@ -{"version":3,"sources":["services/query-export.js"],"names":["PubSub","QueryExport","rest","listen","subscribe","commands","shrine","exportResult","convertObjectToCSV","d","nodes","sort","m","Map","desc","description","resultType","i2b2Options","brdSort","a","b","forEach","breakdowns","results","has","get","add","map","r","dataKey","set","Set","line1","n","adapterNode","join","line2","count","result","v","k","push","Array","from","title","split","shift","s","values","find","undefined","value","csv","exportIEWebkitGecko","context","window","parent","filename","blob","Blob","isIE","navigator","msSaveOrOpenBlob","msSaveBlob","document","createElement","href","URL","createObjectURL","type","download","body","appendChild","click","removeChild"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAQA,kB,WAAAA,M;;;mCACKC,W;;;AACT,uCAAqB;AAAA;;AAAA,sDAANC,IAAM;AAANA,4BAAM;AAAA;;AAAA,4DACjB,0CAASA,IAAT,EADiB;AAEpB;;sCACDC,M,qBAAS;AACL,yBAAKC,SAAL,CAAe,KAAKC,QAAL,CAAcC,MAAd,CAAqBC,YAApC,EAAkDC,kBAAlD;AACH,iB;;;cAN4BR,M;;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OH,IAAP,CAAY,IAAZ,CAA/B;AACAkB,oCAAoBD,GAApB;AACH,a;;AAEKC,+B,GAAsB,SAAtBA,mBAAsB,CAACD,GAAD,EAAkC;AAAA,oBAA5BE,OAA4B,uEAAlBC,OAAOC,MAAW;;AAC1D,oBAAGF,YAAYJ,SAAf,EAA0B;AAC1B,oBAAMO,WAAW,YAAjB;AACA,oBAAMC,OAAO,IAAIC,IAAJ,CAAS,CAACP,GAAD,CAAT,CAAb;AACA,oBAAMQ,OAAON,QAAQO,SAAR,KAAsBX,SAAtB,IAAmCI,QAAQO,SAAR,CAAkBC,gBAAlB,KAAuCZ,SAAvF;AACA,oBAAIU,IAAJ,EAAUN,QAAQO,SAAR,CAAkBE,UAAlB,CAA6BL,IAA7B,EAAmCD,QAAnC,EAAV,KACK;AACD,wBAAMtC,IAAImC,QAAQE,MAAR,CAAeQ,QAAf,CAAwBC,aAAxB,CAAsC,GAAtC,CAAV;AACA9C,sBAAE+C,IAAF,GAASZ,QAAQa,GAAR,CAAYC,eAAZ,CAA4BV,IAA5B,EAAkC,EAACW,MAAM,YAAP,EAAlC,CAAT;AACAlD,sBAAEmD,QAAF,GAAab,QAAb;AACAO,6BAASO,IAAT,CAAcC,WAAd,CAA0BrD,CAA1B;AACAA,sBAAEsD,KAAF;AACAT,6BAASO,IAAT,CAAcG,WAAd,CAA0BvD,CAA1B;AACH;AACJ,a","file":"query-export.js","sourceRoot":"/src"} \ No newline at end of file +{"version":3,"sources":["services/query-export.js"],"names":["PubSub","QueryExport","rest","listen","subscribe","commands","shrine","exportResult","convertObjectToCSV","d","nodes","sort","m","Map","desc","description","resultType","i2b2Options","brdSort","a","b","forEach","breakdowns","results","has","get","add","map","r","dataKey","set","Set","line1","n","adapterNode","join","line2","count","result","v","k","push","Array","from","title","split","shift","s","values","find","undefined","value","csv","exportIEWebkitGecko","context","window","parent","filename","blob","Blob","isIE","navigator","msSaveOrOpenBlob","msSaveBlob","document","createElement","href","URL","createObjectURL","type","download","body","appendCh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","sourceRoot":"/src"} \ No newline at end of file diff --git a/shrine-webclient/src/main/js/client/js-shrine/export/dist/app-build.js b/shrine-webclient/src/main/js/client/js-shrine/export/dist/app-build.js index 55af9d3a5..99c2c1e22 100644 --- a/shrine-webclient/src/main/js/client/js-shrine/export/dist/app-build.js +++ b/shrine-webclient/src/main/js/client/js-shrine/export/dist/app-build.js @@ -1,2 +1,2 @@ -"bundle";System.register("includes-polyfill.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("stringIncludesPolyfill",c=function(){String.prototype.includes||(String.prototype.includes=function(a,b){return"number"!=typeof b&&(b=0),!(b+a.length>this.length)&&this.indexOf(a,b)!==-1})}),a("stringIncludesPolyfill",c)}}}),System.register("main.js",["./includes-polyfill"],function(a,b){"use strict";function c(a){a.use.standardConfiguration().developmentLogging().feature("resources").feature("views"),a.start().then(d).then(function(){return a.setRoot("shell")})}var d;return a("configure",c),{setters:[function(a){d=a.stringIncludesPolyfill}],execute:function(){}}}),System.register("resources/converters/box-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("BoxStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return"transform: translate("+String(-100*a)+"%);"},a}()),a("BoxStyleValueConverter",d)}}}),System.register("resources/converters/count-value-converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("CountValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a<0?"10 patients or fewer":a+" +-10 patients"},a}()),a("CountValueConverter",d)}}}),System.register("resources/converters/datetime.value.converter.js",["moment"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[function(a){d=a["default"]}],execute:function(){a("DateTimeValueConverter",e=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return d(a).format("MM/DD/YYYY h:mm:ss a")},a}()),a("DateTimeValueConverter",e)}}}),System.register("resources/converters/result-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=this.isUnresolved(a)?"color:"+this.getColorValue(a):"";return b},a.prototype.isUnresolved=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FINISHED";return!a||a.status!==b},a.prototype.getColorValue=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ERROR",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#00FF00";return a&&a.status!==b?d:c},a}()),a("ResultStyleValueConverter",d)}}}),System.register("resources/converters/result-value.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a?"FINISHED"!==a.status?"":a.count<0?"<=10":a.count:"not available"},a}()),a("ResultValueConverter",d)}}}),System.register("resources/converters/truncate.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("TruncateValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=20;return a.length>b?a.substring(0,b)+"...":a},a}()),a("TruncateValueConverter",d)}}}),function(){var a=System.amdDefine;a("resources/custom/breakdown/breakdown.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/breakdown/breakdown.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l;return{setters:[function(a){f=a.bindable,g=a.customElement}],execute:function(){a("Breakdown",(h=g("breakdown"),l=h((j=function b(){d(this,b),c(this,"data",k,this)},k=e(j.prototype,"data",[f],{enumerable:!0,initializer:null}),i=j))||i)),a("Breakdown",l)}}}),function(){var a=System.amdDefine;a("resources/custom/node-result/error.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/node-result.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-result/node-result.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o,p;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeResult",(k=h("node-result"),p=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
Patient Count: - ${result.count | count}
'})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/queued.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/submitted.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-status/node-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-status/node-status.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeStatus",(k=h("node-status"),o=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
${result.adapterNode}
  ${result.statusMessage}   ERROR: ${result.statusDescription}   ${result.statusMessage}
  ${result.count | count}
Patient Count: - ${result.count | count}
 - ERROR: ${result.statusDescription} - ${result.statusMessage}'})}(),System.register("resources/index.js",[],function(a,b){"use strict";function c(a){var b="converters",c=["box-style.converter","count-value-converter","datetime.value.converter","result-style.converter","result-value.converter","truncate.converter"];a.globalResources.apply(a,c.map(function(a){return"./"+b+"/"+a}));var d="custom",e=["breakdown/breakdown","node-result/node-result","node-status/node-status"];a.globalResources.apply(a,e.map(function(a){return"./"+d+"/"+a}))}return a("configure",c),{setters:[],execute:function(){}}}),System.register("services/queries.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.notifications}],execute:function(){a("QueriesModel",(h=g=function b(a,d,e){var f=this;c(this,b);var g=d,h=40,i=0,j=0,k=null;b.prototype.load=function(){return g.fetchPreviousQueries(f.maxQueriesPerFetch()+f.loadedCount()).then(function(a){return j=a.rowCount,i=a.queryResults.length,a})["catch"](function(a){return console.log(a)}).then(l).then(function(b){k=b,a.publish(e.shrine.queriesReceived,k)})},b.prototype.totalQueries=function(){return j},b.prototype.loadedCount=function(){return i},b.prototype.maxQueriesPerFetch=function(){return h},b.prototype.moreToLoad=function(){return i1&&void 0!==arguments[1]?arguments[1]:6;return new Promise(function(b,c){for(var d=[],e=6,f=a.adapters,g=f.length,h=a.queryResults,i=0;i"})}(),System.register("services/container.js",["ramda"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a}],execute:function(){e=function(){function a(a,b){for(var c=0;c1?f-1:0),h=1;h0?a.count:0:"unavailable"}).join(",")),h=[];c.forEach(function(a,c){h.push.apply(h,[""].concat(Array.from(a).map(function(a){var d=c.split(" ").shift()+","+a,e=b.map(function(b){var d=b.breakdowns,e=void 0===d?[]:d,f=e.find(function(a){var b=a.resultType.i2b2Options.description;a.results;return b===c}),g=f?f.results.find(function(b){return b.dataKey===a}):void 0;return g?g.value>0?g.value:0:"unavailable"});return d+","+e.join(",")})))});var j=""+f+g+h.join("\n");i(j)},i=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.parent;if(void 0!==b){var c="export.csv",d=new Blob([a]),e=void 0!==b.navigator&&void 0!==b.navigator.msSaveOrOpenBlob;if(e)b.navigator.msSaveBlob(d,c);else{var f=b.parent.document.createElement("a");f.href=b.URL.createObjectURL(d,{type:"text/plain"}),f.download=c,document.body.appendChild(f),f.click(),document.body.removeChild(f)}}}}}}),System.register("shell.js",["services/i2b2.pub-sub","services/query-export"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.I2B2PubSub},function(a){e=a.QueryExport}],execute:function(){a("Shell",(g=f=function b(a,d){c(this,b),a.listen(),d.listen()},f.inject=[d,e],h=g)),a("Shell",h)}}}),System.register("views/index.js",[],function(a,b){"use strict";function c(a){var b=["views/query-status/query-status"];a.globalResources.apply(a,b)}return a("configure",c),{setters:[],execute:function(){}}}),function(){var a=System.amdDefine;a("views/mailto/mailto.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/mailto/mailto.service.js",["repository/qep.repository"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g;return{setters:[function(a){d=a.QEPRepository}],execute:function(){a("MailToService",(f=e=function(){function a(b){c(this,a),this.repository=b}return a.prototype.fetchStewardEmail=function(){return this.repository.fetchStewardEmail()},a}(),e.inject=[d],g=f)),a("MailToService",g)}}}),System.register("views/mailto/mailto.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("MailConfig",c={mailto:"mailto:",subject:encodeURIComponent("Question from a SHRINE User"),body:encodeURIComponent("Please enter the suggested information and your question. Your data steward will reply to this email.\n \n\n***Never send patient information, passwords, or other sensitive information by email****\n \nName:\n \nTitle:\n \nUser name (to log into SHRINE):\n \nTelephone Number (optional):\n \nPreferred email address (optional):\n \n\nQuestion or Comment:")}),a("MailConfig",c)}}}),System.register("views/mailto/mailto.js",["views/mailto/mailto.service","views/mailto/mailto.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.MailToService},function(a){e=a.MailConfig}],execute:function(){a("MailTo",(g=f=function(){function a(b,d){c(this,a),this.service=b,this.config=d}return a.prototype.openEmail=function(){var a=this;this.service.fetchStewardEmail().then(function(b){window.top.location="mailto:"+b+"?subject="+a.config.subject+"&body="+a.config.body})},a}(),f.inject=[d,e],h=g)),a("MailTo",h)}}}),function(){var a=System.amdDefine;a("views/query-status/query-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("repository/qep.repository.js",["aurelia-fetch-client","fetch"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.HttpClient},function(a){}],execute:function(){e=function(){function a(a,b){for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:0;return this.http.fetch("qep/queryResults?limit="+a+"&skip="+b,{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchNetworkId=function(a){return this.http.fetch("qep/networkId?queryName='"+a+"'",{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchQuery=function(a,b,c){return this.http.fetch("qep/queryResult/"+a+"?timeoutSeconds="+b+"&afterVersion="+c,{method:"get"}).then(function(a){var b=a.url,c=a.statusText,d=a.status,e=a.ok;return console.log("fetchQuery: "+b+" - "+e+" - "+d+" - "+c),a.json()})["catch"](function(a){return a})},a.prototype.fetchStewardEmail=function(){return this.http.fetch("data?key=stewardEmail",{method:"get"}).then(function(a){return a.json()}).then(function(a){return a.indexOf('"')>0?a.split('"')[1]:a})["catch"](function(){return""})},e(a,[{key:"url",get:function(){var a=document.URL,b=":6443/shrine-metadata/";return a.substring(0,a.lastIndexOf(":"))+b}},{key:"auth",get:function(){var a=sessionStorage.getItem("shrine.auth");return sessionStorage.removeItem("shrine.auth"),a}}]),a}(),f.inject=[d],h=g)),a("QEPRepository",h)}}}),System.register("services/query-status.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.commands,g=a.notifications}],execute:function(){h=Object.assign||function(a){for(var b=1;bthis.length)&&this.indexOf(a,b)!==-1})}),a("stringIncludesPolyfill",c)}}}),System.register("main.js",["./includes-polyfill"],function(a,b){"use strict";function c(a){a.use.standardConfiguration().developmentLogging().feature("resources").feature("views"),a.start().then(d).then(function(){return a.setRoot("shell")})}var d;return a("configure",c),{setters:[function(a){d=a.stringIncludesPolyfill}],execute:function(){}}}),System.register("resources/converters/box-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("BoxStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return"transform: translate("+String(-100*a)+"%);"},a}()),a("BoxStyleValueConverter",d)}}}),System.register("resources/converters/count-value-converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("CountValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a<0?"10 patients or fewer":a+" +-10 patients"},a}()),a("CountValueConverter",d)}}}),System.register("resources/converters/datetime.value.converter.js",["moment"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[function(a){d=a["default"]}],execute:function(){a("DateTimeValueConverter",e=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return d(a).format("MM/DD/YYYY h:mm:ss a")},a}()),a("DateTimeValueConverter",e)}}}),System.register("resources/converters/result-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=this.isUnresolved(a)?"color:"+this.getColorValue(a):"";return b},a.prototype.isUnresolved=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FINISHED";return!a||a.status!==b},a.prototype.getColorValue=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ERROR",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#00FF00";return a&&a.status!==b?d:c},a}()),a("ResultStyleValueConverter",d)}}}),System.register("resources/converters/result-value.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a?"FINISHED"!==a.status?"":a.count<0?"<=10":a.count:"not available"},a}()),a("ResultValueConverter",d)}}}),System.register("resources/converters/truncate.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("TruncateValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=20;return a.length>b?a.substring(0,b)+"...":a},a}()),a("TruncateValueConverter",d)}}}),function(){var a=System.amdDefine;a("resources/custom/breakdown/breakdown.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/breakdown/breakdown.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l;return{setters:[function(a){f=a.bindable,g=a.customElement}],execute:function(){a("Breakdown",(h=g("breakdown"),l=h((j=function b(){d(this,b),c(this,"data",k,this)},k=e(j.prototype,"data",[f],{enumerable:!0,initializer:null}),i=j))||i)),a("Breakdown",l)}}}),function(){var a=System.amdDefine;a("resources/custom/node-result/error.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/node-result.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-result/node-result.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o,p;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeResult",(k=h("node-result"),p=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
Patient Count: - ${result.count | count}
'})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/queued.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-result/submitted.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),function(){var a=System.amdDefine;a("resources/custom/node-status/node-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("resources/custom/node-status/node-status.js",["aurelia-framework","services/pub-sub"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function g(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var h,i,j,k,l,m,n,o;return{setters:[function(a){h=a.customElement,i=a.bindable},function(a){j=a.PubSub}],execute:function(){a("NodeStatus",(k=h("node-status"),o=k((m=function(a){function b(){d(this,b);for(var f=arguments.length,g=Array(f),h=0;h
${result.adapterNode}
  ${result.statusMessage}   ERROR: ${result.statusDescription}   ${result.statusMessage}
  ${result.count | count}
Patient Count: - ${result.count | count}
 - ERROR: ${result.statusDescription} - ${result.statusMessage}'})}(),System.register("resources/index.js",[],function(a,b){"use strict";function c(a){var b="converters",c=["box-style.converter","count-value-converter","datetime.value.converter","result-style.converter","result-value.converter","truncate.converter"];a.globalResources.apply(a,c.map(function(a){return"./"+b+"/"+a}));var d="custom",e=["breakdown/breakdown","node-result/node-result","node-status/node-status"];a.globalResources.apply(a,e.map(function(a){return"./"+d+"/"+a}))}return a("configure",c),{setters:[],execute:function(){}}}),System.register("services/queries.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.notifications}],execute:function(){a("QueriesModel",(h=g=function b(a,d,e){var f=this;c(this,b);var g=d,h=40,i=0,j=0,k=null;b.prototype.load=function(){return g.fetchPreviousQueries(f.maxQueriesPerFetch()+f.loadedCount()).then(function(a){return j=a.rowCount,i=a.queryResults.length,a})["catch"](function(a){return console.log(a)}).then(l).then(function(b){k=b,a.publish(e.shrine.queriesReceived,k)})},b.prototype.totalQueries=function(){return j},b.prototype.loadedCount=function(){return i},b.prototype.maxQueriesPerFetch=function(){return h},b.prototype.moreToLoad=function(){return i1&&void 0!==arguments[1]?arguments[1]:6;return new Promise(function(b,c){for(var d=[],e=6,f=a.adapters,g=f.length,h=a.queryResults,i=0;i"})}(),System.register("services/container.js",["ramda"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a}],execute:function(){e=function(){function a(a,b){for(var c=0;c1?f-1:0),h=1;h0?a.count:0:"unavailable"}).join(",")),h=[];c.forEach(function(a,c){h.push.apply(h,[""].concat(Array.from(a).map(function(a){var d=c.split(" ").shift()+","+a,e=b.map(function(b){var d=b.breakdowns,e=void 0===d?[]:d,f=e.find(function(a){var b=a.resultType.i2b2Options.description;a.results;return b===c}),g=f?f.results.find(function(b){return b.dataKey===a}):void 0;return g?g.value>0?g.value:0:"unavailable"});return d+","+e.join(",")})))});var j=""+f+g+h.join("\n");i(j)},i=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.parent;if(void 0!==b){var c="export.csv",d=new Blob([a]),e=void 0!==b.navigator&&void 0!==b.navigator.msSaveOrOpenBlob;if(e)b.navigator.msSaveBlob(d,c);else{var f=b.parent.document.createElement("a");f.href=b.URL.createObjectURL(d,{type:"text/plain"}),f.download=c,b.document.body.appendChild(f),f.click(),b.document.body.removeChild(f)}}}}}}),System.register("shell.js",["services/i2b2.pub-sub","services/query-export"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.I2B2PubSub},function(a){e=a.QueryExport}],execute:function(){a("Shell",(g=f=function b(a,d){c(this,b),a.listen(),d.listen()},f.inject=[d,e],h=g)),a("Shell",h)}}}),System.register("views/index.js",[],function(a,b){"use strict";function c(a){var b=["views/query-status/query-status"];a.globalResources.apply(a,b)}return a("configure",c),{setters:[],execute:function(){}}}),function(){var a=System.amdDefine;a("views/mailto/mailto.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/mailto/mailto.service.js",["repository/qep.repository"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g;return{setters:[function(a){d=a.QEPRepository}],execute:function(){a("MailToService",(f=e=function(){function a(b){c(this,a),this.repository=b}return a.prototype.fetchStewardEmail=function(){return this.repository.fetchStewardEmail()},a}(),e.inject=[d],g=f)),a("MailToService",g)}}}),System.register("views/mailto/mailto.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("MailConfig",c={mailto:"mailto:",subject:encodeURIComponent("Question from a SHRINE User"),body:encodeURIComponent("Please enter the suggested information and your question. Your data steward will reply to this email.\n \n\n***Never send patient information, passwords, or other sensitive information by email****\n \nName:\n \nTitle:\n \nUser name (to log into SHRINE):\n \nTelephone Number (optional):\n \nPreferred email address (optional):\n \n\nQuestion or Comment:")}),a("MailConfig",c)}}}),System.register("views/mailto/mailto.js",["views/mailto/mailto.service","views/mailto/mailto.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.MailToService},function(a){e=a.MailConfig}],execute:function(){a("MailTo",(g=f=function(){function a(b,d){c(this,a),this.service=b,this.config=d}return a.prototype.openEmail=function(){var a=this;this.service.fetchStewardEmail().then(function(b){window.top.location="mailto:"+b+"?subject="+a.config.subject+"&body="+a.config.body})},a}(),f.inject=[d,e],h=g)),a("MailTo",h)}}}),function(){var a=System.amdDefine;a("views/query-status/query-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("repository/qep.repository.js",["aurelia-fetch-client","fetch"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.HttpClient},function(a){}],execute:function(){e=function(){function a(a,b){for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:0;return this.http.fetch("qep/queryResults?limit="+a+"&skip="+b,{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchNetworkId=function(a){return this.http.fetch("qep/networkId?queryName='"+a+"'",{method:"get"}).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchQuery=function(a,b,c){return this.http.fetch("qep/queryResult/"+a+"?timeoutSeconds="+b+"&afterVersion="+c,{method:"get"}).then(function(a){var b=a.url,c=a.statusText,d=a.status,e=a.ok;return console.log("fetchQuery: "+b+" - "+e+" - "+d+" - "+c),a.json()})["catch"](function(a){return a})},a.prototype.fetchStewardEmail=function(){return this.http.fetch("data?key=stewardEmail",{method:"get"}).then(function(a){return a.json()}).then(function(a){return a.indexOf('"')>0?a.split('"')[1]:a})["catch"](function(){return""})},e(a,[{key:"url",get:function(){var a=document.URL,b=":6443/shrine-metadata/";return a.substring(0,a.lastIndexOf(":"))+b}},{key:"auth",get:function(){var a=sessionStorage.getItem("shrine.auth");return sessionStorage.removeItem("shrine.auth"),a}}]),a}(),f.inject=[d],h=g)),a("QEPRepository",h)}}}),System.register("services/query-status.model.js",["aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QEPRepository},function(a){f=a.commands,g=a.notifications}],execute:function(){h=Object.assign||function(a){for(var b=1;b1?g-1:0),i=1;i'})}(),System.register("views/query-viewer/context-menu/context-menu.js",["aurelia-framework","aurelia-event-aggregator","common/shrine.messages"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l,m,n;return{setters:[function(a){f=a.bindable},function(a){g=a.EventAggregator},function(a){h=a.commands}],execute:function(){a("ContextMenu",(l=k=function b(a,c){var e=this;d(this,b),m.call(this),b.prototype.cloneQuery=function(b){a.publish(c.i2b2.cloneQuery,b),e.context["class"]="hide"},b.prototype.renameQuery=function(b){a.publish(c.i2b2.renameQuery,b),e.context["class"]="hide"},b.prototype.flagQuery=function(b){a.publish(c.i2b2.flagQuery,b),e.context["class"]="hide"},b.prototype.unflagQuery=function(b){a.publish(c.i2b2.unflagQuery,b),e.context["class"]="hide"}},k.inject=[g,h],m=function(){c(this,"context",j,this)},i=l,j=e(i.prototype,"context",[f],{enumerable:!0,initializer:null}),n=i)),a("ContextMenu",n)}}}),System.register("views/query-viewer/date.converter.js",["moment"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[function(a){d=a["default"]}],execute:function(){a("DateValueConverter",e=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return d(a).format("MM/DD/YYYY")},a}()),a("DateValueConverter",e)}}}),function(){var a=System.amdDefine;a("views/query-viewer/paginator/paginator.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/paginator/paginator.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l;return{setters:[function(a){f=a.bindable}],execute:function(){g=function(){function a(a,b){for(var c=0;cb?b:a,this.element.dispatchEvent(new CustomEvent("paginator-click",{detail:{index:this.index},bubbles:!0,cancelable:!0}))}}]),a}(),j.inject=[Element],h=k,i=e(h.prototype,"pages",[f],{enumerable:!0,initializer:null}),l=h)),a("Paginator",l)}}}),function(){var a=System.amdDefine;a("views/query-viewer/query-status/query-status.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/query-status/query-status.js",["aurelia-framework","ramda"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l,m;return{setters:[function(a){f=a.bindable},function(a){g=a}],execute:function(){a("QueryStatus",(k=j=function(){function a(b){d(this,a),l.call(this),this.floor=b.floor}return a.prototype.attached=function(){var a=75,b=g.curry(function(a,b,c,d){return a(d/c*b)})(this.floor,a,this.status.total),c=this.status,d=b(c.finished),e=b(c.error);this.readyOffset=100-d,this.errorOffset=this.readyOffset-e,this.finished=c.finished,this.error=c.error,this.pending=c.total-(c.finished+c.error),this.total=c.total},a}(),j.inject=[Math],l=function(){c(this,"status",i,this)},h=k,i=e(h.prototype,"status",[f],{enumerable:!0,initializer:null}),m=h)),a("QueryStatus",m)}}}),System.register("views/query-viewer/query-viewer.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("QueryViewerConfig",c={maxNodesPerScreen:10,maxQueriesPerScroll:40}),a("QueryViewerConfig",c)}}}),function(){var a=System.amdDefine;a("views/query-viewer/query-viewer.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/scroll.service.js",["ramda","common/container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("ScrollService",(g=f=function b(){c(this,b)},f.either=d.curry(function(a,b,c){return e.of(d.prop(a,c)||b)}),f.target=function(a,b){return h.either("target",b,b).chain(function(b){return h.either(a,0,b)})},f.clientHeight=function(a){return h.target("clientHeight",a)},f.scrollHeight=function(a){return h.target("scrollHeight",a)},f.scrollTop=function(a){return h.target("scrollTop",a)},f.userScroll=function(a){return h.clientHeight(a).map(function(b){return b+h.scrollTop(a).value})},f.scrollRatio=function(a){return h.userScroll(a).map(function(b){return b/h.scrollHeight(a).value})},h=g)),a("ScrollService",h)}}}),System.register("views/query-viewer/query-viewer.js",["aurelia-event-aggregator","common/queries.model","./scroll.service","common/shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.EventAggregator},function(a){e=a.QueriesModel},function(a){f=a.ScrollService},function(a){g=a.notifications,h=a.commands}],execute:function(){a("QueryViewer",(j=i=function(){function a(b,d,e,g){var h=this;c(this,a),a.prototype.init=function(){h.pageIndex=0,h.showLoader=!0,h.vertStyle="v-min",h.runningQueryName=null},this.init(),a.prototype.setToPage=function(a){h.pageIndex=a,h.page=h.pages[h.pageIndex]};var i=function(a){return 1===f.scrollRatio(a).value};a.prototype.onScroll=function(a){i(a)&&!h.loadingInfiniteScroll&&d.moreToLoad()&&(h.loadingInfiniteScroll=!0,d.load())},a.prototype.publishError=function(a,c){return a.stopPropagation(),b.publish(g.i2b2.showError,c)},a.prototype.getContext=function(a,b,c){return{x:a.pageX,y:a.pageY,"class":"show",query:b,isCount:void 0!==c,count:c}},b.subscribe(e.i2b2.historyRefreshed,function(){return d.load()}),b.subscribe(e.i2b2.tabMax,function(){return h.vertStyle="v-full"}),b.subscribe(e.i2b2.tabMin,function(){return h.vertStyle="v-min"}),b.subscribe(e.i2b2.queryStarted,function(a){return h.runningQueryName=a}),b.subscribe(e.shrine.queriesReceived,function(a){h.pages=a,h.page=h.pages[0],h.runningQueryName=null,h.loadingInfiniteScroll=!1,h.showLoader=!1})}return a.prototype.updatePage=function(a){a.stopPropagation();var b=event.detail.index;this.page=this.pages[b]},a}(),i.inject=[d,e,g,h],k=j)),a("QueryViewer",k)}}}),function(){var a=System.amdDefine;a("views/query-viewer/result-row/loading-bar/loading-bar.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return''})}(),System.register("views/query-viewer/result-row/loading-bar/loading-bar.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i;return{setters:[function(a){f=a.bindable}],execute:function(){a("LoadingBar",(g=function b(){d(this,b),c(this,"status",h,this)},h=e(g.prototype,"status",[f],{enumerable:!0,initializer:null}),i=g)),a("LoadingBar",i)}}}),function(){var a=System.amdDefine;a("views/query-viewer/result-row/loading-bar/row-loader.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return""})}(); \ No newline at end of file diff --git a/shrine-webclient/src/main/js/client/js-shrine/src/services/query-export.js b/shrine-webclient/src/main/js/client/js-shrine/src/services/query-export.js index c5a79a481..e95f8034a 100644 --- a/shrine-webclient/src/main/js/client/js-shrine/src/services/query-export.js +++ b/shrine-webclient/src/main/js/client/js-shrine/src/services/query-export.js @@ -1,54 +1,54 @@ import {PubSub} from './pub-sub'; export class QueryExport extends PubSub{ constructor(...rest) { super(...rest); } listen() { this.subscribe(this.commands.shrine.exportResult, convertObjectToCSV); } } const convertObjectToCSV = (d) => { const nodes = d.nodes.sort(); const m = new Map(); const desc = ({resultType:{i2b2Options:{description}}}) => description; const brdSort = (a,b) => desc(a) <= desc(b)? -1 : 1; nodes.forEach(({breakdowns = []}) => { breakdowns.sort(brdSort).forEach(({resultType:{i2b2Options:{description}}, results}) => m.has(description)? m.get(description).add(...results.map(r => r.dataKey).sort()) : m.set(description, new Set(results.map(r => r.dataKey).sort())) ) }); const line1 = `SHRINE QUERY RESULTS (OBFUSCATED PATIENT COUNTS),${['', ...nodes.map(n => n.adapterNode).join(',')]}`; const line2 = `\nAll Patients,${['', ...nodes.map(n => n.count? (n.count > 0? n.count : 0) : 'unavailable').join(',')]}`; const result = []; m.forEach((v, k) => { result.push('',...Array.from(v).map(s => { const title = `${k.split(' ').shift()},${s}`; const values = nodes.map(({breakdowns = []}) => { const b = breakdowns.find(({resultType:{i2b2Options:{description}}, results}) => description === k); const r = b? b.results.find(r => r.dataKey === s) : undefined; return !r? 'unavailable': r.value > 0? r.value : 0; }); return `${title},${values.join(",")}`; })); }); const csv = `${line1}${line2}${result.join('\n')}`; exportIEWebkitGecko(csv); } const exportIEWebkitGecko = (csv, context = window.parent) => { if(context === undefined) return; const filename = "export.csv"; const blob = new Blob([csv]); const isIE = context.navigator !== undefined && context.navigator.msSaveOrOpenBlob !== undefined if (isIE) context.navigator.msSaveBlob(blob, filename); else { const a = context.parent.document.createElement('a'); a.href = context.URL.createObjectURL(blob, {type: "text/plain"}); a.download = filename; - document.body.appendChild(a); + context.document.body.appendChild(a); a.click(); // IE: "Access is denied"; see: https://connect.microsoft.com/IE/feedback/details/797361/ie-10-treats-blob-url-as-cross-origin-and-denies-access - document.body.removeChild(a); + context.document.body.removeChild(a); } } \ No newline at end of file