244. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/7/2018 11:36:04 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.

244.1 Files compared

# Location File Last Modified
1 C:\SCRUB\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\new-appointment-request 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\new-appointment-request view.js Fri Dec 7 13:07:32 2018 UTC

244.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1026
Changed 1 2
Inserted 0 0
Removed 0 0

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

244.4 Active regular expressions

No regular expressions were active.

244.5 Comparison detail

  1   define([
  2       /* Cor e */
  3       'App',
  4       'Vent' ,
  5       'User' ,
  6       'modul es/appoint ments/appo intments-m odule',
  7       'under score',
  8       'backb one',
  9       'mario nette',
  10  
  11       /* Uti lities */
  12       'modul es/appoint ments/appo intments-r adio',
  13       'modul es/appoint ments/appo intments-m odule',
  14       'modul es/notific ation-pref erences/no tification -preferenc es-module' ,
  15       'modul es/form/fo rm-view-mi xin',
  16  
  17       /* Vie ws */
  18       'modul es/new-app ointment-r equest/vie ws/common/ header/vie w',
  19       'modul es/new-app ointment-r equest/vie ws/common/ error/view ',
  20       'modul es/new-app ointment-r equest/vie ws/common/ email/sect ion-view',
  21       'modul es/new-app ointment-r equest/vie ws/common/ cancel-mod al/popup-v iew',
  22       'modul es/new-app ointment-r equest/vie ws/common/ confirmati on-modal/p opup-view' ,
  23       'modul es/form/le ave-confir mation/lea ve-confirm ation-popu p-view',
  24  
  25       /* Res ources */
  26       'modul es/new-app ointment-r equest/res ources/com mon/model' ,
  27       'modul es/new-app ointment-r equest/res ources/dir ect/model' ,
  28       'modul es/new-app ointment-r equest/res ources/req uest/model ',
  29       'modul es/appoint ments/mess ages/reque st-message -view',
  30  
  31       /* Tem plates */
  32       'text! modules/ne w-appointm ent-reques t/template .html',
  33   ], functio n(/* Core  */
  34       app,
  35       vent,
  36       User,
  37       module ,
  38       _,
  39       Backbo ne,
  40       Marion ette,
  41       /* Uti lities */
  42       radio,
  43       appoin tmentModul e,
  44       notifi cationModu le,
  45       Mixin,
  46       /* Vie ws */
  47       Header View,
  48       ErrorV iew,
  49       EmailP references View,
  50       Cancel Confirmati onModal,
  51       Confir mAppointme ntPopupVie w,
  52       LeaveC onfirmatio nPopupView ,
  53       /* Res ources */
  54       Appoin tmentModel ,
  55       Direct Model,
  56       Reques tModel,
  57       Messag eView,
  58       /* Tem plates */
  59       templa te
  60   ) {
  61       'use s trict';
  62  
  63  
  64       var SU BMIT_REQUE ST = 'Subm it Request ';
  65       var SU BMIT_DIREC T = 'Sched ule Appoin tment';
  66       var CO NFIRM_DIRE CT = 'Conf irm Appoin tment';
  67       var RE SPONSE_SUC CESS = 200 ;
  68  
  69  
  70       return  Marionett e.View.ext end(Mixin. form({
  71           te mplate: _. template(t emplate),
  72  
  73           cl assName: ' appointmen ts',
  74  
  75           ui : {
  76                cancel:  '#new-appo intment-re quest-canc el',
  77                submit:  '#schedule -appointme nt-btn',
  78                confirm:  '#confirm -appointme nt-btn',
  79           },
  80  
  81           ev ents: {
  82                'click @ ui.cancel' : 'onCance l',
  83                'click @ ui.submit' : 'onSubmi t',
  84                'click @ ui.confirm ': 'onConf irm',
  85           },
  86  
  87           re gions: {
  88                header:  '.new-appo intments-h eader',
  89                steps: ' .new-appoi ntments-st eps',
  90                error: ' .new-appoi ntments-er rors',
  91                email: ' .new-appoi ntments-em ail',
  92           },
  93  
  94           ch ildViewEve nts: {
  95                'show:er ror': 'onS erverError ',
  96                'navigat e:appointm ents': 'ro uteHome',
  97                'hide:em ail': 'res etEmailReg ion',
  98           },
  99  
  100           mo delEvents:  {
  101                'change: clinic': ' showEmailR egion',
  102                'change: scheduling -method':  'hideButto n onMethod Change',
  103                'change' : 'resetEr rorRegion' ,
  104                'change: typeOfCare ': 'hideBu tton',
  105                'change: facility':  'hideButt on',
  106           },
  107  
  108           in itialize:  function(o ptions) {
  109                this.mod el = new A ppointment Model();
  110                this.lis tenTo(vent , 'wizard: exit', thi s.handleEx itWizard);
  111                this.isT elehealthF eaturesEna bled = _.i sUndefined (app.disab ledFeature s.get('TH_ FEATURE_SE T'));
  112                this.goo gleAnalyti cs = optio ns.googleA nalyticsPr ovider.get Instance() ;
  113                this.sch edulingSte psLayoutPr ovider = o ptions.sch edulingSte psLayoutPr ovider;
  114           },
  115  
  116           on Render: fu nction() {
  117                var head er = this. getRegion( 'header');
  118  
  119                this.ini tializeMix in();
  120                header.s how(new He aderView() );
  121                this.sho wStepsRegi on();
  122           },
  123  
  124           /* *
  125            *  Sets up t he form wi th the Mix in Compone nts
  126            *  @return { void}
  127            * /
  128           in itializeMi xin: funct ion() {
  129                this.ini tializeFor mValidatio n({
  130                    igno re: ':hidd en:not(#da teTime-hid den)',
  131                    erro rLabelCont ainer: '.e rror-list' ,
  132                });
  133                  this.initi alizeF DNS     firmNaviga tion({
  134                    $for m: this.$e l.find('fo rm > :not( .facility- care-and-s cheduling- section)') ,
  135  
  136                    // e slint-disa ble-next-l ine max-le n
  137                    warn ingMessage : 'You hav e not comp leted your  appointme nt/request . If you w ish to con tinue with out comple ting, sele ct CONTINU E, otherwi se select  RETURN to  return to  the New Ap pointments /Requests  screen.',
  138                });
  139           },
  140  
  141           /* *
  142            *  @return { void}
  143            * /
  144           sh owStepsReg ion: funct ion() {
  145                var step s = this.g etRegion(' steps');
  146  
  147                steps.sh ow(this.sc hedulingSt epsLayoutP rovider.ge tInstance( this.model , this.val idator));
  148           },
  149  
  150           /* *
  151            *  @param {B ackbone.Co llection}  errorColle ction
  152            *  @return { void}
  153            * /
  154           sh owErrorsRe gion: func tion(error Collection ) {
  155                var erro r = this.g etRegion(' error');
  156  
  157                this.res etErrorReg ion();
  158                error.sh ow(new Err orView({co llection:  errorColle ction}));
  159           },
  160  
  161           /* *
  162            *  @return { void}
  163            * /
  164           sh owEmailReg ion: funct ion() {
  165                var regi on = this. getRegion( 'email');
  166                this.ema ilModel =  notificati onModule.n otificatio nPreferenc es.clone() ;
  167  
  168                region.s how(new Em ailPrefere ncesView({
  169                    mode l: this.em ailModel,
  170                    isFo rExpressCa re: this.m odel.isExp ressCare() ,
  171                    isFo rVideoVisi t: Boolean (this.isTe lehealthFe aturesEnab led && thi s.model.is VideoVisit ()),
  172                }));
  173           },
  174  
  175           /* *
  176            *  @return { void}
  177            * /
  178           re setEmailRe gion: func tion() {
  179                var emai l = this.g etRegion(' email');
  180  
  181                if (emai l.currentV iew) {
  182                    emai l.reset();
  183                }
  184           },
  185  
  186           /* *
  187            *  @return { void}
  188            * /
  189           re setErrorRe gion: func tion() {
  190                var erro r = this.g etRegion(' error');
  191  
  192                if (erro r.currentV iew) {
  193                    erro r.reset();
  194                }
  195           },
  196  
  197           /* *
  198            *  Called wh en the sch eduling me thod is ch anged.
  199            *  Used to s et the cor rect name  on the sub mit button
  200            *  @return { void}
  201            * /
  202           on MethodChan ge: functi on() {
  203                var butt onName = t his.getSub mitButtonN ame();
  204                var sche dulingMeth od = this. model.isRe quest() ?  'Submit a  Request to  a VA Sche duler' : ' Schedule M yself';
  205  
  206                this.goo gleAnalyti cs
  207                    .gas ('send', ' event', 'v eteran-app ointment',  'user-sel ected-sche duling-met hod', sche dulingMeth od);
  208  
  209                if (this .model.isR equest())  {
  210                    this .showEmail Region();
  211                }
  212  
  213                if (this .isTelehea lthFeature sEnabled & & this.mod el.isDirec t()) {
  214                    this .ui.confir m.text(but tonName);
  215                    this .ui.confir m.removeCl ass('hidde n');
  216                } else {
  217                    this .ui.submit .text(butt onName);
  218                    this .ui.submit .removeCla ss('hidden ');
  219                    this .googleAna lytics.gas ('send', ' event', 'v eteran-app ointment',  'appointm ent-reques t-requeste d');
  220                }
  221  
  222                
  223           },
  224  
  225           /* *
  226            *  Called wh en the sub mit button  in reques t scheduli ng is pres sed
  227            *  @return { void}
  228            * /
  229           on Submit: fu nction() {
  230                var isFo rmValid =  this.$el.f ind('form' ).valid();
  231  
  232                this.res etErrorReg ion();
  233                if (isFo rmValid) {
  234                    // I  think thi s would be  better in  the succe ss functio n
  235                    // b ut it is b eing put h ere becaus e this is  the equiva lent spot  to where d igital ser vices put  it.
  236                    if ( typeof gas  !== 'unde fined') {
  237                         gas('send' , 'event',  'veteran- appointmen t', 'appoi ntment-sch eduled-suc cessful');
  238                    }
  239  
  240                    this .saveForm( );
  241                } else {
  242                    this .onFormErr ors();
  243                }
  244           },
  245  
  246           /* *
  247            *  Called wh en the con firm butto n in direc t scheduli ng is pres sed
  248            *  @return { void}
  249            * /
  250           on Confirm: f unction()  {
  251                var isFo rmValid =  this.$el.f ind('form' ).valid();
  252                this.res etErrorReg ion();
  253  
  254                if (isFo rmValid) {
  255                    this .showConfi rmationPop upView();
  256                } else {
  257                    this .onFormErr ors();
  258                }
  259           },
  260  
  261           sh owConfirma tionPopupV iew: funct ion() {
  262                var conf irmAppoint mentPopupV iew = new  ConfirmApp ointmentPo pupView({
  263                    mode l: this.mo del,
  264                    type OfCareName : this.mod el.getCare Name(),
  265                    noti ficationEm ail: this. emailModel .get('emai lAddress') ,
  266                    elAf terClose:  this.$el.f ind('#conf irm-appoin tment-btn' ),
  267                });
  268  
  269                this.lis tenTo(conf irmAppoint mentPopupV iew, 'cont inue', fun ction() {
  270                    // I  think thi s would be  better in  the succe ss functio n
  271                    // b ut it is b eing put h ere becaus e this is  the equiva lent spot  to where d igital ser vices put  it.
  272                    if ( typeof gas  !== 'unde fined') {
  273                         gas('send' , 'event',  'veteran- appointmen t', 'user- request-ap pointment- scheduled' );
  274                    }
  275  
  276                    this .saveForm( );
  277                }, this) ;
  278  
  279                this.lis tenToOnce( confirmApp ointmentPo pupView, ' destroy',  function()  {
  280                    this .stopListe ning(confi rmAppointm entPopupVi ew, 'conti nue');
  281                }, this) ;
  282  
  283                confirmA ppointment PopupView. openPopup( );
  284           },
  285           /* *
  286            *  @return { void}
  287            * /
  288           sa veForm: fu nction() {
  289                var Mode l = this.m odel.isDir ect() ? Di rectModel  : RequestM odel;
  290  
  291                this.sav eEmailPref erences();
  292                this.sav eModel = n ew Model(t his.model. attributes );
  293                this.lis tenToOnce( this.saveM odel, 'sav e:success' , this.onS aveSuccess );
  294                this.lis tenToOnce( this.saveM odel, 'sav e:error',  this.onSav eError);
  295                this.sav eModel.sav e();
  296           },
  297  
  298           /* *
  299            *  @return { void}
  300            * /
  301           sa veEmailPre ferences:  function()  {
  302                var noti ficationFr equency =  notificati onModule.n otificatio nPreferenc es.get('em ailAllowed ') ?
  303                    'Eac h new mess age' :
  304                    'Nev er';
  305                var attr ibutes;
  306                var user ;
  307  
  308                notifica tionModule .notificat ionPrefere nces.set(' notificati onFrequenc y', notifi cationFreq uency);
  309                attribut es = this. emailModel .attribute s;
  310                user = t his.model. user();
  311                this.mod el.set('em ailPrefere nces', thi s.emailMod el);
  312  
  313                notifica tionModule .notificat ionPrefere nces.saveP references (attribute s, user);
  314           },
  315  
  316           /* *
  317            *  Called wh en the can cel button  is presse d
  318            *  @return { void}
  319            * /
  320           on Cancel: fu nction() {
  321                var entr yType;
  322                var mode l;
  323                var Popu p;
  324  
  325                if (this .model.isR equest() | | this.mod el.isDirec t()) {
  326                    entr yType = th is.model.i sDirect()  ? 'appoint ment' : 'r equest';
  327                    mode l = new Ba ckbone.Mod el({entryT ype: entry Type});
  328                    Popu p = new Ca ncelConfir mationModa l({
  329                         elAfterClo se: '#new- appointmen t-request- cancel-btn ',
  330                         model: mod el,
  331                         onContinue : _.bind(t his.naviga teHome, th is),
  332                    });
  333  
  334                    Popu p.openPopu p();
  335                    retu rn;
  336                }
  337                this.nav igateHome( );
  338           },
  339  
  340           /* *
  341            *  Displays  Error Mess ages from  within the  form
  342            *  @return { void}
  343            * /
  344           on FormErrors : function () {
  345                var erro rs = _.map (this.vali dator.erro rList, fun ction(erro r) {
  346                    retu rn {error:  error.mes sage};
  347                });
  348  
  349                var coll ection = n ew Backbon e.Collecti on(errors) ;
  350  
  351                this.sho wErrorsReg ion(collec tion);
  352  
  353                if (type of gas !==  'undefine d') {
  354                    if ( this.model .isRequest ()) {
  355                         gas('send' , 'event',  'veteran- appointmen t', 'appoi ntment-req uest-unsuc cessful');
  356                    } el se if (thi s.model.is Direct())  {
  357                         gas('send' , 'event',  'veteran- appointmen t', 'appoi ntment-sch eduled-fai l');
  358                    }
  359                }
  360           },
  361  
  362           /* *
  363            *  Displays  errors ret urned from  the serve r
  364            *  @param {o bject} dat a Server R esponse Da ta
  365            *  @return { void}
  366            * /
  367           on ServerErro r: functio n(data) {
  368                var json  = data.re sponseJSON  || {};
  369                var erro rs = json. errors ||  [
  370                    {
  371                         error: 'Th ere was an  error sav ing your r equest to  the server . ' +
  372                         'Please tr y again la ter.',
  373                    },
  374                ];
  375                var coll ection = n ew Backbon e.Collecti on(errors) ;
  376  
  377                this.sho wErrorsReg ion(collec tion);
  378           },
  379  
  380           /* *
  381            *  @param {B ackbone.Mo del} [mode l] The mod el returne d on the r equest sav e event
  382            *  @param {* } response
  383            *  @return { void}
  384            * /
  385           on SaveSucces s: functio n(model, r esponse) {
  386                this.dis ableShowCo nfirmNavig ation();
  387                if (this .model.isD irect()) {
  388                    this .onAppoint mentSaveSu ccess();
  389                    retu rn;
  390                }
  391                this.onR equestSave Success(re sponse);
  392           },
  393  
  394           /* *
  395            *  Catches a  fake erro r when the  server re turns no d ata
  396            *  @param {B ackbone.Mo del} model
  397            *  @param {j Query.xhr}  response
  398            *  @param {o bject} opt ions
  399            *  @return { void}
  400            * /
  401           on SaveError:  function( model, res ponse, opt ions) {
  402                if (resp onse.statu s === RESP ONSE_SUCCE SS) {
  403                    // N ot a real  error the  server did  not send  anything
  404                    // S o it faile d to parse  the model
  405                    this .onSaveSuc cess(model , response , options) ;
  406                    retu rn;
  407                }
  408                this.onS erverError (response) ;
  409           },
  410  
  411           /* *
  412            *  Updates t he appoint ment modul e with the  new item  and then n avigates t o the
  413            *  details p age.
  414            *  @return { void}
  415            * /
  416           on Appointmen tSaveSucce ss: functi on() {
  417                var deta ilsModel =  this.save Model.toAp pointments Model();
  418  
  419                appointm entModule. appointmen ts.add(det ailsModel) ;
  420                this.nav igateToDir ectDetails (detailsMo del);
  421           },
  422  
  423           /* *
  424            *  Updates t he request  module wi th the new  item and  then navig ates to th e
  425            *  details p age.
  426            *  @param {B ackbone.Mo del} respo nse The re ply from t he server
  427            *  @return { void}
  428            * /
  429           on RequestSav eSuccess:  function(r esponse) {
  430                var Mode l = appoin tmentModul e.requests .model;
  431                var requ est = new  Model(resp onse, {par se: true}) ;
  432                var mess ageView;
  433                // add A ppointment Model's .g etUserId()  to the re questModel  through u serId prop erty
  434                request. set('userI d', this.m odel.getUs erId());
  435                messageV iew = new  MessageVie w(request) ;
  436                appointm entModule. requests.a dd(request );
  437  
  438                messageV iew.checkF orMessage( this.model );
  439           },
  440  
  441           /* *
  442            *  @param {B ackbone.Mo del} detai lsModel
  443            *  @return { void}
  444            * /
  445           na vigateToDi rectDetail s: functio n(detailsM odel) {
  446                var opti ons = {sho wStatus: t rue, showF eedbackLin k: true, s howCancell ation: fal se};
  447  
  448                // TODO  This will  move when  i fix the  getClinicN ame functi on
  449                var clin ic = detai lsModel.ge t('clinic' );
  450                clinic.f riendlyNam e = this.m odel.getFa cilityName ();
  451                clinic.n ame = this .model.get ClinicName ();
  452  
  453                radio.tr igger('app ointments: appointmen t:selected ', details Model, opt ions);
  454           },
  455  
  456           /* *
  457            *  @return { void}
  458            * /
  459           na vigateHome : function () {
  460                var entr yType;
  461  
  462                if (type of gas !==  'undefine d') {
  463                    entr yType = (t his.model. get('sched uling-meth od') === ' direct') ?  'appointm ent' : 're quest';
  464                    gas( 'send', 'e vent', 've teran-appo intment',  'user-canc elled-appo intment-re quest', en tryType);
  465                }
  466                this.dis ableShowCo nfirmNavig ation();
  467                this.rou teHome();
  468           },
  469  
  470           /* *
  471            *  @return { void}
  472            * /
  473           ro uteHome: f unction()  {
  474                window.l ocation.ha sh = '#app ointments' ;
  475           },
  476  
  477           /* *
  478            *  Hides sub mit and co nfirm butt ons
  479            *  @return { void}
  480            * /
  481           hi deButton:  function()  {
  482                this.ui. confirm.ad dClass('hi dden');
  483                this.ui. submit.add Class('hid den');
  484           },
  485  
  486           /* *
  487            *  @return { string} Th e name to  display on  the submi t button
  488            * /
  489           ge tSubmitBut tonName: f unction()  {
  490                if (this .isTelehea lthFeature sEnabled)  {
  491                    retu rn this.mo del.isRequ est() ? SU BMIT_REQUE ST : CONFI RM_DIRECT;
  492                }
  493  
  494                return t his.model. isRequest( ) ? SUBMIT _REQUEST :  SUBMIT_DI RECT;
  495           },
  496  
  497           ha ndleExitWi zard: func tion(e, ca llback) {
  498                // when:  field is  dirty and  need to sh ow exit mo dal
  499                // then:  show exit  modal - o n the exit  modal thi s needs to  be able t o invoke c allback()
  500                //       when the u ser hits c ontinue
  501                var leav eConfirmat ionPopup;
  502  
  503                if (this .model.get ('scheduli ng-method' )) {
  504                    leav eConfirmat ionPopup =  new Leave Confirmati onPopupVie w({
  505                         elAfterClo se: $(e.cu rrentTarge t),
  506                         continue:  callback,
  507                    });
  508                    leav eConfirmat ionPopup.o penPopup() ;
  509                } else {
  510                    call back();
  511                }
  512           },
  513       }));
  514   });