126. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/3/2018 11:43:47 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

126.1 Files compared

# Location File Last Modified
1 eHealth_v8.2.0_build_8.2.0.1.zip\NHIN_adapter\AdapterSubscriptionServiceTesterWEB\src\main\webapp\js app_old.js Tue Jun 26 18:12:59 2018 UTC
2 eHealth_v8.2.0_build_8.2.0.1.zip\NHIN_adapter\AdapterSubscriptionServiceTesterWEB\src\main\webapp\js app_old.js Sat Jun 30 13:04:05 2018 UTC

126.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 6 408
Changed 5 10
Inserted 0 0
Removed 0 0

126.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

126.4 Active regular expressions

No regular expressions were active.

126.5 Comparison detail

  1   var app =  angular.mo dule('subs criptionSe rviceTeste rApp', []) ;
  2  
  3   app.config (function  () {
  4  
  5   });
  6  
  7   app.contro ller('cont roller', [ '$scope',  '$http', ' $timeout',  '$filter' , function  ($scope,  $http, $ti meout, $fi lter) {
  8                    
  9                    $sco pe.sites =  [
  10                         {id: "983" , name: "9 83/CHYSHR" },
  11                         {id: "984" , name: "9 84/DAYTSHR "}
  12                    ]; 
  13                    $sco pe.patient s = [
  14                             {id: " 1012638924 V546709",  name: "NWH INONE"} , 
  15                             {id: " 1012638925 V204624",  name: "NWH INTWO"} ,
  16                             {id: " 1012663918 V362378",  name: "NWH INFIVE"}
  17                    ]; 
  18                    
  19                    $sco pe.subscri be = funct ion () {
  20                $scope.d ocumentRef erences =  null;
  21                $scope.n hioStatuse s = null;
  22                $scope.s ubscriptio nID = null ;
  23                $scope.s ubscriptio nStatus =  null;
  24                $scope.l astModifie d = null;
  25                $scope.E Tag = null ;
  26                var req  = {
  27                    reso urceType:  "Subscript ion",
  28                    // f rom Resour ce: id, me ta, implic itRules, a nd languag e
  29                    // f rom Domain Resource:  text, cont ained, ext ension, an d modifier Extension
  30                    stat us: "reque sted", //  R!  reques ted | acti ve | error  | off
  31                    cont act: [], / / Contact  details fo r source ( e.g. troub leshooting )
  32                    end:  null, //  When to au tomaticall y delete t he subscri ption
  33                    reas on: "Prefe tch", // R !  Descrip tion of wh y this sub scription  was create d
  34                    crit eria: "Doc umentRefer ence?patie nt=Patient /" + $scop e.patient. id, // R!   Rule for  server pus h criteria
  35                    erro r: "<strin g>", // La test error  note
  36                    chan nel: {// R !  The cha nnel on wh ich to rep ort matche s to the c riteria
  37                         type: $sco pe.useWebS ocket ? "w ebsocket"  : "rest-ho ok", // R!   rest-hoo k | websoc ket | emai l | sms |  message
  38                         endpoint:  !$scope.us eWebSocket  ? "http:/ /MOCK-HOST :8090/on-n otify" : n ull, // Wh ere the ch annel poin ts to
  39                         payload: n ull, // Mi metype to  send, or o mit for no  payload
  40                         header: !$ scope.useW ebSocket ?  ["X-Trans actionID:  DAS-098765 4321"] : n ull // Usa ge depends  on the ch annel type
  41                    },
  42                    exte nsion: [{
  43                               url: "http :// URL /Structure Definition /EHXSubscr iption/ann ouncePatie nt",
  44                             valueB oolean: $s cope.annou nce
  45                         }, {
  46                               url: "http :// URL /Structure Definition /EHXSubscr iption/aut oDocRetrie ve",
  47                             valueB oolean: $s cope.autoD R
  48                         }, {
  49                               url: "http :// URL /Structure Definition /EHXSubscr iption/ass ertions",
  50                             extens ion: [{
  51                                      url: "us erID",
  52                                      valueStr ing: $scop e.site.id  + ":user12 3"
  53                                 },  {
  54                                      url: "us erName",
  55                                      valueStr ing: "User  1-2-3"
  56                                 },  {
  57                                      url: "sy stemID",
  58                                      valueStr ing: "JLV"
  59                                 },  {
  60                                      url: "or ganization ID",
  61                                      valueStr ing: "2.16 .840.1.113 883.4.349. 983"
  62                                 },  {
  63                                      url: "or ganization Name",
  64                                      valueStr ing: "Depa rtment of  Veterans A ffairs - C HYSHR"
  65                                 },  {
  66                                      url: "pu rposeOfUse ",
  67                                      valueStr ing: "TREA TMENT"
  68                                 },  {
  69                                      url: "ro le",
  70                                      valueStr ing: "1122 47003"
  71                                 }]
  72                         }]
  73                };
  74  
  75                $scope.s ubscriptio nTime = $f ilter('dat e')(new Da te(), 'yyy y-MM-ddTHH :mm:ss', ' UTC') + 'Z ';
  76  
  77                $http.po st('/Adapt erSubscrip tionServic e/FHIR/Sub scription' , JSON.str ingify(req )).then(fu nction (re sponse) {
  78                    $sco pe.subscri ptionLocat ion = resp onse.heade rs('Locati on');
  79  
  80                    if ( $scope.use WebSocket)  {
  81                         $scope.set upWebSocke t();
  82                    }
  83  
  84                    $sco pe.monitor Subscripti on();
  85                });
  86           };
  87  
  88           $s cope.monit orSubscrip tion = fun ction () {
  89                var conf ig = null;
  90                if ($sco pe.ETag != = null) {
  91                    conf ig = {head ers: {'If- None-Match ': $scope. ETag}};
  92                }
  93                $http.ge t($scope.s ubscriptio nLocation,  config).t hen(functi on (respon se) {
  94                    $sco pe.ETag =  response.h eaders('ET ag');
  95                    $sco pe.lastMod ified = re sponse.hea ders('Last -Modified' );
  96                    var  subscripti on = respo nse.data;
  97                    var  nhioStatus es = [];
  98                    for  (var i in  subscripti on.extensi on) {
  99                         var ext =  subscripti on.extensi on[i];
  100                          if (ext.ur l === 'htt p:// URL /Structure Definition /EHXSubscr iption/nhi oStatus')  {
  101                             var nh ioStatus =  ext.exten sion;
  102                             var o  = {};
  103                             for (v ar j in nh ioStatus)  {
  104                                 va r field =  nhioStatus [j];
  105                                 sw itch (fiel d.url) {
  106                                      case 'hc id':
  107                                          o.hc id = field .valueStri ng;
  108                                          brea k;
  109  
  110                                      case 'st atus':
  111                                          o.st atus = fie ld.valueCo de;
  112                                          brea k;
  113  
  114                                      case 'ty pe':
  115                                          o.st age = fiel d.valueCod e;
  116                                          brea k;
  117  
  118                                      default:
  119                                          brea k;
  120                                 }
  121                             }
  122                             nhioSt atuses.pus h(o);
  123                         }
  124                    }
  125                    $sco pe.subscri ptionStatu s = subscr iption.sta tus;
  126                    $sco pe.nhioSta tuses = nh ioStatuses ;
  127                    $sco pe.subscri ptionID =  subscripti on.id;
  128  
  129                    $htt p.get('/Ad apterSubsc riptionSer vice/FHIR/ DocumentRe ference?pa tient=Pati ent/' + $s cope.patie nt.id + '& _lastUpdat ed=>=' + $ scope.subs criptionTi me).then(f unction (r esponse) {
  130                         var bundle  = respons e.data;
  131                         var docume ntReferenc es = [];
  132                         for (var i  in bundle .entry) {
  133                             var en try = bund le.entry[i ].resource ;
  134                             var hc id = "";
  135                             for (v ar j in en try.extens ion) {
  136                                 va r ext = en try.extens ion[j];
  137                                   if (ext.ur l === "htt p:// URL /Structure Definition /EHXDocume nteReferen ce/homeCom munityId")  {
  138                                      hcid = e xt.valueSt ring;
  139                                      break;
  140                                 }
  141                             }
  142                             docume ntReferenc es.push({
  143                                 hc id: hcid,
  144                                 en try: entry
  145                             });
  146                         }
  147                         $scope.doc umentRefer ences = do cumentRefe rences;
  148                    });
  149  
  150                    if ( !$scope.us eWebSocket ) {
  151                         if (subscr iption.sta tus !== 'o ff') {
  152                             $timeo ut($scope. monitorSub scription,  1000);
  153                         }
  154                    } el se {
  155                         if (subscr iption.sta tus === 'o ff') {
  156                             $scope .tearDownW ebSocket() ;
  157                         }
  158                    }
  159                }, funct ion (respo nse) {
  160                    if ( !$scope.us eWebSocket ) {
  161                         if (respon se.status  === 304) {
  162                             $timeo ut($scope. monitorSub scription,  1000);
  163                         }
  164                    } el se {
  165                         if (respon se.status  !== 304) {
  166                             $scope .tearDownW ebSocket() ;
  167                         }
  168                    }
  169                });
  170           };
  171  
  172           $s cope.setup WebSocket  = function  () {
  173                var prot  = window. location.p rotocol == = 'https:'  ? 'wss' :  'ws';
  174                var ws =  $scope.ws  = new Web Socket(pro t + '://'  + window.l ocation.ho stname + ' :' + windo w.location .port + '/ AdapterSub scriptionS ervice/Sub scriptionW S');
  175  
  176                ws.onope n = functi on () {
  177                    ws.s end('bind  ' + $scope .subscript ionLocatio n.substr($ scope.subs criptionLo cation.las tIndexOf(' /') + 1));
  178                };
  179  
  180                ws.onerr or = funct ion () {
  181                    cons ole.log('A n error ha ppened');
  182                };
  183  
  184                ws.onmes sage = fun ction (mes sage) {
  185                    cons ole.log(me ssage.data );
  186                    var  data = ""  + message. data;
  187                    if ( data.index Of('ping')  === 0) {
  188                         ws.send('p ong ' + $s cope.subsc riptionLoc ation.subs tr($scope. subscripti onLocation .lastIndex Of('/') +  1));
  189                         $scope.mon itorSubscr iption();
  190                    }
  191                    else  if (data. indexOf('u nbound') = == 0) {
  192                         ws.close() ;
  193                    }
  194                };
  195  
  196                ws.onclo se = funct ion () {
  197                    cons ole.log('W ebSocket c losed');
  198                    if ( $scope.sub scriptionS tatus !==  'off') {
  199                         $scope.mon itorSubscr iption();
  200                         console.lo g('  Re-co nnecting.' );
  201                         $timeout($ scope.setu pWebSocket , 500);
  202                    }
  203                };
  204           };
  205           
  206           $s cope.tearD ownWebSock et = funct ion() {
  207                $scope.w s.send('un bind ' + $ scope.subs criptionLo cation.sub str($scope .subscript ionLocatio n.lastInde xOf('/') +  1));
  208           };
  209       }]);