4520. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/9/2017 3:51:45 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.

4520.1 Files compared

# Location File Last Modified
1 Fri Jun 9 19:51:45 2017 UTC
2 eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-web\src\main\webapp\WEB-INF\web patientDetails.jsp Tue May 2 14:49:40 2017 UTC

4520.2 Comparison summary

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

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

4520.4 Active regular expressions

No regular expressions were active.

4520.5 Comparison detail

        1   <%--
        2       Docume nt   : Pat ient Detai ls
        3       Create d By : Dav id Vasquez  / Robert  Snelling
        4       Modifi ed By: Ash a Amritraj
        5       Edited  By : Zach ary Tubb
        6   --%>
        7   <%@page im port="gov. va.nvap.we b.patient. PatientCom ment"%>
        8   <%@page im port="gov. va.nvap.we b.patient. PatientDet ails.Conse ntWrapper" %>
        9   <%@page im port="java .util.Arra yList"%>
        10   <%@page im port="java .util.List "%>
        11   <%@page im port="java .text.Simp leDateForm at"%>
        12   <%@page im port="gov. va.nvap.se rvice.pdq. PatientCor relationsR esponse"%>
        13   <%@page im port="gov. va.nvap.se rvice.pdq. PatientDem ographics" %>
        14   <%@page co ntentType= "text/html " pageEnco ding="UTF- 8"%>
        15   <%@taglib  uri="http: //java.sun .com/jsp/j stl/core"  prefix="c" %>
        16   <%@taglib  tagdir="/W EB-INF/tag s/formatti ng" prefix ="f" %>
        17   <%@taglib  uri="http: //java.sun .com/jsp/j stl/functi ons" prefi x="fn"%>
        18   <%@taglib  uri="http: //java.sun .com/jsp/j stl/fmt" p refix="fmt "%>
        19   <%@taglib  tagdir="/W EB-INF/tag s/cpp" pre fix="cpp"% >
        20   <%
        21       Patien tDemograph ics pd = ( PatientDem ographics)  session.g etAttribut e("patient Demographi cs");
        22       Boolea n hasBeenA nnounced =  (Boolean)  session.g etAttribut e("hasBeen Announced" );
        23       String  orgName =  (String)  session.ge tAttribute ("organiza tionName") ;
        24       String  requestId  = (String ) session. getAttribu te("reques tId");
        25       String  lastAnnou ncement =  (String) s ession.get Attribute( "lastAnnou ncement");
        26       List<P atientCorr elationsRe sponse> co rrelations  = new Arr ayList<Pat ientCorrel ationsResp onse>();
        27       correl ations = ( List<Patie ntCorrelat ionsRespon se>) sessi on.getAttr ibute("cor relations" );
        28       Boolea n isFormUp loadAllowe d = (Boole an) sessio n.getAttri bute("isFo rmUploadAl lowed");
        29       Long m axFileUplo adSize = ( Long) sess ion.getAtt ribute("ma xFileUploa dSize");
        30       List<C onsentWrap per> conse nts = new  ArrayList< ConsentWra pper>();
        31       consen ts = (List <ConsentWr apper>) se ssion.getA ttribute(" consents") ;
        32       List<P atientComm ent> patie ntComments  = new Arr ayList<Pat ientCommen t>();
        33       patien tComments  = (List<Pa tientComme nt>) sessi on.getAttr ibute("pat ientCommen ts");
        34   %>
        35   <%!    
        36       Date t oday = new  Date( );
        37       Simple DateFormat  ft = new  SimpleDate Format ("M M/dd/yyyy" );
        38       String  reportEnd Date = ft. format(tod ay) ;
        39       String  reportSta rtDate = " 01/01/1900 ";
        40   %>  
        41  
        42   <!DOCTYPE  HTML PUBLI C "-//W3C/ /DTD HTML  4.01 Trans itional//E N"
        43       "http: //www.w3.o rg/TR/html 4/loose.dt d">
        44  
        45   <!--
        46       Most R ecent Pati ent Activi ty
        47       Facili ty Number:  <c:out va lue="${pat ientDemogr aphics.fac ilityNumbe r}" />
        48   Facility N ame: <c:ou t value="$ {patientDe mographics .facilityN ame}" />
        49       Date o f Activity : <c:choos e><c:when  test="${!e mpty patie ntDemograp hics.corre lationDate }"><c:out  value="${p atientDemo graphics.c orrelation Date}" />< /c:when><c :otherwise >N/A</c:ot herwise></ c:choose>
        50   <%--Date o f Activity : <c:choos e><c:when  test="${!e mpty patie ntDemograp hics.corre lationDate }"><fmt:fo rmatDate p attern="MM /dd/yyyy"  value="${p atientDemo graphics.c orrelation Date}" />< /c:when><c :otherwise >N/A</c:ot herwise></ c:choose>- -%>
        51   -->
        52   <f:mainTem plate head erText="Pa tient Deta ils">
        53       <scrip t type="te xt/javascr ipt" src=" js/OptionT ransfer.js "></script >
        54       <scrip t type="te xt/javascr ipt" src=" modalbox/p rototype.j s"></scrip t>
        55       <scrip t type="te xt/javascr ipt" src=" modalbox/s criptaculo us.js?load =builder,e ffects"></ script>
        56       <scrip t type="te xt/javascr ipt" src=" modalbox/m odalbox.js "></script >
        57       <link  rel="style sheet" hre f="modalbo x/modalbox .css" type ="text/css " media="s creen" />
        58  
        59       <scrip t type="te xt/javascr ipt">
        60           va r bDocRead y = false;
        61           va r opt = ne w OptionTr ansfer("li st1", "lis t2");
        62           op t.setAutoS ort(false) ;
        63           op t.setDelim iter(",");
        64           op t.setStati cOptionReg ex(new Reg Exp("^.*?D efense.*?$ ", "i"));
        65           op t.saveNewL eftOptions ("newLeft" );
        66           op t.saveNewR ightOption s("newRigh t");
        67  
        68           fu nction clo seAndReloa d() {
        69                Modalbox .hide();
        70           }
        71           va r collecte dReasons =  [];
        72           fu nction col lectDelaye dReasons(r eason) {
        73                if (reas on.checked ) {
        74                    coll ectedReaso ns.push(re ason.value );
        75                } else {
        76                    var  index = co llectedRea sons.index Of(reason. value);
        77                    coll ectedReaso ns.splice( index, 1);
        78                }
        79                collecte dReasons.s ort();
        80                document .getElemen tById('col lectedReas ons').valu e = collec tedReasons ;
        81           }
        82  
        83           fu nction ena bleDelayed Reasons()  {
        84                var dela yed = docu ment.getEl ementById( 'delayedVa lue');
        85                document .getElemen tById('del ayReasons' ).style.vi sibility =  delayed.c hecked ? ' visible' :  'hidden';
        86                document .getElemen tById('opt ion1').dis abled = de layed.chec ked ? true  : false;
        87                document .getElemen tById('sig natureDate ').disable d = delaye d.checked  ? true : f alse;
        88                var butt on = docum ent.getEle mentById(' Authorize' );
        89                if (butt on.value = == "Author ize") {
        90                    butt on.value =  "Delay Au thorizatio n";
        91                    butt on.name =  "delayAuth orization" ;
        92                    butt on.disable d = true;
        93                    if ( document.g etElementB yId('optio n1').check ed) {
        94                         document.g etElementB yId('optio n1').check ed = false ;
        95                    }
        96                    docu ment.getEl ementById( 'signature Date').val ue = '';
        97                } else {
        98                    butt on.value =  "Authoriz e";
        99                    butt on.name =  "optIn";
        100                }
        101           }
        102           ;
        103  
        104           fu nction che ckDelayed( ) {
        105                var isDe layed = do cument.get ElementByI d('isDelay ed');
        106                var dela yedFields  = document .getElemen tById('del ayedFields ');
        107                var butt on = docum ent.getEle mentById(' Authorize' );
        108                if (isDe layed.valu e !== 'tru e') {
        109                    dela yedFields. style.disp lay = 'blo ck';
        110                } else {
        111                    dela yedFields. style.disp lay = 'non e';
        112                    butt on.value =  "Approve" ;
        113                }
        114           }
        115  
        116           fu nction tog gleConsent s() {
        117                sessionS torage.set Item('cons entsVisibi lity', tog gle('trCon sents', 'b tnConsents '));
        118           }
        119           fu nction tog gleCorrela tions() {
        120                sessionS torage.set Item('corr elationsVi sibility',  toggle('t rCorrelati ons', 'btn Correlatio ns'));
        121           }
        122           fu nction tog glePatient Comments()  {
        123                sessionS torage.set Item('pati entComment sVisibilit y', toggle ('trPatien tComments' , 'btnPati entComment s'));
        124           }
        125           fu nction tog gle(sectio nId, butto nId) {
        126                var sect ion = docu ment.getEl ementById( sectionId) ;
        127                var butt on = docum ent.getEle mentById(b uttonId);
        128                var visi bility = s ection.sty le.visibil ity === 'c ollapse' ?  'visible'  : 'collap se';
        129                updateSe ction(sect ion, butto n, visibil ity);
        130                return v isibility;
        131           }
        132           fu nction upd ateSection (section,  button, vi sibility)  {
        133                section. style.visi bility = v isibility;
        134                button.v alue = vis ibility == = 'visible ' ? '-' :  '+';
        135                button.t itle = (vi sibility = == 'visibl e' ? 'Coll apse' : 'E xpand') +  ' this sec tion';
        136           }
        137           fu nction mak eDocReady( ) {
        138                bDocRead y = true;
        139                var cons entsVisibi lity = ses sionStorag e.getItem( 'consentsV isibility' );
        140                if (cons entsVisibi lity !== n ull) {
        141                    upda teSection( document.g etElementB yId('trCon sents'), d ocument.ge tElementBy Id('btnCon sents'), c onsentsVis ibility);
        142                }
        143                var corr elationsVi sibility =  sessionSt orage.getI tem('corre lationsVis ibility');
        144                if (corr elationsVi sibility ! == null) {
        145                    upda teSection( document.g etElementB yId('trCor relations' ), documen t.getEleme ntById('bt nCorrelati ons'), cor relationsV isibility) ;
        146                }
        147                var pati entComment sVisibilit y = sessio nStorage.g etItem('pa tientComme ntsVisibil ity');
        148                if (pati entComment sVisibilit y !== null ) {
        149                    upda teSection( document.g etElementB yId('trPat ientCommen ts'), docu ment.getEl ementById( 'btnPatien tComments' ), patient CommentsVi sibility);
        150                }
        151           }
        152           fu nction che ckReadySta te() {
        153                if (bDoc Ready) {
        154                    bDoc Ready = fa lse;
        155                    retu rn true;
        156                } else {
        157                    retu rn false;
        158                }
        159                function  makeDocRe ady() {
        160                    bDoc Ready = tr ue;
        161                    var  consentsVi sibility =  sessionSt orage.getI tem('conse ntsVisibil ity');
        162                    if ( consentsVi sibility ! == null) {
        163                         updateSect ion(docume nt.getElem entById('t rConsents' ), documen t.getEleme ntById('bt nConsents' ), consent sVisibilit y);
        164                    }
        165                    var  correlatio nsVisibili ty = sessi onStorage. getItem('c orrelation sVisibilit y');
        166                    if ( correlatio nsVisibili ty !== nul l) {
        167                         updateSect ion(docume nt.getElem entById('t rCorrelati ons'), doc ument.getE lementById ('btnCorre lations'),  correlati onsVisibil ity);
        168                    }
        169                    var  patientCom mentsVisib ility = se ssionStora ge.getItem ('patientC ommentsVis ibility');
        170                    if ( patientCom mentsVisib ility !==  null) {
        171                         updateSect ion(docume nt.getElem entById('t rPatientCo mments'),  document.g etElementB yId('btnPa tientComme nts'), pat ientCommen tsVisibili ty);
        172                    }
        173                }
        174                function  checkRead yState() {
        175                    if ( bDocReady)  {
        176                         bDocReady  = false;
        177                         return tru e;
        178                    } el se {
        179                         return fal se;
        180                    }
        181                }
        182                function  sleep(mil liseconds)  {
        183                    var  start = ne w Date().g etTime();
        184                    for  (var i = 0 ; i < 1e7;  i++) {
        185                         if ((new D ate().getT ime() - st art) > mil liseconds)  {
        186                             break;
        187                         }
        188                    }
        189                }
        190           }
        191           fu nction for mShow(id)  {
        192                var elmt  = documen t.getEleme ntById(id) ;
        193                if (elmt  != null)  {
        194                    elmt .style.dis play = "bl ock";
        195                }
        196           }
        197           fu nction for mHide(id)  {
        198                var elmt  = documen t.getEleme ntById(id) ;
        199                if (elmt  != null)  {
        200                    elmt .style.dis play = "no ne";
        201                }
        202           }
        203           fu nction ena bleObjectB yCheck(obj , arg) {
        204                var elmt  = documen t.getEleme ntById(arg );
        205                if (elmt  != null)  {
        206                    if ( obj.checke d == true)  {
        207                         elmt.disab led = fals e;
        208                    } el se {
        209                         elmt.disab led = true ;
        210                    }
        211                }
        212           }
        213           fu nction deC heckObject (obj) {
        214                var elmt  = documen t.getEleme ntById(obj );
        215                if (elmt  != null)  {
        216                    elmt .checked =  false;
        217                }
        218           }
        219  
        220           fu nction ena bleObject( arg) {
        221                var elmt  = documen t.getEleme ntById(arg );
        222                if (elmt  != null)  {
        223                    elmt .disabled  = false;
        224                }
        225           }
        226           fu nction dis ableObject (arg) {
        227                var elmt  = documen t.getEleme ntById(arg );
        228                if (elmt  != null)  {
        229                    elmt .disabled  = true;
        230                }
        231           }
        232           fu nction onR evoke() {
        233                var elmt  = documen t.getEleme ntById('re ason');
        234                if (elmt  != null)  {
        235  
        236                    if ( elmt.value  != 'Revok ed' && elm t.value !=  'New Auth orization' ) {
        237                         var signat ureDate =  document.g etElementB yId('signa tureDate') ;
        238                         var curren tDate = ne w Date();
        239                         signatureD ate.value  = currentD ate.getMon th() + 1 +  "/"
        240                                 +  currentDat e.getDate( ) + "/"
        241                                 +  currentDat e.getFullY ear();
        242                    }
        243                    if ( elmt.value  != 'Patie nt Decease d') {
        244                         var deceas edDate = d ocument.ge tElementBy Id('deceas edDate');
        245                         var curren tDate = ne w Date();
        246                         deceasedDa te.value =  currentDa te.getMont h() + 1 +  "/"
        247                                 +  currentDat e.getDate( ) + "/"
        248                                 +  currentDat e.getFullY ear();
        249                    }
        250                }
        251           }
        252           fu nction ena bleAllElem ents() {
        253                enableOb ject('sign atureDate' );
        254                enableOb ject('file ');
        255                enableOb ject('dece asedDate') ;
        256           }
        257           fu nction onO ptoutReaso nChange(se lectedItem ) {
        258                // if se lectedItem .value is  --Select a  reason--  then disab le revoke
        259                // if se lectedItem .value is  Patient-op tedout or  --Select a  reason--  then disab le revoke  and enable  checkbox
        260                // if se lectedItem .value is  anything o ther than  patient-op ted-out th en enable  revoke
        261                if (sele ctedItem.v alue == '' ) {
        262                    disa bleObject( 'Revoke');
        263                    disa bleObject( 'revokeVal idationChe ckBoxInput ');
        264                    disa bleObject( 'newValida tionCheckB oxInput');
        265                    disa bleObject( 'signature Date');
        266                    disa bleObject( 'file');
        267                    disa bleObject( 'deceasedD ate');
        268                    disa bleObject( 'revokeAnd Authorize' );
        269                    deCh eckObject( 'revokeVal idationChe ckBoxInput ');
        270                    deCh eckObject( 'newValida tionCheckB oxInput');
        271                    //fo rmHide('re vokeButton ');
        272                    form Hide('revo keAndAutho rizeButton ');
        273                    form Hide('revo keValidati onCheckBox ');
        274                    form Hide('revo keDateAndU ploadValid ation');
        275                    form Hide('revo keDateAndU ploadValid ationPatie ntDeceased ');
        276                    form Hide('newV alidationC heckBox');
        277                } else i f (selecte dItem.valu e == 'Revo ked') {
        278                    disa bleObject( 'Revoke');
        279                    enab leObject(' revokeVali dationChec kBoxInput' );
        280                    disa bleObject( 'newValida tionCheckB oxInput');
        281                    enab leObject(' signatureD ate');
        282                    disa bleObject( 'file');
        283                    disa bleObject( 'deceasedD ate');
        284                    disa bleObject( 'revokeAnd Authorize' );
        285                    deCh eckObject( 'revokeVal idationChe ckBoxInput ');
        286                    deCh eckObject( 'newValida tionCheckB oxInput');
        287                    form Show('revo keButton') ;
        288                    form Hide('revo keAndAutho rizeButton ');
        289                    form Show('revo keValidati onCheckBox ');
        290                    form Show('revo keDateAndU ploadValid ation');
        291                    form Hide('revo keDateAndU ploadValid ationPatie ntDeceased ');
        292                    form Hide('newV alidationC heckBox');
        293                    enab leRevokeAf terValidat ion('signa tureDate',  'Revoke') ;
        294                } else i f (selecte dItem.valu e == 'Pati ent Deceas ed') {
        295                    disa bleObject( 'Revoke');
        296                    disa bleObject( 'revokeVal idationChe ckBoxInput ');
        297                    disa bleObject( 'newValida tionCheckB oxInput');
        298                    disa bleObject( 'signature Date');
        299                    disa bleObject( 'file');
        300                    enab leObject(' deceasedDa te');
        301                    disa bleObject( 'revokeAnd Authorize' );
        302                    deCh eckObject( 'revokeVal idationChe ckBoxInput ');
        303                    deCh eckObject( 'newValida tionCheckB oxInput');
        304                    form Show('revo keButton') ;
        305                    form Hide('revo keAndAutho rizeButton ');
        306                    form Hide('revo keValidati onCheckBox ');
        307                    form Hide('revo keDateAndU ploadValid ation');
        308                    form Show('revo keDateAndU ploadValid ationPatie ntDeceased ');
        309                    form Hide('newV alidationC heckBox');
        310                    enab leRevokeAf terValidat ion('decea sedDate',  'Revoke');
        311                } else i f (selecte dItem.valu e == 'New  Authorizat ion') {
        312                    disa bleObject( 'Revoke');
        313                    disa bleObject( 'revokeVal idationChe ckBoxInput ');
        314                    enab leObject(' newValidat ionCheckBo xInput');
        315                    enab leObject(' signatureD ate');
        316                    disa bleObject( 'file');
        317                    disa bleObject( 'deceasedD ate');
        318                    disa bleObject( 'revokeAnd Authorize' );
        319                    form Show('revo keAndAutho rizeButton ');
        320                    deCh eckObject( 'revokeVal idationChe ckBoxInput ');
        321                    deCh eckObject( 'newValida tionCheckB oxInput');
        322                    disa bleObject( 'revokeAnd Authorize' );
        323                    form Hide('revo keButton') ;
        324                    form Hide('revo keValidati onCheckBox ');
        325                    form Show('revo keDateAndU ploadValid ation');
        326                    form Hide('revo keDateAndU ploadValid ationPatie ntDeceased ');
        327                    form Show('newV alidationC heckBox');
        328                    enab leRevokeAf terValidat ion('signa tureDate',  'Revoke') ;
        329                } else {
        330                    enab leObject(' Revoke');
        331                    disa bleObject( 'revokeVal idationChe ckBoxInput ');
        332                    disa bleObject( 'newValida tionCheckB oxInput');
        333                    disa bleObject( 'signature Date');
        334                    disa bleObject( 'file');
        335                    disa bleObject( 'deceasedD ate');
        336                    disa bleObject( 'revokeAnd Authorize' );
        337                    deCh eckObject( 'revokeVal idationChe ckBox');
        338                    deCh eckObject( 'newValida tionCheckB ox');
        339                    form Show('revo keButton') ;
        340                    form Hide('revo keAndAutho rizeButton ');
        341                    form Hide('revo keValidati onCheckBox ');
        342                    form Hide('revo keDateAndU ploadValid ation');
        343                    form Hide('revo keDateAndU ploadValid ationPatie ntDeceased ');
        344                    form Hide('newV alidationC heckBox');
        345                }
        346           }
        347           fu nction ena bleAuthori zeAfterVal idation(ob jA, objB,  arg) {
        348                var dela yed = docu ment.getEl ementById( 'delayedVa lue');
        349                var vale lmentA = d ocument.ge tElementBy Id(objA);
        350                var vale lmentB = d ocument.ge tElementBy Id(objB);
        351                var elmt  = documen t.getEleme ntById(arg );
        352                if (dela yed !== nu ll && dela yed.checke d) {
        353                    if ( document.g etElementB yId('colle ctedReason s').value  !== '') {
        354                         elmt.disab led = fals e;
        355                    } el se {
        356                         elmt.disab led = true ;
        357                    }
        358                } else i f (elmt !=  null) {
        359                    if ( valelmentA .value !=  '' && isDa te(valelme ntA.value)  == true & & valelmen tB.checked  == true)  {
        360                         elmt.disab led = fals e;
        361                    } el se {
        362                         elmt.disab led = true ;
        363                    }
        364                }
        365           }
        366           fu nction ena bleRevokeA fterValida tion(objA,  arg) {
        367                var vale lmentA = d ocument.ge tElementBy Id(objA);
        368                var elmt  = documen t.getEleme ntById(arg );
        369                if (elmt  != null)  {
        370                    var  elmtOption A = docume nt.getElem entById('r evokeValid ationCheck Box');
        371                    var  elmtOption B = docume nt.getElem entById('n ewValidati onCheckBox ');
        372                    if ( (elmtOptio nA != null  && elmtOp tionA.styl e.display  != "none")  || (elmtO ptionB !=  null && el mtOptionB. style.disp lay != "no ne")) {
        373                         if (elmtOp tionA != n ull && elm tOptionA.s tyle.displ ay != "non e") {
        374                             var va lelmentB =  document. getElement ById('revo keValidati onCheckBox Input');
        375                         } else {
        376                             var va lelmentB =  document. getElement ById('newV alidationC heckBoxInp ut');
        377                             var el mt = docum ent.getEle mentById(' revokeAndA uthorize') ;
        378                         }
        379                         if (valelm entA.value  != '' &&  isDate(val elmentA.va lue) == tr ue && vale lmentB.che cked == tr ue) {
        380                             elmt.d isabled =  false;
        381                         } else {
        382                             elmt.d isabled =  true;
        383                         }
        384                    } el se {
        385                         if (valelm entA.value  != '' &&  isDate(val elmentA.va lue) == tr ue) {
        386                             elmt.d isabled =  false;
        387                         } else {
        388                             elmt.d isabled =  true;
        389                         }
        390                    }
        391                }
        392           }
        393           fu nction ena bleRestric tAfterVali dation(obj A, objB, o bjC, objD,  arg) {
        394                var vale lmentA = d ocument.ge tElementBy Id(objA);
        395                var vale lmentB = d ocument.ge tElementBy Id(objB);
        396                var vale lmentC = d ocument.ge tElementBy Id(objC);
        397                var vale lmentD = d ocument.ge tElementBy Id(objD);
        398                var elmt  = documen t.getEleme ntById(arg );
        399                if (elmt  != null)  {
        400                    if ( valelmentA .value !=  '' && isDa te(valelme ntA.value)  == true & & valelmen tB.checked  == true & & valelmen tC.length  >= 1 && va lelmentD.l ength != 0 ) {
        401                         elmt.disab led = fals e;
        402                    } el se {
        403                         elmt.disab led = true ;
        404                    }
        405                }
        406           }
        407           fu nction ena bleLetterG enerate(fi eld) {
        408                var sign ature = do cument.get ElementByI d(field);
        409                var butt on = docum ent.getEle mentById(' Generate') ;
        410                if (sign ature !==  null && si gnature.va lue !== '' ) {
        411                    butt on.disable d = false;
        412                } else {
        413                    butt on.disable d = true;
        414                }
        415           }
        416           fu nction isD ate(input)  {
        417                if (!/^\ d{2}\/\d{2 }\/\d{4}$/ .test(inpu t)) {
        418                    retu rn false;
        419                } else {
        420                    var  monthfield  = input.s plit("/")[ 0];
        421                    var  dayfield =  input.spl it("/")[1] ;
        422                    var  yearfield  = input.sp lit("/")[2 ];
        423  
        424                    var  dayobj = n ew Date(ye arfield, m onthfield  - 1, dayfi eld);
        425                    if ( (dayobj.ge tMonth() +  1 != mont hfield) ||  (dayobj.g etDate() ! = dayfield ) || (dayo bj.getFull Year() !=  yearfield) ) {
        426                         return fal se;
        427                    } el se {
        428                         return tru e;
        429                    }
        430                }
        431           }
        432           jQ uery(docum ent).ready (function  () {
        433                shouldRe load = tru e;
        434  
        435                jQuery(' .vap-old-m odal').on( 'click', f unction (e vent) {
        436                    //if  (checkRea dyState())  {
        437                    if ( jQuery(thi s).data('c onsent-typ e') === 'd elayed') {
        438                         var url =  'PatientDe tails.do_s ec?editMai lDatesForm =true&dela yedConsent Id=' + jQu ery(this). data('dela yed-consen t-id');
        439                    } el se {
        440                         var url =  'PatientDe tails.do_s ec?editMai lDatesForm =true&cons entDirId='  + jQuery( this).data ('consent- dir-id');
        441                    }
        442  
        443                    Moda lbox.show( url, {titl e: jQuery( this).data ('title'),  width: 60 0, height:  'auto', a fterHide:  function ( ) {
        444                         if (should Reload) {
        445                             locati on.reload( );
        446                         }
        447                    }});
        448                    retu rn false;
        449                });
        450  
        451                makeDocR eady();
        452           }) ;
        453       </scri pt>
        454  
        455       <div i d="slideta bsmenu">
        456           <u l>
        457                <li id=" current">
        458                    <a t itle="Pati ent Summar y" href="P atientDeta ils.do_sec "><span>Pa tient Summ ary</span>  </a>
        459                </li>
        460                <li>
        461                    <a h ref="Patie ntDetails. do_sec?vie w=true" ti tle="View  Health Sum mary (C32) "><span>He alth Summa ry (C32)</ span> </a>
        462                </li>
        463           </ ul>
        464           <c :if test=" ${!empty p atients}">
        465                <a style ="float: r ight; back ground-col or: white"  title="Ba ck to Pati ent Search  Results"  href="Pati entSearchR esults.do_ sec">Back  to Patient  Search Re sults</a>
        466           </ c:if>
        467       </div>
        468  
        469       <div c lass="vap- grey-heade r">
        470           Pa tient Info rmation
        471       </div>
        472  
        473       <%@inc lude file= "patientDe mographics .jsp"%> <% -- TODO: c hange up t he table ( or remove  it) from t his includ ed file -- %>
        474  
        475       <div c lass="vap- grey-heade r">
        476           <d iv class=" pull-left" >
        477                <input i d="btnPati entComment s" type="b utton" cla ss="vap-ha nd-hover"  style="bor der:none;  background :none;" va lue="-" ti tle="Colla pse this s ection" on click="tog glePatient Comments() ;" />
        478                Comments
        479           </ div>
        480           <d iv class=" pull-right ">
        481                <a href= "PatientDe tails.do_s ec?addPati entComment Form=true& patientIen =<c:out va lue="${pat ientDemogr aphics.icn }"/>" titl e="Add Com ments" onc lick="if ( checkReady State()) {
        482                         Modalbox.s how(this.h ref, {titl e: this.ti tle, width : 643, hei ght: 180,  afterHide:  function  () {
        483                                 wi ndow.locat ion.href =  window.lo cation.hre f;
        484                             }});
        485                         return fal se;
        486                    } el se {
        487                         return fal se;
        488                    }">A dd Comment </a>
        489           </ div>
        490           <d iv class=" clearfix"> </div>
        491       </div>
        492  
        493       <div i d="trPatie ntComments " class="p ad-bottom- 20">
        494           <% @include f ile="patie ntComments .jsp"%>
        495       </div>
        496  
        497       <div c lass="vap- grey-heade r">
        498           Ma nage Acces s to Veter an Health  Records
        499       </div>
        500       <c:set  var="NwHI NactiveDel ay" value= "${NwHINac tiveDelay} " />
        501       <c:set  var="SSAa ctiveDelay " value="$ {SSAactive Delay}" />
        502  
        503       <c:cho ose>
        504           <c :when test ="${!empty  consentDi rective}">
        505                <div>
        506                    <spa n class="v ap-grey-bo ld"><c:out  value="${ organizati onName}"/>  Access</s pan><br />
        507                    <str ong>The Ve teran has  currently  authorized  the relea se </stron g>
        508                    of p rotected h ealth info rmation fr om
        509                    <str ong><fmt:f ormatDate  pattern="M M/dd/yyyy"  value="${ consentDir ective.opt inDate}" / ></strong>
        510                    thro ugh <c:out  value="${ organizati onName}"/> .
        511                    <ul>
        512                         <li>
        513                             <a hre f="Patient Details.do _sec?revok eNwHIN=tru e" title=" Revoke <c: out value= "${organiz ationName} "/>"
        514                                 on click="if  (checkRead yState())  {
        515                                      Modalbox .show(this .href, {ti tle: this. title, wid th: 900, h eight: 600 , afterHid e: functio n () {
        516                                               window.loc ation.href  = window. location.h ref;
        517                                          }});
        518                                      return f alse;
        519                                 }  else {
        520                                      return f alse;
        521                                 }" ><c:out va lue="${isN ewAuthoriz ationAllow ed ? 'Revo ke access  or submit  new author ization' :  'Revoke a ccess'}"/>
        522                                 to  Veteran e lectronic  health inf ormation ( <c:out val ue="${orga nizationNa me}"/>)</a >
        523                                 wi th non-VA  healthcare  provider  organizati ons via <c :out value ="${organi zationName }"/> for t he purpose s of treat ment.
        524                         </li>
        525                    </ul >
        526                </div>
        527           </ c:when>
        528           <c :when test ="${NwHINa ctiveDelay  != null}" >
        529                <div>
        530                    <spa n class="v ap-grey-bo ld"><c:out  value="${ organizati onName}"/>  Access</s pan><br />
        531                    <str ong>The Ve teran has  an authori zation to  release </ strong>
        532                    prot ected heal th informa tion throu gh <c:out  value="${o rganizatio nName}"/>  in
        533                    <str ong>DELAYE D</strong>  status, p ending fin al approva l.
        534                    Reas on<c:if te st="${fn:l ength(NwHI NactiveDel ay.delayRe asonCollec tion) > 1} ">s</c:if>  for delay :
        535                    <c:f orEach var ="r" items ="${NwHINa ctiveDelay .delayReas onCollecti on}" varSt atus="loop ">
        536                         <c:out val ue="${r.na me}"/><c:i f test="${ fn:length( NwHINactiv eDelay.del ayReasonCo llection)  gt 1 and ( loop.index  lt fn:len gth(NwHINa ctiveDelay .delayReas onCollecti on) - 1)}" >,</c:if>
        537                    </c: forEach>
        538                    <ul>
        539                         <li>
        540                             > <a h ref="Patie ntDetails. do_sec?aut horizeDela yNwHIN=tru e&delayedC onsentId=< c:out valu e="${NwHIN activeDela y.delayedC onsentId}" />"
        541                                 ti tle="Appro ve Pending  <c:out va lue="${org anizationN ame}"/> Au thorizatio n"
        542                                 on click="if  (checkRead yState())  {
        543                                               Modalbox.s how(this.h ref, {titl e: this.ti tle,
        544                                                   width:  900, heig ht: 600, a fterLoad:  function ( ) {
        545                                                       ch eckDelayed ();
        546                                                   },
        547                                                   afterH ide: funct ion () {
        548                                                       wi ndow.locat ion.href =
        549                                                                wind ow.locatio n.href;
        550                                                   }});
        551                                               return fal se;
        552                                          } el se {
        553                                               return fal se;
        554                                          }">A pprove thi s authoriz ation</a>
        555                         </li>
        556                         <li>
        557                             > <a h ref="Patie ntDetails. do_sec?can celDelayed Authorizat ion=true&d elayedCons entId=<c:o ut value=" ${NwHINact iveDelay.d elayedCons entId}"/>"
        558                                 ti tle="Cance l Pending  <c:out val ue="${orga nizationNa me}"/> Aut horization "
        559                                 on click="if  (checkRead yState())  {
        560                                               Modalbox.s how(this.h ref, {titl e: this.ti tle,
        561                                                   width:  643, heig ht: 180, a fterHide:  function ( ) {
        562                                                       wi ndow.locat ion.href =
        563                                                                wind ow.locatio n.href;
        564                                                   }});
        565                                               return fal se;
        566                                          } el se {
        567                                               return fal se;
        568                                          }">C ancel this  authoriza tion</a>
        569                         </li>
        570                         <li>
        571                             > <a h ref="Patie ntDetails. do_sec?ehe Delay=true &printLett er=true&de layedConse ntId=<c:ou t value="$ {NwHINacti veDelay.de layedConse ntId}"/>"
        572                                 ti tle="Gener ate Notifi cation Let ter of Aut horization  Delay"
        573                                 on click="Mod albox.show (this.href , {title:  this.title ,
        574                                               width: 900 , height:  'auto'});
        575                                          retu rn false;" >Print not ification  letter</a>
        576                         </li>
        577                    </ul >
        578                </div>
        579           </ c:when>
        580           <c :otherwise >
        581                <div>
        582                    <spa n class="v ap-grey-bo ld"><c:out  value="${ organizati onName}"/>  Access</s pan><br />
        583                    <str ong>The Ve teran has  currently  NOT author ized the r elease</st rong>
        584                    of p rotected h ealth info rmation th rough <c:o ut value=" ${organiza tionName}" />.
        585                    <ul>
        586                         <li>
        587                             > <a h ref="Patie ntDetails. do_sec?aut horizeNwHI N=true"
        588                                 ti tle="Autho rize <c:ou t value="$ {organizat ionName}"/ >"
        589                                 on click="if  (checkRead yState())  {
        590                                               Modalbox.s how(this.h ref, {titl e: this.ti tle,
        591                                                   width:  900, heig ht: 600, a fterLoad:  function ( ) {
        592                                                       ch eckDelayed ();
        593                                                   },
        594                                                   afterH ide: funct ion () {
        595                                                       wi ndow.locat ion.href =  window.lo cation.hre f;
        596                                                   }});
        597                                               return fal se;
        598                                          } el se {
        599                                               return fal se;
        600                                          }">S hare Veter an electro nic health  informati on (<c:out  value="${ organizati onName}"/> )</a>
        601                             with n on-VA heal thcare pro vider orga nizations  via <c:out  value="${ organizati onName}"/>  for the p urposes of  treatment .
        602                         </li>
        603                    </ul >
        604                </div>
        605           </ c:otherwis e>
        606       </c:ch oose>
        607  
        608       <c:if  test="${is Organizati onExclusio nsAllowed} ">
        609           <c :choose>
        610                <c:when  test="${!e mpty nwhin Organizati onRestrict ionsDirect ive}">
        611                    <div >
        612                         <span clas s="vap-gre y-bold">Re strictions </span><br  />
        613                         <strong>Th e Veteran  currently  has Restri ctions </s trong>
        614                         that limit  the shari ng of elec tronic hea lth inform ation.
        615                         <ul>
        616                             <li>
        617                                 >  <a href="P atientDeta ils.do_sec ?modifyNwH INOrganiza tionRestri ctions=tru e"
        618                                      title="V iew/Modify  <c:out va lue="${org anizationN ame}"/> Or ganization  Restricti on"
        619                                      onclick= "if (check ReadyState ()) {
        620                                                   Modalb ox.show(th is.href, { title: thi s.title, w idth: 900,  height: 6 00, evalSc ripts: tru e, afterHi de: functi on () {
        621                                                            window.l ocation.hr ef = windo w.location .href;
        622                                                       }} );
        623                                                   return  false;
        624                                               } else {
        625                                                   return  false;
        626                                               }">View/Mo dify Veter an's exist ing restri ctions.</a >
        627                             </li>
        628                             <li>
        629                                 >  <a href="P atientDeta ils.do_sec ?revokeNwH INOrganiza tionRestri ctions=tru e"
        630                                      title="R evoke or T erminate < c:out valu e="${organ izationNam e}"/> Orga nization R estriction "
        631                                      onclick= "if (check ReadyState ()) {
        632                                                   Modalb ox.show(th is.href, { title: thi s.title, w idth: 900,  height: 6 00, evalSc ripts: tru e, afterHi de: functi on () {
        633                                                            window.l ocation.hr ef = windo w.location .href;
        634                                                       }} );
        635                                                   return  false;
        636                                               } else {
        637                                                   return  false;
        638                                               }">Revoke
        639                                      or termi nate Veter an's exist ing restri ctions</a>  that limi t the shar ing of ele ctronic he alth infor mation.
        640                             </li>
        641                         </ul>
        642                    </di v>
        643                </c:when >
        644                <c:other wise>
        645                    <div >
        646                         <span clas s="vap-gre y-bold">Re strictions </span><br  />
        647                         <strong>Th e Veteran  has curren tly no res trictions. </strong>
        648                         <ul>
        649                             <li>
        650                                 >  <a href="P atientDeta ils.do_sec ?authorize NwHINOrgan izationRes trictions= true"
        651                                      title="< c:out valu e="${organ izationNam e}"/> Rest rictions"
        652                                      onclick= "if (check ReadyState ()) {
        653                                                   Modalb ox.show(th is.href, { title: thi s.title, w idth: 900,  height: 6 00, evalSc ripts: tru e, afterHi de: functi on () {
        654                                                            window.l ocation.hr ef = windo w.location .href;
        655                                                       }} );
        656                                                   return  false;
        657                                                   void(0 );
        658                                               } else {
        659                                                   return  false;
        660                                               }">Manage  Veteran re strictions </a>
        661                                 th at limit t he sharing  of his/he r electron ic health  informatio n for non- VA healthc are
        662                                 pr ovider org anizations  via <c:ou t value="$ {organizat ionName}"/ > for the  purpose of  treatment .
        663                             </li>
        664                         </ul>
        665                    </di v>
        666                </c:othe rwise>
        667           </ c:choose>
        668       </c:if >
        669       <c:cho ose>
        670           <c :when test ="${!empty  ssaConsen tDirective }">
        671                <div cla ss="margin -bottom-15 ">
        672                    <spa n class="v ap-grey-bo ld">Social  Security  Administra tion (SSA)  Access</s pan><br />
        673                    <str ong>The Ve teran has  currently  authorized  the relea se of </st rong>
        674                    prot ected heal th informa tion to th e Social S ecurity Ad ministrati on from
        675                    <str ong><fmt:f ormatDate  pattern="M M/dd/yyyy"  value="${ ssaConsent Directive. optinDate} " /> </str ong>
        676                    that  expires o n
        677                    <str ong><fmt:f ormatDate  pattern="M M/dd/yyyy"  value="${ ssaConsent Directive. expiration Date}" />,  </strong>
        678                    thro ugh <c:out  value="${ organizati onName}"/> .
        679                    <%--
        680                    <ul>
        681                         <li>
        682                             <a hre f="Patient Details.do _sec?revok eSSA=true"
        683                                 ti tle="Revok e SSA"
        684                                 on click="if  (checkRead yState())  {
        685                                               Modalbox.s how(this.h ref, {titl e: this.ti tle, width : 900, hei ght: 600,  afterHide:  function  () {
        686                                                       wi ndow.locat ion.href =  window.lo cation.hre f;
        687                                                   }});
        688                                               return fal se;
        689                                          } el se {
        690                                               return fal se;
        691                                          }">< c:out valu e="${isSSA NewAuthori zationAllo wed ? 'Rev oke access  or submit  new autho rization'  : 'Revoke  Access'}"/ > to Veter an health  informatio n with the  Social Se curity Adm inistratio n</a>
        692                             via <c :out value ="${organi zationName }"/> for t he purpose s of recei ving disab ility bene fits (Cove rage).
        693                         </li>
        694                    </ul >
        695                    --%>
        696                </div>
        697           </ c:when>
        698           <% --
        699           <c :when test ="${SSAact iveDelay ! = null}">
        700                <div>
        701                    <spa n class="v ap-grey-bo ld">Social  Security  Administra tion (SSA)  Access</s pan><br />
        702                    <str ong>The Ve teran has  an authori zation to  release </ strong>
        703                    prot ected heal th informa tion throu gh Social  Security A dministrat ion (SSA)  in <strong >DELAYED</ strong> st atus, pend ing final  approval.
        704                    Reas on<c:if te st="${fn:l ength(SSAa ctiveDelay .delayReas onCollecti on) > 1}"> s</c:if>
        705                    for  delay:
        706                    <c:f orEach var ="r" items ="${SSAact iveDelay.d elayReason Collection }" varStat us="loop">
        707                         <c:out val ue="${r.na me}"/><c:i f test="${ fn:length( SSAactiveD elay.delay ReasonColl ection) gt  1 and (lo op.index l t fn:lengt h(SSAactiv eDelay.del ayReasonCo llection)  - 1)}">,</ c:if>
        708                    </c: forEach>
        709                    <ul>
        710                         <li>
        711                             > <a h ref="Patie ntDetails. do_sec?aut horizeDela ySSA=true& delayedCon sentId=<c: out value= "${SSAacti veDelay.de layedConse ntId}"/>"
        712                                 ti tle="Appro ve Pending  Social Se curity Adm inistratio n (SSA) Au thorizatio n"
        713                                 on click="if  (checkRead yState())  {
        714                                               Modalbox.s how(this.h ref, {titl e: this.ti tle,
        715                                                   width:  900, heig ht: 600, a fterLoad:  function ( ) {
        716                                                       ch eckDelayed ();
        717                                                   },
        718                                                   afterH ide: funct ion () {
        719                                                       wi ndow.locat ion.href =
        720                                                                wind ow.locatio n.href;
        721                                                   }});
        722                                               return fal se;
        723                                          } el se {
        724                                               return fal se;
        725                                          }">A pprove thi s authoriz ation</a>
        726                         </li>
        727                         <li>
        728                             > <a h ref="Patie ntDetails. do_sec?can celDelayed Authorizat ion=true&d elayedCons entId=<c:o ut value=" ${SSAactiv eDelay.del ayedConsen tId}"/>"
        729                                 ti tle="Cance l Pending  SSA Author ization"
        730                                 on click="if  (checkRead yState())  {
        731                                               Modalbox.s how(this.h ref, {titl e: this.ti tle,
        732                                                   width:  643, heig ht: 180, a fterHide:  function ( ) {
        733                                                       wi ndow.locat ion.href =
        734                                                                wind ow.locatio n.href;
        735                                                   }});
        736                                               return fal se;
        737                                          } el se {
        738                                               return fal se;
        739                                          }">C ancel this  authoriza tion</a>
        740                         </li>
        741                         <li>
        742                             > <a h ref="Patie ntDetails. do_sec?ssa Delay=true &printLett er=true&de layedConse ntId=<c:ou t value="$ {SSAactive Delay.dela yedConsent Id}"/>"
        743                                 ti tle="Gener ate Notifi cation Let ter of Aut horization  Delay"
        744                                 on click="Mod albox.show (this.href , {title:  this.title ,
        745                                               width: 900 , height:  'auto'});
        746                                          retu rn false;" >Print not ification  letter</a>
        747                         </li>
        748                    </ul >
        749                </div>
        750           </ c:when>
        751           -- %>
        752           <c :otherwise >
        753                <div cla ss="margin -bottom-15 ">
        754                    <spa n class="v ap-grey-bo ld">Social  Security  Administra tion (SSA)  Access</s pan><br />
        755                    <str ong>The Ve teran has  currently  NOT author ized the r elease of  </strong>
        756                    prot ected heal th informa tion to th e Social S ecurity Ad ministrati on through  <c:out va lue="${org anizationN ame}"/>.
        757                    <%--
        758                    <ul>
        759                         <li>
        760                             > <a h ref="Patie ntDetails. do_sec?aut horizeSSA= true"
        761                                 ti tle="Autho rize SSA"
        762                                 on click="if  (checkRead yState())  {
        763                                               Modalbox.s how(this.h ref, {titl e: this.ti tle,
        764                                                   width:  900, heig ht: 600, a fterHide:  function ( )
        765                                                   {
        766                                                       wi ndow.locat ion.href =  window.lo cation.hre f;
        767                                                   }});
        768                                               return fal se;
        769                                          } el se
        770                                          {
        771                                               return fal se;
        772                                          }">S hare Veter an health  informatio n with the  Social Se curity Adm inistratio n</a>
        773                             via <c :out value ="${organi zationName }"/> for t he purpose s of
        774                             receiv ing disabi lity benef its (Cover age).
        775                         </li>
        776                    </ul >
        777                    --%>
        778                </div>
        779           </ c:otherwis e>
        780       </c:ch oose>
        781  
        782       <%--Ad ding DIV f or Patient  bulk down load --%>
        783       <cpp:u serInRole  role="VAPA pplication ReportsUse r">
        784           <d iv class=" margin-bot tom-15">
        785                <span cl ass="vap-g rey-bold"> Data Quali ty Export< /span><br  />
        786                <strong> Download a ll documen ts for the  patient t hat were r eferenced  by an eHea lth Exchan ge Adapter  Audit</st rong>
        787                <ul>
        788                    <li> > <a
        789                         href="Adap terDateRan geReport.d o_sec?star tDate=<c:o ut value=' <%=reportS tartDate%> '/>&endDat e=<c:out v alue='<%=r eportEndDa te%>'/>&pa tientIdent ifier=<c:o ut value=" ${patientD emographic s.icn}"/>"
        790                         title="Dow nload Audi ted Patien t Document s">Downloa d Document s</a>
        791                    </li >
        792                </ul>
        793           </ div>
        794       </cpp: userInRole >
        795  
        796       <div c lass="vap- grey-heade r">
        797           An nounce
        798       </div>
        799  
        800       <div>
        801           <% @include f ile="annou nce.jsp"%>
        802       </div>
        803  
        804       <c:if  test="${!e mpty conse nts}">
        805           <d iv class=" vap-grey-h eader">
        806                <input i d="btnCons ents" type ="button"  class="vap -hand-hove r" style=" border:non e; backgro und:none;"  value="-"  title="Co llapse thi s section"  onclick=" toggleCons ents();" / >
        807                Status H istory
        808           </ div>
        809  
        810           <d iv id="trC onsents" c lass="pad- bottom-20" >
        811                <%@inclu de file="c onsentHist ory.jsp"%>
        812           </ div>
        813       </c:if >
        814  
        815       <div c lass="vap- grey-heade r">
        816           <i nput id="b tnCorrelat ions" type ="button"  class="vap -hand-hove r" style=" border:non e; backgro und:none;"  value="-"  title="Co llapse thi s section"  onclick=" toggleCorr elations() ;" />
        817           <c :out value ="${organi zationName }"/> Corre lations
        818       </div>
        819  
        820       <div i d="trCorre lations">
        821           <% @include f ile="corre lations.js p" %>
        822       </div>
        823  
        824   </f:mainTe mplate>