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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tools\vista-sync-tools | rpc-subscribe-domain.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tools\vista-sync-tools | rpc-subscribe-domain.js | Tue Oct 3 13:38:49 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 352 |
| Changed | 3 | 12 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | 'use stric t'; | |
| 2 | ||
| 3 | require('. ./../env-s etup'); | |
| 4 | ||
| 5 | var _ = re quire('und erscore'); | |
| 6 | var uuid = require(' node-uuid' ); | |
| 7 | ||
| 8 | var inspec t = requir e('util'). inspect; | |
| 9 | var RpcCli ent = requ ire('vista -js').RpcC lient; | |
| 10 | ||
| 11 | var argv = require(' yargs') | |
| 12 | .usage ('Usage: $ 0 [options ...]') | |
| 13 | .deman d(['host', 'port', ' dfn']) | |
| 14 | .descr ibe('host' , 'IP Addr ess of the VistA hos t') | |
| 15 | .descr ibe('port' , 'Port of the VistA host') | |
| 16 | .descr ibe('dfn', 'DFN of t he patient for the s ubscribe r equest (\' OP\' for o perational data)') | |
| 17 | .descr ibe('domai ns', 'The domains to use when subscribin g the pati ent. This is a comma -delimited list') | |
| 18 | .describe( 'accessCod e', 'Value to use fo r accessCo de for val idation. D efaults to REDACTED ') | |
| 19 | .describe( 'verifyCod e', 'Value to use fo r verifyCo de for val idation. D efaults to REDACTED ') | |
| 20 | .nargs ('accessCo de', 1) | |
| 21 | .nargs ('verifyCo de', 1) | |
| 22 | .descr ibe('local IP', 'Valu e to use f or the loc alIP param eter in th e RPC call . Defaults to 127.0. 0.1') | |
| 23 | .descr ibe('local Address', 'Value to use for th e localAdd ress param eter in th e RPC call . Defaults to localh ost') | |
| 24 | .descr ibe('conne ctTimeout' , 'Value i n millisec onds to us e for the connectTim eout param eter in th e RPC call . Defaults to 3000') | |
| 25 | .descr ibe('sendT imeout', ' Value in m illisecond s to use f or the sen dTimeout p arameter i n the RPC call. Defa ults to 10 000') | |
| 26 | .descr ibe('conte xt', 'Cont ext to set for runni ng the RPC . Defaults to or HMP SYNCHRONI ZATION CON TEXT') | |
| 27 | .descr ibe('hmpSe rverId', ' Value for the hmpSer verId para meter. Def aults to h mp-develop ment-box') | |
| 28 | .descr ibe('logLe vel', 'bun yan log le vels, one of: trace, debug, in fo, warn, error, fat al. Defaul ts to erro r.') | |
| 29 | .argv; | |
| 30 | ||
| 31 | ||
| 32 | var domain s = [ | |
| 33 | 'aller gy', | |
| 34 | 'auxil iary', | |
| 35 | 'appoi ntment', | |
| 36 | 'diagn osis', | |
| 37 | 'docum ent', | |
| 38 | 'facto r', | |
| 39 | 'immun ization', | |
| 40 | 'lab', | |
| 41 | 'med', | |
| 42 | 'obs', | |
| 43 | 'order ', | |
| 44 | 'probl em', | |
| 45 | 'proce dure', | |
| 46 | 'consu lt', | |
| 47 | 'image ', | |
| 48 | 'surge ry', | |
| 49 | 'task' , | |
| 50 | 'visit ', | |
| 51 | 'vital ', | |
| 52 | 'ptf', | |
| 53 | 'exam' , | |
| 54 | 'cpt', | |
| 55 | 'educa tion', | |
| 56 | 'pov', | |
| 57 | 'skin' , | |
| 58 | 'treat ment', | |
| 59 | 'roadt rip', | |
| 60 | 'patie nt' | |
| 61 | ]; | |
| 62 | ||
| 63 | if (!_.isE mpty(argv. domains)) { | |
| 64 | domain s = _.map( argv.domai ns.split(' ,'), funct ion(domain ) { | |
| 65 | re turn domai n.trim(); | |
| 66 | }); | |
| 67 | } | |
| 68 | ||
| 69 | var logger = require ('bunyan') .createLog ger({ | |
| 70 | name: 'rpc', | |
| 71 | level: argv.logL evel || 'e rror' | |
| 72 | }); | |
| 73 | ||
| 74 | var rpc = 'HMPDJFS A PI'; | |
| 75 | var params = { | |
| 76 | '"serv er"': argv .hmpServer Id || 'hmp -developme nt-box' | |
| 77 | }; | |
| 78 | ||
| 79 | ||
| 80 | if (argv.d fn === 'OP ') { | |
| 81 | params ['"command "'] = 'sta rtOperatio nalDataExt ract'; | |
| 82 | } else { | |
| 83 | params ['"command "'] = 'put PtSubscrip tion'; | |
| 84 | params ['"localId "'] = Stri ng(argv.df n); | |
| 85 | params ['"rootJob Id"'] = uu id.v4(); | |
| 86 | params ['"HMPSVER S"'] = 1; | |
| 87 | ||
| 88 | _.each (domains, function(d omain) { | |
| 89 | va r jobDomai nId = '"jo bDomainId- ' + domain + '"'; | |
| 90 | pa rams[jobDo mainId] = uuid.v4(); | |
| 91 | }); | |
| 92 | } | |
| 93 | ||
| 94 | ||
| 95 | var config = { | |
| 96 | host: argv.host, | |
| 97 | port: argv.port, | |
| 98 | accessCode : argv.acc essCode || ' REDACTED ', | |
| 99 | verifyCode : argv.ver ifyCode || ' REDACTED ', | |
| 100 | localI P: argv.lo calIP || ' 127.0.0.1' , | |
| 101 | localA ddress: ar gv.localAd dress || ' localhost' , | |
| 102 | contex t: argv.co ntext || ' HMP SYNCHR ONIZATION CONTEXT', | |
| 103 | connec tTimeout: argv.conne ctTimeout || 3000, | |
| 104 | sendTi meout: arg v.sendTime out || 100 00 | |
| 105 | }; | |
| 106 | ||
| 107 | RpcClient. callRpc(lo gger, conf ig, rpc, p arams, fun ction(erro r, respons e) { | |
| 108 | logger .debug('Co mpleted ca lling Subs cribe RPC for dfn: % s; result: %j', argv .dfn, resp onse); | |
| 109 | if (er ror) { | |
| 110 | co nsole.log( 'Error cal ling Subsc ribe for d fn: %s', a rgv.dfn); | |
| 111 | co nsole.log( error); | |
| 112 | if (response ) { | |
| 113 | console. log(respon se); | |
| 114 | } | |
| 115 | pr ocess.exit (1); | |
| 116 | } | |
| 117 | ||
| 118 | consol e.log('Cal led Subscr ibe for df n: %s', ar gv.dfn); | |
| 119 | consol e.log('Res ponse:'); | |
| 120 | try { | |
| 121 | co nsole.log( inspect(JS ON.parse(r esponse), { | |
| 122 | depth: n ull | |
| 123 | }) ); | |
| 124 | } catc h (err) { | |
| 125 | co nsole.log( response); | |
| 126 | } | |
| 127 | proces s.exit(0); | |
| 128 | }); | |
| 129 | ||
| 130 | var logger = require ('bunyan') .createLog ger({ | |
| 131 | name: 'rpc', | |
| 132 | level: argv.logL evel || 'e rror' | |
| 133 | }); | |
| 134 | ||
| 135 | var rpc = 'HMPDJFS A PI'; | |
| 136 | var params = { | |
| 137 | '"serv er"': argv .hmpServer Id || 'hmp -developme nt-box' | |
| 138 | }; | |
| 139 | ||
| 140 | ||
| 141 | if (argv.d fn === 'OP ') { | |
| 142 | params ['"command "'] = 'sta rtOperatio nalDataExt ract'; | |
| 143 | } else { | |
| 144 | params ['"command "'] = 'put PtSubscrip tion'; | |
| 145 | params ['"localId "'] = Stri ng(argv.df n); | |
| 146 | } | |
| 147 | ||
| 148 | ||
| 149 | var config = { | |
| 150 | host: argv.host, | |
| 151 | port: argv.port, | |
| 152 | accessCode : argv.acc essCode || ' REDACTED ', | |
| 153 | verifyCode : argv.ver ifyCode || ' REDACTED ', | |
| 154 | localI P: argv.lo calIP || ' 127.0.0.1' , | |
| 155 | localA ddress: ar gv.localAd dress || ' localhost' , | |
| 156 | contex t: argv.co ntext || ' HMP SYNCHR ONIZATION CONTEXT', | |
| 157 | connec tTimeout: argv.conne ctTimeout || 3000, | |
| 158 | sendTi meout: arg v.sendTime out || 100 00 | |
| 159 | }; | |
| 160 | ||
| 161 | RpcClient. callRpc(lo gger, conf ig, rpc, p arams, fun ction(erro r, respons e) { | |
| 162 | logger .debug('Co mpleted ca lling Subs cribe RPC for dfn: % s; result: %j', argv .dfn, resp onse); | |
| 163 | if (er ror) { | |
| 164 | co nsole.log( 'Error cal ling Subsc ribe for d fn: %s', a rgv.dfn); | |
| 165 | co nsole.log( error); | |
| 166 | if (response ) { | |
| 167 | console. log(respon se); | |
| 168 | } | |
| 169 | pr ocess.exit (1); | |
| 170 | } | |
| 171 | ||
| 172 | consol e.log('Cal led Subscr ibe for df n: %s', ar gv.dfn); | |
| 173 | consol e.log('Res ponse:'); | |
| 174 | try { | |
| 175 | co nsole.log( inspect(JS ON.parse(r esponse), { | |
| 176 | depth: n ull | |
| 177 | }) ); | |
| 178 | } catc h (err) { | |
| 179 | co nsole.log( response); | |
| 180 | } | |
| 181 | proces s.exit(0); | |
| 182 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.