921. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 10/3/2017 11:16:05 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.

921.1 Files compared

# Location File Last Modified
1 ehmp.zip\ehmp\ehmp\product\production\vx-sync\tools\vista-sync-tools rpc-fetch.js Mon Jul 10 17:46:22 2017 UTC
2 ehmp.zip\ehmp\ehmp\product\production\vx-sync\tools\vista-sync-tools rpc-fetch.js Tue Oct 3 13:38:28 2017 UTC

921.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 210
Changed 2 8
Inserted 0 0
Removed 0 0

921.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

921.4 Active regular expressions

No regular expressions were active.

921.5 Comparison detail

  1   'use stric t';
  2  
  3   require('. ./../env-s etup');
  4   var _ = re quire('und erscore');
  5   var inspec t = requir e('util'). inspect;
  6   var rpcUti l = requir e(global.V X_UTILS +  '/rpc-util ');
  7   var objUti l = requir e(global.V X_UTILS +  'object-ut ils');
  8  
  9   var argv =  require(' yargs')
  10           .u sage('Usag e: $0 [opt ions...]')
  11           .d emand(['ho st', 'port '])
  12           .d emand(['si te'])
  13           .s tring('sit e')
  14           .d escribe('s ite', 'Sit e hash of  the VistA  site where  the reque st is bein g directed .')
  15           .d escribe('h ost', 'IP  Address of  the VistA  host')
  16           .d escribe('p ort', 'Por t of the V istA host' )
  17           .d escribe('a ccessCode' , 'Value t o use for  accessCode  for valid ation. Def aults to  REDACTED )
  18           .d escribe('v erifyCode' , 'Value t o use for  verifyCode  for valid ation. Def aults to  REDACTED ')
  19           .n args('acce ssCode', 1 )
  20           .n args('veri fyCode', 1 )
  21           .d escribe('c ontext', ' Context to  set for r unning the  RPC. Defa ults to VP R SYNCHRON IZATION CO NTEXT or H MP SYNCHRO NIZATION C ONTEXT')
  22           .d escribe('l astUpdate' , 'Value o f the last Update rec eived. Def aults to 0 ')
  23           .d escribe('m axBatchSiz e', 'Maxim um Batch S ize to ret urn.')
  24           .d escribe('h mpServerId ', 'Value  for the hm pServerId  parameter.  Defaults  to hmp-dev elopment-b ox.')
  25           .d escribe('l ogLevel',  'bunyan lo g levels,  one of: tr ace, debug , info, wa rn, error,  fatal. De faults to  error.')
  26           .a rgv;
  27  
  28  
  29   var logger  = require ('bunyan') .createLog ger({
  30           na me: 'rpc',
  31           le vel: argv. logLevel | | 'error'
  32   });
  33  
  34   var worker Config = r equire(glo bal.VX_ROO T + 'worke r-config') ;
  35  
  36   var config  = {
  37           ho st: argv.h ost,
  38           po rt: argv.p ort,
  39           ac cessCode:  argv.acces sCode || ' REDACTED ,
  40           ve rifyCode:  argv.verif yCode || ' REDACTED ',
  41           lo calIP: '12 7.0.0.1',
  42           lo calAddress : 'localho st',
  43           co ntext: arg v.context  || 'HMP SY NCHRONIZAT ION CONTEX T',
  44           co nnectTimeo ut: 3000,
  45           se ndTimeout:  10000
  46   };
  47  
  48   var rpc =  'HMPDJFS A PI';
  49   var params  = {
  50           '" command"':  'getPtUpd ates',
  51           '" lastUpdate "': argv.l astUpdate  ? String(a rgv.lastUp date) : '0 ',
  52           '" getStatus" ': true,
  53           '" max"': arg v.maxBatch Size || '1 000',
  54           '" hmpVersion "': '0.7-S 65',
  55           '" extractSch ema"': '3. 001',
  56           '" server"':  argv.hmpSe rverId ||  'hmp-devel opment-box '
  57   };
  58  
  59   // Make su re the sit e is valid .
  60   //-------- ---------- ---------- --
  61   var site;
  62   if ((_.isS tring(argv .site)) &&  (_.isObje ct(workerC onfig.vist aSites[arg v.site])))  {
  63       site =  argv.site ;
  64   } else {
  65       consol e.log('Sit e: %s is n ot a valid  site.  Ve rify the e xistence o f this sit e in worke r-config.j son.', arg v.site);
  66       proces s.exit();
  67   };
  68  
  69   // Make su re the ip  and ports  match.
  70   //-------- ---------- ---------- --
  71   if (config .host != o bjUtil.get Property(w orkerConfi g, 'vistaS ites', sit e, 'host') ) {
  72       consol e.log('req uested ip  address do es not mat ch configu ration');
  73       proces s.exit();
  74   };
  75   if (config .port != o bjUtil.get Property(w orkerConfi g, 'vistaS ites', sit e, 'port') ) {
  76       consol e.log('req uested por t does not  match con figuration ');
  77       proces s.exit();
  78   };
  79  
  80   // Make su re that th e site bei ng request ed is conf igured for  multiple  poller mod e.
  81   //-------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
  82   var multip leMode = o bjUtil.get Property(w orkerConfi g, 'vistaS ites', sit e, 'multip leMode');
  83   if (multip leMode ===  true) {
  84       consol e.log('Sit e: %s is c onfigured  as a multi -poller-mo de site.   This utili ty is only  valid for  sites run ning in si ngle-polle r-mode.',  argv.site) ;
  85       proces s.exit();
  86   };
  87  
  88   rpcUtil.st andardRPCC all(logger , config,  rpc, param s, null, f unction(er ror, respo nse) {
  89           lo gger.debug ('Complete d calling  Fetch RPC  for dfn: % s; result:  %j', argv .dfn, resp onse);
  90           if  (error) {
  91                    cons ole.log('E rror calli ng Fetch') ;
  92                    cons ole.log(er ror);
  93                    if ( response)  {
  94                             consol e.log(resp onse);
  95                    }
  96                    proc ess.exit(1 );
  97           }
  98  
  99           co nsole.log( 'Called Fe tch');
  100           co nsole.log( 'Response: ');
  101           tr y {
  102                    cons ole.log(in spect(JSON .parse(res ponse), {
  103                             depth:  null
  104                    }));
  105           }  catch (err ) {
  106                    cons ole.log(re sponse);
  107           }
  108           pr ocess.exit (0);
  109   });