Produced by Araxis Merge on 10/4/2017 9:15:14 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 | vista-js.zip\vista-js\src | examples.js | Tue Sep 27 13:46:04 2016 UTC |
| 2 | vista-js.zip\vista-js\src | examples.js | Wed Oct 4 13:40:42 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 238 |
| Changed | 1 | 10 |
| 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 | var util = require(' util'); | |
| 4 | var _ = re quire('und erscore'); | |
| 5 | var clc = require('c li-color') ; | |
| 6 | var moment = require ('moment') ; | |
| 7 | var RpcCli ent = requ ire('./Rpc Client').R pcClient; | |
| 8 | var logger = require ('bunyan') .createLog ger({ | |
| 9 | name: 'RpcClient ', | |
| 10 | level: 'trace' | |
| 11 | }); | |
| 12 | ||
| 13 | ||
| 14 | ||
| 15 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /// | |
| 16 | /* | |
| 17 | TO DO: | |
| 18 | ||
| 19 | 1. handle default lo gging bett er (maybe throw an e xception, or write t o console. log) | |
| 20 | 2. add 3rd parameter to callba ck with ad ditional r eturned in fo (i.e. a uthenticat ion, etc.) | |
| 21 | 3. add aut henticate( ) function | |
| 22 | 4. get rid of 'throw ' in resul ts process ing | |
| 23 | 5. look in to connect ion poolin g (can the user be c hanged? ca n multiple RPCs be c alled?): | |
| 24 | ||
| 25 | */ | |
| 26 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /// | |
| 27 | ||
| 28 | ||
| 29 | ||
| 30 | function i nspect(obj ) { | |
| 31 | return obj ? uti l.inspect( obj, { | |
| 32 | de pth: null | |
| 33 | }) : ' '; | |
| 34 | } | |
| 35 | ||
| 36 | function p rintResult (error, re sult) { | |
| 37 | consol e.log(clc. red(inspec t(error))) ; | |
| 38 | consol e.log(clc. cyan(inspe ct(result) )); | |
| 39 | } | |
| 40 | ||
| 41 | function p rintJsonRe sult(error , result) { | |
| 42 | consol e.log(clc. red(inspec t(error))) ; | |
| 43 | ||
| 44 | var ou tput = res ult; | |
| 45 | try { | |
| 46 | ou tput = JSO N.parse(re sult); | |
| 47 | } catc h (err) { | |
| 48 | // use defau lt | |
| 49 | } | |
| 50 | ||
| 51 | consol e.log(clc. cyan(inspe ct(output) )); | |
| 52 | } | |
| 53 | ||
| 54 | var contex t = 'OR CP RS GUI CHA RT'; | |
| 55 | ||
| 56 | var config uration = { | |
| 57 | contex t: 'HMP UI CONTEXT', | |
| 58 | host: ' IP ', | |
| 59 | port: PORT , | |
| 60 | accessCode : ' USER ', | |
| 61 | verifyCode : ' PW ', | |
| 62 | localIP: ' IP ', | |
| 63 | localA ddress: 'l ocalhost' | |
| 64 | }; | |
| 65 | ||
| 66 | ||
| 67 | // VistaJS .callRpc(l ogger, con figuration , 'ORWDAL3 2 ALLERGY MATCH', Vi staJS.RpcP arameter.l iteral('AM P'), print Result); | |
| 68 | // VistaJS .callRpc(l ogger, con figuration , 'ORWDAL3 2 ALLERGY MATCH', 'A MP', print Result); | |
| 69 | ||
| 70 | // VistaJS .callRpc(l ogger, con figuration , 'VPRCRPC RPC', { ' "command"' : 'logPati entAccess' , '"patien tId"': '16 7' }, prin tResult); | |
| 71 | // respons e -> '{"re sult":"ok" }' | |
| 72 | ||
| 73 | RpcClient. callRpc(lo gger, conf iguration, 'VPRCRPC RPC', { '" command"': 'getPatie ntChecks', '"patient Id"': '3' }, printRe sult); | |
| 74 | // respons e -> '{}' | |
| 75 | ||
| 76 | // VistaJS .callRpc(l ogger, con figuration , 'VPRCRPC RPC', { ' "command"' : 'getPati entChecks' , '"patien tId"': '16 7' }, prin tResult); | |
| 77 | // respons e -> '{"se nsitive":{ "dfn":167, "logAccess ":true,"ma yAccess":t rue,"text" :"\\r\\n** *RESTRICTE D RECORD** *\\r\\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \\r\\n* T his record is protec ted by the Privacy A ct of 1974 and the H ealth * \\r\\n* In surance Po rtability and Accoun tability A ct of 1996 . If you e lect *\ \r\\n* to proceed, y ou will be required to prove y ou have a need to kn ow. *\\ r\\n* Acce ssing this patient i s tracked, and your station Se curity Off icer *\\r \\n* will contact yo u for your justifica tion. *\\r\ \n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "}}' | |
| 78 | ||
| 79 | ||
| 80 | // VistaJS .callRpc(l ogger, con figuration , 'ORWU US ERINFO', p rintResult ); | |
| 81 | ||
| 82 | RpcClient. authentica te(logger, configura tion, prin tResult); | |
| 83 | ||
| 84 | RpcClient. callRpc(lo gger, conf iguration, 'VPR GET PATIENT DA TA JSON', { '"patien tId"': '8' , '"domain "': 'aller gy' }, pri ntResult); | |
| 85 | ||
| 86 | // VistaJS .callRpc(l ogger, con figuration , 'ORWDAL3 2 SYMPTOMS ', [ | |
| 87 | // Vis taJS.RpcPa rameter.li teral(''), | |
| 88 | // Vis taJS.RpcPa rameter.li teral('1') | |
| 89 | // ], prin tResult); | |
| 90 | ||
| 91 | // VistaJS .callRpc(l ogger, con figuration , 'ORWDAL3 2 SYMPTOMS ', ['', '1 '], printR esult); | |
| 92 | ||
| 93 | RpcClient. callRpc(lo gger, conf iguration, 'ORWDAL32 SYMPTOMS' , '', '1', printResu lt); | |
| 94 | // VistaJS .callRpc(l ogger, con figuration , 'ORWDAL3 2 SYMPTOMS ', '', 1, printResul t); | |
| 95 | ||
| 96 | // VistaJS .callRpc(l ogger, con figuration , 'ORWDAL3 2 DEF', pr intResult) ; | |
| 97 | ||
| 98 | // var all ergyList = { | |
| 99 | // '"G MRAGNT"': 'SULFAPYRI DINE^88;PS (50.416,', | |
| 100 | // '"G MRATYPE"': 'D^Drug', | |
| 101 | // '"G MRANATR"': 'A^Allerg y', | |
| 102 | // '"G MRAORIG"': '10000000 225', | |
| 103 | // '"G MRAORDT"': '3140904. 1737', | |
| 104 | // '"G MRASYMP",0 ': '1', | |
| 105 | // '"G MRASYMP",1 ': '39^ANX IETY^^^', | |
| 106 | // '"G MRACHT",0' : '1', | |
| 107 | // '"G MRACHT",1' : '3140904 .17374', | |
| 108 | // '"G MRAOBHX"': 'h^HISTOR ICAL' | |
| 109 | // }; | |
| 110 | ||
| 111 | // VistaJS .callRpc(l ogger, con figuration , 'ORWDAL3 2 SAVE ALL ERGY', '0' , '8', all ergyList, printResul t); | |
| 112 | ||
| 113 | ||
| 114 | // cont ext: 'VPR APPLICATIO N PROXY', | |
| 115 | ||
| 116 | // configu ration.rpc = 'GMV AL LERGY'; | |
| 117 | // configu ration.rpc = 'ORQQAL LIST'; | |
| 118 | // VistaJS .callRpc(l ogger, con figuration , 'ORQQAL LIST', [Rp cParameter .literal(' 8')], prin tResult); | |
| 119 | ||
| 120 | ||
| 121 | //VistaJS. callRpc(lo gger, conf iguration, [{ type: 'literal', value: '8 ' }]); | |
| 122 | ||
| 123 | ||
| 124 | //VistaJS. callRpc(lo gger, conf iguration, 'ORWDAL32 ALLERGY M ATCH', ['t est'], [1, 2], { tes t: 'value' }, printR esult); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.