Produced by Araxis Merge on 5/9/2017 12:04:21 PM Eastern 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 | OSCIF_HEC_v1.4_Sprint23_build4_Apr_2017.zip\Web_Resources\VIA | VistaLoginControlScriptLib.js | Fri Apr 28 20:45:14 2017 UTC |
| 2 | OSCIF_HEC_v1.4_Sprint23_build4_Apr_2017.zip\Web_Resources\VIA | VistaLoginControlScriptLib.js | Thu May 4 22:57:54 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 414 |
| Changed | 1 | 2 |
| 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 | //VistaLog inControlS criptLib.j s | |
| 2 | //Contains variables and funct ions used by the Vis taLoginCon trol.html page | |
| 3 | ||
| 4 | //Static V ariables | |
| 5 | var vlc_Us erSiteId = ''; | |
| 6 | var vlc_Us erSiteNo = ''; | |
| 7 | var vlc_Vi aLoginMinu tes; | |
| 8 | ||
| 9 | function s etAppNameV alue(value ) { | |
| 10 | consum ingApp.nam e = value; | |
| 11 | via_se tCookie("v iasessiona ppname", v alue, vlc_ ViaLoginMi nutes); | |
| 12 | } | |
| 13 | function s etAppToken Value(valu e) { | |
| 14 | consum ingApp.tok en = value ; | |
| 15 | via_se tCookie("v iasessiona pptoken", value, vlc _ViaLoginM inutes); | |
| 16 | } | |
| 17 | function s etAppPassV alue(value ) { | |
| 18 | consum ingApp.pas sword = va lue; | |
| 19 | via_se tCookie("v iasessiona pppass", v alue, vlc_ ViaLoginMi nutes); | |
| 20 | } | |
| 21 | function s etUrlValue (value) { | |
| 22 | consum ingApp.url = value; | |
| 23 | via_se tCookie("v iasessiona ppurl", va lue, vlc_V iaLoginMin utes); | |
| 24 | } | |
| 25 | function s etNoteTitl eValue(val ue) { | |
| 26 | consum ingApp.not etitleid = value; | |
| 27 | via_se tCookie("v iasessionn otetitleid ", value, vlc_ViaLog inMinutes) ; | |
| 28 | } | |
| 29 | function s etLoginCoo kies(value ) { | |
| 30 | vlc_Vi aLoginMinu tes = valu e; | |
| 31 | getKey ValuePair( "via_consu mingapp_na me", setAp pNameValue ); | |
| 32 | getKey ValuePair( "via_consu mingapp_to ken", setA ppTokenVal ue); | |
| 33 | getKey ValuePair( "via_consu mingapp_pa ss", setAp pPassValue ); | |
| 34 | getKey ValuePair( "via_endpo int", setU rlValue); | |
| 35 | getKey ValuePair( "via_ncchv notetitle_ id", setNo teTitleVal ue); | |
| 36 | } | |
| 37 | ||
| 38 | function v lc_formLoa d() { | |
| 39 | try { | |
| 40 | ||
| 41 | // Determine the status of the pa rent recor d | |
| 42 | if (parent.X rm.Page.ui .getFormTy pe() > 2) { | |
| 43 | //The fo rm is disa bled, hide login sec tion | |
| 44 | parent.X rm.Page.ui .tabs.get( "tab_gener al").secti ons.get("t ab_general _section_v istalogin" ).setVisib le(false); | |
| 45 | return f alse; | |
| 46 | } | |
| 47 | ||
| 48 | // //Get VIA Login URL and other items need ed for log in | |
| 49 | // consumingA pp = new A ppInfo(); | |
| 50 | // vlc_ViaLog inMinutes = 230; | |
| 51 | // consumingA pp.name = "HRC_CRM"; | |
| 52 | // consumingA pp.token = "HRC_CRM_ ID_5496"; | |
| 53 | // consumingA pp.passwor d = "Bf5d2 w!rQj"; | |
| 54 | //consumin gApp.url = "https:// URL . DN S
|
|
| 55 | // consumingA pp.notetit leid = 194 9; | |
| 56 | // getKeyValu ePair("via _login_min utes", set LoginCooki es); | |
| 57 | ||
| 58 | va r notetype = parent. Xrm.Page.g etAttribut e("vhacrm_ notetype_c ode").getV alue(); | |
| 59 | if (notetype == null | | notetype == 713770 000) { | |
| 60 | // CRM N ote Only | |
| 61 | return f alse; | |
| 62 | } | |
| 63 | ||
| 64 | if (via_chec kUserLogIn ()) { | |
| 65 | //Hide t he login s ection | |
| 66 | parent.X rm.Page.ui .tabs.get( "tab_gener al").secti ons.get("t ab_general _section_v istalogin" ).setVisib le(false); | |
| 67 | ||
| 68 | //Get Ve teran Id f rom Vista facility | |
| 69 | var vete ranId = pa rent.Xrm.P age.getAtt ribute("cu stomerid") .getValue( ); | |
| 70 | if (vete ranId) { | |
| 71 | via_ getVeteran (veteranId , getVeter an_Result) ; | |
| 72 | } | |
| 73 | ||
| 74 | //Popula te dropdow ns | |
| 75 | via_getL ocations(g etLocation s_Result); | |
| 76 | ||
| 77 | return t rue; | |
| 78 | } | |
| 79 | el se { | |
| 80 | //Show t he login s ection | |
| 81 | parent.X rm.Page.ui .tabs.get( "tab_gener al").secti ons.get("t ab_general _section_v istalogin" ).setVisib le(true); | |
| 82 | //Set fo cus to the login con trol | |
| 83 | parent.X rm.Page.ge tControl(" WebResourc e_VistaLog inControl" ).setFocus (); | |
| 84 | return f alse; | |
| 85 | } | |
| 86 | ||
| 87 | } | |
| 88 | catch (err) { | |
| 89 | al ert('VistA Login Con trol Web R esource Fu nction Err or(vlc_for mLoad): ' + err.mess age); | |
| 90 | } | |
| 91 | } | |
| 92 | ||
| 93 | function v lc_vistaLo gin() { | |
| 94 | try { | |
| 95 | // Get Login Field data | |
| 96 | va r vlc_acce ssCode = $ ('#vlc_acc essCode'). val(); | |
| 97 | va r vlc_veri fyCode = $ ('#vlc_ver ifyCode'). val(); | |
| 98 | // Verify tha t fields a re not emp ty | |
| 99 | if (vlc_acce ssCode == null || vl c_accessCo de == "") { alert("P lease ente r your Acc ess Code!" ); return false; } | |
| 100 | if (vlc_veri fyCode == null || vl c_verifyCo de == "") { alert("P lease ente r your Ver ify Code!" ); return false; } | |
| 101 | ||
| 102 | // Disable lo gin fields and butto n | |
| 103 | do cument.get ElementByI d('vlc_acc essCode'). disabled = true; | |
| 104 | do cument.get ElementByI d('vlc_ver ifyCode'). disabled = true; | |
| 105 | do cument.get ElementByI d('vlc_log inbuttonid ').disable d = true; | |
| 106 | ||
| 107 | // Get the Si te ID (Sta tion Suffi x) | |
| 108 | va r vlc_User SiteNo = p arent.Xrm. Page.getAt tribute("v hacrm_stat ionsuffix_ text").get Value(); | |
| 109 | vl c_UserSite Id = vlc_U serSiteNo. toString() ; | |
| 110 | ||
| 111 | VI AServices. loginVIA(v lc_UserSit eId, vlc_a ccessCode, vlc_verif yCode, vlc _vistaLogi n_response ); | |
| 112 | ||
| 113 | } | |
| 114 | catch (err) { | |
| 115 | al ert('VistA Login Con trol Web R esource Fu nction Err or(vlc_vis taLogin): ' + err.me ssage); | |
| 116 | } | |
| 117 | } | |
| 118 | ||
| 119 | ||
| 120 | function v lc_vistaLo gin_respon se(returnU serTO) { | |
| 121 | userTO = returnU serTO; | |
| 122 | ||
| 123 | if (us erTO.error !== "" && userTO.er ror !== nu ll) { | |
| 124 | // Handle Err ors | |
| 125 | al ert(userTO .error + " \n" + user TO.fault); | |
| 126 | // Clear logi n fields | |
| 127 | do cument.get ElementByI d('vlc_acc essCode'). disabled = false; | |
| 128 | do cument.get ElementByI d('vlc_ver ifyCode'). disabled = false; | |
| 129 | do cument.get ElementByI d('vlc_log inbuttonid ').disable d = false; | |
| 130 | re turn false ; | |
| 131 | ||
| 132 | } else { | |
| 133 | // Success | |
| 134 | vi a_setCooki e("viasess ionlink", userTO, vl c_ViaLogin Minutes); | |
| 135 | ||
| 136 | al ert("Login Successfu l \n" + us erTO.greet ing); | |
| 137 | ||
| 138 | // Clear logi n fields a nd hide co ntrol | |
| 139 | pa rent.Xrm.P age.ui.cle arFormNoti fication(" VIASERVICE "); | |
| 140 | do cument.get ElementByI d('vlc_acc essCode'). disabled = false; | |
| 141 | do cument.get ElementByI d('vlc_ver ifyCode'). disabled = false; | |
| 142 | do cument.get ElementByI d('vlc_log inbuttonid ').disable d = false; | |
| 143 | do cument.get ElementByI d('vlc_acc essCode'). value = '' ; | |
| 144 | do cument.get ElementByI d('vlc_ver ifyCode'). value = '' ; | |
| 145 | pa rent.Xrm.P age.ui.tab s.get("tab _general") .sections. get("tab_g eneral_sec tion_vista login").se tVisible(f alse); | |
| 146 | ||
| 147 | // Get Vista Facility Locations | |
| 148 | vi a_getLocat ions(getLo cations_Re sult); | |
| 149 | ||
| 150 | // Get Vista Veteran I d | |
| 151 | va r veteranI d = parent .Xrm.Page. getAttribu te("custom erid").get Value(); | |
| 152 | if (veteranI d) { | |
| 153 | var vist aVeteranId = parent. Xrm.Page.g etAttribut e("vhacrm_ vistaveter anid_text" ).getValue (); | |
| 154 | if (vist aVeteranId == null) { | |
| 155 | via_ getVeteran Id(veteran Id, getVet eran_Resul t); | |
| 156 | } | |
| 157 | } | |
| 158 | ||
| 159 | } | |
| 160 | } | |
| 161 | ||
| 162 | function g etVeteran_ Result(ser viceResult ) { | |
| 163 | try { | |
| 164 | if (serviceR esult) { | |
| 165 | if (serv iceResult[ 0].error = "") { | |
| 166 | arra yPatientTO = service Result; | |
| 167 | pati entTO = ar rayPatient TO[0]; | |
| 168 | // S et Vista V eteran fie lds | |
| 169 | pare nt.Xrm.Pag e.getAttri bute("vhac rm_vistave teranid_te xt").setVa lue(patien tTO.localp id); | |
| 170 | pare nt.Xrm.Pag e.getAttri bute("vhac rm_vistave teranname_ text").set Value(pati entTO.pati entname); | |
| 171 | } | |
| 172 | } | |
| 173 | el se { | |
| 174 | alert("T he Veteran is not re gistered w ith this f acility. A note can not be wri tten to VI STA."); | |
| 175 | return f alse; | |
| 176 | } | |
| 177 | } catc h (err) { | |
| 178 | al ert("getVe teran_Resu lt: " + er r.message) ; | |
| 179 | } | |
| 180 | } | |
| 181 | ||
| 182 | function g etLocation s_Result(s erviceResu lt) { | |
| 183 | try { | |
| 184 | if (serviceR esult.leng th > 0) { | |
| 185 | ||
| 186 | //Popula te dropdow n | |
| 187 | var ddLo cations = parent.Xrm .Page.ui.c ontrols.ge t('WebReso urce_Vista WriteNoteC ontrol').g etObject() .contentWi ndow.docum ent.getEle mentById(' ddLocation '); | |
| 188 | $.each(s erviceResu lt, functi on (index, item) { | |
| 189 | if ( item.error !== "" && item.erro r !== null ) { | |
| 190 | //Handle E rrors | |
| 191 | alert(item .error + " \n" + item .fault); | |
| 192 | } el se { | |
| 193 | //Success | |
| 194 | ddLocation s.add(new Option(ite m.name, it em.id)); | |
| 195 | } | |
| 196 | }); | |
| 197 | ||
| 198 | //Set se lected loc ation | |
| 199 | var faci litylocati on = paren t.Xrm.Page .getAttrib ute("vhacr m_vistaloc ationid_te xt").getVa lue(); | |
| 200 | if (faci litylocati on) { | |
| 201 | ddLo cations.va l(facility location); | |
| 202 | } | |
| 203 | } | |
| 204 | } catc h (err) { | |
| 205 | al ert("getLo cations_Re sult: " + err.messag e); | |
| 206 | } | |
| 207 | } | |
| 208 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.