Produced by Araxis Merge on 12/7/2018 11:36:02 AM Central Standard 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 | C:\SCRUB\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\community-care-request\new-appointment-request-question\notification-selection | community-care-notification-settings-layout-view.js | Mon Oct 22 23:25:20 2018 UTC |
| 2 | C:\MHED-scrubbed\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\community-care-request\new-appointment-request-question\notification-selection | community-care-notification-settings-layout-view.js | Fri Dec 7 13:07:18 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 468 |
| 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 | /* eslint- disable ma x-len */ | |
| 2 | define([ | |
| 3 | 'under score', | |
| 4 | 'backb one', | |
| 5 | 'modul es/appoint ments/appo intments-m odule', | |
| 6 | 'App', | |
| 7 | 'User' , | |
| 8 | 'modul es/communi ty-care-re quest/view /community -care-view ', | |
| 9 | 'modul es/new-app ointment-w izard/wiza rd-step-mo del', | |
| 10 | 'text! modules/co mmunity-ca re-request /new-appoi ntment-req uest-quest ion/notifi cation-sel ection/com munity-car e-notifica tion-setti ngs-layout .html', | |
| 11 | 'modul es/communi ty-care-re quest/new- appointmen t-request- question/n otificatio n-selectio n/request- details/re quest-deta ils-phone- contact-se ction-view ', | |
| 12 | 'modul es/new-app ointment-r equest/vie ws/common/ email/sect ion-view', | |
| 13 | 'modul es/loading -spinner/l oading-spi nner', | |
| 14 | 'modul es/notific ation-pref erences/no tification -preferenc es-module' , | |
| 15 | 'model s/resource s-collecti on', | |
| 16 | 'modul es/appoint ments/mess ages/reque st-message -view', | |
| 17 | 'model s/request- model', | |
| 18 | 'modul es/new-app ointment-r equest/vie ws/request s/message/ section-vi ew', | |
| 19 | 'modul es/page/co re/behavio rs/focus-c c-on-heade r-behavior ', | |
| 20 | ], | |
| 21 | function ( | |
| 22 | _, | |
| 23 | Backbo ne, | |
| 24 | module , | |
| 25 | app, | |
| 26 | User, | |
| 27 | Commun ityCareVie w, | |
| 28 | Wizard StepModel, | |
| 29 | templa te, | |
| 30 | PhoneC ontactSect ionView, | |
| 31 | EmailP references SectionVie w, | |
| 32 | loadin gSpinner, | |
| 33 | notifi cationPref erencesMod ule, | |
| 34 | Resour ces, | |
| 35 | Messag eView, | |
| 36 | Reques tModel, | |
| 37 | NewMes sageSectio nView, | |
| 38 | Focus | |
| 39 | ) { | |
| 40 | 'use s trict'; | |
| 41 | // TODO ma ke a Wizar d Page Lay out View t hat this c an extend to make so me methods such as d eclaimF DNS trols, dis ableContin ue, enable Continue, showPrevio us DRY | |
| 42 | return Community CareView.e xtend({ | |
| 43 | te mplate: _. template(t emplate), | |
| 44 | re gions: { | |
| 45 | communit yCareSetti ngs: '.com munity-car e-settings ', | |
| 46 | newMessa geRegion: '.request- details-ne w-message- section', | |
| 47 | emailPre ferencesRe gion: '.em ail-prefer ences-sect ion', | |
| 48 | }, | |
| 49 | ev ents: _.ex tend({}, C ommunityCa reView.pro totype.eve nts, { | |
| 50 | 'submit #new-appoi ntment-req uest-form' : 'prevent Default', | |
| 51 | 'click # submit-btn ': 'saveSe ttings', | |
| 52 | 'change #emailAddr ess': 'han dleModelCh ange', | |
| 53 | }) , | |
| 54 | mo delEvents: { | |
| 55 | 'change: bestTimeTo Call': 'ha ndleModelC hange', | |
| 56 | 'change: phoneNumbe r': 'handl eModelChan ge', | |
| 57 | 'change: emailAddre ss': 'hand leModelCha nge', | |
| 58 | }, | |
| 59 | in itialize: function ( options) { | |
| 60 | if (_.is Undefined( options)) { | |
| 61 | this .model = n ew WizardS tepModel.M odel(); | |
| 62 | } else { | |
| 63 | this .model = o ptions.mod el; | |
| 64 | this .validator = options .validator ; | |
| 65 | this .isValid = options.i sValid; | |
| 66 | $.wh en(notific ationPrefe rencesModu le.notific ationPrefe rences._is Ready).the n(function () { | |
| 67 | // store d ata in clo ne of noti fication p references until suc cessful sa ve | |
| 68 | this.email Preference sModel = n otificatio nPreferenc esModule.n otificatio nPreferenc es.clone() ; | |
| 69 | }.bi nd(this)); | |
| 70 | } | |
| 71 | }, | |
| 72 | on Render: fu nction () { | |
| 73 | this.dis ableContin ueButton() ; | |
| 74 | ||
| 75 | this.sho wChildView ('communit yCareSetti ngs', new PhoneConta ctSectionV iew({ | |
| 76 | mode l: this.mo del, | |
| 77 | vali dator: thi s.validato r, | |
| 78 | })); | |
| 79 | this.sho wChildView ('newMessa geRegion', new NewMe ssageSecti onView({ | |
| 80 | mode l: this.mo del, | |
| 81 | })); | |
| 82 | this.sho wChildView ('emailPre ferencesRe gion', new EmailPref erencesSec tionView({ | |
| 83 | mode l: this.em ailPrefere ncesModel, | |
| 84 | vali dator: thi s.validato r, | |
| 85 | isFo rCommunity Care: true , | |
| 86 | })); | |
| 87 | }, | |
| 88 | // overrides the commu nity-care- view disab leContinue Button fun ction | |
| 89 | di sableConti nueButton: function( ) { | |
| 90 | this.ui. submit.pro p('disable d', true); | |
| 91 | }, | |
| 92 | // overrides the commu nity-care- view enabl eContinueB utton func tion | |
| 93 | en ableContin ueButton: function() { | |
| 94 | this.ui. submit.pro p('disable d', false) ; | |
| 95 | }, | |
| 96 | sa veSettings : function () { | |
| 97 | this.sav eCommunity CareReques ts(this.mo del); | |
| 98 | this.sav eEmailPref erences(); | |
| 99 | }, | |
| 100 | sa veCommunit yCareReque sts: funct ion (model ) { | |
| 101 | var mess ageView; | |
| 102 | var subm itModel; | |
| 103 | this.cle arOutInval idProvider s(); | |
| 104 | this.uns etDateTime ForPCP(); | |
| 105 | ||
| 106 | submitMo del = this .formatCom munityCare Requests() ; | |
| 107 | this.uns etHiddenAt tributes(' travelBurd en', submi tModel); | |
| 108 | this.uns etHiddenAt tributes(' unusualTra velBurden' , submitMo del); | |
| 109 | submitMo del.save({ }, { | |
| 110 | url: app.resou rces.get(' community- care-reque sts').form atHref({ | |
| 111 | 'assigning -authority ': User.ge t('idType' ), | |
| 112 | 'patient-i d': User.g et('id'), | |
| 113 | }), | |
| 114 | }).done( function ( response, success, j qxhr) { | |
| 115 | var appointmen tRequestRe sponse = n ew Request Model(resp onse, { pa rse: true }); | |
| 116 | appo intmentReq uestRespon se.set('cc Appointmen tRequest', new Backb one.Model( { | |
| 117 | preferredC ity: appoi ntmentRequ estRespons e.get('pre ferredCity '), | |
| 118 | preferredL anguage: a ppointment RequestRes ponse.get( 'preferred Language') , | |
| 119 | preferredP roviders: appointmen tRequestRe sponse.get ('preferre dProviders '), | |
| 120 | preferredS tate: appo intmentReq uestRespon se.get('pr eferredSta te'), | |
| 121 | travelBurd en: appoin tmentReque stResponse .get('trav elBurden') , | |
| 122 | unusualTra velBurden: appointme ntRequestR esponse.ge t('unusual TravelBurd en'), | |
| 123 | preferredZ ipCode: ap pointmentR equestResp onse.get(' preferredZ ipCode'), | |
| 124 | }).t oJSON()); | |
| 125 | modu le.request s.add(appo intmentReq uestRespon se); | |
| 126 | mess ageView = new Messag eView(appo intmentReq uestRespon se); | |
| 127 | mess ageView.ch eckForMess age(submit Model); | |
| 128 | }); | |
| 129 | }, | |
| 130 | ||
| 131 | // eslint-di sable-next -line comp lexity | |
| 132 | fo rmatCommun ityCareReq uests: fun ction () { | |
| 133 | var DIST ANCE_TO_TR AVEL_CASE_ 100 = 100; | |
| 134 | var dist anceEligib le = this. model.has( 'distanceE ligible') ? this.mod el.get('di stanceElig ible') === 'yes' : t rue; | |
| 135 | var ccRe questModel = new Bac kbone.Mode l({ | |
| 136 | addi tionalInfo rmation: t his.model. get('addit ionalPrefe rences'), | |
| 137 | addr ess: this. model.get( 'address') ? this.mo del.get('a ddress') : '', | |
| 138 | appo intmentTyp e: this.mo del.get('c areTypeNam e'), | |
| 139 | best TimetoCall : this.mod el.get('be stTimeToCa ll'), | |
| 140 | ccAp pointmentR equest: {p referredZi pCode: thi s.model.ge t('preferr edZipcode' )}, | |
| 141 | city : this.mod el.get('ci ty') ? thi s.model.ge t('city') : '', | |
| 142 | dist anceEligib le: distan ceEligible , | |
| 143 | dist anceWillin gToTravel: this.mode l.get('pri maryPrefer redMiles') === '100 or more' ? DISTANCE_ TO_TRAVEL_ CASE_100 : this.mode l.get('pri maryPrefer redMiles') , | |
| 144 | emai l: this.em ailPrefere ncesModel. get('email Address'), | |
| 145 | faci lity: this .model.get ('facility '), | |
| 146 | newM essage: th is.model.g et('newMes sage'), | |
| 147 | offi ceHours: t his.model. get('offic eHours'), | |
| 148 | opti onDate1: t his.model. get('optio nDate1') ? this.mode l.get('opt ionDate1') : 'No Dat e Selected ', | |
| 149 | opti onDate2: t his.model. get('optio nDate2') ? this.mode l.get('opt ionDate2') : 'No Dat e Selected ', | |
| 150 | opti onDate3: t his.model. get('optio nDate3') ? this.mode l.get('opt ionDate3') : 'No Dat e Selected ', | |
| 151 | opti onTime1: t his.model. get('optio nTime1') ? this.mode l.get('opt ionTime1') : 'No Tim e Selected ', | |
| 152 | opti onTime2: t his.model. get('optio nTime2') ? this.mode l.get('opt ionTime2') : 'No Tim e Selected ', | |
| 153 | opti onTime3: t his.model. get('optio nTime3') ? this.mode l.get('opt ionTime3') : 'No Tim e Selected ', | |
| 154 | pati entIdentif ier: { | |
| 155 | assigningA uthority: User.get(' idType'), | |
| 156 | uniqueId: User.get(' id'), | |
| 157 | }, | |
| 158 | phon eNumber: t his.model. get('phone Number'), | |
| 159 | pref erredCity: this.mode l.get('pri maryCity') , | |
| 160 | pref erredLangu age: this. model.get( 'preferred LanguageSp oken'), | |
| 161 | pref erredProvi ders: this .model.get ('preferre dProviders '), | |
| 162 | pref erredState : this.mod el.get('pr imaryState '), | |
| 163 | pref erredZipCo de: this.m odel.get(' primaryZip Code'), | |
| 164 | prov iderId: '0 ', | |
| 165 | prov iderOption : this.mod el.get('re questedPho neCall') ? 'Call bef ore bookin g appointm ent' : '', | |
| 166 | purp oseOfVisit : 'routine -follow-up ', | |
| 167 | reas onForVisit : this.mod el.get('ca reType') = == 'CCPCPR VDR' ? 'Fi nd a Prima ry Care Pr ovider' : '', | |
| 168 | requ estedPhone Call: this .model.get ('requeste dPhoneCall ') === 'ye s', | |
| 169 | serv ice: this. model.get( 'service') , | |
| 170 | stat e: this.mo del.get('s tate') ? t his.model. get('state ') : '', | |
| 171 | trav elBurden: this.model .get('trav elBurden') === 'yes' , | |
| 172 | type OfCareId: this.model .get('care Type'), | |
| 173 | unus ualTravelB urden: thi s.model.ge t('unusual TravelBurd en') === ' yes', | |
| 174 | visi tType: 'Of fice Visit ', | |
| 175 | zipC ode: this. model.get( 'zipCode') ? this.mo del.get('z ipCode') : '', | |
| 176 | }); | |
| 177 | return c cRequestMo del; | |
| 178 | }, | |
| 179 | ||
| 180 | un setHiddenA ttributes: function( attributeN ame, submi tModel) { | |
| 181 | if (!thi s.model.ha s(attribut eName)) { | |
| 182 | subm itModel.un set(attrib uteName); | |
| 183 | this .model.uns et(attribu teName); | |
| 184 | } | |
| 185 | }, | |
| 186 | sa veEmailPre ferences: function ( ) { | |
| 187 | notifica tionPrefer encesModul e.notifica tionPrefer ences.save ( | |
| 188 | this .emailPref erencesMod el.attribu tes, | |
| 189 | { | |
| 190 | url: app.r esources.g et('notifi cation-pre ference'). formatHref ({ | |
| 191 | 'assig ning-autho rity': Use r.get('idT ype'), | |
| 192 | 'patie nt-id': Us er.get('id '), | |
| 193 | }), | |
| 194 | type: 'PUT ', | |
| 195 | } | |
| 196 | ); | |
| 197 | }, | |
| 198 | cl earOutInva lidProvide rs: functi on() { | |
| 199 | _.each(t his.model. get('prefe rredProvid ers').mode ls, functi on(provide r) { | |
| 200 | _.ea ch(provide r.keys(), function(a ttribute) { | |
| 201 | if (provid er.get(att ribute) == = '') { | |
| 202 | provid er.unset(a ttribute); | |
| 203 | } else if (attribute === 'addr ess') { | |
| 204 | this.r emoveEmpty Address(pr ovider); | |
| 205 | } | |
| 206 | }.bi nd(this)); | |
| 207 | }.bind(t his)); | |
| 208 | }, | |
| 209 | ||
| 210 | re moveEmptyA ddress: fu nction(pro vider) { | |
| 211 | var isEm pty = true ; | |
| 212 | var key; | |
| 213 | for (key in provid er.get('ad dress')) { | |
| 214 | if ( provider.g et('addres s')[key] ! == '') { | |
| 215 | isEmpty = false; | |
| 216 | } | |
| 217 | } | |
| 218 | ||
| 219 | if (isEm pty) { | |
| 220 | prov ider.unset ('address' ); | |
| 221 | } | |
| 222 | }, | |
| 223 | un setDateTim eForPCP: f unction() { | |
| 224 | if (this .model.get ('careType ') === 'CC PCPRVDR') { | |
| 225 | this .model.uns et('option Date1'); | |
| 226 | this .model.uns et('option Date2'); | |
| 227 | this .model.uns et('option Date3'); | |
| 228 | this .model.uns et('option Time1'); | |
| 229 | this .model.uns et('option Time2'); | |
| 230 | this .model.uns et('option Time3'); | |
| 231 | } | |
| 232 | }, | |
| 233 | ||
| 234 | }); | |
| 235 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.