54. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/25/2018 3:41:12 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

54.1 Files compared

# Location File Last Modified
1 Pain_Coach_v3.0_Jun_2018.zip\vpc-staff-web.zip\vpc-staff-web\app\provider\js app.js Tue Apr 3 17:26:25 2018 UTC
2 Pain_Coach_v3.0_Jun_2018.zip\vpc-staff-web.zip\vpc-staff-web\app\provider\js app.js Wed Jul 25 14:27:18 2018 UTC

54.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 84
Changed 3 26
Inserted 0 0
Removed 0 0

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

54.4 Active regular expressions

No regular expressions were active.

54.5 Comparison detail

  1   "use stric t";var VPC ={App:{},D ata:{},Vie w:{},Model :{},Router :{},Templa te:{},Reso urces:{},C ollection: {}};VPC.Ap p=Marionet te.Applica tion.exten d({initial ize:functi on(options ){VPC.Data =VPC_Data, VPC.Data.V iew={},VPC .Data.user Selected=! 1,App_Util s.ErrorHan dling()}}) ;var App_R esources={ Data:{},Mo del:{},Col lection:{} };App_Reso urces.host nameProvid er="https: // URL /",App_Res ources.hos tname="htt ps:// URL /",App_Res ources.Mod el.AppReso urce=Backb one.Model. extend({id Attribute: "title",de faults:{ti tle:"",hre f:"",type: ""}}),App_ Resources. Model.Atom Resource=B ackbone.Mo del.extend ({idAttrib ute:"title ",defaults :{rel:"",t itle:"","o bject-type ":"",href: "",type:"" }}),App_Re sources.Mo del.Hateoa sResource= Backbone.M odel.exten d({idAttri bute:"rel" ,defaults: {rel:"",hr ef:""}}),A pp_Resourc es.Collect ion.AppRes ources=Bac kbone.Coll ection.ext end({url:" resource-d irectory.j son",model :App_Resou rces.Model .AppResour ce,parse:f unction(re sponse){re turn respo nse.links} }),App_Res ources.Get VPCResourc ePath=func tion(urlNa me,params) {var urlPa th=VPC.Res ources.VPC Resources. get(urlNam e).toJSON( ).href.rep lace(/{/g, "{{").repl ace(/}/g," }}");retur n"localhos t"!=docume nt.locatio n.hostname &&"file:"! =window.lo cation.pro tocol||(ur lPath=urlP ath.replac e("..","ht tp:/// URL ")),Handle bars.compi le(urlPath )(params)} ,App_Resou rces.GetUs erAssignin gAuthority =function( ){try{retu rn VPC.Dat a.View.Hea der.mhpuse r?VPC.Data .View.Head er.mhpuser .userIdent ifier.assi gningAutho rity:App.d ebug?"EDIP I":void 0} catch(err) {return co nsole.log( "error get ting assig ning autho rity: "+er r.message) ,App.debug ?"EDIPI":v oid 0}},Ap p_Resource s.GetUserP atientId=f unction(){ try{if(VPC .Data.View .Header.mh puser)retu rn VPC.Dat a.View.Hea der.mhpuse r.userIden tifier.uni queId;if(A pp.debug)r eturn"loca lhost"==do cument.loc ation.host name?"5432 1":"55555" }catch(err ){return c onsole.log ("error ge tting pati ent id: "+ err.messag e),App.deb ug?"localh ost"==docu ment.locat ion.hostna me?"54321" :"55555":n ull}return  null};var  App_Utils ={GetDomai nPath:func tion(){ret urn App_Ut ils.GetRef erencePath ()},GetRef erencePath :function( ){return A pp.debug?A pp.ngDev+" /":(consol e.log(">>>  ref path  =",window. location.h ref.split( App.ngCont ext)[0]+"/ "),encodeU RI(window. location.h ref.split( App.ngCont ext)[0]+"/ "))},SetRe questHeade r:function (){var syn c=Backbone .sync;Back bone.sync= function(m ethod,mode l,options) {options.b eforeSend= function(x hr){null!= App_Utils. GetSession Token()&&x hr.setRequ estHeader( "Authoriza tion","Bea rer "+App_ Utils.GetS essionToke n())},sync (method,mo del,option s)}},Debug Mode:funct ion(){if(A pp_Utils.G etLocalSto rage("VPC_ Eula")){$( "#eulaBtn" ).length|| $("body"). append('<b utton type ="button"  class="btn -default b tn-sm" id= "eulaBtn"  style="pos ition:abso lute; righ t:335px; t op:0;">Del ete Eula</ button>'), $("#eulaBt n").on("cl ick",funct ion(){App_ Utils.Dele teLocalSto rage("VPC_ Eula"),loc ation.relo ad()})}},F ocusOnLoad :function( ){$("#head er-login-l ink").focu s()},Heade rModalShow n:function (modalId){ $(".va-tit le-area, . app-title- area, #err orSection,  #content,  footer, . scrollbar- gradient") .attr("ari a-hidden", !0),$("#"+ modalId).r emoveAttr( "aria-hidd en"),this. FocusOnMod al()},Head erModalHid den:functi on(modalId ){$(".va-t itle-area,  .app-titl e-area, #e rrorSectio n, #conten t, footer,  .scrollba r-gradient ").removeA ttr("aria- hidden"),$ ("#"+modal Id).attr(" aria-hidde n",!0)},Fo oterModalS hown:funct ion(modalI d){$("head er, #error Section, # content, . footer-con tent, .scr ollbar-gra dient").at tr("aria-h idden","tr ue"),$("#" +modalId). removeAttr ("aria-hid den"),this .FocusOnMo dal()},Foo terModalHi dden:funct ion(modalI d){$("head er, #error Section, # content, . footer-con tent, .scr ollbar-gra dient").re moveAttr(" aria-hidde n"),$("#"+ modalId).a ttr("aria- hidden",!0 )},SetMain Modal:func tion(modal ,focus){$( modal).on( "shown.bs. modal",fun ction(){$( "header, # errorSecti on, #main- content, f ooter, .sc rollbar-gr adient").a ttr("aria- hidden","t rue"),$(mo dal).remov eAttr("ari a-hidden") ;var targe t=focus||" .modal-tit le";$(targ et).focus( )}),$(moda l).on("hid den.bs.mod al",functi on(){$("he ader, #err orSection,  #main-con tent, foot er, .scrol lbar-gradi ent").remo veAttr("ar ia-hidden" ),$(modal) .attr("ari a-hidden", !0)})},Set ModalConta iner:funct ion(modal) {$(modal). on("shown. bs.modal", function() {$("header , #errorSe ction, #co ntent, foo ter, .scro llbar-grad ient").att r("aria-hi dden","tru e"),$(moda l).removeA ttr("aria- hidden"),$ (".modal-t itle").foc us()}),$(m odal).on(" hidden.bs. modal",fun ction(){$( "header, # errorSecti on, #conte nt, footer , .scrollb ar-gradien t").remove Attr("aria -hidden"), $(modal).a ttr("aria- hidden","t rue")})},F ocusOnModa l:function (element){ var target =element|| ".modal-ti tle";$(tar get).focus ()},Select TitleMenu: function(a ppView,con tainer){va r _self=th is;$("#tit leMenu").o n("shown.b s.dropdown ",function (){$("#sel ectBtn").a ttr("aria- expanded", !0),setTim eout(funct ion(){$("# titleMenu  .dropdown- menu li:fi rst-child  a").focus( )},500),_s elf.Select MenuOnShow nAria(appV iew,contai ner)}),$(" #titleMenu ").on("hid den.bs.dro pdown",fun ction(){$( "#selectBt n").attr(" aria-expan ded",!1),_ self.Selec tMenuOnHid denAria(ap pView,cont ainer)})}, SelectMenu OnShownAri a:function (appView,c ontainer){ "providerV iew"==appV iew?( $("header,  #errorSec tion, .tit le-back-bt n, #conten t-title, # pat
  2  
ientHeader Section, f ooter, .sc rollbar-gr adient").a ttr("aria- hidden","t rue"),$(co ntainer).a ttr("aria- hidden","t rue")):($( "header, # errorSecti on, .title -back-btn,  #content- title, foo ter, .scro llbar-grad ient").att r("aria-hi dden","tru e"),$(cont ainer).att r("aria-hi dden","tru e"))},Sele ctMenuOnHi ddenAria:f unction(ap pView,cont ainer){"pr oviderView "==appView ?($("heade r, #errorS ection, .t itle-back- btn, #cont ent-title,  #patientH eaderSecti on, footer , .scrollb ar-gradien t").remove Attr("aria -hidden"), $(containe r).removeA ttr("aria- hidden")): ($("header , #errorSe ction, .ti tle-back-b tn, #conte nt-title,  footer, .s crollbar-g radient"). removeAttr ("aria-hid den"),$(co ntainer).r emoveAttr( "aria-hidd en"))},Err orHandling :function( ){var sync =Backbone. sync;Backb one.sync=f unction(me thod,model ,options){ var error= options.er ror;option s.error=fu nction(xhr ,statusTxt ,thrown){c onsole.log ("In globa l error ha ndler. key ="+model.k ey+" XHR", xhr),conso le.log("er ror: "+sta tusTxt),VP C.View.Hea der||VPC.L ayout.head er.show(VP C.View.Hea der=new VP C.View.hea der),401!= =xhr.statu s&&403!==x hr.status| |(App_Util s.Launchpa dLogin(),A pp.debug&& "Last Acce ssed Time" ===model.k ey&&clearI nterval(Ap p.KeepAliv eInterval) ),404===xh r.status&& "Right of  Access"=== model.key? App_Utils. ROARedirec t():"resou rce-direct ory-pvs"== model.key| |"resource -directory -vpc"==mod el.key?App .vent.trig ger("resou rces:faile d",model.k ey):(App.v ent.trigge r((model.k ey?model.k ey:"genera l")+":fail ed",{model :model,xhr :xhr}),App _Utils.For matErrorMS G(model,xh r),error(x hr,statusT xt,thrown) )},sync(me thod,model ,options)} },FormatEr rorMSG:fun ction(mode l,xhr){var  key,res,s tatus,stat ustext,msg ,devmsg;ke y=res=stat us=statust ext=msg="" ,key=model .key?model .key:"",xh r.response JSON&&(res =xhr.respo nseJSON.de veloperMes sage?xhr.r esponseJSO N.develope rMessage:" ",devmsg=x hr.respons eJSON.mess age?xhr.re sponseJSON .message:" "),status= xhr.status ?xhr.statu s:"No stat us",status text=xhr.s tatusText? xhr.status Text:"No s tatus text ",msg=key+ " encounte red the fo llowing er ror: "+res +" (Status : "+status +" / "+sta tustext+")  "+devmsg, App.vent.t rigger("we bsite:erro r",msg)},B ackButton: function() {var backB utton=$("a .back"),ba ckButton2= $("a .back "),backBut ton3=$("bu tton .back ");1==back Button.len gth?backBu tton.click ():1==back Button2.le ngth?backB utton2.cli ck():1===b ackButton3 .length?ba ckButton3. click():wi ndow.histo ry.back()} ,RightOfAc cess:funct ion(){cons ole.warn(" >>> RightO fAccess fu nction sho uld not be  called in  NextGen.. .")},ROARe direct:fun ction(){co nsole.log( ">>> ROARe direct: ro a web url  =",App_Uti ls.GetDoma inPath()+A pp.ngRoaWe b),window. location=A pp_Utils.G etDomainPa th()+App.n gRoaWeb},G etLocalSto rage:funct ion(key){r eturn loca lStorage.g etItem(key )},SetLoca lStorage:f unction(ke y,value){l ocalStorag e.setItem( key,JSON.s tringify(v alue))},De leteLocalS torage:fun ction(key) {localStor age.remove Item(key)} ,CookieExi sts:functi on(cookieN ame){retur n document .cookie.in dexOf(cook ieName)>0} ,DeleteCoo kie:functi on(cookieN ame){docum ent.cookie =encodeURI Component( cookieName )+"=delete d; expires ="+new Dat e(0).toUTC String()}, SetSession Token:func tion(name, value){val ue=value.r eplace(/"/ g,"").repl ace(/'/g," "),session Storage.se tItem(name ,'"'+value .toString( )+'"')},Cl earSession Token:func tion(name) {sessionSt orage.setI tem(name,n ull)},Retr ieveToken: function(n ame){var t oken=sessi onStorage. getItem(na me);return "null"!=to ken&&null! =token?tok en.replace (/"/g,""): null},GetS essionToke n:function (){return  App_Utils. RetrieveTo ken("token ")},GetMHV Token:func tion(){ret urn App_Ut ils.Retrie veToken("m hvToken")} ,AppCleanu p:function (){console .warn(">>>  app utils  AppCleanu p... this  should not  be called  in NextGe n...")},Ge tUrlParame ter:functi on(sParam) {for(var s PageURL=wi ndow.locat ion.search .substring (1),sURLVa riables=sP ageURL.spl it("&"),i= 0;i<sURLVa riables.le ngth;i++){ var sParam eterName=s URLVariabl es[i].spli t("=");if( sParameter Name[0]==s Param)retu rn sParame terName[1] }},SetUrl: function() {var url=w indow.loca tion.href; return url =url.slice (0,url.ind exOf("?")) },ReturnTo Launchpad: function() {var url=A pp_Utils.N extGenLaun chpadRedir ect();wind ow.locatio n=encodeUR I(url)},La unchpadLog in:functio n(){App_Ut ils.VAMFLo ginRedirec t()},VAMFL ogout:func tion(){var  url=App.v amfUser.ur ls.logout; console.lo g(">>> VAM FLogout en dpoint =", url),windo w.location =encodeURI (url)},VAM FLogoutVet :function( ){App_Util s.VAMFLogo ut()},VAMF LogoutPro: function() {App_Utils .VAMFLogou t()},Modal ContainerS hown:funct ion(elemen t){$("head er, main,  footer, .s crollbar-g radient"). attr("aria -hidden"," true"),thi s.FocusOnM odal(eleme nt)},Modal ContainerH idden:func tion(){$(" header, ma in, footer , .scrollb ar-gradien t").remove Attr("aria -hidden")} ,SetSort:f unction(){ $("#sortMe nu").on("s hown.bs.dr opdown",fu nction(){$ ("#sortBtn ").attr("a ria-expand ed",!0),se tTimeout(f unction(){ $("#sortMe nu .dropdo wn-menu li :first-chi ld a").foc us()},500) ,$("header , #errorSe ction, .so rt-hide, f ooter, .sc rollbar-gr adient").a ttr("aria- hidden","t rue")}),$( "#sortMenu ").on("hid den.bs.dro pdown",fun ction(){$( "#sortBtn" ).attr("ar ia-expande d",!1),$(" header, #e rrorSectio n, .sort-h ide, foote r, .scroll bar-gradie nt").remov eAttr("ari a-hidden") })},Initia lizeAff ix:functio n(element) {$(element ).affix({o ffset:{top :function( ){r
  3  
eturn this .top=$(ele ment).offs et().top}} })},SetVAM FUser:func tion(){App _Utils.Has JwtCookie( )?(console .log(">>>  SetVAMFUse r found jw t cookie") ,App.vamfU ser=new VA MFUser,con sole.log(" >>> new Ap p.vamfUser  has been  initialize d")):(cons ole.log("> >> SetVAMF User found  no jwt co okie... Ap p.debug?", App.debug) ,App.debug ?App_Utils .InjectDeb uggingCook ie():App_U tils.VAMFL oginRedire ct())},Get Cookie:fun ction(name ){var toke n=document .cookie.ma tch("(^|;) \\s*"+name +"\\s*=\\s *([^;]+)") ;return to ken?token. pop():""}, GetVAMFUse rUrls:func tion(){var  baseUrl=A pp_Utils.G etDomainPa th();retur n{session: baseUrl+Ap p.ngSessio nPath,logo ut:baseUrl +App.ngLog outPath,lo gin:baseUr l+App.ngLo ginPath}}, GetVDSUrls :function( ){if(_.isN ull(App.ng VistaDataS ervices)|| _.isEmpty( App.ngVist aDataServi ces))retur n App.vent .trigger(" website:er ror","Vist a Data Ser vices prop erty not f ound."),{} ;var baseU rl=App_Uti ls.GetDoma inPath();r eturn{pati ent:baseUr l+App.ngVD SPatient,p atientsByS ite:baseUr l+App.ngVD SPatientsB ySite}},Ha sJwtCookie :function( ){return!! document.c ookie.matc h("(^|;)\\ s*"+App.ng JwtCookieN ame+"\\s*= \\s*([^;]+ )")},Injec tDebugging Cookie:fun ction(){Ap p.isProvid er?App_Uti ls.InjectP roviderCoo kie():App_ Utils.Inje ctVeteranC ookie()},I njectProvi derCookie: function() {console.l og(">>> [P rovider] i njecting c ookies for  developme nt...");$. ajax({url: App_Utils. GetDomainP ath()+App. ngJwtPath, headers:{a dUpn:"PCOA CHProvider .2",firstN ame:"TWO", lastName:" PCOACHProv ider"},suc cess:funct ion(respon se){},erro r:function (){App.ven t.trigger( "website:e rror","Can not get ne w jwt toke n from ser ver")},com plete:func tion(){App .loadResou rces()}})} ,InjectVet eranCookie :function( ){console. log(">>> [ Caregiver]  injecting  cookies f or develop ment..."); $.ajax({ur l:App_Util s.GetDomai nPath()+Ap p.ngJwtPat h,headers: {va_eauth_ dodedipnid :"86667803 01",va_eau th_firstna me:"Pcoach ",va_eauth _lastname: "Patientel even"},suc cess:funct ion(respon se){},erro r:function (){App.ven t.trigger( "website:e rror","Can not get ne w jwt toke n from ser ver")},com plete:func tion(){App .loadResou rces()}})} ,NextGenLa unchpadRed irect:func tion(){var  uiHost=Ap p_Utils.Ge tReference Path();ret urn consol e.log(">>>  UI host = ",uiHost), (uiHost.in dexOf("vet -dev")>0|| uiHost.ind exOf("staf f-dev")>0? uiHost.rep lace("vet- dev","vet- test").rep lace("staf f-dev","st aff-test") :uiHost.in dexOf("vet -sqa")>0|| uiHost.ind exOf("staf f-sqa")>0? uiHost.rep lace("vet- sqa","vet- int").repl ace("staff -sqa","sta ff-int"):u iHost)+App .ngLaunchp ad},ParseJ wt:functio n(token){v ar base64S tring=toke n.split(". ")[1],base 64=base64S tring.spli t("-").joi n("+").spl it("_").jo in("/");re turn JSON. parse(wind ow.atob(ba se64))},Se tCallHandl er:functio n(){consol e.log("%%%  SetCallHa ndler...") ,$(documen t).ajaxCom plete(func tion(event ,xhr,setti ngs){conso le.log("%% % ajaxComp lete - JWT  should ha ve been re freshed; l ook for ne w JWT in t imeoutModa l start... "),VPC.Dat a.View.Tim eoutModal. start()})} ,VAMFLogin Redirect:f unction(){ window.loc ation=App_ Utils.GetV AMFUserUrl s().login} };(functio n(){consol e.log(">>>  VAMFUser. ..");var V AMFUser=fu nction(){v ar jwtCook ie=App_Uti ls.GetCook ie(App.ngJ wtCookieNa me),user=" "===jwtCoo kie?{}:App _Utils.Par seJwt(jwtC ookie);con sole.log(" >>> VAMFUs er.user ob ject set") ;var isCoo kieExpired =function( ){var expi red=!0;ret urn user.e xp?expired =moment(). isAfter(mo ment(new D ate(1e3*us er.exp))): console.er ror(">>> c annot acce ss 'exp' f rom JWT co okie"),exp ired},isUs erReady=fu nction(){r eturn user .expired=i sCookieExp ired(),con sole.log(" >>> cookie  expired?" ,user.expi red),!user .expired&& (App.isPro vider?(App .debug&&(u ser.vistaI ds=[{siteI d:"508",du z:"2222843 9",siteNam e:"ATLANTA  VAMC"},{s iteId:"590 ",duz:"111 28439",sit eName:"HAM PTON VA ME DICAL CENT ER"}]),con sole.log(" >>> [Provi der] VAMFU ser user.v istaIds at tribute ex ists?",!!u ser.vistaI ds),!!user .vistaIds) :(console. log(">>> [ Veteran] V AMFUser us er.patient  attribute  exist?",! !user.pati ent),!!use r.patient) )},getVist aLocation= function() {return Ap p_Utils.Ge tCookie(Ap p.ngVistaC ookieName) },getProvi derId=func tion(){if( user.vista Ids){var f acility=_. find(user. vistaIds,f unction(si te){return  site.site Id===user. vistaLocat ion});retu rn console .log(">>>  facility = ",facility ),void 0!= =facility? facility.d uz:"UNKNOW N"}return" UNKNOWN"}; return use r.baseUrl= App_Utils. GetDomainP ath(),user .urls=App_ Utils.GetV AMFUserUrl s(),consol e.log(">>>  user.urls  =",user.u rls),conso le.log(">> > user.aut henticated ?",user.au thenticate d),console .log(">>>  isUserRead y?",isUser Ready()),u ser.authen ticated&&i sUserReady ()?(consol e.log(">>>  user auth enticated  & ready -  continue t o set othe r properti es... "),u ser.displa yName=user .lastName+ ", "+user. firstName, user.userI dentifier= function() {var autho rity="UNKN OWN",pid=" 0000000000 ",identifi er={};retu rn App.isP rovider?(c onsole.log (">>> [Pro vider] get UserIdenti fier..."), user.vista Ids&&(auth ority="USD VA",user.v istaLocati on=getVist aLocation( ),console. log(">>> u ser.vistaL ocation =" ,user.vist aLocation) ,pid=getPr oviderId() ),identifi er={assign ingAuthori ty:authori ty+"-"+use r.vistaLoc ation,uniq ueId:pid}) :user.pati ent&&(cons ole.log("> >> [Vetera n] getUser Identifier ..."),user .patient.i cn?(author ity="ICN", pid=user.p atient.icn ):user. patient.ed ipid?(auth ority="EDI PI",pid=us er.patient .edipid):u ser
  4  
.attribute s.va_eauth _secid?(au thority="U SDVA",pid= user.attri butes.va_e auth_secid ):console. error("Ins ufficient  identifier : VAMF use r JWT does  not conta in ICN, ED IPI or SEC ID!"),iden tifier=App .debug?{as signingAut hority:"ED IPI",uniqu eId:"86667 80301"}:{a ssigningAu thority:au thority,un iqueId:pid }),identif ier}(),con sole.log(" >>> user.u serIdentif ier =",use r.userIden tifier)):A pp.debug|| (console.l og(">>> us er not aut henticated  or not re ady"),App_ Utils.VAMF LoginRedir ect()),use r};"functi on"==typeo f define&& define.amd ?define("V AMFUser",f unction(re quire,expo rts,module ){return V AMFUser}): window.VAM FUser=VAMF User}).cal l(this),VP C.Model.la stAccessed Time=Backb one.Model. extend({ke y:"Last Ac cessed Tim e",default s:{lastAcc essedTime: null,lastL oginTime:n ull,timeTo ExpireInSe conds:null ,userId:nu ll}}),VPC. Model.mhpU ser=Backbo ne.Model.e xtend({key :"Get MHP  User",defa ults:{id:" ",lastName :"",firstN ame:"",dis playName:" ",rightOfA ccessAccep ted:!1,lin k:"",vista Location:" ",facility Name:""},u rl:functio n(){return  VPC.Resou rces.HARes ources.get ("mhpuser" ).toJSON() .href}}),V PC.Model.s ession=Bac kbone.Mode l.extend({ key:"Enter prise Sess ion",defau lts:{token :"",expire sDate:""}, url:functi on(){var u serIdentif ier=VPC.Da ta.View.He ader.mhpus er.userIde ntifier,ur l=VPC.Reso urces.VPCR esources.g et("sessio n").toJSON ().href.re place("{as signing-au thority}", userIdenti fier.assig ningAuthor ity).repla ce("{patie nt-id}",us erIdentifi er.uniqueI d);return  console.lo g("session  url: "+ur l),url}}), VPC.Model. user=Backb one.Model. extend({ke y:"User fe tch",defau lts:{clien tTimeout:n ull,"objec t-type":nu ll,mhpuser :null}}),V PC.Model.A ssessmentQ uestion=Ba ckbone.Mod el.extend( {defaults: {id:null,t itle:null, sourceId:n ull,text:n ull,type:n ull,order: null,min:n ull,max:nu ll,minChoi ces:null,m axChoices: null,defin ition:null ,snomedCod e:null,ans wers:[{ord er:null,te xtValue:nu ll,numeric Value:null }],dateCre ated:null, dateUpdate d:null}}), VPC.Model. MonthlyAss essment=Ba ckbone.Mod el.extend( {idAttribu te:"_id",d efaults:{_ id:null,da teCreated: null,painI ntensity:n ull,painIn terference General:nu ll,painInt erferenceL ife:null,s leepQualit y:null,ple asureLevel :null,depr ession:nul l,overallS tatus:null ,assessmen tQuestions :[],painIn terference :function( ){return(t his.painIn terference General+th is.painInt erferenceL ife)/2},de pressionSc ore:functi on(){retur n this.ple asureLevel +this.depr ession},re portDate:f unction(){ if(this.da teCreated) {var subDa te=this.da teCreated. substring( 0,10),date =subDate.s plit("-"); if(date.le ngth>1)ret urn date[1 ]+"/"+date [2]+"/"+da te[0]}retu rn this.da teCreated} }}),VPC.Mo del.Monthl yAssessmen tPost=Back bone.Model .extend({d efaults:{d ateCreated :null,pain Intensity: null,painI nterferenc eGeneral:n ull,painIn terference Life:null, sleepQuali ty:null,pl easureLeve l:null,dep ression:nu ll,overall Status:nul l},validat e:function (attrs){va r errors=" ";return a ttrs.dateC reated||(e rrors+="<u l><li>Crea te Date is  missing.< /li></ul>" ),attrs.pa inIntensit y||0!=attr s.painInte nsity&&(er rors+="<ul ><li>Pain  Intensity  score is m issing.</l i></ul>"), attrs.pain Interferen ceGeneral| |0!=attrs. painInterf erenceGene ral&&(erro rs+="<ul>< li>Pain In terference  Score 1 i s missing. </li></ul> "),attrs.p ainInterfe renceLife| |0!=attrs. painInterf erenceLife &&(errors+ ="<ul><li> Pain Inter ference Sc ore 2 is m issing.</l i></ul>"), attrs.slee pQuality|| 0!=attrs.s leepQualit y&&(errors +="<ul><li >Sleep Qua lity score  is missin g.</li></u l>"),attrs .pleasureL evel||0!=a ttrs.pleas ureLevel&& (errors+=" <ul><li>Pe rsonal Moo d score is  missing.< /li></ul>" ),attrs.de pression|| 0!=attrs.d epression& &(errors+= "<ul><li>D epression  Mood score  is missin g.</li></u l>"),attrs .overallSt atus||0!=a ttrs.overa llStatus&& (errors+=" <ul><li>Ov erall Stat us is miss ing.</li>< /ul>"),err ors}}),VPC .Model.Pai nDiary=Bac kbone.Mode l.extend({ idAttribut e:"_id",de faults:{pa inRating:n ull,painSy mptoms:[], painSympto msOther:nu ll,worsene dBy:null,i mprovedBy: null,treat mentsUsed: [],treatme ntsUsedOth er:null,to olsUsed:[] ,movementI mpact:null ,activityI nterferenc e:null,moo dEffect:nu ll,depress ionLevel:n ull,sleepO utcome:nul l,comment: null,dateC reated:nul l},validat e:function (attrs){va r errors=" ";return a ttrs.painR ating||0!= attrs.pain Rating&&(e rrors+="<u l><li>Pain  Rating is  missing.< /li></ul>" ),errors}} ),VPC.Mode l.Patient= Backbone.M odel.exten d({idAttri bute:"id", defaults:{ id:void 0, "object-ty pe":"patie nt",firstN ame:void 0 ,lastName: void 0,pat ientIdenti fier:void  0,dateOfBi rth:void 0 ,age:void  0,gender:v oid 0,ssn: void 0,inp atient:!1, textMessag ingAllowed :!1,servic eConnected :!1,servic eConnected Percent:0, sensitive: !1,display Name:void  0,wardLoca tion:void  0,roombed: void 0,cwa d:void 0,i cn:void 0, admittedDa teTime:voi d 0}}),VPC .Model.Pat ientIdenti fier=Backb one.Model. extend({id Attribute: "assigning Authority" ,defaults: {assigning Authority: void 0,uni queId:void  0}}),VPC. Model.Sear chPatient= Backbone.M odel.exten d({url:fun ction(){va r patientI dentifier= this.get(" patientIde ntifier"), assigningA uthority=p atientIden tifier.ass igningAuth ority,uniq ueId=patie ntIdentifi er.uniqueI d;return A pp_Utils.G etVDSUrls( ).patient. replace("{ assigning- authority} ",assignin gAuthority ).replace( "{patient- id}",uniqu eId)}}),VP C.Collecti on.Assessm entQues tions=Back bone.Colle ction.exte nd({url:"a ssessmentQ uestion.js on"
  5  
,model:VPC .Model.Ass essmentQue stion}),VP C.Collecti on.Monthly Assessment s=Backbone .Collectio n.extend({ key:"Month ly Assessm ents",mode l:VPC.Mode l.MonthlyA ssessment, sortField: "dateCreat ed",sortDi rection:-1 ,comparato r:function (a,b){var  x,y;return "dateCreat ed"===this .sortField ?(x=Date.p arse(a.get ("dateCrea ted")),y=D ate.parse( b.get("dat eCreated") )):"painIn terference "===this.s ortField?( x=(a.get(" painInterf erenceGene ral")+a.ge t("painInt erferenceL ife"))/2,y =(b.get("p ainInterfe renceGener al")+b.get ("painInte rferenceLi fe"))/2):" depression Score"===t his.sortFi eld?(x=a.g et("pleasu reLevel")+ a.get("dep ression"), y=b.get("p leasureLev el")+b.get ("depressi on")):(x=a .get(this. sortField) ,y=b.get(t his.sortFi eld)),x==y ?0:1===thi s.sortDire ction?x>y? 1:-1:x<y?1 :-1}}),VPC .Collectio n.PainDiar ies=Backbo ne.Collect ion.extend ({model:VP C.Model.Pa inDiary,ke y:"Pain Di aries",sor tField:"da teCreated" ,sortDirec tion:-1,co mparator:f unction(a, b){return" dateCreate d"===this. sortField? (a=Date.pa rse(a.get( "dateCreat ed")),b=Da te.parse(b .get("date Created")) ):(a=a.get (this.sort Field),b=b .get(this. sortField) ),a==b?0:1 ===this.so rtDirectio n?a>b?1:-1 :a<b?1:-1} }),VPC.Col lection.Pa tients=Bac kbone.Coll ection.ext end({model :VPC.Model .Patient,s ortField:" patientLas tName",sor tDirection :1,compara tor:functi on(a,b){va r x=a.get( this.sortF ield),y=b. get(this.s ortField); return 1== =this.sort Direction? x>y?1:-1:x <y?1:-1}}) ,VPC.Colle ction.Sear chPatients =Backbone. Collection .extend({m odel:VPC.M odel.Searc hPatient,e rror:null, hasQuery:! 1,searchSt ring:"",ur l:function (){return  App_Utils. GetVDSUrls ().patient sBySite.re place("{si te-code}", App.vamfUs er.vistaLo cation)+th is.searchS tring},que ry:functio n(param){v ar _this=t his;param& &(this.sea rchString= "?searchst ring="+enc odeURI(par am)),this. hasQuery=! 0,this.fet ch({reset: !0,success :function( collection ,response, options){} ,error:fun ction(coll ection,res ponse,opti ons){conso le.log("er ror trappe d:",collec tion),cons ole.log("r esponse:", response), console.lo g("option: ",options) ;var messa ge="An err or has occ urred";res ponse&&res ponse.resp onseJSON&& (message=r esponse.re sponseJSON .detailedD escription ||response .responseJ SON.messag e),_this.e rror=messa ge,console .log(messa ge),collec tion.reset ([])}})},p arse:funct ion(respon se){return  this.erro r=null,res ponse.pati ents||[]}} ),VPC.Coll ection.VPC Resources= Backbone.C ollection. extend({ke y:"resourc e-director y-vpc",mod el:App_Res ources.Mod el.Hateoas Resource,u rl:functio n(){var en dpoint=VPC .Resources .App.get(" resource-d irectory-v pc").toJSO N().href;r eturn App. debug?App. ngDev+"/"+ endpoint:A pp_Utils.G etDomainPa th()+endpo int},parse :function( response){ return res ponse.link s}});var V PC_Data=VP C_Data||{} ;VPC_Data. app={"app- name":"Pai n Coach"," app-abbrev iation":"V PC","app-v ersion":"2 .0","last- update-dat e":"09/21/ 17",addres s:{street: "810 Vermo nt Avenue" ,city:"NW  Washington ",state:"D C",zipcode :"20420"}, about:{"ap plication- name-title ":"Applica tion Name" ,"applicat ion-name": "Pain Coac h Mobile A pplication ","applica tion-name- mobile":"P ain Coach  Mobile App lication", "version-t itle":"Ver sion Numbe r","versio n-number-v eteran":"2 .0.0","ver sion-numbe r-provider ":"1.0.0", "developed -by-title" :"Develope d By","dev eloped-by" :"U.S. Dep artment of  Veterans  Affairs"," national-r elease-dat e-title":" National R elease Dat e","nation al-release -date":"20 17","appli cation-des cription-t itle":"App lication D escription ","applica tion-descr iption-vet eran":"The  VA Pain C oach Appli cation pro vides Vete rans with  readily av ailable to ols to man age pain w henever it  arises. V eterans wi ll be able  to enter  informatio n about th eir pain,  such as th e type, se verity, lo cation, an d effect.  Veterans c an track p ain over t ime, set g oals for i mproving t heir condi tions, and  share thi s informat ion with t heir healt hcare team . The App  includes a  pain self -assessmen t, which w ill offer  recommenda tions and  next steps  depending  on result s. Reminde rs can be  set to ale rt Veteran s to take  the self-a ssessment  every 30 d ays and se lf-enter i nformation  as freque ntly as de sired.","a pplication -descripti on-provide r":"The Pa in Coach A pplication  provides  health car e Provider s with the  ability t o review b oth Monthl y Check-In s and Dail y Pain Dia ries compl eted by th eir patien ts. Provid ers will b e able to  look at a  particular  day or tr ends for o ne month." },help:{"b rowsers-su pported":{ title:"Bro wsers","co ntent-vete ran":"This  applicati on can be  used on th e followin g supporte d browsers :","conten t-provider ":"This ap plication  can be use d on the f ollowing G FE support ed browser s:"},"brow sers-suppo rted-veter an":[{"bro wser-name" :"Internet  Explorer" ,"browser- version":" 11 and hig her"},{"br owser-name ":"Safari" ,"browser- version":" 7 and high er"}],"bro wsers-supp orted-prov ider":[{"b rowser-nam e":"Intern et Explore r","browse r-version" :"11"},{"b rowser-nam e":"Safari ","browser -version": "7 and hig her"}],"he lp-desk-ve teran":{ti tle:"Help  Desk",cont ent:"If yo u need ass istance wi th the Pai n Coach Mo bile App,  dial <a hr ef='tel:1- 877-470-59 47'>1-877- 470-5947</ a> to spea k with a H elp Desk R epresentat ive. The H elp Desk i s open Mon day - Frid ay from 7  a.m. to 7  p.m. CST.  For TTY as sistance,  dial <a hr ef='tel :711'>711< /a>. If yo u have que stions abo ut your DS  Logon acc oun
  6  
t, visit < a href='ht tps:// ur l
/dslogon'  target='_b lank'> ur l
/dslogon</ a> or dial  <a href=' tel:1-800- 983-0937'> 1-800-983- 0937</a> f or assista nce. Mobil e App Trai ning: Plea se visit < a href='ht tps:// ur l
/appstore'  target='_ blank'> ur l
/appstore< /a>, and s earch for  the Pain C oach Mobil e App to a ccess trai ning mater ials."},"h elp-desk-p rovider":{ title:"Hel p Desk",co ntent:"If  you need a ssistance  with the P ain Coach  Mobile App , dial <a  href='tel: 1-844-482- 6624'>1-84 4-482-6624 </a> to sp eak with a  VA Mobile  Solutions  Service D esk Repres entative.  The VA Mob ile Soluti ons Servic e Desk is  open Monda y - Friday  from 7 a. m. to 7 p. m. CST. Fo r TTY assi stance, di al <a href ='tel:711' >711</a>.  You may al so receive  24/7 assi stance by  visiting t he VA Mobi le Solutio ns Service  Desk onli ne at <a h ref='http: //help.vam obile.us'  target='_b lank'>help .vamobile. us</a>. Mo bile App T raining: P lease visi t <a href= 'https:// ur l
/appstore'  target='_ blank'> ur l
/appstore< /a>, and s earch for  the Pain C oach Mobil e App to a ccess trai ning mater ials."},"e mergencies -veteran": {title:"Em ergencies" ,content:" If you fee l that you r informat ion may ha ve been co mpromised,  contact y our local  VA facilit y to obtai n the cont act inform ation for  your Priva cy Officer . To ident ify your l ocal VA fa cility, vi sit VA's F acility Lo cator <a h ref='http: //1.usa.go v/1TTdj42'  target='_ blank'>her e</a>, or  by copying  and pasti ng the fol lowing lin k into you r browser:  http://1. usa.gov/1T Tdj42. Not e that you  should ne ver use th is app in  an emergen cy situati on. If you  encounter  an emerge ncy, call  your local  medical c enter or d ial <a hre f='tel:911 '>911</a>.     Veterans C risis Line : <a href= 'tel:1-800 -273-8255' >1-800-273 -8255</a>  Press 1."} ,"emergenc ies-provid er":{title :"Emergenc ies",conte nt:"If you  feel that  your info rmation ma y have bee n compromi sed, conta ct your lo cal VA fac ility to o btain the  contact in formation  for your P rivacy Off icer. To i dentify yo ur local V A facility , visit VA 's Facilit y Locator  <a href='h ttp://1.us a.gov/1TTd j42' targe t='_blank' >here</a>,  or by cop ying and p asting the  following  link into  your brow ser: http: //1.usa.go v/1TTdj42.  Note that  you shoul d never us e this app  in an eme rgency sit uation. If  you encou nter an em ergency, c all your l ocal medic al center  or dial <a  href='tel :911'>911< /a>."},"ge neral-feed back-veter an":{title :"General  Feedback t o VA",url: "https:// ur l
/app/pain- coach"},"g eneral-fee dback-prov ider":{tit le:"Genera l Feedback  to VA",ur l:"https:/ / ur l
/app/pain- coach"}}," not-found" :{title:"P age Not Fo und","link -title":"R eturn to P ain Coach  Home Page" ,url:"","a lt-text":" Return to  Pain Coach  Home Page "},user:{i sHome:!1,a uthenticat ed:!1,firs tName:"One ",lastName :"VPCVeter an"},appCo nfig:{vete ran:!1,pro vider:!0,c ordova:!1} },VPC_Data .resource_ directory= {links:[{t itle:"reso urce-direc tory-vpc", href:"Pain CoachServi cesProvide r/v1/publi c/resource -directory ",type:"ha teoas"}]}, VPC_Data[" resource-d irectory"] ={links:[{ title:"res ource-dire ctory-vpc" ,href:"Pai nCoachServ icesProvid er/v1/publ ic/resourc e-director y",type:"h ateoas"}]} ,this.VPC= this.VPC|| {},this.VP C.Template =this.VPC. Template|| {},Handleb ars.regist erPartial( "providerR eportMenu" ,this.VPC. Template.p roviderRep ortMenu=Ha ndlebars.t emplate({1 :function( container, depth0,hel pers,parti als,data){ return" gl yphicon-ok "},compile r:[7,">= 4 .0.0"],mai n:function (container ,depth0,he lpers,part ials,data) {var stack 1,alias1=n ull!=depth 0?depth0:c ontainer.n ullContext ||{},alias 2=helpers. helperMiss ing;return '<div id=" titleMenu"  class="dr opdown pul l-right re port-title -menu-prov ">\n    <button ty pe="button " id="sele ctBtn" cla ss="dropdo wn-toggle"  data-togg le="dropdo wn" aria-c ontrols="s elect-repo rt" aria-h aspopup="t rue" aria- expanded=" false">\n      Select <br />Report\n       <img src=" img/icon-e xpand.svg"  id="menu- off" alt=" " aria-hid den="true" /><img src ="img/icon -collapse. svg" id="m enu-on" al t="" aria- hidden="tr ue"/>\n    </button>\   <ul class= "dropdown- menu" role ="region"  id="select -report" a ria-label= "Select Re port">\n      <li><a hre f="#report MonthlyChe ckIn">Comp leted Mont hly Check- Ins <span  class="gly phicon'+(n ull!=(stac k1=(helper s.equal||d epth0&&dep th0.equal| |alias2).c all(alias1 ,null!=dep th0?depth0 .reportPag e:depth0," assessment s",{name:" equal",has h:{},fn:co ntainer.pr ogram(1,da ta,0),inve rse:contai ner.noop,d ata:data}) )?stack1:" ")+'"></sp an></a></l i>\n      <li><a hre f="#assess ments-grap h">Monthly  Check-In  Graph <spa n class="g lyphicon'+ (null!=(st ack1=(help ers.equal| |depth0&&d epth0.equa l||alias2) .call(alia s1,null!=d epth0?dept h0.reportP age:depth0 ,"assessme ntsGraphRe ports",{na me:"equal" ,hash:{},f n:containe r.program( 1,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+'"> </span></a ></li>\n      <li><a hre f="#report DailyPainD iary">Comp leted Pain  Diary Ent ries <span  class="gl yphicon'+( null!=(sta ck1=(helpe rs.equal|| depth0&&de pth0.equal ||alias2). call(alias 1,null!=de pth0?depth 0.reportPa ge:depth0, "reportDai lyPainDiar y",{name:" equal",has h:{},fn:co ntainer.pr ogram(1,da ta,0),inve rse:contai ner.noop,d ata:data}) )?stack1:" ")+'"></sp an></a></l i>\n      <li>< a href="#p ain-diary- graph">Pai n Diary Gr aph <span  class="gly phicon'+(n ull!=(stac k1=(helper s.equal||d epth0&&dep th0.equal| |alias2).c all(alias1 ,nu
  7  
ll!=depth0 ?depth0.re portPage:d epth0,"pai nDiaryGrap hReports", {name:"equ al",hash:{ },fn:conta iner.progr am(1,data, 0),inverse :container .noop,data :data}))?s tack1:"")+ '"></span> </a></li>\   </ul>\n</d iv>\n\n'}, useData:!0 })),this.V PC.Templat e.emptyTem plate=Hand lebars.tem plate({com piler:[7," >= 4.0.0"] ,main:func tion(conta iner,depth 0,helpers, partials,d ata){retur n"\x3c!--  this templ ate intent ionally le ft blank - -\x3e\n<di v></div>"} ,useData:! 0}),this.V PC.Templat e.error=Ha ndlebars.t emplate({c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){var  stack1,he lper;retur n'<div cla ss="alert  alert-dang er alert-d ismissable " role="al ert">\n      <button ty pe="button " class="c lose" data -dismiss=" alert" ari a-label="C lose"><img  src="img/ icon-delet e.svg" alt ="Delete"  title="Del ete" class ="alert-de lete"/></b utton>\n      <img src=" img/icon-a lertRed.sv g" alt="Al ert" title ="Alert" c lass="aler t-icon" /> \n      <div class ="alert-te xt">\n          <strong>Er ror: </str ong>'+(nul l!=(helper =null!=(he lper=helpe rs.errorMe ssage||(nu ll!=depth0 ?depth0.er rorMessage :depth0))? helper:hel pers.helpe rMissing,
  8   stack1="fu nction"==t ypeof help er?helper. call(null! =depth0?de pth0:conta iner.nullC ontext||{} ,{name:"er rorMessage ",hash:{}, data:data} ):helper)? stack1:"") +"\n    </ div>\n</di v>"},useDa ta:!0}),th is.VPC.Tem plate.erro rBanner=Ha ndlebars.t emplate({1 :function( container, depth0,hel pers,parti als,data){ var stack1 ,alias1=co ntainer.la mbda;retur n'<div cla ss="alert  alert-bann er alert-d anger" rol e="alert"  id="errorB anner">\n     <button  aria-labe l="Close"  id="btnErr orClose" d ata-dismis s="alert"  class="clo se" type=" button"><s pan aria-h idden="tru e">X</span ></button> \n    <img  src="img/ icon-alert Red.svg" a lt="Alert"  title="Al ert" class ="alert-ic on" />\n     <div cla ss="alert- text">\n\n         <p  class="st atement">\ n             A probl em occurre d. Not all  features  of this ap plication  will funct ion proper ly.\n         </p>\n         <di v class="e rr">\n             <p ><strong>E rror:</str ong> The f ollowing e rror(s) we re capture d:</p>\n         </di v>\n         <ul>\n'+ (null!=(st ack1=helpe rs.each.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},n ull!=(stac k1=null!=d epth0?dept h0.errors: depth0)?st ack1.error :stack1,{n ame:"each" ,hash:{},f n:containe r.program( 2,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+'         </ul >\n         <div clas s="help">\ n             <p>If t his proble m persists  please co ntact the  help desk: </p>\n             <d iv class=" errorBanne r-help">\n                <label  for="help -desk">'+( null!=(sta ck1=alias1 (null!=(st ack1=null! =(stack1=n ull!=depth 0?depth0.h elp:depth0 )?stack1[" help-desk- veteran"]: stack1)?st ack1.title :stack1,de pth0))?sta ck1:"")+'< /label><br />\n               <d iv id="hel p-desk">'+ (null!=(st ack1=alias 1(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. help:depth 0)?stack1[ "help-desk -veteran"] :stack1)?s tack1.cont ent:stack1 ,depth0))? stack1:"") +"</div>\n             </div>\n         </d iv>\n    < /div>\n</d iv>\n"},2: function(c ontainer,d epth0,help ers,partia ls,data){r eturn"             <l i>"+contai ner.escape Expression (container .lambda(de pth0,depth 0))+"</li> \n"},compi ler:[7,">=  4.0.0"],m ain:functi on(contain er,depth0, helpers,pa rtials,dat a){var sta ck1;return  null!=(st ack1=helpe rs.if.call (null!=dep th0?depth0 :container .nullConte xt||{},nul l!=(stack1 =null!=(st ack1=null! =depth0?de pth0.error s:depth0)? stack1.err or:stack1) ?stack1.le ngth:stack 1,{name:"i f",hash:{} ,fn:contai ner.progra m(1,data,0 ),inverse: container. noop,data: data}))?st ack1:""},u seData:!0} ),this.VPC .Template. errors=Han dlebars.te mplate({1: function(c ontainer,d epth0,help ers,partia ls,data){v ar stack1; return"             < li>"+(null !=(stack1= container. lambda(dep th0,depth0 ))?stack1: "")+"</li> \n"},compi ler:[7,">=  4.0.0"],m ain:functi on(contain er,depth0, helpers,pa rtials,dat a){var sta ck1;return '<div clas s="alert a lert-dange r alert-di smissable"  role="ale rt">\n     <img src=" img/icon-a lertRed.sv g" alt="Al ert" title ="Alert" c lass="aler t-icon" /> \n    <div  class="al ert-text"> \n         <strong>Er ror:</stro ng> Please  correct t he followi ng:</br>\n         <u l>\n'+(nul l!=(stack1 =helpers.e ach.call(n ull!=depth 0?depth0:c ontainer.n ullContext ||{},null! =depth0?de pth0.error s:depth0,{ name:"each ",hash:{}, fn:contain er.program (1,data,0) ,inverse:c ontainer.n oop,data:d ata}))?sta ck1:"")+"         </u l>\n    </ div>\n</di v>"},useDa ta:!0}),th is.VPC.Tem plate.eula Modal=Hand lebars.tem plate({com piler:[7," >= 4.0.0"] ,main:func tion(conta iner,depth 0,helpers, partials,d ata){retur n'<div cla ss="modal  fade text- left" aria -labelledb y="eulaMod alTitle" i d="eula-mo dal" tabin dex="-1" r ole="dialo g" data-ba ckdrop="st atic">\n     <div cla ss="modal- dialog">\n         <d iv class=" modal-cont ent">\n             < div class= "modal-hea der">\n                  <h4 id= "eulaModal Title" cla ss="modal- title" tab index="0"> End User L icensing A greement</ h4>\n             </d iv>\n             <di v class="m odal-body" >\n                 < div class= "row">\n                      <d iv class=" col-xs-12  col-sm-12" >\n                          <p> <strong>UN ITED STATE S DEPARTME NT OF VETE RANS AFFAI RS ("VA")< /strong></ p>\n                          <p ><strong>S OFTWARE EN D USER LIC ENSE AGREE MENT</stro ng></p>\n                           <p>By a greeing to  have any  of VA\'s s oftware pr oducts ins talled on  to your de vice and b y subseque nt use of  the Licens ed Softwar e, you agr ee to comp ly with th e terms of  this gene ral End Us er License  Agreement  ("EULA")  where no s pecific ag reement is  in place  between VA  and the u ser of the  software.  If you do  not agree  to the te rms of thi s EULA, do  not insta ll or use  the Licens ed Softwar e but unin stall it f rom your d evice. Thi s EULA app lies to an y upgrades  and suppl ements to  the origin al License d Software  provided  and is ref erred to o n your ope ning scree n.</p>\n                           <ol>\n                               <li> The Licens ed Softwar e is owned  by VA. Th e Licensed  Software  is license d, not sol d, only on  the terms  of this E ULA. Accep tance and  installati on of the  software i ndicates y our accept ance of th e terms an d conditio ns of this  EULA.</li >\n                               <li>Upon  installati on of the  Licensed S oftware, y ou will ac quire the  right to u se the Lic ensed Soft ware, dire ctly from  VA. You as sume respo nsibility  for the se lection of  the progr am to achi
  9   eve your i ntended re sults, and  for the i nstallatio n, use and  results o btained fr om the Lic ensed Soft ware.</li> \n                               <li>VA and  you ackno wledge tha t this Agr eement is  concluded  between VA  and you o nly, and n ot with Ap ple.  VA i s solely r esponsible  for the L icensed So ftware and  its conte nt.</li>\n                               <l i>In consi deration o f your acc eptance of  the terms  and condi tions cont ained in t his EULA,  VA grants  you a non- exclusive  license to  use the L icensed So ftware and  the assoc iated docu mentation  for your o wn needs o n one devi ce. You ar e not lice nsed to re nt, lease,  transfer,  or distri bute the L icensed So ftware.</l i>\n                               <li>Titl e to the L icensed So ftware, in cluding me dia and do cumentatio n, remain  with VA. Y ou may not  copy, rep roduce or  make data  transmissi ons, in wh ole or in  part, exce pt as is n ecessary f or back-up  or archiv al purpose s. You may  not rever se enginee r, transla te, disass emble, dec ompile the  Licensed  Software o r create s imilar sof tware in w hole or in  part.</li >\n                               <li>The l icense is  effective  upon accep tance and  installati on of the  Licensed S oftware an d shall co ntinue unt il termina ted. You m ay termina te it at a ny time by  uninstall ing the Li censed Sof tware. VA  has the ri ght to ter minate thi s Agreemen t if you f ail to com ply with a ny term or  condition  of this E ULA. Upon  terminatio n you shal l stop all  use of th e Software  and unins tall the L icensed So ftware.</l i>\n                               <li>Conf identialit y obligati ons pertai ning to th e Licensed  Software  will survi ve any ter mination o f this EUL A, to incl ude the ap plication,  design, a nd functio nality.</l i>\n                               <li>This  Licensed  Software i s distribu ted AS IS,  in the ho pe that it  will be u seful, but  WITHOUT A NY WARRANT Y; without  even the  implied wa rranties o f MERCHANT ABILITY or  FITNESS F OR A PARTI CULAR PURP OSE.</li>\ n                              < li>In no e vent will  VA be liab le for any  damages,  including  those for  loss of da ta, loss o f use, or  indirect,  special, i ncidental  or consequ ential dam ages in an y way rela ted to or  arising ou t of the u se of the  Licensed S oftware, w hether bas ed upon wa rranty, co ntract, or  otherwise , whether  or not inj ury was su stained by  persons o r property  or otherw ise, and w hether or  not loss w as sustain ed from, o r arose ou t of, use  of License d Software .  You agr ee to waiv e any and  all claims  against t he U.S. Go vernment,  VA, its co ntractors,  their sub contractor s, and sha ll indemni fy and hol d harmless  the U.S.  Government , its cont ractors, a nd their s ubcontract ors for an y damage t hat you ma y incur fr om your us e of the L icensed So ftware.</l i>\n                               <li>VA s hall be ne ither liab le nor res ponsible f or any mai ntenance o r updating  of the pr ovided Lic ensed Soft ware, nor  for correc tion of an y errors i n the Lice nsed Softw are.  </li >\n                               <li>This  Agreement  shall be c onstrued a nd enforce d in accor dance with  federal l aw and eac h party ag rees to be  subject t o those re levant law s for all  purposes.< /li>\n                               <li>It  is unders tood and a cknowledge d that VA  has the ab solute rig ht to obta in injunct ive relief  to protec t VA\'s pr oprietary  rights.</l i>\n                               <li>By u sing the L icensed So ftware, yo u further  agree that  this is t he complet e and excl usive stat ement of t he Agreeme nt which s upersedes  any propos al or prio r agreemen t, oral or  written,  and any ot her commun ications r elating to  the subje ct matter  of this EU LA.</li>\n                               <l i>If any p rovision o f this Agr eement is  held to be  invalid o r unenforc eable the  remaining  provisions  will not  be affecte d.</li>\n                               <li >For stati stical pur poses VA c ollects an onymous us age data a nd sends i t to a dat a provider . By accep ting this  agreement,  it is und erstood th at this fe ature can  be disable d through  the settin gs screen  at any tim e.</li>\n                               <li >PRIVACY N OTICE:  No  individua lly identi fiable dat a is trans ferred or  transmitte d to VA in  any way t hrough the  use of th e Licensed  Software.   All indi vidually i dentifiabl e data ent ered by yo u remains  your sole  property a nd will no t be acces sed by VA  without yo ur further  express c onsent.  Y ou also ac knowledge  that it is  your sole  responsib ility to p rotect and  otherwise  secure an y informat ion captur ed and sto red by the  software  once insta lled on yo ur device. </li>\n                               <li>D ISCLAIMER:  The conte nt of this  applicati on is inte nded for u se only as  an inform ative tool .  It is n ot, is not  intended  to be, and  should no t be used  in any way  as a subs titute for  professio nal medica l advice o r training .  The acc uracy of t he informa tion provi ded is not  guarantee d.  You ac knowledge  in initiat ing this a pplication  that the  informatio n is not m eant to di agnose a h ealth cond ition or d isease and  is not me ant to dev elop a hea lth treatm ent plan.   If you ar e in an em ergency or  life-thre atening me dical situ ation, see k medical  assistance  immediate ly.  Dial  emergency  number (91 1 in the U SA) for em ergency me dical serv
  10   ices.</li> \n                            </ol>\n                       </div>\n                   </div>\n               </div>\n               <div class ="modal-fo oter">\n                   <button ty pe="button " class="b tn btn-def ault pull- left" id=" eula-decli ne">Declin e</button> \n                   <button ty pe="button " class="b tn btn-pri mary pull- left" id=" eula-accep t">Accept< /button>\n                </div>\n          </div>\n      </div>\n</ div>\n'},u seData:!0} ),this.VPC .Template. layout=Han dlebars.te mplate({co mpiler:[7, ">= 4.0.0" ],main:fun ction(cont ainer,dept h0,helpers ,partials, data){retu rn'<header  class="ro w" role="b anner"></h eader>\n<s ection id= "errorSect ion"></sec tion>\n<se ction clas s="row con tent" id=" content">< img src="i mg/loading _spinner.g if" class= "spinner-i mage"></se ction>\n\n <footer cl ass="row"  role="cont entinfo" t abindex="0 "></footer >\n\n<sect ion class= "modal-con tainer"></ section>\n \n<section  class="ti meout"></s ection>\n\ n<div clas s="scrollb ar-gradien t"></div>\ n\n<div cl ass="mask"  tabindex= "-1">\n      <div class ="spinner" >Loading</ div>\n</di v>\n'},use Data:!0}), this.VPC.T emplate.re sourceFail edBanner=H andlebars. template({ 1:function (container ,depth0,he lpers,part ials,data) {var stack 1,alias1=c ontainer.l ambda;retu rn'<div cl ass="alert  alert-war ning" role ="alert">\     <h4>A prob lem occure d during s tartup of  this appli cation. No t all feat ures of th is applica tion will  function\n           properly.< /h4>\n      <h5>The fo llowing re source(s)  failed to  load:</h5> \n      <ul>\n'+(n ull!=(stac k1=helpers .each.call (null!=dep th0?depth0 :container .nullConte xt||{},nul l!=(stack1 =null!=dep th0?depth0 .resources :depth0)?s tack1.reso urce:stack 1,{name:"e ach",hash: {},fn:cont ainer.prog ram(2,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +'      </ul>\n      <h5>If thi s problem  persists p lease cont act the he lp desk:</ h5>\n\n      <div class ="row">\n          <div class ="col-sm-5 "><label f or="help-d esk">'+(nu ll!=(stack 1=alias1(n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.hel p:depth0)? stack1["he lp-desk-ve teran"]:st ack1)?stac k1.title:s tack1,dept h0))?stack 1:"")+'</l abel></div >\n          <div class ="col-sm-7 " id="help -desk">'+( null!=(sta ck1=alias1 (null!=(st ack1=null! =(stack1=n ull!=depth 0?depth0.h elp:depth0 )?stack1[" help-desk- veteran"]: stack1)?st ack1.conte nt:stack1, depth0))?s tack1:"")+ "</div>\n      </div>\n</ div>\n"},2 :function( container, depth0,hel pers,parti als,data){ return"          <li>"+cont ainer.esca peExpressi on(contain er.lambda( depth0,dep th0))+"</l i>\n"},com piler:[7," >= 4.0.0"] ,main:func tion(conta iner,depth 0,helpers, partials,d ata){var s tack1;retu rn null!=( stack1=hel pers.if.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.res ources:dep th0)?stack 1.resource :stack1)?s tack1.leng th:stack1, {name:"if" ,hash:{},f n:containe r.program( 1,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:""},use Data:!0}), this.VPC.T emplate.re sources=Ha ndlebars.t emplate({c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){ret urn'<p id= "learn-sec tion-top"  tabindex=" 0">\n      <strong>Ca regiver Su pport Line </strong>:  <a href=" tel:185526 03274"><st rong>1-855 -260-3274< /strong></ a>\n      (Toll-free )<br/>Mond ay through  Friday 8: 00 am - 11 :00 pm ET< br/>Saturd ay 10:30 a m - 6:00 p m ET\n</p> \n\n<p><a  href="http ://www. URL /help_land ing.asp" t arget="_bl ank" class ="resource s-link"><s trong>Care giver Supp ort Coordi nator</str ong></a>:  Your local  Caregiver  Support C oordinator  is a lice nsed profe ssional wh o can supp ort you by  matching  you with s ervices fo r which yo u are elig ible, and  providing  you with v aluable in formation  about reso urces that  can help  you stay s mart, stro ng and org anized as  you care f or the Vet eran you l ove. Find  your local  Caregiver  Support C oordinator  by visiti ng our &qu ot;Help Ne ar Home&qu ot; page a nd enterin g your zip  code.</p> \n\n\n<p>< a href="ht tp://www. URL /support/s upport_ser vices.asp"  target="_ blank" cla ss="resour ces-link"> <strong>Ca regiver Se rvices</st rong></a>:  VA offers  a number  of service s that can  provide y ou with th e support  that\'s ri ght for yo u. Whether  you and t he Veteran  you care  for could  use some h elp at hom e or you j ust need s omeone to  listen, we \'re here  to support  you. Foll ow the lin k to learn  more abou t the vari ety of ser vices avai lable to F amily Care givers.</p >\n\n<p><a  href="htt p://www. URL /toolbox/i ndex.asp"  target="_b lank" clas s="resourc es-link">< strong>Car egivers To olbox</str ong></a>:  As a Famil y Caregive r, you kno w better t han anyone  else that  caring fo r a Vetera n requires  major org anizationa l skills.  Whether yo u are new  to family  caregiving  or lookin g for fres h tips and  resources , VA has c reated thi s Caregive r Tool Box  to help y ou find to ols that w ork for yo u. This pa ge offers  resources  and inform ation to h elp you st ay on top  of things  and manage  the daily  stresses  of family  caregiving .</p>\n\n< p><a href= "http://ww w. URL /strong/in dex.asp" t arget="_bl ank" class ="resource s-link"><s trong>Stay ing Strong </strong>< /a>: Takin g care of  the Vetera n you love  is often  your prima ry focus f or the day . But some times, sta ying stron g for that  Veteran a nd your fa mily can f eel exhaus ting, and  leave you  without mu ch time fo r yourself
  11  
 The links  on this p age provid e informat ion and ti ps to help  you stay  strong and  stay info rmed. Afte r all, you r health i s essentia l to your  ability to  keep prov iding for  the Vetera n you love .</p>\n\n< p><a href= "http://ww w. URL /support/s upport_ben efits.asp"  target="_ blank" cla ss="resour ces-link"> <strong>Ne w Services  for Famil y Caregive rs of Post -9/11 Vete rans</stro ng></a>: I f you are  the Family  Caregiver  of a Vete ran who wa s injured  post-9/11,  you may b e eligible  for addit ional serv ices throu gh VA, inc luding a s tipend, co mprehensiv e training  and medic al coverag e through  VA if you  are not al ready cove red by a p lan. Follo w the link  to learn  more about  the newes t services  and to se e if you a re current ly eligibl e.</p>\n\n <p><a href ="http://m aketheconn ection.net " target=" _blank" cl ass="resou rces-link" ><strong>M ake the Co nnection</ strong></a >: This si te connect s Veterans , their fr iends, and  family me mbers with  informati on resourc es, soluti ons, and i ssues affe cting thei r health,  well-being , and ever yday lives   Hear inspi ring stori es of stre ngth. Lear n what has  worked fo r other Ve terans.</p >\n'},useD ata:!0}),t his.VPC.Te mplate.tim eoutModal= Handlebars .template( {compiler: [7,">= 4.0 .0"],main: function(c ontainer,d epth0,help ers,partia ls,data){r eturn'<div  class="mo dal fade t ext-left"  id="timeou t-modal" t abindex="- 1" role="d ialog" ari a-hidden=" true" data -backdrop= "static" d ata-keyboa rd="false" >\n      <div class ="modal-di alog">\n          <div class ="modal-co ntent">\n               <div class ="modal-he ader">\n                   <h4 class= "modal-tit le" tabind ex="0">Ses sion Timeo ut</h4>\n               </div>\n               <div class ="modal-bo dy">\n                   <p>Your us er session  will time  out in:</ p>\n                   <div class ="time-rem aining" ro le="timer" ></div>\n                   <p>To help  protect y our inform ation, you r User ses sion times  out after  15 minute s.</p>\n                   <p>If you  are active ly using y our VA Mob ile applic ations, si mply tap < strong>Con tinue</str ong> to re set the se ssion. You  can also  tap <stron g>Logout</ strong> to  logout of  your user  session n ow.</p>\n               </div>\n               <div class ="modal-fo oter pc-mo dal-footer ">\n                   <button ty pe="button " class="b tn btn-def ault pull- left" id=" logout">Lo gout</butt on>\n                   <button ty pe="button " class="b tn btn-pri mary pull- left" id=" stay">Cont inue</butt on>\n               </div>\n          </div>\n      </div>\n</ div>\n'},u seData:!0} ),this.VPC .Template. assessment s=Handleba rs.templat e({compile r:[7,">= 4 .0.0"],mai n:function (container ,depth0,he lpers,part ials,data) {var stack 1;return'< button typ e="button"  class="ti tle-back-b tn" onclic k="App_Uti ls.BackBut ton();"><i mg src="im g/icon-arr owBack.svg " alt="Ret urn to Pre vious Page "/></butto n>\n<h2 id ="content- title" tab index="0"  class="sm- phone-head er assessm ents-heade r"></h2>\n '+(null!=( stack1=con tainer.inv okePartial (partials. providerRe portMenu,d epth0,{nam e:"provide rReportMen u",data:da ta,helpers :helpers,p artials:pa rtials,dec orators:co ntainer.de corators}) )?stack1:" ")+'<div i d="patient HeaderSect ion" data- spy="affix " data-off set-top="1 60"></div> \n<div id= "assessmen ts-content ">\n      <div id="a ssessments -region" c lass="spin ner-backgr ound"></di v>\n      <div id="a ssessments -phone-reg ion"></div >\n</div>\ n\n'},useP artial:!0, useData:!0 }),this.VP C.Template .assessmen tsDetails= Handlebars .template( {compiler: [7,">= 4.0 .0"],main: function(c ontainer,d epth0,help ers,partia ls,data){v ar stack1, helper,ali as1=null!= depth0?dep th0:contai ner.nullCo ntext||{}, alias2=hel pers.helpe rMissing,a lias3=cont ainer.esca peExpressi on,alias4= "function" ,alias5=co ntainer.la mbda;retur n"<div>\n    <p><strong >Date Subm itted:</st rong> "+al ias3((help ers.format ISODateStr ing||depth 0&&depth0. formatISOD ateString| |alias2).c all(alias1 ,null!=dep th0?depth0 .dateCreat ed:depth0, {name:"for matISODate String",ha sh:{},data :data}))+' </p>\n</di v>\n\n<div  id="check -in-detail s-tablet-v iew">\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Pain Int ensity Sco re and Ans wers">\n      <thead>\n        <tr>\n          <th>Pain I ntensity</ th>\n          <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.p ainIntensi ty||(null! =depth0?de pth0.painI ntensity:d epth0))?he lper:alias 2,typeof h elper===al ias4?helpe r.call(ali as1,{name: "painInten sity",hash :{},data:d ata}):help er))+'\n            <span clas s="possibl e">of 10</ span>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td>'+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[0]:stac k1)?stack1 .text:stac k1,depth0) )+"</td>\n           <td>"+alia s3((helper s.getAnswe r||depth0& &depth0.ge tAnswer||a lias2).cal l(alias1,n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.ass essmentQue stions:dep th0)?stack 1[0]:stack 1)?stack1. answers:st ack1,null! =depth0?de pth0.painI ntensity:d epth0,{nam e:"getAnsw er",hash:{ },data:dat a}))+' </t d>\n        </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table -striped t able-borde red check- in-details -table" su mmary="Pai n Int
  12  
erference  Score and  Answers">\     <thead>\n        <tr>\n          <th>Pain I nterferenc e</th>\n          <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.p ainInterfe rence||(nu ll!=depth0 ?depth0.pa inInterfer ence:depth 0))?helper :alias2,ty peof helpe r===alias4 ?helper.ca ll(alias1, {name:"pai nInterfere nce",hash: {},data:da ta}):helpe r))+'\n            <span clas s="possibl e">of 10</ span>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td>'+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[1]:stac k1)?stack1 .text:stac k1,depth0) )+"</td>\n           <td>"+alia s3((helper s.getAnswe r||depth0& &depth0.ge tAnswer||a lias2).cal l(alias1,n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.ass essmentQue stions:dep th0)?stack 1[1]:stack 1)?stack1. answers:st ack1,null! =depth0?de pth0.painI nterferenc eGeneral:d epth0,{nam e:"getAnsw er",hash:{ },data:dat a}))+"</td >\n        </tr>\n        <tr>\n          <td>"+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[2]:stac k1)?stack1 .text:stac k1,depth0) )+"</td>\n           <td>"+alia s3((helper s.getAnswe r||depth0& &depth0.ge tAnswer||a lias2).cal l(alias1,n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.ass essmentQue stions:dep th0)?stack 1[2]:stack 1)?stack1. answers:st ack1,null! =depth0?de pth0.painI nterferenc eLife:dept h0,{name:" getAnswer" ,hash:{},d ata:data}) )+'</td>\n         </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Sleep Qu ality Scor e and Answ ers">\n      <thead>\n        <tr>\n          <th>Sleep  Quality</t h>\n          <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.s leepQualit y||(null!= depth0?dep th0.sleepQ uality:dep th0))?help er:alias2, typeof hel per===alia s4?helper. call(alias 1,{name:"s leepQualit y",hash:{} ,data:data }):helper) )+'\n            <span clas s="possibl e">of 10</ span>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td>'+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[3]:stac k1)?stack1 .text:stac k1,depth0) )+"</td>\n           <td>"+alia s3((helper s.getAnswe r||depth0& &depth0.ge tAnswer||a lias2).cal l(alias1,n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.ass essmentQue stions:dep th0)?stack 1[3]:stack 1)?stack1. answers:st ack1,null! =depth0?de pth0.sleep Quality:de pth0,{name :"getAnswe r",hash:{} ,data:data }))+'</td> \n        </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Depressi on Score a nd Answers ">\n      <thead>\n        <tr>\n          <th>Depres sion</th>\         <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.d epressionS core||(nul l!=depth0? depth0.dep ressionSco re:depth0) )?helper:a lias2,type of helper= ==alias4?h elper.call (alias1,{n ame:"depre ssionScore ",hash:{}, data:data} ):helper)) +'\n            <span clas s="possibl e">of 6</s pan>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td>'+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[4]:stac k1)?stack1 .text:stac k1,depth0) )+"</td>\n           <td>"+alia s3((helper s.getAnswe r||depth0& &depth0.ge tAnswer||a lias2).cal l(alias1,n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.ass essmentQue stions:dep th0)?stack 1[4]:stack 1)?stack1. answers:st ack1,null! =depth0?de pth0.pleas ureLevel:d epth0,{nam e:"getAnsw er",hash:{ },data:dat a}))+"</td >\n        </tr>\n        <tr>\n          <td>"+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[5]:stac k1)?stack1 .text:stac k1,depth0) )+"</td>\n           <td>"+alia s3((helper s.getAnswe r||depth0& &depth0.ge tAnswer||a lias2).cal l(alias1,n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.ass essmentQue stions:dep th0)?stack 1[5]:stack 1)?stack1. answers:st ack1,null! =depth0?de pth0.depre ssion:dept h0,{name:" getAnswer" ,hash:{},d ata:data}) )+'</td>\n         </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Overall  Status Det ails">\n      <thead>\n        <tr>\n          <th>Overal l Status</ th>\n          <th class= "score">\n             <div class ="overall- status">'+ alias3((he lpers.over allStatusT ext||depth 0&&depth0. overallSta tusText||a lias2).cal l(alias1,n ull!=depth 0?depth0.o verallStat us:depth0, {name:"ove rallStatus Text",hash :{},data:d ata}))+"</ div>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td>"+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[6]:stac k1)?stack1 .text:stac k1,depth0) )+"</td>\n           <td>"+alia s3((helper s.getAnswe r||depth0& &depth0.ge tAnswer||a lias2).cal l(alias1,n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.ass essmentQue stions:dep th0)?stack 1[6]:stack 1)?stack1. answers:st ack1,null! =depth0?de pth0.overa llStatus:d epth0,{nam e:"getAnsw er",hash:{ },data:dat a}))+'</td >\n        </tr>\n      </tbody>\n       </table>\n  
  13  
 </div>\n< /div>\n\n< div id="ch eck-in-det ails-phone -view">\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Pain Int ensity Sco re and Ans wers">\n      <thead>\n        <tr>\n          <th>Pain I ntensity</ th>\n          <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.p ainIntensi ty||(null! =depth0?de pth0.painI ntensity:d epth0))?he lper:alias 2,typeof h elper===al ias4?helpe r.call(ali as1,{name: "painInten sity",hash :{},data:d ata}):help er))+'\n            <span clas s="possibl e">of 10</ span>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td colspa n="2">'+al ias3(alias 5(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. assessment Questions: depth0)?st ack1[0]:st ack1)?stac k1.text:st ack1,depth 0))+"<br/> <br/>"+ali as3((helpe rs.getAnsw er||depth0 &&depth0.g etAnswer|| alias2).ca ll(alias1, null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[0]:stac k1)?stack1 .answers:s tack1,null !=depth0?d epth0.pain Intensity: depth0,{na me:"getAns wer",hash: {},data:da ta}))+'</t d>\n        </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Pain Int erference  Score and  Answers">\     <thead>\n        <tr>\n          <th>Pain I nterferenc e</th>\n          <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.p ainInterfe rence||(nu ll!=depth0 ?depth0.pa inInterfer ence:depth 0))?helper :alias2,ty peof helpe r===alias4 ?helper.ca ll(alias1, {name:"pai nInterfere nce",hash: {},data:da ta}):helpe r))+'\n            <span clas s="possibl e">of 10</ span>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td colspa n="2">'+al ias3(alias 5(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. assessment Questions: depth0)?st ack1[1]:st ack1)?stac k1.text:st ack1,depth 0))+"<br/> <br/>"+ali as3((helpe rs.getAnsw er||depth0 &&depth0.g etAnswer|| alias2).ca ll(alias1, null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[1]:stac k1)?stack1 .answers:s tack1,null !=depth0?d epth0.pain Interferen ceGeneral: depth0,{na me:"getAns wer",hash: {},data:da ta}))+'</t d>\n        </tr>\n        <tr>\n          <td colspa n="2">'+al ias3(alias 5(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. assessment Questions: depth0)?st ack1[2]:st ack1)?stac k1.text:st ack1,depth 0))+"<br/> <br/>"+ali as3((helpe rs.getAnsw er||depth0 &&depth0.g etAnswer|| alias2).ca ll(alias1, null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[2]:stac k1)?stack1 .answers:s tack1,null !=depth0?d epth0.pain Interferen ceLife:dep th0,{name: "getAnswer ",hash:{}, data:data} ))+'</td>\       </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Sleep Qu ality Scor e and Answ ers">\n      <thead>\n        <tr>\n          <th>Sleep  Quality</t h>\n          <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.s leepQualit y||(null!= depth0?dep th0.sleepQ uality:dep th0))?help er:alias2, typeof hel per===alia s4?helper. call(alias 1,{name:"s leepQualit y",hash:{} ,data:data }):helper) )+'\n            <span clas s="possibl e">of 10</ span>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td colspa n="2">'+al ias3(alias 5(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. assessment Questions: depth0)?st ack1[3]:st ack1)?stac k1.text:st ack1,depth 0))+"<br/> <br/>"+ali as3((helpe rs.getAnsw er||depth0 &&depth0.g etAnswer|| alias2).ca ll(alias1, null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[3]:stac k1)?stack1 .answers:s tack1,null !=depth0?d epth0.slee pQuality:d epth0,{nam e:"getAnsw er",hash:{ },data:dat a}))+'</td >\n        </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Depressi on Score a nd Answers ">\n      <thead>\n        <tr>\n          <th>Depres sion</th>\         <th class= "score">\n             '+alias3(( helper=nul l!=(helper =helpers.d epressionS core||(nul l!=depth0? depth0.dep ressionSco re:depth0) )?helper:a lias2,type of helper= ==alias4?h elper.call (alias1,{n ame:"depre ssionScore ",hash:{}, data:data} ):helper)) +'\n            <span clas s="possibl e">of 6</s pan>\n          </th>\n        </tr>\n      </thead>\n       <tbody>\n        <tr>\n          <td colspa n="2">'+al ias3(alias 5(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. assessment Questions: depth0)?st ack1[4]:st ack1)?stac k1.text:st ack1,depth 0))+"<br/> <br/>"+ali as3((helpe rs.getAnsw er||depth0 &&depth0.g etAnswer|| alias2).ca ll(alias1, null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[4]:stac k1)?stack1 .answers:s tack1,null !=depth0?d epth0.plea sureLevel: depth0,{na me:"getAns wer",hash: {},data:da ta}))+'</t d>\n        </tr>\n        <tr>\n          <td colspa n="2">'+al ias3(alias 5(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. assessment Questions: depth0)?st ack1[5]:st ack1)?stac k1.text:st ack1,depth 0))+"<br/> <br/>"+ali as3((helpe rs.getAnsw er||depth0 &&depth0.g etAns
  14  
wer||alias 2).call(al ias1,null! =(stack1=n ull!=(stac k1=null!=d epth0?dept h0.assessm entQuestio ns:depth0) ?stack1[5] :stack1)?s tack1.answ ers:stack1 ,null!=dep th0?depth0 .depressio n:depth0,{ name:"getA nswer",has h:{},data: data}))+'< /td>\n        </tr>\n      </tbody>\n       </table>\n     </div>\n    <div class ="check-in -details-t able-wrapp er">\n      <table cla ss="table  table-stri ped table- bordered c heck-in-de tails-tabl e" summary ="Overall  Status Det ails">\n      <thead>\n        <tr>\n          <th>Overal l Status</ th>\n          <th class= "score">\n             <div class ="overall- status">'+ alias3((he lpers.over allStatusT ext||depth 0&&depth0. overallSta tusText||a lias2).cal l(alias1,n ull!=depth 0?depth0.o verallStat us:depth0, {name:"ove rallStatus Text",hash :{},data:d ata
  15   }))+'</div >\n         </th>\n       </tr>\ n    </the ad>\n    < tbody>\n       <tr>\n         <t d colspan= "2">'+alia s3(alias5( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.as sessmentQu estions:de pth0)?stac k1[6]:stac k1)?stack1 .text:stac k1,depth0) )+"<br/><b r/>"+alias 3((helpers .getAnswer ||depth0&& depth0.get Answer||al ias2).call (alias1,nu ll!=(stack 1=null!=(s tack1=null !=depth0?d epth0.asse ssmentQues tions:dept h0)?stack1 [6]:stack1 )?stack1.a nswers:sta ck1,null!= depth0?dep th0.overal lStatus:de pth0,{name :"getAnswe r",hash:{} ,data:data }))+'</td> \n      </ tr>\n    < /tbody>\n     </table >\n  </div >\n</div>\ n\n<div cl ass="cente r-buttons" >\n  <a da ta-nav="ne xt" href=" #" class=" btn btn-de fault back " role="bu tton"><img  src="img/ icon-arrow Back-black .svg" clas s="forward " alt="" t itle="" ar ia-hidden= "true"/> B ack</a>\n< /div>\n'}, useData:!0 }),this.VP C.Template .assessmen tsEntries= Handlebars .template( {1:functio n(containe r,depth0,h elpers,par tials,data ){var alia s1=contain er.lambda, alias2=con tainer.esc apeExpress ion;return '        < li data-pa ge="'+alia s2(alias1( depth0,dep th0))+'">< a href="#" >'+alias2( alias1(dep th0,depth0 ))+"</a></ li>\n"},co mpiler:[7, ">= 4.0.0" ],main:fun ction(cont ainer,dept h0,helpers ,partials, data){var  stack1;ret urn'<p id= "intro-tex t-tablet-c heck-in">F or more in formation  on the ent ry, click  on the cor responding  table row . <a tabin dex="0" cl ass="icon- info" role ="button"  aria-label ="Monthly  score info  button -  click for  more infor mation" da ta-toggle= "modal" da ta-target= "#monthlyI nfo"><img  src="img/i con-info.s vg" class= "pain-diar y-info-ico n" alt=""  aria-hidde n="true"/> </a></p>\n <p id="int ro-text-ph one-diary" >For more  informatio n, click o n the entr y.<a tabin dex="0" cl ass="icon- info" role ="button"  aria-label ="Monthly  score info  button -  click for  more infor mation" da ta-toggle= "modal" da ta-target= "#monthlyI nfo"><img  src="img/i con-info.s vg" class= "pain-diar y-info-ico n" alt=""  aria-hidde n="true"/> </a></p>\n \n<div cla ss="table- responsive  monthly-c heck-ins-t able-margi ns" id="ta ble-tablet -view">\n   <table id ="monthly- entries-ta ble" class ="table ta ble-stripe d table-bo rdered che ck-in-entr ies-table"  summary=" List of Mo nthly Chec k-Ins">\n     <thead> \n      <t r>\n         <th scop e="col" da ta-sort="d ateCreated " class="v pc-sortabl e">Date<br />Submitte d <span cl ass="sr-on ly">Select  to sort</ span><span  class="gl yphicon gl yphicon-ch evron-down " aria-hid den="true" ></span></ th>\n         <th sco pe="col" d ata-sort=" painIntens ity" class ="vpc-sort able">Pain <br/>Inten sity <span  class="sr -only">Sel ect to sor t</span><s pan class= "glyphicon  glyphicon -chevron-d own" aria- hidden="tr ue"></span ></th>\n         <th  scope="col " data-sor t="painInt erference"  class="vp c-sortable ">Pain<br/ >Interfere nce <span  class="sr- only">Sele ct to sort </span><sp an class=" glyphicon  glyphicon- chevron-do wn" aria-h idden="tru e"></span> </th>\n         <th s cope="col"  data-sort ="sleepQua lity" clas s="vpc-sor table">Sle ep<br/>Qua lity <span  class="sr -only">Sel ect to sor t</span><s pan class= "glyphicon  glyphicon -chevron-d own" aria- hidden="tr ue"></span ></th>\n         <th  scope="col " data-sor t="depress ionScore"  class="vpc -sortable" >Depressio n <span cl ass="sr-on ly">Select  to sort</ span><span  class="gl yphicon gl yphicon-ch evron-down " aria-hid den="true" ></span></ th>\n         <th sco pe="col" d ata-sort=" overallSta tus" class ="vpc-sort able">Over all<br/>St atus <span  class="sr -only">Sel ect to sor t</span><s pan class= "glyphicon  glyphicon -chevron-d own" aria- hidden="tr ue"></span ></th>\n       </tr>\ n    </the ad>\n    < tbody id=" assessment s-entry">< /tbody>\n   </table>\ n  <div cl ass="compl eted-check -in-pagina tion">\n     <ul clas s="paginat ion">\n       <li>\n         <a  href="#" c lass="prev ious-page"  aria-labe l="Previou s">\n           <span  aria-hidd en="true"> &laquo;</s pan>\n         </a>\n       </li >\n'+(null !=(stack1= helpers.ea ch.call(nu ll!=depth0 ?depth0:co ntainer.nu llContext| |{},null!= depth0?dep th0.pages: depth0,{na me:"each", hash:{},fn :container .program(1 ,data,0),i nverse:con tainer.noo p,data:dat a}))?stack 1:"")+'       <li>\n         <a  href="#" c lass="next -page" ari a-label="N ext">\n           <sp an aria-hi dden="true ">&raquo;< /span>\n         </a> \n      </ li>\n    < /ul>\n  </ div>\n</di v>\n\n<div  class="mo dal" id="m onthlyInfo " data-bac kdrop="sta tic" tabin dex="-1" r ole="dialo g" aria-la bel="Month ly Check-i n Informat ion" aria- hidden="tr ue">\n  <d iv class=" modal-dial og modal-l g">\n    < div class= "modal-con tent">\n       <div c lass="moda l-header h elp-header ">\n         <h4 clas s="modal-t itle help- title" id= "monthly-i nfo-header " tabindex ="0">Month ly Check-I n Informat ion</h4>\n       </di v>\n       <div class ="modal-bo dy">\n         <div c lass="cent er-block"> \n           <table c lass="tabl e table-bo rdered tab le-condens ed">\n             <t r>\n               <t h>Question </th>\n                <th>Score  Title</th >\n               <th >Score Ran ge</th>\n              </tr>\n              <tr>\n                <td>What n umber best  describes  your pain  on averag e in the p ast week?< /td>\n                <td>Pain</ td>\n               < td>This sc ore repres ents your  pain inten sity over  the past w eek 0= no  pain, 1-3  = mild pai n, 4-6 = m oderate pa in, 7-10 =  severe pa in.</td>\n           
  16     </tr>\n              <tr>\n                <td>What  number bes t describe s how, dur ing the pa st week, p ain has in terfered w ith your g eneral act ivities?</ td>\n               < td>Pain In terference </td>\n                <td>This  score repr esents an  average sc ore of how  your pain  interfere s with you r general  activities  and enjoy ment of li fe. 0 = do es not int erfere , 1 0 = comple tely inter feres</td> \n             </tr>\ n             <tr>\n                <td>Wha t number b est descri bes how, d uring the  past week,  pain has  interfered  with your  enjoyment  of life?< /td>\n                <td>Pain I nterferenc e</td>\n                <td>Q2 o f the pain  interfere nce score< /td>\n             </ tr>\n             <tr >\n               <td >What numb er best de scribes ho w much dif ficulty, i f any, you  have had  falling or  staying a sleep in t he past we ek?</td>\n                <td>Sl eep Qualit y</td>\n                <td>This  score rep resents ho w much dif ficulty yo u have had  sleeping  this week,  0 = no di fficulty ( great slee p) and 10  = extreme  difficulty  (terrible  sleep)</t d>\n             </tr >\n             <tr>\ n               <td>O ver the pa st 2 weeks , how ofte n have you  been both ered by li ttle inter est or ple asure in d oing thing s?</td>\n                <td>Dep ression</t d>\n               <t d>This sco re represe nts your l evel of de pressed mo od in the  past 2 wee k , scores  &ge; 3 =  initial po sitive scr een  for d epression  </td>\n             < /tr>\n             <t r>\n               <t d>Over the  past 2 we eks, how o ften have  you been b othered by  feeling d own, depre ssed or ho peless?</t d>\n               <t d>Depressi on</td>\n                <td>Q2  of the dep ression sc ore</td>\n              </tr>\n              <tr>\n                <td>Since  your last  assessmen t, conside ring all o f the prev ious quest ions, your  overall s tatus is:< /td>\n                <td>Overal l Status</ td>\n               < td>This sc ore repres ents the c hange in y our pain-r elated hea lth since  your last  assessment , ranging  from <em>M uch Worse< /em> to <e m>Much Bet ter.</em>< /td>\n             </ tr>\n           </tab le>\n         </div>\ n      </d iv>\n       <div clas s="modal-f ooter cent er">\n         <butto n class="b tn btn-pri mary" type ="reset" d ata-dismis s="modal"  aria-label ="Close Mo nthly Info  Window">C lose</butt on>\n       </div>\n     </div>\ n  </div>\ n</div>\n' },useData: !0}),this. VPC.Templa te.assessm entsEntry= Handlebars .template( {compiler: [7,">= 4.0 .0"],main: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper, alias1=nul l!=depth0? depth0:con tainer.nul lContext|| {},alias2= helpers.he lperMissin g,alias3=c ontainer.e scapeExpre ssion;retu rn"<td>"+a lias3((hel pers.short Date||dept h0&&depth0 .shortDate ||alias2). call(alias 1,null!=de pth0?depth 0.dateCrea ted:depth0 ,{name:"sh ortDate",h ash:{},dat a:data}))+ "</td>\n<t d>"+alias3 ((helper=n ull!=(help er=helpers .painInten sity||(nul l!=depth0? depth0.pai nIntensity :depth0))? helper:ali as2,"funct ion"==type of helper? helper.cal l(alias1,{ name:"pain Intensity" ,hash:{},d ata:data}) :helper))+ " of 10</t d>\n<td>"+ alias3((he lper=null! =(helper=h elpers.pai nInterfere nce||(null !=depth0?d epth0.pain Interferen ce:depth0) )?helper:a lias2,"fun ction"==ty peof helpe r?helper.c all(alias1 ,{name:"pa inInterfer ence",hash :{},data:d ata}):help er))+" of  10</td>\n< td>"+alias 3((helper= null!=(hel per=helper s.sleepQua lity||(nul l!=depth0? depth0.sle epQuality: depth0))?h elper:alia s2,"functi on"==typeo f helper?h elper.call (alias1,{n ame:"sleep Quality",h ash:{},dat a:data}):h elper))+"  of 10</td> \n<td>"+al ias3((help er=null!=( helper=hel pers.depre ssionScore ||(null!=d epth0?dept h0.depress ionScore:d epth0))?he lper:alias 2,"functio n"==typeof  helper?he lper.call( alias1,{na me:"depres sionScore" ,hash:{},d ata:data}) :helper))+ " of 6</td >\n<td>"+a lias3((hel pers.overa llStatusTe xt||depth0 &&depth0.o verallStat usText||al ias2).call (alias1,nu ll!=depth0 ?depth0.ov erallStatu s:depth0,{ name:"over allStatusT ext",hash: {},data:da ta}))+"</t d>\n"},use Data:!0}), this.VPC.T emplate.as sessmentsG raph=Handl ebars.temp late({1:fu nction(con tainer,dep th0,helper s,partials ,data){ret urn'             <p>< span class ="glyphico n glyphico n-arrow-do wn"></span ></p>\n'}, 3:function (container ,depth0,he lpers,part ials,data) {var stack 1;return n ull!=(stac k1=helpers .if.call(n ull!=depth 0?depth0:c ontainer.n ullContext ||{},null! =depth0?de pth0.bette rStatus:de pth0,{name :"if",hash :{},fn:con tainer.pro gram(4,dat a,0),inver se:contain er.program (6,data,0) ,data:data }))?stack1 :""},4:fun ction(cont ainer,dept h0,helpers ,partials, data){retu rn'             <p><s pan class= "glyphicon  glyphicon -arrow-up" ></span></ p>\n'},6:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r stack1;r eturn null !=(stack1= helpers.if .call(null !=depth0?d epth0:cont ainer.null Context||{ },null!=de pth0?depth 0.sameStat us:depth0, {name:"if" ,hash:{},f n:containe r.program( 7,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:""},7:f unction(co ntainer,de pth0,helpe rs,partial s,data){re turn'             <p> <img src=" img/icon-h appyFace.s vg" alt="h appy face" ></p>\n           '}, compiler:[ 7,">= 4.0. 0"],main:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r stack1,h elper,alia s1=null!=d epth0?dept h0:contain er.nullCon text||{},a lias2=help ers.helper Missing,al ias3=conta iner.escap eExpressio n,alias4="
  17   function"; return'\x3 c!-- modal -hide is a  style use d only set  aria-hidd en=true wh en modal i s displaye d for 508.   No styli ng associa ted with i t. --\x3e\ n<p class= "modal-hid e center a ssessment- header-tex t">Click o n the grap h to open  up a large r view of  the graph. </p>\n<div  class="cl earfix mod al-hide">< /div>\n<di v class="r ow graphs  modal-hide ">\n  <div  class="co l-sm-6">\n     <div c lass="pane l panel-de fault mont hly-assess ment-panel ">\n       <div class ="panel-he ading"><st rong>Pain  Intensity< /strong></ div>\n       <div cla ss="panel- body panel -click-are a">\n         <div>La st Pain In tensity Ra ting on '+ alias3((he lpers.form atDate||de pth0&&dept h0.formatD ate||alias 2).call(al ias1,null! =depth0?de pth0.lastD ate:depth0 ,{name:"fo rmatDate", hash:{},da ta:data})) +"</div>\n         <p ><span>"+a lias3((hel per=null!= (helper=he lpers.pain Intensity| |(null!=de pth0?depth 0.painInte nsity:dept h0))?helpe r:alias2,t ypeof help er===alias 4?helper.c all(alias1 ,{name:"pa inIntensit y",hash:{} ,data:data }):helper) )+'</span>  of 10</p> \n         <div class ="panel-bo dy monthly -check-in- graph-disp lay" id="p ainIntensi ty">\n           <can vas id="mo nthly-chec k-in-graph -canvas">< /canvas> \ x3c!--  Ne eded to fi x graph in  IE  --\x3 e\n         </div>\n         <di v class="c enter">Ave rage: '+al ias3((help er=null!=( helper=hel pers.painI ntensityAv g||(null!= depth0?dep th0.painIn tensityAvg :depth0))? helper:ali as2,typeof  helper=== alias4?hel per.call(a lias1,{nam e:"painInt ensityAvg" ,hash:{},d ata:data}) :helper))+ ' of 10</d iv>\n       </div>\n       <div  class="pan el-footer  center-but tons">\n         <a d ata-nav="n ext" href= "#" class= "btn btn-d efault tab ular" role ="button"  data-id="p ainIntensi ty" aria-l abel="Pain  Intensity  Tabular V iew">View  Tabular Da ta</a>\n       </div> \n    </di v>\n  </di v>\n  <div  class="co l-sm-6">\n     <div c lass="pane l panel-de fault mont hly-assess ment-panel ">\n       <div class ="panel-he ading"><st rong>Pain  Interferen ce</strong ></div>\n       <div  class="pan el-body pa nel-click- area">\n         <div >Last Pain  Interfere nce Rating  on '+alia s3((helper s.formatDa te||depth0 &&depth0.f ormatDate| |alias2).c all(alias1 ,null!=dep th0?depth0 .lastDate: depth0,{na me:"format Date",hash :{},data:d ata}))+"</ div>\n         <p><sp an>"+alias 3((helper= null!=(hel per=helper s.painInte rferenceAv g||(null!= depth0?dep th0.painIn terference Avg:depth0 ))?helper: alias2,typ eof helper ===alias4? helper.cal l(alias1,{ name:"pain Interferen ceAvg",has h:{},data: data}):hel per))+'</s pan> of 10 </p>\n         <div c lass="pane l-body mon thly-check -in-graph- display" i d="painInt erference" >\n           <canvas  id="month ly-check-i n-graph-ca nvas"></ca nvas> \x3c !--  Neede d to fix g raph in IE   --\x3e\n         </ div>\n         <div c lass="rati ng-average ">Average:  '+alias3( (helper=nu ll!=(helpe r=helpers. painIntTot alAvg||(nu ll!=depth0 ?depth0.pa inIntTotal Avg:depth0 ))?helper: alias2,typ eof helper ===alias4? helper.cal l(alias1,{ name:"pain IntTotalAv g",hash:{} ,data:data }):helper) )+' of 10< /div>\n       </div>\ n      <di v class="p anel-foote r center-b uttons">\n         <a  data-nav= "next" hre f="#" clas s="btn btn -default t abular" ro le="button " data-id= "painInter ference" a ria-label= "Pain Inte rference T abular Vie w">View Ta bular Data </a>\n       </div>\n     </div> \n  </div> \n  <div c lass="col- sm-6">\n     <div cla ss="panel  panel-defa ult monthl y-assessme nt-panel"> \n      <d iv class=" panel-head ing"><stro ng>Sleep Q uality</st rong></div >\n      < div class= "panel-bod y panel-cl ick-area"> \n         <div>Last  Sleep Qual ity Rating  on '+alia s3((helper s.formatDa te||depth0 &&depth0.f ormatDate| |alias2).c all(alias1 ,null!=dep th0?depth0 .lastDate: depth0,{na me:"format Date",hash :{},data:d ata}))+"</ div>\n         <p><sp an>"+alias 3((helper= null!=(hel per=helper s.sleepQua lity||(nul l!=depth0? depth0.sle epQuality: depth0))?h elper:alia s2,typeof  helper===a lias4?help er.call(al ias1,{name :"sleepQua lity",hash :{},data:d ata}):help er))+'</sp an> of 10< /p>\n         <div cl ass="panel -body mont hly-check- in-graph-d isplay" id ="sleepQua lity">\n           <c anvas id=" monthly-ch eck-in-gra ph-canvas" ></canvas>  \x3c!--   Needed to  fix graph  in IE  --\ x3e\n         </div>\ n        < div class= "rating-av erage">Ave rage: '+al ias3((help er=null!=( helper=hel pers.sleep QualityAvg ||(null!=d epth0?dept h0.sleepQu alityAvg:d epth0))?he lper:alias 2,typeof h elper===al ias4?helpe r.call(ali as1,{name: "sleepQual ityAvg",ha sh:{},data :data}):he lper))+' o f 10</div> \n      </ div>\n       <div cla ss="panel- footer cen ter-button s">\n         <a data -nav="next " href="#"  class="bt n btn-defa ult tabula r" role="b utton" dat a-id="slee pQuality"  aria-label ="Sleep Qu ality Tabu lar View"> View Tabul ar Data</a >\n      < /div>\n     </div>\n   </div>\n   <div clas s="col-sm- 6">\n    < div class= "panel pan el-default  monthly-a ssessment- panel">\n       <div  class="pan el-heading "><strong> Depression </strong>< /div>\n       <div cl ass="panel -body pane l-click-ar ea">\n         <div>L ast Depres sion Ratin g on '+ali as3((helpe rs.formatD ate||depth 0&&depth0. formatDate ||alias2). call(alias 1,null!=de pth0?depth 0.lastDate :depth0,{n ame:"forma tDate",has h:{},data: data}))+"< /div>\n         <p><s pan>"+alia s3((helper =null!=(he lper=helpe rs.depress ion||(null !=depth0?d epth0.depr ession:dep th0))?help er:alias2, typeof hel
  18   per===alia s4?helper. call(alias 1,{name:"d epression" ,hash:{},d ata:data}) :helper))+ '</span> o f 6</p>\n         <di v class="p anel-body  monthly-ch eck-in-gra ph-display " id="depr ession">\n            <canvas id ="monthly- check-in-g raph-canva s"></canva s> \x3c!--   Needed t o fix grap h in IE  - -\x3e\n         </div >\n         <div clas s="rating- average">A verage: '+ alias3((he lper=null! =(helper=h elpers.dep ressionAvg ||(null!=d epth0?dept h0.depress ionAvg:dep th0))?help er:alias2, typeof hel per===alia s4?helper. call(alias 1,{name:"d epressionA vg",hash:{ },data:dat a}):helper ))+' of 6< /div>\n       </div>\ n      <di v class="p anel-foote r center-b uttons">\n         <a  data-nav= "next" hre f="#" clas s="btn btn -default t abular" ro le="button " data-id= "depressio nScore" ar ia-label=" Depression  Tabular V iew">View  Tabular Da ta</a>\n       </div> \n    </di v>\n  </di v>\n  <div  class="cl earfix mod al-hide">< /div>\n  < div class= "col-sm-3" ></div>\n   <div clas s="col-sm- 6">\n    < div class= "panel pan el-default  monthly-a ssessment- panel" id= "overall-s tatus-pane l">\n       <div clas s="panel-h eading cen ter"><stro ng>Overall  Status</s trong></di v>\n       <div class ="panel-bo dy panel-c lick-area"  id="pgic_ noGraph">\ n        < div class= "center">L ast Overal l Status R ating on ' +alias3((h elpers.for matDate||d epth0&&dep th0.format Date||alia s2).call(a lias1,null !=depth0?d epth0.last Date:depth 0,{name:"f ormatDate" ,hash:{},d ata:data}) )+'</div>\ n        < div class= "center">\ n           <p>'+alia s3((helper s.overallS tatusText| |depth0&&d epth0.over allStatusT ext||alias 2).call(al ias1,null! =depth0?de pth0.overa llStatus:d epth0,{nam e:"overall StatusText ",hash:{}, data:data} ))+"</p>\n "+(null!=( stack1=hel pers.if.ca ll(alias1, null!=dept h0?depth0. worseStatu s:depth0,{ name:"if", hash:{},fn :container .program(1 ,data,0),i nverse:con tainer.pro gram(3,dat a,0),data: data}))?st ack1:"")+'         </ div>\n       </div>\n     </div> \n  </div> \n  <div c lass="col- sm-3"></di v>\n</div> \n\n\x3c!- - Graph Mo dal --\x3e \n<div cla ss="modal  fade" id=" graph-moda l" tabinde x="-1" rol e="dialog"  aria-labe l="Graph W indow" ari a-hidden=" true">\n   <div class ="modal-di alog">\n     <div cla ss="modal- content gr aph-modal" >\n      < div class= "modal-hea der">\n         <h4 c lass="moda l-title" i d="graph-l abel" tabi ndex="0">G raph</h4>\ n      </d iv>\n       <div clas s="modal-b ody">\n       </div>\ n      <di v class="m odal-foote r center-b uttons">\n         <b utton type ="button"  class="btn  btn-prima ry" data-d ismiss="mo dal" aria- label="Clo se Graph W indow">Clo se</button >\n      < /div>\n     </div>\n   </div>\n< /div>\n'}, useData:!0 }),this.VP C.Template .assessmen tsGraphMis sing=Handl ebars.temp late({comp iler:[7,"> = 4.0.0"], main:funct ion(contai ner,depth0 ,helpers,p artials,da ta){return '<p class= "missing-r ecord cent er">No Mon thly Check -In record s found fo r this use r.</p>\n'} ,useData:! 0}),this.V PC.Templat e.assessme ntsGraphRe ports=Hand lebars.tem plate({com piler:[7," >= 4.0.0"] ,main:func tion(conta iner,depth 0,helpers, partials,d ata){var s tack1;retu rn'<div>\n   <button  type="butt on" class= "title-bac k-btn" onc lick="App_ Utils.Back Button();" ><img src= "img/icon- arrowBack. svg" alt=" Return to  Previous P age"/></bu tton>\n  < h2 id="con tent-title " tabindex ="0" class ="sm-phone -header mo dal-hide a ssessments -header mo nthly-asse ssment-gra ph-header" ><span>Mon thly Check -In Graph< /span></h2 >\n'+(null !=(stack1= container. invokePart ial(partia ls.provide rReportMen u,depth0,{ name:"prov iderReport Menu",data :data,inde nt:"  ",he lpers:help ers,partia ls:partial s,decorato rs:contain er.decorat ors}))?sta ck1:"")+'   <div id=" patientHea derSection " data-spy ="affix" d ata-offset -top="160" ></div>\n   <div id=" assessment s-graphs-r egion" cla ss="spinne r-backgrou nd"></div> \n</div>\n '},usePart ial:!0,use Data:!0}), this.VPC.T emplate.as sessmentsP honeEntrie s=Handleba rs.templat e({1:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var al ias1=conta iner.lambd a,alias2=c ontainer.e scapeExpre ssion;retu rn'             <li d ata-page=" '+alias2(a lias1(dept h0,depth0) )+'"><a hr ef="#">'+a lias2(alia s1(depth0, depth0))+" </a></li>\ n"},compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){var stac k1;return' <div id="t able-phone -view">\n     <div id ="monthly- data-regio n"></div>\ n    <div  class="com pleted-che ck-in-pagi nation">\n         <u l class="p agination" >\n             <li>\ n                 <a  href="#" c lass="prev ious-page"  aria-labe l="Previou s">\n                      <span  aria-hidd en="true"> &laquo;</s pan>\n                  </a>\n              </li>\n'+( null!=(sta ck1=helper s.each.cal l(null!=de pth0?depth 0:containe r.nullCont ext||{},nu ll!=depth0 ?depth0.pa ges:depth0 ,{name:"ea ch",hash:{ },fn:conta iner.progr am(1,data, 0),inverse :container .noop,data :data}))?s tack1:"")+ '             <li>\n                  <a hr ef="#" cla ss="next-p age" aria- label="Nex t">\n                      <span  aria-hidd en="true"> &raquo;</s pan>\n                  </a>\n              </li>\n         </ul> \n    </di v>\n</div> \n'},useDa ta:!0}),th is.VPC.Tem plate.asse ssmentsPho neEntry=Ha ndlebars.t emplate({c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){var  helper,al ias1=null! =depth0?de pth0:conta iner.nullC ontext||{} ,alias2=he lpers.help erMissing, alias3="fu nction",al ias4=conta
  19   iner.escap eExpressio n;return'< a href="#' +alias4((h elper=null !=(helper= helpers._i d||(null!= depth0?dep th0._id:de pth0))?hel per:alias2 ,typeof he lper===ali as3?helper .call(alia s1,{name:" _id",hash: {},data:da ta}):helpe r))+'" cla ss="progre ss-phone-l inks" aria -label="Mo nthly Chec k-In Entry  submitted  on '+alia s4((helper s.formatIS ODateStrin g||depth0& &depth0.fo rmatISODat eString||a lias2).cal l(alias1,n ull!=depth 0?depth0.d ateCreated :depth0,{n ame:"forma tISODateSt ring",hash :{},data:d ata}))+'.  Click for  more detai ls.">\n<di v class="p anel-body"  id="'+ali as4((helpe r=null!=(h elper=help ers._id||( null!=dept h0?depth0. _id:depth0 ))?helper: alias2,typ eof helper ===alias3? helper.cal l(alias1,{ name:"_id" ,hash:{},d ata:data}) :helper))+ '">\n    < div class= "row">\n         <div  class="co l-xs-6"><l abel for=" date-creat ed">Date S ubmitted</ label></di v>\n         <div cla ss="col-xs -6" id="da te-created ">'+alias4 ((helpers. shortDate| |depth0&&d epth0.shor tDate||ali as2).call( alias1,nul l!=depth0? depth0.dat eCreated:d epth0,{nam e:"shortDa te",hash:{ },data:dat a}))+'</di v>\n    </ div>\n     <div class ="row">\n         <di v class="c ol-xs-6">< label for= "pain-inte nsity">Pai n Intensit y</label>< /div>\n         <div  class="col -xs-6" id= "pain-inte nsity">'+a lias4((hel per=null!= (helper=he lpers.pain Intensity| |(null!=de pth0?depth 0.painInte nsity:dept h0))?helpe r:alias2,t ypeof help er===alias 3?helper.c all(alias1 ,{name:"pa inIntensit y",hash:{} ,data:data }):helper) )+' of 10< /div>\n     </div>\n     <img sr c="img/ico n-arrowFor ward.svg"  class="com pleted-che ck-in-phon e-arrow" a lt="" aria -hidden="t rue"/>\n     <div cla ss="row">\ n        < div class= "col-xs-6" ><label fo r="pain-in terference ">Pain Int erference< /label></d iv>\n         <div cl ass="col-x s-6" id="p ain-interf erence">'+ alias4((he lper=null! =(helper=h elpers.pai nInterfere nce||(null !=depth0?d epth0.pain Interferen ce:depth0) )?helper:a lias2,type of helper= ==alias3?h elper.call (alias1,{n ame:"painI nterferenc e",hash:{} ,data:data }):helper) )+' of 10< /div>\n     </div>\n     <div cl ass="row"> \n         <div class ="col-xs-6 "><label f or="sleep- quality">S leep Quali ty</label> </div>\n         <div  class="co l-xs-6" id ="sleep-qu ality">'+a lias4((hel per=null!= (helper=he lpers.slee pQuality|| (null!=dep th0?depth0 .sleepQual ity:depth0 ))?helper: alias2,typ eof helper ===alias3? helper.cal l(alias1,{ name:"slee pQuality", hash:{},da ta:data}): helper))+'  of 10</di v>\n    </ div>\n     <div class ="row">\n         <di v class="c ol-xs-6">< label for= "depressio n">Depress ion</label ></div>\n         <di v class="c ol-xs-6" i d="depress ion">'+ali as4((helpe r=null!=(h elper=help ers.depres sionScore| |(null!=de pth0?depth 0.depressi onScore:de pth0))?hel per:alias2 ,typeof he lper===ali as3?helper .call(alia s1,{name:" depression Score",has h:{},data: data}):hel per))+' of  6</div>\n     </div> \n    <div  class="ro w">\n         <div cl ass="col-x s-6"><labe l for="ove rall-statu s">Overall  Status</l abel>\n         </div >\n         <div clas s="col-xs- 6" id="ove rall-statu s">'+alias 4((helpers .overallSt atusText|| depth0&&de pth0.overa llStatusTe xt||alias2 ).call(ali as1,null!= depth0?dep th0.overal lStatus:de pth0,{name :"overallS tatusText" ,hash:{},d ata:data}) )+"</div>\ n    </div >\n</div>\ n</a>\n"}, useData:!0 }),this.VP C.Template .assessmen tsTabular= Handlebars .template( {1:functio n(containe r,depth0,h elpers,par tials,data ){var help er,alias1= null!=dept h0?depth0: container. nullContex t||{},alia s2=helpers .helperMis sing,alias 3=containe r.escapeEx pression;r eturn"       <tr>\n         <td> "+alias3(( helpers.fo rmatDate|| depth0&&de pth0.forma tDate||ali as2).call( alias1,nul l!=depth0? depth0.dat eCreated:d epth0,{nam e:"formatD ate",hash: {},data:da ta}))+"</t d>\n         <td>"+al ias3((help er=null!=( helper=hel pers.painI ntensity|| (null!=dep th0?depth0 .painInten sity:depth 0))?helper :alias2,"f unction"== typeof hel per?helper .call(alia s1,{name:" painIntens ity",hash: {},data:da ta}):helpe r))+" of 1 0</td>\n         <td> "+alias3(( helper=nul l!=(helper =helpers.p ainInterfe rence||(nu ll!=depth0 ?depth0.pa inInterfer ence:depth 0))?helper :alias2,"f unction"== typeof hel per?helper .call(alia s1,{name:" painInterf erence",ha sh:{},data :data}):he lper))+" o f 10</td>\ n        < td>"+alias 3((helper= null!=(hel per=helper s.sleepQua lity||(nul l!=depth0? depth0.sle epQuality: depth0))?h elper:alia s2,"functi on"==typeo f helper?h elper.call (alias1,{n ame:"sleep Quality",h ash:{},dat a:data}):h elper))+"  of 10</td> \n         <td>"+alia s3((helper =null!=(he lper=helpe rs.depress ionScore|| (null!=dep th0?depth0 .depressio nScore:dep th0))?help er:alias2, "function" ==typeof h elper?help er.call(al ias1,{name :"depressi onScore",h ash:{},dat a:data}):h elper))+"  of 6</td>\ n        < td>"+alias 3((helpers .overallSt atusText|| depth0&&de pth0.overa llStatusTe xt||alias2 ).call(ali as1,null!= depth0?dep th0.overal lStatus:de pth0,{name :"overallS tatusText" ,hash:{},d ata:data}) )+"</td>\n       </tr >\n"},3:fu nction(con tainer,dep th0,helper s,partials ,data){var  helper,al ias1=null! =depth0?de pth0:conta iner.nullC ontext||{} ,alias2=he lpers.help erMissing, alias3="fu nction",al ias4=conta iner.escap eExpressio n;return'   <div clas s="panel p anel-defau lt" id="'+ alias4((he lper=null! =(helper=h elpers.id| |(null!=de pth0?depth 0.id:depth 0))?helper :alias2,ty peof helpe r===alias3 ?helper.ca ll(alias1, {name:"id" ,hash:{},d
  20   ata:data}) :helper))+ '">\n    < div class= "panel-bod y">\n       <div clas s="row">\n         <d iv class=" col-xs-6"> <label for ="date-cre ated">Date  Submitted </label></ div>\n         <div c lass="col- xs-6" id=" date-creat ed">'+alia s4((helper s.formatDa te||depth0 &&depth0.f ormatDate| |alias2).c all(alias1 ,null!=dep th0?depth0 .dateCreat ed:depth0, {name:"for matDate",h ash:{},dat a:data}))+ '</div>\n       </div >\n      < div class= "row">\n         <div  class="co l-xs-6"><l abel for=" pain-inten sity">Pain  Intensity </label></ div>\n         <div c lass="col- xs-6" id=" pain-inten sity">'+al ias4((help er=null!=( helper=hel pers.painI ntensity|| (null!=dep th0?depth0 .painInten sity:depth 0))?helper :alias2,ty peof helpe r===alias3 ?helper.ca ll(alias1, {name:"pai nIntensity ",hash:{}, data:data} ):helper)) +' of 10</ div>\n       </div>\n       <div  class="ro w">\n         <div cl ass="col-x s-6"><labe l for="pai n-interfer ence">Pain  Interfere nce</label ></div>\n         <di v class="c ol-xs-6" i d="pain-in terference ">'+alias4 ((helper=n ull!=(help er=helpers .painInter ference||( null!=dept h0?depth0. painInterf erence:dep th0))?help er:alias2, typeof hel per===alia s3?helper. call(alias 1,{name:"p ainInterfe rence",has h:{},data: data}):hel per))+' of  10</div>\ n      </d iv>\n       <div clas s="row">\n         <d iv class=" col-xs-6"> <label for ="sleep-qu ality">Sle ep Quality </label></ div>\n         <div c lass="col- xs-6" id=" sleep-qual ity">'+ali as4((helpe r=null!=(h elper=help ers.sleepQ uality||(n ull!=depth 0?depth0.s leepQualit y:depth0)) ?helper:al ias2,typeo f helper== =alias3?he lper.call( alias1,{na me:"sleepQ uality",ha sh:{},data :data}):he lper))+' o f 10</div> \n      </ div>\n       <div cla ss="row">\ n        < div class= "col-xs-6" ><label fo r="depress ion-score" >Depressio n</label>< /div>\n         <div  class="col -xs-6" id= "depressio n-score">' +alias4((h elper=null !=(helper= helpers.de pressionSc ore||(null !=depth0?d epth0.depr essionScor e:depth0)) ?helper:al ias2,typeo f helper== =alias3?he lper.call( alias1,{na me:"depres sionScore" ,hash:{},d ata:data}) :helper))+ ' of 6</di v>\n       </div>\n       <div c lass="row" >\n         <div clas s="col-xs- 6"><label  for="overa llStatus"> Overall St atus</labe l></div>\n         <d iv class=" col-xs-6"  id="overal lStatus">' +alias4((h elpers.ove rallStatus Text||dept h0&&depth0 .overallSt atusText|| alias2).ca ll(alias1, null!=dept h0?depth0. overallSta tus:depth0 ,{name:"ov erallStatu sText",has h:{},data: data}))+"< /div>\n       </div>\ n    </div >\n  </div >\n"},comp iler:[7,"> = 4.0.0"], main:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var st ack1,alias 1=null!=de pth0?depth 0:containe r.nullCont ext||{};re turn'<h4 c lass="tabu lar-view"> Tabular Da ta View</h 4>\n<div c lass="cent er-buttons  view-grap h-data">\n   <a data- nav="next"  href="#"  class="btn  btn-secon dary graph -view back " role="bu tton">View  Graph Dat a</a>\n</d iv>\n<div  class="tab le-respons ive table- tabular-da ta-view" i d="table-t ablet-view ">\n  <tab le id="ass essments-e ntries-tab le" class= "table tab le-striped  table-bor dered" sum mary="List  of Monthl y Entries. ">\n    <t head>\n       <tr>\n         <th  scope="co l" data-so rt="dateCr eated">Dat e Submitte d<span cla ss="sr-onl y">Select  to sort</s pan><span  class="gly phicon gly phicon-che vron-down"  aria-hidd en="true"> </span></t h>\n         <th scop e="col" da ta-sort="p ainIntensi ty">Pain I ntensity<s pan class= "sr-only"> Select to  sort</span ><span cla ss="glyphi con glyphi con-chevro n-down" ar ia-hidden= "true"></s pan></th>\ n        < th scope=" col" data- sort="pain Interferen ce">Pain I nterferenc e<span cla ss="sr-onl y">Select  to sort</s pan><span  class="gly phicon gly phicon-che vron-down"  aria-hidd en="true"> </span></t h>\n         <th scop e="col" da ta-sort="s leepQualit y">Sleep Q uality<spa n class="s r-only">Se lect to so rt</span>< span class ="glyphico n glyphico n-chevron- down" aria -hidden="t rue"></spa n></th>\n         <th  scope="co l" data-so rt="depres sionScore" >Depressio n<span cla ss="sr-onl y">Select  to sort</s pan><span  class="gly phicon gly phicon-che vron-down"  aria-hidd en="true"> </span></t h>\n         <th scop e="col" da ta-sort="o verallStat us">Overal l Status<s pan class= "sr-only"> Select to  sort</span ><span cla ss="glyphi con glyphi con-chevro n-down" ar ia-hidden= "true"></s pan></th>\ n      </t r>\n    </ thead>\n     <tbody i d="assessm ents-entry ">\n'+(nul l!=(stack1 =helpers.e ach.call(a lias1,null !=depth0?d epth0.item s:depth0,{ name:"each ",hash:{}, fn:contain er.program (1,data,0) ,inverse:c ontainer.n oop,data:d ata}))?sta ck1:"")+'     </tbody >\n  </tab le>\n</div >\n\n<div  id="table- phone-view ">\n'+(nul l!=(stack1 =helpers.e ach.call(a lias1,null !=depth0?d epth0.item s:depth0,{ name:"each ",hash:{}, fn:contain er.program (3,data,0) ,inverse:c ontainer.n oop,data:d ata}))?sta ck1:"")+"< /div>\n"}, useData:!0 }),this.VP C.Template .footer=Ha ndlebars.t emplate({c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){var  stack1,al ias1=conta iner.lambd a,alias2=c ontainer.e scapeExpre ssion;retu rn'<span c lass="foot er-content ">'+alias2 (alias1(nu ll!=(stack 1=null!=(s tack1=null !=depth0?d epth0.app: depth0)?st ack1.about :stack1)?s tack1["dev eloped-by" ]:stack1,d epth0))+'< /span>\n<s pan class= "footer-co ntent">'+a lias2(alia s1(null!=( stack1=nul l!=(stack1 =null!=dep th0?depth0 .app:depth 0)?stack1. address:st ack1)?stac k1.street: stack1,dep
  21   th0))+", " +alias2(al ias1(null! =(stack1=n ull!=(stac k1=null!=d epth0?dept h0.app:dep th0)?stack 1.address: stack1)?st ack1.city: stack1,dep th0))+" "+ alias2(ali as1(null!= (stack1=nu ll!=(stack 1=null!=de pth0?depth 0.app:dept h0)?stack1 .address:s tack1)?sta ck1.state: stack1,dep th0))+" "+ alias2(ali as1(null!= (stack1=nu ll!=(stack 1=null!=de pth0?depth 0.app:dept h0)?stack1 .address:s tack1)?sta ck1.zipcod e:stack1,d epth0))+'< /span>\n<s pan class= "footer-co ntent">Las t reviewed /updated ' +alias2((h elpers.tri mAppDate|| depth0&&de pth0.trimA ppDate||he lpers.help erMissing) .call(null !=depth0?d epth0:cont ainer.null Context||{ },null!=(s tack1=null !=depth0?d epth0.app: depth0)?st ack1["last -update-da te"]:stack 1,{name:"t rimAppDate ",hash:{}, data:data} ))+'</span >\n<span c lass="foot er-content  footer-en d">App Ver sion: '+al ias2(alias 1(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. app:depth0 )?stack1.a bout:stack 1)?stack1[ "version-n umber-prov ider"]:sta ck1,depth0 ))+"</span >\n"},useD ata:!0}),t his.VPC.Te mplate.hea der=Handle bars.templ ate({1:fun ction(cont ainer,dept h0,helpers ,partials, data){var  stack1,hel per,alias1 =container .escapeExp ression
  22   ;return'          <a  href="#" i d="header- login-link " class="d ropdown-to ggle" data -toggle="d ropdown" a ria-haspop up="true"  aria-expan ded="false " role="bu tton" aria -controls= "userMenu" >\n             '+ali as1(contai ner.lambda (null!=(st ack1=null! =depth0?de pth0.mhpus er:depth0) ?stack1.di splayName: stack1,dep th0))+'<im g src="img /icon-user MenuDown.s vg" id="lo gin-off" a lt="" aria -hidden="t rue" /><im g src="img /icon-user MenuUp.svg " id="logi n-on" alt= "" aria-hi dden="true "/>\n         </a>\n         <ul  class="dr opdown-men u dropdown -menu-righ t" role="n avigation"  aria-labe l="User Su bmenu" id= "userMenu" >\n             \x3c! --<li><a h ref="'+ali as1((helpe r=null!=(h elper=help ers.launch pad||(null !=depth0?d epth0.laun chpad:dept h0))?helpe r:helpers. helperMiss ing,"funct ion"==type of helper? helper.cal l(null!=de pth0?depth 0:containe r.nullCont ext||{},{n ame:"launc hpad",hash :{},data:d ata}):help er))+'">Re turn to La unchpad</a ></li>--\x 3e\n             <li> <a href="j avascript: void(0);"  id="logout ">Log Out< /a></li>\n         </ ul>\n'},3: function(c ontainer,d epth0,help ers,partia ls,data){r eturn'         <a hre f="#" id=" nav-dropdo wn" class= "dropdown- toggle" da ta-toggle= "dropdown"  role="but ton"\n            ari a-controls ="tabletRe portsMenu"  aria-hasp opup="true " aria-exp anded="fal se">\n           Prog ress Repor ts\n           <img s rc="img/ic on-menuDow n.svg" id= "menu-off"  alt="" ar ia-hidden= "true"/>\n            <img src=" img/icon-m enuDownBla ck.svg" id ="menu-off 2" alt=""  aria-hidde n="true"/> \n           <img src ="img/icon -menuUp.sv g" id="men u-on" alt= "" aria-hi dden="true "/>\n         </a>\n         <ul  class="dr opdown-men u dropdown -menu-righ t" role="n avigation"  aria-labe l="Progres s Reports  Submenu" i d="tabletR eportsMenu ">\n           <li><a  href="#re portMonthl yCheckIn"> Completed  Monthly Ch eck-Ins</a ></li>\n           <l i><a href= "#assessme nts-graph" >Monthly C heck-In Gr aph</a></l i>\n           <li><a  href="#re portDailyP ainDiary"> Completed  Pain Diary  Entries</ a></li>\n           < li><a href ="#pain-di ary-graph" >Pain Diar y Graph</a ></li>\n         </ul >\n'},5:fu nction(con tainer,dep th0,helper s,partials ,data){ret urn'             <li> <a href="# reportMont hlyCheckIn ">Complete d Monthly  Check-Ins  <img src=" img/icon-a rrowForwar d.svg" alt ="" aria-h idden="tru e"/></a></ li>\n             <li ><a href=" #assessmen ts-graph"> Monthly Ch eck-In Gra ph <img sr c="img/ico n-arrowFor ward.svg"  alt="" ari a-hidden=" true"/></a ></li>\n              <li><a hre f="#report DailyPainD iary">Comp leted Pain  Diary Ent ries <img  src="img/i con-arrowF orward.svg " alt="" a ria-hidden ="true"/>< /a></li>\n              <li><a h ref="#pain -diary-gra ph">Pain D iary Graph  <img src= "img/icon- arrowForwa rd.svg" al t="" aria- hidden="tr ue"/></a>< /li>\n'},7 :function( container, depth0,hel pers,parti als,data){ var helper ,alias1=nu ll!=depth0 ?depth0:co ntainer.nu llContext| |{},alias2 =helpers.h elperMissi ng,alias4= container. escapeExpr ession;ret urn"                               <li>"+al ias4((help er=null!=( helper=hel pers["brow ser-name"] ||(null!=d epth0?dept h0["browse r-name"]:d epth0))?he lper:alias 2,"functio n"==typeof  helper?he lper.call( alias1,{na me:"browse r-name",ha sh:{},data :data}):he lper))+" " +alias4((h elper=null !=(helper= helpers["b rowser-ver sion"]||(n ull!=depth 0?depth0[" browser-ve rsion"]:de pth0))?hel per:alias2 ,"function "==typeof  helper?hel per.call(a lias1,{nam e:"browser -version", hash:{},da ta:data}): helper))+" </li>\n"}, compiler:[ 7,">= 4.0. 0"],main:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r stack1,a lias1=null !=depth0?d epth0:cont ainer.null Context||{ },alias2=c ontainer.l ambda,alia s3=contain er.escapeE xpression; return'\x3 c!-- VA He alth Title  Bar --\x3 e\n<div cl ass="va-ti tle-area"> \n    <img  src="img/ logo-vaHea lth.svg" i d="logo-va " alt="VA  Health" ti tle="VA He alth"/>\n     <div cl ass="dropd own" id="h eader-logi n">\n'+(nu ll!=(stack 1=helpers. if.call(al ias1,null! =depth0?de pth0.mhpus er:depth0, {name:"if" ,hash:{},f n:containe r.program( 1,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+'     </div>\n     <a cla ss="sr-onl y sr-only- focusable"  id="skipN av" href=" #content-t itle">Skip  to main c ontent</a> \n</div>\n \n\x3c!--  App Title  Bar --\x3e \n<div cla ss="app-ti tle-area"> \n    <h1  id="app-ti tle-h1"><i mg src="im g/appIcon- paincoach. svg" alt=" " aria-hid den="true" /> Pain Co ach</h1>\n     \x3c!- - Tablet &  Desktop N avigation  --\x3e\n     <nav cla ss="navbar " id="menu -list">\n         <a  href="#hom e" id="hom e">Home</a >\n'+(null !=(stack1= helpers.if .call(alia s1,null!=d epth0?dept h0.userSel ected:dept h0,{name:" if",hash:{ },fn:conta iner.progr am(3,data, 0),inverse :container .noop,data :data}))?s tack1:"")+ '        < a href="#"  id="about " role="bu tton" data -toggle="m odal" data -target="# about-moda l" aria-co ntrols="ab out-modal" >About</a> \n         <a href="# " id="help " role="bu tton" data -toggle="m odal" data -target="# help-modal " aria-con trols="hel p-modal">H elp</a>\n     </nav>\ n    \x3c! -- Phone H amburger M enu --\x3e \n    <nav  class="na vbar" id=" hamburger- list">\n         <a h ref="#" cl ass="dropd own-toggle " data-tog gle="dropd own" role= "button" a ria-label= "Menu" ari a-haspopup ="true" ar ia-expande d="false"  aria-contr ols="phone FeaturesMe nu" id="ph oneFeature sMenuLink" >\n             <img  src="img/b tn-hamburg er-off.svg
  23   " id="hamb urger-off"  alt="" ar ia-hidden= "true"/>\n              <img src ="img/btn- hamburger- on.svg" id ="hamburge r-on" alt= "" aria-hi dden="true "/>\n         </a>\n         <ul  class="dr opdown-men u dropdown -menu-righ t" role="n avigation"  id="phone FeaturesMe nu">\n             <l i><a href= "#home">Ho me <img sr c="img/ico n-arrowFor ward.svg"  alt="" ari a-hidden=" true"/></a ></li>\n'+ (null!=(st ack1=helpe rs.if.call (alias1,nu ll!=depth0 ?depth0.us erSelected :depth0,{n ame:"if",h ash:{},fn: container. program(5, data,0),in verse:cont ainer.noop ,data:data }))?stack1 :"")+'             <l i><a href= "#" role=" button" da ta-toggle= "modal" da ta-target= "#about-mo dal" aria- controls=" about-moda l">About < img src="i mg/icon-ar rowForward .svg" alt= "" aria-hi dden="true "/></a></l i>\n             <li  id="last"> <a href="# " role="bu tton" data -toggle="m odal" data -target="# help-modal " aria-con trols="hel p-modal">H elp <img s rc="img/ic on-arrowFo rward.svg"  alt="" ar ia-hidden= "true"/></ a></li>\n         </u l>\n    </ nav>\n</di v>\n\n\x3c !-- About  Modal --\x 3e\n<div c lass="moda l fade tex t-left" id ="about-mo dal" tabin dex="-1" r ole="dialo g" aria-la bel="About  this Appl ication" a ria-hidden ="true">\n     <div c lass="moda l-dialog"> \n         <div class ="modal-co ntent">\n              <div clas s="modal-h eader abou t-header"> \n                 <h 4 class="m odal-title  about-tit le" id="ab out-label"  tabindex= "0">About< /h4>\n             </ div>\n             <d iv class=" modal-body  about-bod y">\n                  <div clas s="row abo ut-row">\n                       <div class ="col-sm-4 "><label f or="about- app-name"> '+alias3(a lias2(null !=(stack1= null!=(sta ck1=null!= depth0?dep th0.app:de pth0)?stac k1.about:s tack1)?sta ck1["appli cation-nam e-title"]: stack1,dep th0))+'</l abel></div >\n                      <div cl ass="col-s m-8" id="a bout-app-n ame">'+ali as3(alias2 (null!=(st ack1=null! =(stack1=n ull!=depth 0?depth0.a pp:depth0) ?stack1.ab out:stack1 )?stack1[" applicatio n-name"]:s tack1,dept h0))+'</di v>\n                  </div>\n                  <div c lass="row  about-row" >\n                      <div cl ass="col-s m-4"><labe l for="abo ut-version ">'+alias3 (alias2(nu ll!=(stack 1=null!=(s tack1=null !=depth0?d epth0.app: depth0)?st ack1.about :stack1)?s tack1["ver sion-title "]:stack1, depth0))+' </label></ div>\n                      <div  class="co l-sm-8" id ="about-ve rsion">'+a lias3(alia s2(null!=( stack1=nul l!=(stack1 =null!=dep th0?depth0 .app:depth 0)?stack1. about:stac k1)?stack1 ["version- number-pro vider"]:st ack1,depth 0))+'</div >\n                 < /div>\n                  <div cl ass="row a bout-row"> \n                      <div cla ss="col-sm -4"><label  for="abou t-develope d">'+alias 3(alias2(n ull!=(stac k1=null!=( stack1=nul l!=depth0? depth0.app :depth0)?s tack1.abou t:stack1)? stack1["de veloped-by -title"]:s tack1,dept h0))+'</la bel></div> \n                      <div cla ss="col-sm -8" id="ab out-develo ped">'+ali as3(alias2 (null!=(st ack1=null! =(stack1=n ull!=depth 0?depth0.a pp:depth0) ?stack1.ab out:stack1 )?stack1[" developed- by"]:stack 1,depth0)) +'</div>\n                  </di v>\n                  <div class ="row abou t-row">\n                      < div class= "col-sm-4" ><label fo r="about-d ate">'+ali as3(alias2 (null!=(st ack1=null! =(stack1=n ull!=depth 0?depth0.a pp:depth0) ?stack1.ab out:stack1 )?stack1[" national-r elease-dat e-title"]: stack1,dep th0))+'</l abel></div >\n                      <div cl ass="col-s m-8" id="a bout-date" >'+alias3( alias2(nul l!=(stack1 =null!=(st ack1=null! =depth0?de pth0.app:d epth0)?sta ck1.about: stack1)?st ack1["nati onal-relea se-date"]: stack1,dep th0))+'</d iv>\n                  </div>\n                  <div  class="row  about-row " id="abou t-last">\n                       <div class ="col-sm-4 "><label f or="about- desc">'+al ias3(alias 2(null!=(s tack1=null !=(stack1= null!=dept h0?depth0. app:depth0 )?stack1.a bout:stack 1)?stack1[ "applicati on-descrip tion-title "]:stack1, depth0))+' </label></ div>\n                      <div  class="co l-sm-8" id ="about-de sc">'+alia s3(alias2( null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.ap p:depth0)? stack1.abo ut:stack1) ?stack1["a pplication -descripti on-provide r"]:stack1 ,depth0))+ '</div>\n                  </div >\n             </div >\n             <div  class="mod al-footer  about-foot er left-bu ttons">\n                  <butt on type="b utton" cla ss="btn bt n-primary"  data-dism iss="modal " aria-lab el="Close  About Wind ow">Close< /button>\n              </div>\n         </ div>\n     </div>\n</ div>\n\n\x 3c!-- Help  Modal --\ x3e\n<div  class="mod al fade te xt-left" i d="help-mo dal" tabin dex="-1" r ole="dialo g" aria-la bel="Appli cation Hel p" aria-hi dden="true ">\n    <d iv class=" modal-dial og">\n         <div c lass="moda l-content" >\n             <div  class="mod al-header  help-heade r">\n                  <h4 class ="modal-ti tle help-t itle" id=" help-label " tabindex ="0">Help< /h4>\n             </ div>\n             <d iv class=" modal-body  help-body ">\n                  <div class ="row help -row">\n                      <d iv class=" col-sm-4"> <label for ="help-bro wsers">'+( null!=(sta ck1=alias2 (null!=(st ack1=null! =(stack1=n ull!=(stac k1=null!=d epth0?dept h0.app:dep th0)?stack 1.help:sta ck1)?stack 1["browser s-supporte d"]:stack1 )?stack1.t itle:stack 1,depth0)) ?stack1:"" )+'</label ></div>\n                      < div class= "col-sm-8"  id="help- browsers">
  24   \n                          '+(n ull!=(stac k1=alias2( null!=(sta ck1=null!= (stack1=nu ll!=(stack 1=null!=de pth0?depth 0.app:dept h0)?stack1 .help:stac k1)?stack1 ["browsers -supported "]:stack1) ?stack1["c ontent-pro vider"]:st ack1,depth 0))?stack1 :"")+"\n                           <ul>\n"+ (null!=(st ack1=helpe rs.each.ca ll(alias1, null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.ap p:depth0)? stack1.hel p:stack1)? stack1["br owsers-sup ported-pro vider"]:st ack1,{name :"each",ha sh:{},fn:c ontainer.p rogram(7,d ata,0),inv erse:conta iner.noop, data:data} ))?stack1: "")+'                          < /ul>\n                      </di v>\n                  </div>\n                  <div c lass="row  help-row"> \n                      <div cla ss="col-sm -4"><label  for="help -desk">'+( null!=(sta ck1=alias2 (null!=(st ack1=null! =(stack1=n ull!=(stac k1=null!=d epth0?dept h0.app:dep th0)?stack 1.help:sta ck1)?stack 1["help-de sk-provide r"]:stack1 )?stack1.t itle:stack 1,depth0)) ?stack1:"" )+'</label ></div>\n                      < div class= "col-sm-8"  id="help- desk">'+(n ull!=(stac k1=alias2( null!=(sta ck1=null!= (stack1=nu ll!=(stack 1=null!=de pth0?depth 0.app:dept h0)?stack1 .help:stac k1)?stack1 ["help-des k-provider "]:stack1) ?stack1.co ntent:stac k1,depth0) )?stack1:" ")+'</div> \n                 </ div>\n                  <div cla ss="row he lp-row">\n                       <div class ="col-sm-4 "><label f or="help-e mergencies ">'+(null! =(stack1=a lias2(null !=(stack1= null!=(sta ck1=null!= (stack1=nu ll!=depth0 ?depth0.ap p:depth0)? stack1.hel p:stack1)? stack1["em ergencies- provider"] :stack1)?s tack1.titl e:stack1,d epth0))?st ack1:"")+' </label></ div>\n                      <div  class="co l-sm-8" id ="help-eme rgencies"> '+(null!=( stack1=ali as2(null!= (stack1=nu ll!=(stack 1=null!=(s tack1=null !=depth0?d epth0.app: depth0)?st ack1.help: stack1)?st ack1["emer gencies-pr ovider"]:s tack1)?sta ck1.conten t:stack1,d epth0))?st ack1:"")+' </div>\n                  </div> \n                 <d iv class=" row help-r ow">\n                      <div  class="co l-sm-4"><l abel for=" help-feedb ack">'+(nu ll!=(stack 1=alias2(n ull!=(stac k1=null!=( stack1=nul l!=(stack1 =null!=dep th0?depth0 .app:depth 0)?stack1. help:stack 1)?stack1[ "general-f eedback-pr ovider"]:s tack1)?sta ck1.title: stack1,dep th0))?stac k1:"")+'</ label></di v>\n                      <div c lass="col- sm-8" id=" help-feedb ack"><a hr ef="'+alia s3(alias2( null!=(sta ck1=null!= (stack1=nu ll!=(stack 1=null!=de pth0?depth 0.app:dept h0)?stack1 .help:stac k1)?stack1 ["general- feedback-p rovider"]: stack1)?st ack1.url:s tack1,dept h0))+'" ta rget="_bla nk">'+alia s3(alias2( null!=(sta ck1=null!= (stack1=nu ll!=(stack 1=null!=de pth0?depth 0.app:dept h0)?stack1 .help:stac k1)?stack1 ["general- feedback-p rovider"]: stack1)?st ack1.url:s tack1,dept h0))+'</a> </div>\n                  </div> \n             </div> \n             <div c lass="moda l-footer h elp-footer  left-butt ons">\n                  <button  type="but ton" class ="btn btn- primary" d ata-dismis s="modal"  aria-label ="Close He lp Window" >Close</bu tton>\n             < /div>\n         </div >\n    </d iv>\n</div >\n'},useD ata:!0}),t his.VPC.Te mplate.hom e=Handleba rs.templat e({compile r:[7,">= 4 .0.0"],mai n:function (container ,depth0,he lpers,part ials,data) {return'<d iv id="mai n-content" >  \x3c!--  div ID us ed to hide  everythin g within w hen search  modal dis plays usin g App_Util s.SetMainM odal() --\ x3e\n  <di v class="t itle"><h2  id="conten t-title" t abindex="0 ">Home</h2 ></div>\n\ n\n  <p id ="home-int ro-text" c lass="welc ome-msg">T o view a p atient\'s  progress r eports, pl ease searc h for a pa tient firs t. Once yo u have sel ected a pa tient, you  will be t aken to th e <strong> Progress R eports</st rong> page  where you  can selec t to view  the patien t\'s <stro ng>Complet ed Monthly  Check-Ins </strong>  or <strong >Completed  Pain Diar y Entries< /strong>.< /p>\n\n\n   <div id=" home-butto n-layout"> \n    <div  class="co l-sm-12">\ n        < div class= "home-butt on">\n             <a  href="#se archPatien t" role="b utton" cla ss="provid er_search"  aria-labe l="Search  for a pati ent" data- toggle="mo dal" data- target="#P roviderSea rch" aria- controls=" ProviderSe arch">\n                  <img s rc="img/ic on-search. svg" class ="home-but ton-icon"  id="icon-h ome-search " alt="" a ria-hidden ="true" /> \n                 <i mg src="im g/icon-arr owForward. svg" class ="home-but ton-arrow"  alt="" ar ia-hidden= "true"/>\n                  <h3> Search for  a Patient </h3>\n             < /a>\n         </div>\ n    </div >\n  </div >\n</div>\ n\n\x3c!--  Provider  Search Mod al --\x3e\ n<div clas s="modal f ade" id="P roviderSea rch" tabin dex="-1" r ole="dialo g" aria-la belledby=" providerSe archLabel"  aria-hidd en="true"> \n    <div  class="mo dal-dialog ">\n         <div cla ss="modal- content">\ n           <div clas s="row mod al-header  modal-head er-blue">\ n             <div cl ass="col-x s-8 modal- title" id= "providerS earchLabel " tabindex ="0">Patie nt Search< /div>\n     \t\t\t\t< div class= "col-xs-4  modal-clos e">\n             \t< button typ e="button"  data-dism iss="modal ">\n    \t \t\t\t     <span clas s="glyphic on glyphic on-remove- circle"></ span> Clos e\n             \t</b utton>\n     \t\t\t\t </div>\n           </ div>\n             <d iv class=" modal-body "></div>\x 3c!-- EOF  Modal-body --\x3e\n         </di v>\x3c!--  EOF Modal- content--\ x3e\n    < /div>\x3c! -- EOF Mod al-dialog- -\x3e\n</d
  25   iv>\n\n\x3 c!-- Patie nt Search  Details Mo dal --\x3e \n<div cla ss="modal  fade" id=" PatientSea rchDetails " tabindex ="-1" role ="dialog"  aria-label ledby="pat ientSearch DetailsLab el" aria-h idden="tru e">\n    < div class= "modal-dia log">\n         <div  class="mod al-content ">\n           <div c lass="row  modal-head er modal-h eader-blue ">\n             <div  class="co l-xs-8 mod al-title"  id="patien tSearchDet ailsLabel"  tabindex= "0">Patien t Search D etails</di v>\n    \t \t\t\t<div  class="co l-xs-4 mod al-close"> \n             \t<but ton class= "close-det ails" type ="button"  data-dismi ss="modal" >\x3c!-- d o not remo ve close-d etails cla ss --\x3e\ n    \t\t\ t\t    <sp an class=" glyphicon  glyphicon- remove-cir cle"></spa n> Close\n              \t</butt on>\n    \ t\t\t\t</d iv>\n           </div >\n             <div  class="mod al-body">< /div>\x3c! -- EOF Mod al-body--\ x3e\n         </div>\ x3c!-- EOF  Modal-con tent--\x3e \n    </di v>\x3c!--  EOF Modal- dialog--\x 3e\n</div> \n'},useDa ta:!0}),th is.VPC.Tem plate.pain DiaryEntry Missing=Ha ndlebars.t emplate({c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){ret urn'<div i d="patient HeaderSect ion" data- spy="affix " data-off set-top="1 60"></div> \n<div cla ss="table- responsive " id="tabl e-tablet-v iew">\n     <p class= "missing-r ecord cent er">No com pleted ass essment we re found.< /p>\n</div >'},useDat a:!0}),thi s.VPC.Temp late.painD iaryGraph= Handlebars .template( {compiler: [7,">= 4.0 .0"],main: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper, alias1=nul l!=depth0? depth0:con tainer.nul lContext|| {},alias2= helpers.he lperMissin g,alias3=c ontainer.e scapeExpre ssion;retu rn'<div id ="currentD ateError"  class=\'al ert alert- danger hid den\' role ="alert">\ n  <img sr c="img/ico n-alertRed .svg" alt= "Alert" ti tle="Alert " class="a lert-icon" />\n  <spa n tabindex ="0"><stro ng>Invalid  Start Dat e!</strong > Please e nter a val id date be tween 1/1/ 2000 and t oday\'s da te.</span> \n</div>\n <p>To begi n, enter a  start dat e to view  up to a mo nth range  of pain di ary entrie s and clic k the <str ong>Go</st rong> butt on</p>\n<d iv class=" date-scrol l-provider ">\n  <lab el for="cu rrent-date ">Start Da te:</label >\n  <a ta bindex="0"  class="ic on-info" r ole="butto n" aria-la bel="Start  Date info  button -  click for  more infor mation" da ta-toggle= "popover"  data-trigg er="focus"  data-plac ement="top " data-con tent="The  Pain Diary  Graph wil l display  details fo r entries  added in a  month\'s  span.  You  can updat e the date  range by  entering a  start dat e and clic king the G o button."  id="info- btn-activi ty">\n     <img src=" img/icon-i nfo.svg" c lass="pain -diary-inf o-icon" al t="" aria- hidden="tr ue"/>\n  < /a>\n  <in put type=" text" clas s="form-co ntrol inpu t-lg" id=" current-da te" name=" current-da te" value= "'+alias3( (helpers.f ormatISODa teString|| depth0&&de pth0.forma tISODateSt ring||alia s2).call(a lias1,null !=depth0?d epth0.curr entDate:de pth0,{name :"formatIS ODateStrin g",hash:{} ,data:data }))+'" dat a-link="'+ alias3((he lper=null! =(helper=h elpers.cur rentDate|| (null!=dep th0?depth0 .currentDa te:depth0) )?helper:a lias2,"fun ction"==ty peof helpe r?helper.c all(alias1 ,{name:"cu rrentDate" ,hash:{},d ata:data}) :helper))+ '" aria-la bel="Date  input fiel d">\n  <bu tton id="b tnCurrentD ateGo" cla ss="btn bt n-primary"  aria-labe l="Retriev e Daily Pa in Diary f or this da te">Go</bu tton>\n</d iv>\n\n'}, useData:!0 }),this.VP C.Template .painDiary GraphDetai ls=Handleb ars.templa te({compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){return'< div id="ta bRegion">\ n<div clas s="center  view-tabul ar-btn">\n   <a data- nav="next"  href="#"  class="btn  btn-defau lt tabular " role="bu tton">View  Tabular D ata</a>\n< /div>\n<di v id="grap h" class=" pain-diary -graph-dis play pain- diary-grap h-provider  container -fluid">\n   <canvas  id="pain-d iary-graph -canvas">< /canvas> \ x3c!--  Ne eded to fi x graph in  IE  --\x3 e\n</div>\ n<div clas s="clearfi x"></div>\ n  <div id ="dateErro rRegion" c lass=\'ale rt alert-d anger hidd en\' role= "alert">\n     <img s rc="img/ic on-alertRe d.svg" alt ="Alert" t itle="Aler t" class=" alert-icon "/>\n    < span tabin dex="0"><s trong>Inva lid Start  Date!</str ong> Pleas e enter a  valid date  between 1 /1/2000 an d today\'s  date.</sp an>\n  </d iv>\n<div  id="dateRe gion" clas s="center  date-scrol l-provider "></div>\n </div>\n'} ,useData:! 0}),this.V PC.Templat e.painDiar yGraphDeta ilsDate=Ha ndlebars.t emplate({c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){ret urn'  <lab el for="tx tGraphDate ">Enter St art Date t o View Mon th Range:< /label>\n   <a tabind ex="0" cla ss="icon-i nfo" role= "button" a ria-label= "Start Dat e info but ton - clic k for more  informati on" data-t oggle="pop over" data -trigger=" focus" dat a-placemen t="top" da ta-content ="The Pain  Diary Gra ph will di splay deta ils for en tries adde d in a mon th\'s span .  You can  update th e date ran ge by ente ring a sta rt date an d clicking  the Go bu tton." id= "info-btn- activity"> \n      <i mg src="im g/icon-inf o.svg" cla ss="pain-d iary-info- icon" alt= "" aria-hi dden="true "/>\n  </a >\n  <inpu t  id="txt GraphDate"  type="tex t" class=" form-contr ol input-l g" name="t xtGraphDat e" value=" '+containe r.escapeEx pression(( helpers.fo rmatISODat eString||d epth0&&dep th0.format ISODateStr ing||helpe rs.helperM issing).ca
  26   ll(null!=d epth0?dept h0:contain er.nullCon text||{},n ull!=depth 0?depth0.c urrentDate :depth0,{n ame:"forma tISODateSt ring",hash :{},data:d ata}))+'"> \n  <butto n id="btnG raphDateGo " class="b tn btn-pri mary" aria -label="Re trieve wee k of this  date">Go</ button>\n' },useData: !0}),this. VPC.Templa te.painDia ryGraphDet ailsTab=Ha ndlebars.t emplate({1 :function( container, depth0,hel pers,parti als,data){ var stack1 ;return nu ll!=(stack 1=(helpers .ifCond||d epth0&&dep th0.ifCond ||helpers. helperMiss ing).call( null!=dept h0?depth0: container. nullContex t||{},data &&data.ind ex,"<",10, {name:"ifC ond",hash: {},fn:cont ainer.prog ram(2,data ,0),invers e:containe r.noop,dat a:data}))? stack1:""} ,2:functio n(containe r,depth0,h elpers,par tials,data ){var help er;return' \n      <t h scope="c ol">'+cont ainer.esca peExpressi on((helper =null!=(he lper=helpe rs.reportD ate||(null !=depth0?d epth0.repo rtDate:dep th0))?help er:helpers .helperMis sing,"func tion"==typ eof helper ?helper.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},{ name:"repo rtDate",ha sh:{},data :data}):he lper))+"</ th>\n"},4: function(c ontainer,d epth0,help ers,partia ls,data){v ar stack1; return nul l!=(stack1 =(helpers. ifCond||de pth0&&dept h0.ifCond| |helpers.h elperMissi ng).call(n ull!=depth 0?depth0:c ontainer.n ullContext ||{},data& &data.inde x,"<",10,{ name:"ifCo nd",hash:{ },fn:conta iner.progr am(5,data, 0),inverse :container .noop,data :data}))?s tack1:""}, 5:function (container ,depth0,he lpers,part ials,data) {var helpe r,alias1=n ull!=depth 0?depth0:c ontainer.n ullContext ||{},alias 2=helpers. helperMiss ing,alias4 =container .escapeExp ression;re turn"\n       <td>"+a lias4((hel per=null!= (helper=he lpers.scor e||(null!= depth0?dep th0.score: depth0))?h elper:alia s2,"functi on"==typeo f helper?h elper.call (alias1,{n ame:"score ",hash:{}, data:data} ):helper)) +" of "+al ias4((help er=null!=( helper=hel pers.maxSc ore||(null !=depth0?d epth0.maxS core:depth 0))?helper :alias2,"f unction"== typeof hel per?helper .call(alia s1,{name:" maxScore", hash:{},da ta:data}): helper))+" </td>\n"}, 7:function (container ,depth0,he lpers,part ials,data) {var stack 1;return(n ull!=(stac k1=(helper s.ifCond|| depth0&&de pth0.ifCon d||helpers .helperMis sing).call (null!=dep th0?depth0 :container .nullConte xt||{},dat a&&data.in dex,">=",1 0,{name:"i fCond",has h:{},fn:co ntainer.pr ogram(8,da ta,0),inve rse:contai ner.noop,d ata:data}) )?stack1:" ")+"\n"},8 :function( container, depth0,hel pers,parti als,data){ var stack1 ;return"\n "+(null!=( stack1=(he lpers.ifCo nd||depth0 &&depth0.i fCond||hel pers.helpe rMissing). call(null! =depth0?de pth0:conta iner.nullC ontext||{} ,data&&dat a.index,"< ",20,{name :"ifCond", hash:{},fn :container .program(9 ,data,0),i nverse:con tainer.noo p,data:dat a}))?stack 1:"")+" "} ,9:functio n(containe r,depth0,h elpers,par tials,data ){var help er;return'       <th  scope="col ">'+contai ner.escape Expression ((helper=n ull!=(help er=helpers .reportDat e||(null!= depth0?dep th0.report Date:depth 0))?helper :helpers.h elperMissi ng,"functi on"==typeo f helper?h elper.call (null!=dep th0?depth0 :container .nullConte xt||{},{na me:"report Date",hash :{},data:d ata}):help er))+"</th >\n      " },11:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var st ack1;retur n(null!=(s tack1=(hel pers.ifCon d||depth0& &depth0.if Cond||help ers.helper Missing).c all(null!= depth0?dep th0:contai ner.nullCo ntext||{}, data&&data .index,">= ",10,{name :"ifCond", hash:{},fn :container .program(1 2,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+"\n "},12:func tion(conta iner,depth 0,helpers, partials,d ata){var s tack1;retu rn"\n"+(nu ll!=(stack 1=(helpers .ifCond||d epth0&&dep th0.ifCond ||helpers. helperMiss ing).call( null!=dept h0?depth0: container. nullContex t||{},data &&data.ind ex,"<",20, {name:"ifC ond",hash: {},fn:cont ainer.prog ram(13,dat a,0),inver se:contain er.noop,da ta:data})) ?stack1:"" )+" "},13: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper, alias1=nul l!=depth0? depth0:con tainer.nul lContext|| {},alias2= helpers.he lperMissin g,alias4=c ontainer.e scapeExpre ssion;retu rn"      < td>"+alias 4((helper= null!=(hel per=helper s.score||( null!=dept h0?depth0. score:dept h0))?helpe r:alias2," function"= =typeof he lper?helpe r.call(ali as1,{name: "score",ha sh:{},data :data}):he lper))+" o f "+alias4 ((helper=n ull!=(help er=helpers .maxScore| |(null!=de pth0?depth 0.maxScore :depth0))? helper:ali as2,"funct ion"==type of helper? helper.cal l(alias1,{ name:"maxS core",hash :{},data:d ata}):help er))+"</td >\n      " },15:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var st ack1;retur n(null!=(s tack1=(hel pers.ifCon d||depth0& &depth0.if Cond||help ers.helper Missing).c all(null!= depth0?dep th0:contai ner.nullCo ntext||{}, data&&data .index,">= ",20,{name :"ifCond", hash:{},fn :container .program(1 6,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+"\n "},16:func tion(conta iner,depth 0,helpers, partials,d ata){var s tack1;retu rn"\n"+(nu ll!=(stack 1=(helpers .ifCond||d epth0&&dep th0.ifCond ||helpers. helperMiss ing).call( null!=dept h0?depth0: container. nullContex t||{},data &&data.ind ex,"<",31, {name:"ifC ond",hash: {},fn:cont ainer.prog ram(9,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +" "},18:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r stack1;r eturn(null !=(stack1= (helpers.i fCond||dep th0&&depth 0.ifCond|| helpers.he lperMissin g).call(nu ll!=depth0 ?depth0:co ntainer.nu llContext| |{},data&& data.index
  27   ,">=",20,{ name:"ifCo nd",hash:{ },fn:conta iner.progr am(19,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +"\n"},19: function(c ontainer,d epth0,help ers,partia ls,data){v ar stack1; return"\n" +(null!=(s tack1=(hel pers.ifCon d||depth0& &depth0.if Cond||help ers.helper Missing).c all(null!= depth0?dep th0:contai ner.nullCo ntext||{}, data&&data .index,"<" ,31,{name: "ifCond",h ash:{},fn: container. program(13 ,data,0),i nverse:con tainer.noo p,data:dat a}))?stack 1:"")+" "} ,21:functi on(contain er,depth0, helpers,pa rtials,dat a){var hel per,alias1 =null!=dep th0?depth0 :container .nullConte xt||{},ali as2=helper s.helperMi ssing,alia s4=contain er.escapeE xpression; return'     <tr>\n       <th sco pe="row">' +alias4((h elper=null !=(helper= helpers.re portDate|| (null!=dep th0?depth0 .reportDat e:depth0)) ?helper:al ias2,"func tion"==typ eof helper ?helper.ca ll(alias1, {name:"rep ortDate",h ash:{},dat a:data}):h elper))+"< /th>\n       <td>"+al ias4((help er=null!=( helper=hel pers.score ||(null!=d epth0?dept h0.score:d epth0))?he lper:alias 2,"functio n"==typeof  helper?he lper.call( alias1,{na me:"score" ,hash:{},d ata:data}) :helper))+ " of "+ali as4((helpe r=null!=(h elper=help ers.maxSco re||(null! =depth0?de pth0.maxSc ore:depth0 ))?helper: alias2,"fu nction"==t ypeof help er?helper. call(alias 1,{name:"m axScore",h ash:{},dat a:data}):h elper))+"< /td>\n     </tr>\n"}, compiler:[ 7,">= 4.0. 0"],main:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r stack1,h elper,alia s1=null!=d epth0?dept h0:contain er.nullCon text||{};r eturn'\x3c !--<div id ="painDair yTabularVi ewTitle">\ n<h4>Tabul ar Data Vi ew</h4> </ div>\n<div  id="conte nt-categor y">\n Pain  Rating\n< /div> --\x 3e\n<div c lass="tabl e-responsi ve pain-di ary-tabula r-view-tab let" id="t able-table t-view">\n   <h4 clas s="tabular -view '+co ntainer.es capeExpres sion((help er=null!=( helper=hel pers.hidde n||(null!= depth0?dep th0.hidden :depth0))? helper:hel pers.helpe rMissing," function"= =typeof he lper?helpe r.call(ali as1,{name: "hidden",h ash:{},dat a:data}):h elper))+'" >Tabular D ata View</ h4>\n  <di v class="c enter-butt ons view-g raph-data" >\n    <a  class="btn  btn-secon dary graph icalView"  role="butt on">View G raph Data< /a>\n  </d iv>\n\n  < table id=" painDiaryE ntryTable"  class="ta ble table- bordered"  summary="L ist of Pai n Diary En tries">\n     <thead> \n    <tr> \n      '+ (null!=(st ack1=helpe rs.each.ca ll(alias1, null!=dept h0?depth0. items:dept h0,{name:" each",hash :{},fn:con tainer.pro gram(1,dat a,0),inver se:contain er.noop,da ta:data})) ?stack1:"" )+"    </t r>\n    </ thead>\n     <tbody>\ n    <tr>\ n      "+( null!=(sta ck1=helper s.each.cal l(alias1,n ull!=depth 0?depth0.i tems:depth 0,{name:"e ach",hash: {},fn:cont ainer.prog ram(4,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +'    </tr >\n    </t body>\n\n   </table>\ n  <table  id="painDi aryEntryTa ble1" clas s="table t able-borde red" summa ry="List o f Pain Dia ry Entries ">\n    <t head>\n\n     <tr>\n       '+(nu ll!=(stack 1=helpers. each.call( alias1,nul l!=depth0? depth0.ite ms:depth0, {name:"eac h",hash:{} ,fn:contai ner.progra m(7,data,0 ),inverse: container. noop,data: data}))?st ack1:"")+"     </tr>\ n    </the ad>\n    < tbody>\n     <tr>\n       "+(nul l!=(stack1 =helpers.e ach.call(a lias1,null !=depth0?d epth0.item s:depth0,{ name:"each ",hash:{}, fn:contain er.program (11,data,0 ),inverse: container. noop,data: data}))?st ack1:"")+'     </tr>\ n    </tbo dy>\n\n  < /table>\n   <table id ="painDiar yEntryTabl e2" class= "table tab le-bordere d" summary ="List of  Pain Diary  Entries"> \n    <the ad>\n    < tr>\n       '+(null!= (stack1=he lpers.each .call(alia s1,null!=d epth0?dept h0.items:d epth0,{nam e:"each",h ash:{},fn: container. program(15 ,data,0),i nverse:con tainer.noo p,data:dat a}))?stack 1:"")+"     </tr>\n     </thead> \n    <tbo dy>\n    < tr>\n       "+(null!= (stack1=he lpers.each .call(alia s1,null!=d epth0?dept h0.items:d epth0,{nam e:"each",h ash:{},fn: container. program(18 ,data,0),i nverse:con tainer.noo p,data:dat a}))?stack 1:"")+'     </tr>\n     </tbody> \n\n  </ta ble>\n\n</ div>\n\n<d iv class=" pain-diary -tabular-v iew-phone"  id="table -phone-vie w">\n  <di v class="c enter-butt ons view-g raph-data" >\n    <a  class="btn  btn-secon dary graph icalView"  role="butt on">View G raph Data< /a>\n  </d iv>\n  <ta ble id="pa inDiaryEnt ryTablePho ne" class= "table tab le-bordere d" summary ="List of  Pain Diary  Entries"> \n'+(null! =(stack1=h elpers.eac h.call(ali as1,null!= depth0?dep th0.items: depth0,{na me:"each", hash:{},fn :container .program(2 1,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+"   </table>\n </div>\n"} ,useData:! 0}),this.V PC.Templat e.painDiar yGraphHead er=Handleb ars.templa te({compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){return'< div id="co ntent-titl e-bar">\n     <button  type="but ton" class ="title-ba ck-btn"><i mg src="im g/icon-arr owBack.svg " alt="Ret urn to Pre vious Page "/></butto n>\n    <h 2 id="cont ent-title"  tabindex= "0" class= "sm-phone- header">Pa in Diary G raph</h2>\ n</div>'}, useData:!0 }),this.VP C.Template .painDiary GraphMissi ng=Handleb ars.templa te({compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){return'< p class="m issing-rec ord center ">No asses sments fou nd.</p>'}, useData:!0 }),this.VP C.Template .painDiary GraphRepor ts=Handleb ars.templa te({compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data
  28   ){var stac k1;return' <div>\n  < div id="he ader-regio n"></div>\ n'+(null!= (stack1=co ntainer.in vokePartia l(partials .providerR eportMenu, depth0,{na me:"provid erReportMe nu",data:d ata,indent :"  ",help ers:helper s,partials :partials, decorators :container .decorator s}))?stack 1:"")+'  < div id="pa tientHeade rSection"  data-spy=" affix" dat a-offset-t op="160">< /div>\n  < h4 class=" tabular-vi ew hidden" >Tabular D ata View</ h4>\n  <di v id="pain -diary-gra ph-content ">\n    <d iv id="pai n-diary-gr aphs-regio n" class=" spinner-ba ckground"> </div>\n     <div id= "pain-diar y-row"></d iv>\n  </d iv>\n</div >\n'},useP artial:!0, useData:!0 }),this.VP C.Template .painDiary GraphRow=H andlebars. template({ 1:function (container ,depth0,he lpers,part ials,data) {var helpe r;return c ontainer.e scapeExpre ssion((hel per=null!= (helper=he lpers.pain Rating||(n ull!=depth 0?depth0.p ainRating: depth0))?h elper:help ers.helper Missing,"f unction"== typeof hel per?helper .call(null !=depth0?d epth0:cont ainer.null Context||{ },{name:"p ainRating" ,hash:{},d ata:data}) :helper))} ,3:functio n(containe r,depth0,h elpers,par tials,data ){return"0 "},5:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var he lper;retur n containe r.escapeEx pression(( helper=nul l!=(helper =helpers.m ovementImp act||(null !=depth0?d epth0.move mentImpact :depth0))? helper:hel pers.helpe rMissing,
  29   "function" ==typeof h elper?help er.call(nu ll!=depth0 ?depth0:co ntainer.nu llContext| |{},{name: "movementI mpact",has h:{},data: data}):hel per))},7:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r helper;r eturn cont ainer.esca peExpressi on((helper =null!=(he lper=helpe rs.activit yInterfere nce||(null !=depth0?d epth0.acti vityInterf erence:dep th0))?help er:helpers .helperMis sing,"func tion"==typ eof helper ?helper.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},{ name:"acti vityInterf erence",ha sh:{},data :data}):he lper))},9: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper; return con tainer.esc apeExpress ion((helpe r=null!=(h elper=help ers.moodEf fect||(nul l!=depth0? depth0.moo dEffect:de pth0))?hel per:helper s.helperMi ssing,"fun ction"==ty peof helpe r?helper.c all(null!= depth0?dep th0:contai ner.nullCo ntext||{}, {name:"moo dEffect",h ash:{},dat a:data}):h elper))},1 1:function (container ,depth0,he lpers,part ials,data) {var helpe r;return c ontainer.e scapeExpre ssion((hel per=null!= (helper=he lpers.depr essionLeve l||(null!= depth0?dep th0.depres sionLevel: depth0))?h elper:help ers.helper Missing,"f unction"== typeof hel per?helper .call(null !=depth0?d epth0:cont ainer.null Context||{ },{name:"d epressionL evel",hash :{},data:d ata}):help er))},13:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r helper;r eturn cont ainer.esca peExpressi on((helper =null!=(he lper=helpe rs.sleepOu tcome||(nu ll!=depth0 ?depth0.sl eepOutcome :depth0))? helper:hel pers.helpe rMissing," function"= =typeof he lper?helpe r.call(nul l!=depth0? depth0:con tainer.nul lContext|| {},{name:" sleepOutco me",hash:{ },data:dat a}):helper ))},compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){var stac k1,alias1= null!=dept h0?depth0: container. nullContex t||{};retu rn'<p>Sele ct a categ ory to see  a graph o f the dail y diary en tries.</p> <br/>\n<di v class="h ome-button -layout">\ n    <div  class="hom e-button p ain-diary- graph-butt on-prov">\ n        < a href="#"  role="but ton" class ="graph-ca tegory-lin k-prov gra ph-details " data-id= "pain-rati ng">\n             <i mg src="im g/icon-met er.svg" cl ass="home- button-ico n" id="ico n-progress -pain-rati ng-prov"   alt="" ari a-hidden=" true"/>\n              <img src= "img/icon- arrowForwa rd.svg" cl ass="home- button-arr ow" alt=""  aria-hidd en="true"/ >\n             <h3>P ain Rating  <span cla ss="averag e"><span c lass="aver age-label" >Monthly A verage:</s pan> <stro ng>'+(null !=(stack1= helpers.if .call(alia s1,null!=d epth0?dept h0.painRat ing:depth0 ,{name:"if ",hash:{}, fn:contain er.program (1,data,0) ,inverse:c ontainer.p rogram(3,d ata,0),dat a:data}))? stack1:"") +'</strong > of 10</s pan></h3>\ n        < /a>\n    < /div>\n     <div clas s="home-bu tton pain- diary-grap h-button-p rov">\n         <a hr ef="#" rol e="button"  class="gr aph-catego ry-link-pr ov graph-d etails" da ta-id="enj oyment-int erference" >\n             <img  src="img/i con-sun.sv g" class=" home-butto n-icon" id ="icon-pro gress-enjo yment-prov "  alt=""  aria-hidde n="true"/> \n             <img s rc="img/ic on-arrowFo rward.svg"  class="ho me-button- arrow" alt ="" aria-h idden="tru e"/>\n             <h 3>Enjoymen t Interfer ence <span  class="av erage"><sp an class=" average-la bel">Month ly Average :</span> < strong>'+( null!=(sta ck1=helper s.if.call( alias1,nul l!=depth0? depth0.mov ementImpac t:depth0,{ name:"if", hash:{},fn :container .program(5 ,data,0),i nverse:con tainer.pro gram(3,dat a,0),data: data}))?st ack1:"")+' </strong>  of 10</spa n></h3>\n         </a >\n    </d iv>\n    < div class= "home-butt on pain-di ary-graph- button-pro v">\n         <a href ="#" role= "button" c lass="grap h-category -link-prov  graph-det ails" data -id="gener al-activit y-interfer ence">\n              <img src=" img/icon-r unningMan2 .svg" clas s="home-bu tton-icon"  id="icon- progress-a ctivity-in terference -prov"  al t="" aria- hidden="tr ue"/>\n             < img src="i mg/icon-ar rowForward .svg" clas s="home-bu tton-arrow " alt="" a ria-hidden ="true"/>\ n             <h3>Gen eral Activ ity Interf erence <sp an class=" average">< span class ="average- label">Mon thly Avera ge:</span>  <strong>' +(null!=(s tack1=help ers.if.cal l(alias1,n ull!=depth 0?depth0.a ctivityInt erference: depth0,{na me:"if",ha sh:{},fn:c ontainer.p rogram(7,d ata,0),inv erse:conta iner.progr am(3,data, 0),data:da ta}))?stac k1:"")+'</ strong> of  10</span> </h3>\n         </a>\ n    </div >\n    <di v class="h ome-button  pain-diar y-graph-bu tton-prov" >\n         <a href=" #" role="b utton" cla ss="graph- category-l ink-prov g raph-detai ls" data-i d="mood-in terference ">\n             <img  src="img/ icon-neutr alFace.svg " class="h ome-button -icon" id= "icon-prog ress-mood- effect-pro v"  alt=""  aria-hidd en="true"/ >\n             <img  src="img/i con-arrowF orward.svg " class="h ome-button -arrow" al t="" aria- hidden="tr ue"/>\n             < h3>Mood In terference  <span cla ss="averag e"><span c lass="aver age-label" >Monthly A verage:</s pan> <stro ng>'+(null !=(stack1= helpers.if .call(alia s1,null!=d epth0?dept h0.moodEff ect:depth0 ,{name:"if ",hash:{}, fn:contain er.program (9,data,0) ,inverse:c ontainer.p rogram(3,d ata,0),dat a:data}))? stack1:"") +'</strong > of 10</s pan></h3>\ n        < /a>\n    < /div>\n     <div clas s="home-bu tton pain- diary-grap h-button-p rov">\n         <a hr ef="#" rol e="button"  class="gr aph-catego ry-link-pr ov graph-d etails" da ta-id="dep ression-le vel">\n             <
  30   img src="i mg/icon-sa dFaceBlue. svg" class ="home-but ton-icon"  id="icon-p rogress-de pression-l evel-prov"   alt="" a ria-hidden ="true"/>\ n             <img sr c="img/ico n-arrowFor ward.svg"  class="hom e-button-a rrow" alt= "" aria-hi dden="true "/>\n             <h3 >Depressio n Level <s pan class= "average"> <span clas s="average -label">Mo nthly Aver age:</span > <strong> '+(null!=( stack1=hel pers.if.ca ll(alias1, null!=dept h0?depth0. depression Level:dept h0,{name:" if",hash:{ },fn:conta iner.progr am(11,data ,0),invers e:containe r.program( 3,data,0), data:data} ))?stack1: "")+'</str ong> of 10 </span></h 3>\n         </a>\n     </div>\n     <div c lass="home -button pa in-diary-g raph-butto n-prov">\n         <a  href="#"  role="butt on" class= "graph-cat egory-link -prov grap h-details"  data-id=" sleep-qual ity">\n             < img src="i mg/icon-be d.svg" cla ss="home-b utton-icon " id="icon -progress- sleep-outc ome-prov"   alt="" ar ia-hidden= "true"/>\n              <img src ="img/icon -arrowForw ard.svg" c lass="home -button-ar row" alt=" " aria-hid den="true" />\n             <h3> Sleep Qual ity <span  class="ave rage"><spa n class="a verage-lab el">Monthl y Average: </span> <s trong>'+(n ull!=(stac k1=helpers .if.call(a lias1,null !=depth0?d epth0.slee pOutcome:d epth0,{nam e:"if",has h:{},fn:co ntainer.pr ogram(13,d ata,0),inv erse:conta iner.progr am(3,data, 0),data:da ta}))?stac k1:"")+"</ strong> of  10</span> </h3>\n         </a>\ n    </div >\n</div>\ n"},useDat a:!0}),thi s.VPC.Temp late.painD iaryGraphS ubHeader=H andlebars. template({ compiler:[ 7,">= 4.0. 0"],main:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r helper;r eturn'<div  id="conte nt-title-b ar">\n     <button ty pe="button " class="t itle-back- btn"><img  src="img/i con-arrowB ack.svg" a lt="Return  to Previo us Page"/> </button>\ n    <h2 i d="content -title" ta bindex="0"  class="sm -phone-hea der text-c apitalize" >'+contain er.escapeE xpression( (helper=nu ll!=(helpe r=helpers. category|| (null!=dep th0?depth0 .category: depth0))?h elper:help ers.helper Missing,"f unction"== typeof hel per?helper .call(null !=depth0?d epth0:cont ainer.null Context||{ },{name:"c ategory",h ash:{},dat a:data}):h elper))+"< /h2>\n</di v>"},useDa ta:!0}),th is.VPC.Tem plate.pain DiaryGraph TableMissi ng=Handleb ars.templa te({compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){return'< p class="m issing-rec ord center ">No entry  was found  for this  date range .</p>\n'}, useData:!0 }),this.VP C.Template .painDiary PhoneEntry Missing=Ha ndlebars.t emplate({c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){ret urn'<div i d="table-p hone-view" >\n    <p  class="mis sing-recor d center"> No complet ed assessm ents were  found.</p> \n</div>'} ,useData:! 0}),this.V PC.Templat e.patientH eader=Hand lebars.tem plate({com piler:[7," >= 4.0.0"] ,main:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper,alia s1=null!=d epth0?dept h0:contain er.nullCon text||{},a lias2=help ers.helper Missing,al ias4=conta iner.escap eExpressio n;return'< div class= "row selec ted-patien t">\n    < div class= "col-sm-3" >\n         Veteran:\ n        < span>'+ali as4((helpe r=null!=(h elper=help ers.displa yName||(nu ll!=depth0 ?depth0.di splayName: depth0))?h elper:alia s2,"functi on"==typeo f helper?h elper.call (alias1,{n ame:"displ ayName",ha sh:{},data :data}):he lper))+'</ span>\n     </div>\n     <div cl ass="col-s m-3">\n         SSN:\ n        < span>'+ali as4((helpe r=null!=(h elper=help ers.ssn||( null!=dept h0?depth0. ssn:depth0 ))?helper: alias2,"fu nction"==t ypeof help er?helper. call(alias 1,{name:"s sn",hash:{ },data:dat a}):helper ))+'</span >\n    </d iv>\n    < div class= "col-sm-4" >\n         Date of B irth:\n         <span >'+alias4( (helpers.s hortDate|| depth0&&de pth0.short Date||alia s2).call(a lias1,null !=depth0?d epth0.date OfBirth:de pth0,{name :"shortDat e",hash:{} ,data:data }))+" ("+a lias4((hel per=null!= (helper=he lpers.age| |(null!=de pth0?depth 0.age:dept h0))?helpe r:alias2," function"= =typeof he lper?helpe r.call(ali as1,{name: "age",hash :{},data:d ata}):help er))+')</s pan>\n     </div>\n     <div cla ss="col-sm -2">\n         Gender :\n         <span>'+a lias4((hel per=null!= (helper=he lpers.gend er||(null! =depth0?de pth0.gende r:depth0)) ?helper:al ias2,"func tion"==typ eof helper ?helper.ca ll(alias1, {name:"gen der",hash: {},data:da ta}):helpe r))+"</spa n>\n    </ div>\n</di v>\n"},use Data:!0}), this.VPC.T emplate.pr ogressRepo rts=Handle bars.templ ate({compi ler:[7,">=  4.0.0"],m ain:functi on(contain er,depth0, helpers,pa rtials,dat a){return' <a href="# home" clas s="title-b ack-btn" r ole="butto n" aria-la bel="Retur n to Home" ><img src= "img/icon- arrowBack. svg" alt=" " aria-hid den="true" /></a>\n<h 2 id="cont ent-title"  tabindex= "0">Progre ss Reports </h2>\n\n< div id="pa tientHeade rSection"  data-spy=" affix" dat a-offset-t op="160">< /div>\n\n< div id="ho me-button- layout">\n   <div cla ss="col-sm -12">\n     <div clas s="home-bu tton">\n       <a hre f="#report MonthlyChe ckIn" role ="button"> \n\t\t\t\t <img src=" img/icon-c ompletedMo nth.svg" c lass="home -button-ic on" id="ic on-report- complete-m onthly-pro v"  alt=""  aria-hidd en="true"/ >\n\t\t\t\ t<img src= "img/icon- arrowForwa rd.svg" cl ass="home- button-arr ow" alt=""  aria-hidd en="true"/ >\n           <h3>Com pleted Mon thly Check -Ins</h3>\ n           <div clas s="tablet- text">See  an overvie w of the M onthly Che ck-In scor es for eac h assessme
  31   nt domain. </div>\n       </a>\n       <a t abindex="0 " class="i con-info p hone-text"  role="but ton" data- toggle="po pover" dat a-trigger= "focus" da ta-placeme nt="top" d ata-conten t="See an  overview o f the Mont hly Check- In scores  for each a ssessment  domain." i d="info-bt n-report-c omplete-mo nthly-prov " aria-lab el="Comple ted Monthl y Check-In s info but ton - clic k for more  informati on">\n         <img s rc="img/ic on-info.sv g" alt=""  aria-hidde n="true"/> \n      </ a>\n    </ div>\n  </ div>\n  <d iv class=" col-sm-12" >\n    <di v class="h ome-button ">\n       <a href="# assessment s-graph" r ole="butto n">\n\t\t\ t\t<img sr c="img/ico n-monthlyG raph.svg"  class="hom e-button-i con" id="i con-report -graph-mon thly-prov"   alt="" a ria-hidden ="true"/>\ n\t\t\t\t< img src="i mg/icon-ar rowForward .svg" clas s="home-bu tton-arrow " alt="" a ria-hidden ="true"/>\ n        < h3>Monthly  Check-In  Graph</h3> \n         <div class ="tablet-t ext">See M onthly Che ck-In scor es over ti me with gr aphs.</div >\n      < /a>\n       <a tabind ex="0" cla ss="icon-i nfo phone- text" role ="button"  data-toggl e="popover " data-tri gger="focu s" data-pl acement="t op" data-c ontent="Se e Monthly  Check-In s cores over  time with  graphs."  id="info-b tn-graph-m onthly-pro v" aria-la bel="Month ly Check-I n graph in fo button  - click fo r more inf ormation"> \n         <img src=" img/icon-i nfo.svg" a lt="" aria -hidden="t rue"/>\n       </a>\n     </div> \n  </div> \n  <div c lass="col- sm-12">\n     <div cl ass="home- button">\n       <a h ref="#repo rtDailyPai nDiary" ro le="button ">\n\t\t\t \t<img src ="img/icon -completed Diary.svg"  class="ho me-button- icon" id=" icon-repor t-complete -diary-pro v"  alt=""  aria-hidd en="true"/ >\n\t\t\t\ t<img src= "img/icon- arrowForwa rd.svg" cl ass="home- button-arr ow" alt=""  aria-hidd en="true"/ >\n         <h3>Compl eted Pain  Diary Entr ies</h3>\n         <d iv class=" tablet-tex t">See the  completed  the pain  diary entr ies.</div> \n      </ a>\n       <a tabinde x="0" clas s="icon-in fo phone-t ext" role= "button" d ata-toggle ="popover"  data-trig ger="focus " data-pla cement="to p" data-co ntent="See  the compl eted the p ain diary  entries."  id="info-b tn-report- complete-d iary-prov"  aria-labe l="Complet ed pain di ary entrie s info but ton - clic k for more  informati on">\n         <img s rc="img/ic on-info.sv g" alt=""  aria-hidde n="true"/> \n      </ a>\n    </ div>\n  </ div>\n  <d iv class=" col-sm-12" >\n    <di v class="h ome-button ">\n       <a href="# pain-diary -graph" ro le="button ">\n\t\t\t \t<img src ="img/icon -diaryGrap h.svg" cla ss="home-b utton-icon " id="icon -graph-dia ry-prov"   alt="" ari a-hidden=" true"/>\n\ t\t\t\t<im g src="img /icon-arro wForward.s vg" class= "home-butt on-arrow"  alt="" ari a-hidden=" true"/>\n         <h3 >Pain Diar y Graph</h 3>\n         <div cla ss="tablet -text">See  Pain Diar y Entries  over time  with graph s.</div>\n       </a> \n      <a  tabindex= "0" class= "icon-info  phone-tex t" role="b utton" dat a-toggle=" popover" d ata-trigge r="focus"  data-place ment="top"  data-cont ent="See P ain Diary  Entries ov er time wi th graphs. " id="info -btn-graph -diary-pro v" aria-la bel="Pain  diary grap h info but ton - clic k for more  informati on">\n         <img s rc="img/ic on-info.sv g" alt=""  aria-hidde n="true"/> \n      </ a>\n    </ div>\n  </ div>\n\n</ div>\n'},u seData:!0} ),this.VPC .Template. provider_s earch=Hand lebars.tem plate({com piler:[7," >= 4.0.0"] ,main:func tion(conta iner,depth 0,helpers, partials,d ata){retur n'<form cl ass="patie nt_search" >\n    <h4 ><label fo r="patient Name">Pati ent</label ></h4>\n     <a role= "button" d ata-toggle ="popover"  data-plac ement="aut o" data-tr igger="foc us"\n        tabindex ="0" class ="icon-inf o" data-ht ml="true"\ n       da ta-content ="<strong> Search by: </strong>< br/>\n                     Last  name only< br/>\n                     Last  name, Firs t name<br/ >\n                     Last nam e, First n ame, Middl e name<br/ >\n                     Last ini tial and l ast four o f SSN (e.g ., J0008)< br/>\n                     Full  SSN"\n        aria-la bel="Patie nt Search  tips" id=" patientSea rchToolTip ">\n         <img src ="img/icon -info.svg"  alt="info "/></a>\n         <in put type=" text" name ="patientN ame" id="p atientName " class="f orm-contro l" placeho lder="Sear ch Patient  By Name o r SSN"/>\n </form>\n< div class= "search_pa tients_con tainer">\n     <ul cl ass="searc h_patients "></ul>\n< /div>\n'}, useData:!0 }),this.VP C.Template .provider_ search_det ails=Handl ebars.temp late({1:fu nction(con tainer,dep th0,helper s,partials ,data){var  helper;re turn conta iner.escap eExpressio n((helper= null!=(hel per=helper s.dateOfBi rth||(null !=depth0?d epth0.date OfBirth:de pth0))?hel per:helper s.helperMi ssing,"fun ction"==ty peof helpe r?helper.c all(null!= depth0?dep th0:contai ner.nullCo ntext||{}, {name:"dat eOfBirth", hash:{},da ta:data}): helper))}, 3:function (container ,depth0,he lpers,part ials,data) {return"N/ A"},5:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn contain er.escapeE xpression( (helper=nu ll!=(helpe r=helpers. age||(null !=depth0?d epth0.age: depth0))?h elper:help ers.helper Missing,"f unction"== typeof hel per?helper .call(null !=depth0?d epth0:cont ainer.null Context||{ },{name:"a ge",hash:{ },data:dat a}):helper ))},7:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn contain er.escapeE xpression( (helper=nu ll!=(helpe r=helpers.
  32   gender||(n ull!=depth 0?depth0.g ender:dept h0))?helpe r:helpers. helperMiss ing,"funct ion"==type of helper? helper.cal l(null!=de pth0?depth 0:containe r.nullCont ext||{},{n ame:"gende r",hash:{} ,data:data }):helper) )},9:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var he lper;retur n containe r.escapeEx pression(( helper=nul l!=(helper =helpers.s sn||(null! =depth0?de pth0.ssn:d epth0))?he lper:helpe rs.helperM issing,"fu nction"==t ypeof help er?helper. call(null! =depth0?de pth0:conta iner.nullC ontext||{} ,{name:"ss n",hash:{} ,data:data }):helper) )},11:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn contain er.escapeE xpression( (helper=nu ll!=(helpe r=helpers. locationIE N||(null!= depth0?dep th0.locati onIEN:dept h0))?helpe r:helpers. helperMiss ing,"funct ion"==type of helper? helper.cal l(null!=de pth0?depth 0:containe r.nullCont ext||{},{n ame:"locat ionIEN",ha sh:{},data :data}):he lper))},co mpiler:[7, ">= 4.0.0" ],main:fun ction(cont ainer,dept h0,helpers ,partials, data){var  stack1,hel per,alias1 =null!=dep th0?depth0 :container .nullConte xt||{};ret urn"<h5>"+ container. escapeExpr ession((he lper=null! =(helper=h elpers.dis playName|| (null!=dep th0?depth0 .displayNa me:depth0) )?helper:h elpers.hel perMissing ,"function "==typeof  helper?hel per.call(a lias1,{nam e:"display Name",hash :{},data:d ata}):help er))+'</h5 >\n<div>\n     <label  class="jv -label">DO B: </label >\n    <sp an>'+(null !=(stack1= helpers.if .call(alia s1,null!=d epth0?dept h0.dateOfB irth:depth 0,{name:"i f",hash:{} ,fn:contai ner.progra m(1,data,0 ),inverse: container. program(3, data,0),da ta:data})) ?stack1:"" )+'</span> \n</div>\n <div>\n     <label cl ass="jv-la bel">Age:  </label>\n     <span> '+(null!=( stack1=hel pers.if.ca ll(alias1, null!=dept h0?depth0. age:depth0 ,{name:"if ",hash:{}, fn:contain er.program (5,data,0) ,inverse:c ontainer.p rogram(3,d ata,0),dat a:data}))? stack1:"") +'</span>\ n</div>\n< div>\n     <label cla ss="jv-lab el">Gender : </label> \n    <spa n>'+(null! =(stack1=h elpers.if. call(alias 1,null!=de pth0?depth 0.gender:d epth0,{nam e:"if",has h:{},fn:co ntainer.pr ogram(7,da ta,0),inve rse:contai ner.progra m(3,data,0 ),data:dat a}))?stack 1:"")+'</s pan>\n</di v>\n<div>\ n    <labe l class="j v-label">S SN: </labe l>\n    <s pan>'+(nul l!=(stack1 =helpers.i f.call(ali as1,null!= depth0?dep th0.ssn:de pth0,{name :"if",hash :{},fn:con tainer.pro gram(9,dat a,0),inver se:contain er.program (3,data,0) ,data:data }))?stack1 :"")+'</sp an>\n</div >\n<div>\n     <label  class="jv -label">Lo cation: </ label>\n     <span>'+ (null!=(st ack1=helpe rs.if.call (alias1,nu ll!=depth0 ?depth0.lo cationIEN: depth0,{na me:"if",ha sh:{},fn:c ontainer.p rogram(11, data,0),in verse:cont ainer.prog ram(3,data ,0),data:d ata}))?sta ck1:"")+'< /span>\n</ div>\n<div  class="ce nter-butto ns">\n     <button ty pe="button " class="b tn btn-sec ondary btn -lg select _patient"> Select Pat ient</butt on>\n</div >\n'},useD ata:!0}),t his.VPC.Te mplate.pro vider_sear ch_nopatie nt=Handleb ars.templa te({compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){return"N o patients  found"},u seData:!0} ),this.VPC .Template. provider_s earch_pati ent=Handle bars.templ ate({compi ler:[7,">=  4.0.0"],m ain:functi on(contain er,depth0, helpers,pa rtials,dat a){var hel per,alias1 =null!=dep th0?depth0 :container .nullConte xt||{},ali as2=helper s.helperMi ssing,alia s4=contain er.escapeE xpression; return'<a  href="#" r ole="butto n" aria-la bel="Get D etails for  '+alias4( (helper=nu ll!=(helpe r=helpers. displayNam e||(null!= depth0?dep th0.displa yName:dept h0))?helpe r:alias2," function"= =typeof he lper?helpe r.call(ali as1,{name: "displayNa me",hash:{ },data:dat a}):helper ))+'" data -toggle="m odal" data -target="# PatientSea rchDetails " aria-con trols="Pat ientSearch Details">\ n    '+ali as4((helpe r=null!=(h elper=help ers.displa yName||(nu ll!=depth0 ?depth0.di splayName: depth0))?h elper:alia s2,"functi on"==typeo f helper?h elper.call (alias1,{n ame:"displ ayName",ha sh:{},data :data}):he lper))+"\n </a>"},use Data:!0}), this.VPC.T emplate.re portDailyP ainDiary=H andlebars. template({ compiler:[ 7,">= 4.0. 0"],main:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r stack1;r eturn'<div >\n   \x3c !-- <a hre f="#progre ssReports"  class="ti tle-back-b tn" role=" button" ar ia-label=" Return to  Progress"> <img src=" img/icon-a rrowBack.s vg" alt=""  aria-hidd en="true"/ ></a> --\x 3e\n    <b utton type ="button"  class="tit le-back-bt n" onclick ="App_Util s.BackButt on();"><im g src="img /icon-arro wBack.svg"  alt="Retu rn to Prev ious Page" /></button >\n    <h2  id="conte nt-title"  tabindex=" 0" class=" sm-phone-h eader asse ssments-he ader"><spa n>Complete d Pain Dia ry Entries </span></h 2>\n'+(nul l!=(stack1 =container .invokePar tial(parti als.provid erReportMe nu,depth0, {name:"pro viderRepor tMenu",dat a:data,ind ent:"    " ,helpers:h elpers,par tials:part ials,decor ators:cont ainer.deco rators}))? stack1:"") +'    <div  id="patie ntHeaderSe ction" dat a-spy="aff ix" data-o ffset-top= "160"></di v>\n     < div id="pa in-diary-c ontent">\n       <p i d="intro-t ext-tablet -diary">Fo r more inf ormation o n the entr y, click o n the corr esponding  table row. </p>\n       <p id="i ntro-text- phone-diar y">For mor e informat ion, click  on the en try.</p>\n       <div  id="pain- diary-regi on" class= "spinner-b ackground" ></div>\n       <div  id="pain-d iary-phone -region">< /div>\n     </div>\n< /div>\n'}, usePartial :!0,useDat a:!0}),thi
  33   s.VPC.Temp late.repor tDailyPain DiaryGraph =Handlebar s.template ({compiler :[7,">= 4. 0.0"],main :function( container, depth0,hel pers,parti als,data){ var stack1 ;return'<b utton type ="button"  class="tit le-back-bt n" onclick ="App_Util s.BackButt on();"><im g src="img /icon-arro wBack.svg"  alt="Retu rn to Prev ious Page" /></button >\n<h2 id= "content-t itle" tabi ndex="0">P ain Diary  Graph</h2> \n'+(null! =(stack1=c ontainer.i nvokeParti al(partial s.provider ReportMenu ,depth0,{n ame:"provi derReportM enu",data: data,helpe rs:helpers ,partials: partials,d ecorators: container. decorators }))?stack1 :"")+'\n<d iv id="gra ph-content ">\n</div> \n'},usePa rtial:!0,u seData:!0} ),this.VPC .Template. reportMont hlyCheckIn =Handlebar s.template ({compiler :[7,">= 4. 0.0"],main :function( container, depth0,hel pers,parti als,data){ var stack1 ;return'<b utton type ="button"  class="tit le-back-bt n" onclick ="App_Util s.BackButt on();"><im g src="img /icon-arro wBack.svg"  alt="Retu rn to Prev ious Page" /></button >\n<h2 id= "content-t itle" tabi ndex="0">C ompleted M onthly Che ck-Ins</h2 >\n'+(null !=(stack1= container. invokePart ial(partia ls.provide rReportMen u,depth0,{ name:"prov iderReport Menu",data :data,help ers:helper s,partials :partials, decorators :container .decorator s}))?stack 1:"")},use Partial:!0 ,useData:! 0}),this.V PC.Templat e.reportMo nthlyGraph =Handlebar s.template ({compiler :[7,">= 4. 0.0"],main :function( container, depth0,hel pers,parti als,data){ var stack1 ;return'<a  href="#pr ogressRepo rts" class ="title-ba ck-btn" ro le="button " aria-lab el="Return  to Progre ss"><img s rc="img/ic on-arrowBa ck.svg" al t="" aria- hidden="tr ue"/></a>\ n<h2 id="c ontent-tit le" tabind ex="0">Mon thly Check -In Graph< /h2>\n'+(n ull!=(stac k1=contain er.invokeP artial(par tials.prov iderReport Menu,depth 0,{name:"p roviderRep ortMenu",d ata:data,h elpers:hel pers,parti als:partia ls,decorat ors:contai ner.decora tors}))?st ack1:"")+' <div id="g raph-conte nt">\n</di v>\n'},use Partial:!0 ,useData:! 0}),this.V PC.Templat e.reportPa inDiaryDet ails=Handl ebars.temp late({1:fu nction(con tainer,dep th0,helper s,partials ,data){var  stack1;re turn'         <tr>\n              <td class ="left-col ">Tools Us ed</td>\n              <td>\n'+( null!=(sta ck1=helper s.each.cal l(null!=de pth0?depth 0:containe r.nullCont ext||{},nu ll!=depth0 ?depth0.to olsUsed:de pth0,{name :"each",ha sh:{},fn:c ontainer.p rogram(2,d ata,0),inv erse:conta iner.noop, data:data} ))?stack1: "")+"             </t d>\n         </tr>\n" },2:functi on(contain er,depth0, helpers,pa rtials,dat a){var ali as1=contai ner.lambda ,alias2=co ntainer.es capeExpres sion;retur n"                 "+ alias2(ali as1(null!= depth0?dep th0.toolNa me:depth0, depth0))+" \n                 (T ool Rating : "+alias2 (alias1(nu ll!=depth0 ?depth0.to olRating:d epth0,dept h0))+")\n                  <br/> <br/>\n"}, 4:function (container ,depth0,he lpers,part ials,data) {var stack 1,alias1=n ull!=depth 0?depth0:c ontainer.n ullContext ||{};retur n'<tr><td  class="lef t-col">Add itional Tr eatments U sed</td><t d>'+contai ner.escape Expression ((helpers. commaSpace r||depth0& &depth0.co mmaSpacer| |helpers.h elperMissi ng).call(a lias1,null !=depth0?d epth0.trea tmentsUsed :depth0,{n ame:"comma Spacer",ha sh:{},data :data}))+( null!=(sta ck1=helper s.if.call( alias1,nul l!=depth0? depth0.tre atmentsUse dOther:dep th0,{name: "if",hash: {},fn:cont ainer.prog ram(5,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +"</td></t r>"},5:fun ction(cont ainer,dept h0,helpers ,partials, data){var  helper;ret urn" - "+c ontainer.e scapeExpre ssion((hel per=null!= (helper=he lpers.trea tmentsUsed Other||(nu ll!=depth0 ?depth0.tr eatmentsUs edOther:de pth0))?hel per:helper s.helperMi ssing,"fun ction"==ty peof helpe r?helper.c all(null!= depth0?dep th0:contai ner.nullCo ntext||{}, {name:"tre atmentsUse dOther",ha sh:{},data :data}):he lper))},7: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper; return'<tr ><td class ="left-col ">Enjoymen t Interfer ence</td>< td>'+conta iner.escap eExpressio n((helper= null!=(hel per=helper s.movement Impact||(n ull!=depth 0?depth0.m ovementImp act:depth0 ))?helper: helpers.he lperMissin g,"functio n"==typeof  helper?he lper.call( null!=dept h0?depth0: container. nullContex t||{},{nam e:"movemen tImpact",h ash:{},dat a:data}):h elper))+"  of 10</td> </tr>"},9: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper; return'<tr ><td class ="left-col ">General  Activity I nterferenc e</td><td> '+containe r.escapeEx pression(( helper=nul l!=(helper =helpers.a ctivityInt erference| |(null!=de pth0?depth 0.activity Interferen ce:depth0) )?helper:h elpers.hel perMissing ,"function "==typeof  helper?hel per.call(n ull!=depth 0?depth0:c ontainer.n ullContext ||{},{name :"activity Interferen ce",hash:{ },data:dat a}):helper ))+" of 10 </td></tr> "},11:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn'<tr><td  class="le ft-col">Mo od Interfe rence</td> <td class= "left-col" >'+contain er.escapeE xpression( (helper=nu ll!=(helpe r=helpers. moodEffect ||(null!=d epth0?dept h0.moodEff ect:depth0 ))?helper: helpers.he lperMissin g,"functio n"==typeof  helper?he lper.call( null!=dept h0?depth0: container. nullContex t||{},{nam e:"moodEff ect",hash: {},data:da ta}):helpe r))+" of 1 0</td></tr >"},13:fun ction(cont ainer,dept h0,helpers ,partials, data){var  helper;ret urn'<tr><t d class="l eft-col">D epression  Level</td> <td>'+cont ainer.esca peExpressi on((helper =null!=(he lper=helpe rs.depress
  34   ionLevel|| (null!=dep th0?depth0 .depressio nLevel:dep th0))?help er:helpers .helperMis sing,"func tion"==typ eof helper ?helper.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},{ name:"depr essionLeve l",hash:{} ,data:data }):helper) )+" of 10< /td></tr>" },15:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var he lper;retur n'<tr><td  class="lef t-col">Sle ep Quality </td><td>' +container .escapeExp ression((h elper=null !=(helper= helpers.sl eepOutcome ||(null!=d epth0?dept h0.sleepOu tcome:dept h0))?helpe r:helpers. helperMiss ing,"funct ion"==type of helper? helper.cal l(null!=de pth0?depth 0:containe r.nullCont ext||{},{n ame:"sleep Outcome",h ash:{},dat a:data}):h elper))+"  of 10</td> </tr>"},17 :function( container, depth0,hel pers,parti als,data){ var helper ;return'<t r><td clas s="left-co l">Comment s</td><td> '+containe r.escapeEx pression(( helper=nul l!=(helper =helpers.c omment||(n ull!=depth 0?depth0.c omment:dep th0))?help er:helpers .helperMis sing,"func tion"==typ eof helper ?helper.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},{ name:"comm ent",hash: {},data:da ta}):helpe r))+"</td> </tr>"},19 :function( container, depth0,hel pers,parti als,data){ var stack1 ,alias1=nu ll!=depth0 ?depth0:co ntainer.nu llContext| |{};return '<tr><td c lass="left -col">Symp toms</td>< td>'+conta iner.escap eExpressio n((helpers .commaSpac er||depth0 &&depth0.c ommaSpacer ||helpers. helperMiss ing).call( alias1,nul l!=depth0? depth0.pai nSymptoms: depth0,{na me:"commaS pacer",has h:{},data: data}))+(n ull!=(stac k1=helpers .if.call(a lias1,null !=depth0?d epth0.pain SymptomsOt her:depth0 ,{name:"if ",hash:{}, fn:contain er.program (20,data,0 ),inverse: container. noop,data: data}))?st ack1:"")+" </td></tr> "},20:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn" - "+co ntainer.es capeExpres sion((help er=null!=( helper=hel pers.painS ymptomsOth er||(null! =depth0?de pth0.painS ymptomsOth er:depth0) )?helper:h elpers.hel perMissing ,"function "==typeof  helper?hel per.call(n ull!=depth 0?depth0:c ontainer.n ullContext ||{},{name :"painSymp tomsOther" ,hash:{},d ata:data}) :helper))} ,22:functi on(contain er,depth0, helpers,pa rtials,dat a){var hel per;return '<tr><td c lass="left -col">Wors ened By</t d><td>'+co ntainer.es capeExpres sion((help er=null!=( helper=hel pers.worse nedBy||(nu ll!=depth0 ?depth0.wo rsenedBy:d epth0))?he lper:helpe rs.helperM issing,"fu nction"==t ypeof help er?helper. call(null! =depth0?de pth0:conta iner.nullC ontext||{} ,{name:"wo rsenedBy", hash:{},da ta:data}): helper))+" </td></tr> "},24:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn'<tr><td  class="le ft-col">Im proved By< /td><td>'+ container. escapeExpr ession((he lper=null! =(helper=h elpers.imp rovedBy||( null!=dept h0?depth0. improvedBy :depth0))? helper:hel pers.helpe rMissing," function"= =typeof he lper?helpe r.call(nul l!=depth0? depth0:con tainer.nul lContext|| {},{name:" improvedBy ",hash:{}, data:data} ):helper)) +"</td></t r>"},26:fu nction(con tainer,dep th0,helper s,partials ,data){var  stack1;re turn"         <tr>\n              <td>Tools  Used\n"+( null!=(sta ck1=helper s.each.cal l(null!=de pth0?depth 0:containe r.nullCont ext||{},nu ll!=depth0 ?depth0.to olsUsed:de pth0,{name :"each",ha sh:{},fn:c ontainer.p rogram(27, data,0),in verse:cont ainer.noop ,data:data }))?stack1 :"")+"             </ td>\n         </tr>\n "},27:func tion(conta iner,depth 0,helpers, partials,d ata){var a lias1=cont ainer.lamb da,alias2= container. escapeExpr ession;ret urn"                  <br/><br/> \n                 "+ alias2(ali as1(null!= depth0?dep th0.toolNa me:depth0, depth0))+" \n                 (T ool Rating : "+alias2 (alias1(nu ll!=depth0 ?depth0.to olRating:d epth0,dept h0))+")\n" },29:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var st ack1,alias 1=null!=de pth0?depth 0:containe r.nullCont ext||{};re turn"<tr>< td>Additio nal Treatm ents Used< br/><br/>" +container .escapeExp ression((h elpers.com maSpacer|| depth0&&de pth0.comma Spacer||he lpers.help erMissing) .call(alia s1,null!=d epth0?dept h0.treatme ntsUsed:de pth0,{name :"commaSpa cer",hash: {},data:da ta}))+(nul l!=(stack1 =helpers.i f.call(ali as1,null!= depth0?dep th0.treatm entsUsedOt her:depth0 ,{name:"if ",hash:{}, fn:contain er.program (30,data,0 ),inverse: container. noop,data: data}))?st ack1:"")+" </td></tr> "},30:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn"<br/><b r/>"+conta iner.escap eExpressio n((helper= null!=(hel per=helper s.treatmen tsUsedOthe r||(null!= depth0?dep th0.treatm entsUsedOt her:depth0 ))?helper: helpers.he lperMissin g,"functio n"==typeof  helper?he lper.call( null!=dept h0?depth0: container. nullContex t||{},{nam e:"treatme ntsUsedOth er",hash:{ },data:dat a}):helper ))},32:fun ction(cont ainer,dept h0,helpers ,partials, data){var  helper;ret urn"<tr><t d>Enjoymen t Interfer ence<br/>< br/>"+cont ainer.esca peExpressi on((helper =null!=(he lper=helpe rs.movemen tImpact||( null!=dept h0?depth0. movementIm pact:depth 0))?helper :helpers.h elperMissi ng,"functi on"==typeo f helper?h elper.call (null!=dep th0?depth0 :container .nullConte xt||{},{na me:"moveme ntImpact", hash:{},da ta:data}): helper))+"  of 10</td ></tr>"},3 4:function (container ,depth0,he lpers,part ials,data) {var helpe r;return"< tr><td>Gen eral Activ ity Interf erence<br/ ><br/>"+co ntainer.es capeExpres sion((help er=null!=( helper=hel pers.activ ityInterfe rence||(nu ll!=depth0 ?depth0.ac tivityInte rference:d epth0))?he lper:helpe rs.helperM issing,"fu nction"==t
  35   ypeof help er?helper. call(null! =depth0?de pth0:conta iner.nullC ontext||{} ,{name:"ac tivityInte rference", hash:{},da ta:data}): helper))+"  of 10</td ></tr>"},3 6:function (container ,depth0,he lpers,part ials,data) {var helpe r;return"< tr><td>Moo d Interfer ence<br/>< br/>"+cont ainer.esca peExpressi on((helper =null!=(he lper=helpe rs.moodEff ect||(null !=depth0?d epth0.mood Effect:dep th0))?help er:helpers .helperMis sing,"func tion"==typ eof helper ?helper.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},{ name:"mood Effect",ha sh:{},data :data}):he lper))+" o f 10</td>< /tr>"},38: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper; return"<tr ><td>Depre ssion Leve l<br/><br/ >"+contain er.escapeE xpression( (helper=nu ll!=(helpe r=helpers. depression Level||(nu ll!=depth0 ?depth0.de pressionLe vel:depth0 ))?helper: helpers.he lperMissin g,"functio n"==typeof  helper?he lper.call( null!=dept h0?depth0: container. nullContex t||{},{nam e:"depress ionLevel", hash:{},da ta:data}): helper))+"  of 10</td ></tr>"},4 0:function (container ,depth0,he lpers,part ials,data) {var helpe r;return"< tr><td>Sle ep Quality <br/><br/> "+containe r.escapeEx pression(( helper=nul l!=(helper =helpers.s leepOutcom e||(null!= depth0?dep th0.sleepO utcome:dep th0))?help er:helpers .helperMis sing,
  36   "function" ==typeof h elper?help er.call(nu ll!=depth0 ?depth0:co ntainer.nu llContext| |{},{name: "sleepOutc ome",hash: {},data:da ta}):helpe r))+" of 1 0</td></tr >"},42:fun ction(cont ainer,dept h0,helpers ,partials, data){var  helper;ret urn"<tr><t d>Comments <br/><br/> "+containe r.escapeEx pression(( helper=nul l!=(helper =helpers.c omment||(n ull!=depth 0?depth0.c omment:dep th0))?help er:helpers .helperMis sing,"func tion"==typ eof helper ?helper.ca ll(null!=d epth0?dept h0:contain er.nullCon text||{},{ name:"comm ent",hash: {},data:da ta}):helpe r))+"</td> </tr>"},44 :function( container, depth0,hel pers,parti als,data){ var stack1 ,alias1=nu ll!=depth0 ?depth0:co ntainer.nu llContext| |{};return "<tr><td>S ymptoms<br /><br/>"+c ontainer.e scapeExpre ssion((hel pers.comma Spacer||de pth0&&dept h0.commaSp acer||help ers.helper Missing).c all(alias1 ,null!=dep th0?depth0 .painSympt oms:depth0 ,{name:"co mmaSpacer" ,hash:{},d ata:data}) )+(null!=( stack1=hel pers.if.ca ll(alias1, null!=dept h0?depth0. painSympto msOther:de pth0,{name :"if",hash :{},fn:con tainer.pro gram(20,da ta,0),inve rse:contai ner.noop,d ata:data}) )?stack1:" ")+"</td>< /tr>"},46: function(c ontainer,d epth0,help ers,partia ls,data){v ar helper; return"<tr ><td>Impro ved By<br/ ><br/>"+co ntainer.es capeExpres sion((help er=null!=( helper=hel pers.impro vedBy||(nu ll!=depth0 ?depth0.im provedBy:d epth0))?he lper:helpe rs.helperM issing,"fu nction"==t ypeof help er?helper. call(null! =depth0?de pth0:conta iner.nullC ontext||{} ,{name:"im provedBy", hash:{},da ta:data}): helper))+" </td></tr> "},48:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper;retu rn"<tr><td >Worsened  By<br/><br />"+contai ner.escape Expression ((helper=n ull!=(help er=helpers .worsenedB y||(null!= depth0?dep th0.worsen edBy:depth 0))?helper :helpers.h elperMissi ng,"functi on"==typeo f helper?h elper.call (null!=dep th0?depth0 :container .nullConte xt||{},{na me:"worsen edBy",hash :{},data:d ata}):help er))+"</td ></tr>"},c ompiler:[7 ,">= 4.0.0 "],main:fu nction(con tainer,dep th0,helper s,partials ,data){var  stack1,he lper,alias 1=null!=de pth0?depth 0:containe r.nullCont ext||{},al ias2=helpe rs.helperM issing,ali as3=contai ner.escape Expression ;return"<d iv>\n    < p><strong> Date Submi tted:</str ong> "+ali as3((helpe rs.formatI SODateStri ng||depth0 &&depth0.f ormatISODa teString|| alias2).ca ll(alias1, null!=dept h0?depth0. dateCreate d:depth0,{ name:"form atISODateS tring",has h:{},data: data}))+"< /p>\n    < p><strong> Pain Ratin g:</strong > "+alias3 ((helper=n ull!=(help er=helpers .painRatin g||(null!= depth0?dep th0.painRa ting:depth 0))?helper :alias2,"f unction"== typeof hel per?helper .call(alia s1,{name:" painRating ",hash:{}, data:data} ):helper)) +' of 10</ p>\n</div> \n\n<div c lass="tabl e-responsi ve diary-d etails-tab le-wrapper " id="tabl e-tablet-v iew">\n     <table cl ass="table  table-str iped table -bordered  pain-diary -entry-det ail-table"  summary=" Additional  Treatment s and Tool s Used Det ails">\n         <the ad><tr><th  colspan=" 2" scope=" col">Treat ments &amp ; Tools Us ed</th></t r></thead> \n         <tbody>\n' +(null!=(s tack1=help ers.if.cal l(alias1,n ull!=depth 0?depth0.t oolsUsed:d epth0,{nam e:"if",has h:{},fn:co ntainer.pr ogram(1,da ta,0),inve rse:contai ner.noop,d ata:data}) )?stack1:" ")+"         "+(null! =(stack1=h elpers.if. call(alias 1,null!=de pth0?depth 0.treatmen tsUsed:dep th0,{name: "if",hash: {},fn:cont ainer.prog ram(4,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +'\n         </tbody> \n    </ta ble>\n     <table cla ss="table  table-stri ped table- bordered p ain-diary- entry-deta il-table"  summary="S leep Quali ty and Mov ement Inte rference"> \n         <thead><tr ><th colsp an="2" sco pe="col">H ealth Impa ct &amp; C omments</t h></tr></t head>\n         <tbod y>\n         '+(null! =(stack1=h elpers.if. call(alias 1,null!=de pth0?depth 0.movement Impact:dep th0,{name: "if",hash: {},fn:cont ainer.prog ram(7,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +"\n         "+(null! =(stack1=h elpers.if. call(alias 1,null!=de pth0?depth 0.activity Interferen ce:depth0, {name:"if" ,hash:{},f n:containe r.program( 9,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+"\n         "+ (null!=(st ack1=helpe rs.if.call (alias1,nu ll!=depth0 ?depth0.mo odEffect:d epth0,{nam e:"if",has h:{},fn:co ntainer.pr ogram(11,d ata,0),inv erse:conta iner.noop, data:data} ))?stack1: "")+"\n         "+(nu ll!=(stack 1=helpers. if.call(al ias1,null! =depth0?de pth0.depre ssionLevel :depth0,{n ame:"if",h ash:{},fn: container. program(13 ,data,0),i nverse:con tainer.noo p,data:dat a}))?stack 1:"")+"\n         "+( null!=(sta ck1=helper s.if.call( alias1,nul l!=depth0? depth0.sle epOutcome: depth0,{na me:"if",ha sh:{},fn:c ontainer.p rogram(15, data,0),in verse:cont ainer.noop ,data:data }))?stack1 :"")+"\n         "+(n ull!=(stac k1=helpers .if.call(a lias1,null !=depth0?d epth0.comm ent:depth0 ,{name:"if ",hash:{}, fn:contain er.program (17,data,0 ),inverse: container. noop,data: data}))?st ack1:"")+' \n         </tbody>\n     </tabl e>\n    <t able class ="table ta ble-stripe d table-bo rdered pai n-diary-en try-detail -table" su mmary="Pai n Descript ion Detail s">\n         <thead> <tr><th co lspan="2"  scope="col ">Pain Des cription</ th></tr></ thead>\n         <tbo dy>\n         '+(null !=(stack1= helpers.if .call(alia s1,null!=d epth0?dept h0.painSym ptoms:dept h0,{name:" if",hash:{ },fn:conta iner.progr am(19,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +"\n      
  37     "+(null! =(stack1=h elpers.if. call(alias 1,null!=de pth0?depth 0.worsened By:depth0, {name:"if" ,hash:{},f n:containe r.program( 22,data,0) ,inverse:c ontainer.n oop,data:d ata}))?sta ck1:"")+"\ n        " +(null!=(s tack1=help ers.if.cal l(alias1,n ull!=depth 0?depth0.i mprovedBy: depth0,{na me:"if",ha sh:{},fn:c ontainer.p rogram(24, data,0),in verse:cont ainer.noop ,data:data }))?stack1 :"")+'\n         </tb ody>\n     </table>\n </div>\n\n <div class ="diary-de tails-tabl e-wrapper"  id="table -phone-vie w">\n    < table clas s="table t able-strip ed table-b ordered pa in-diary-e ntry-detai l-table" s ummary="Ad ditional T reatments  and Tools  Used Detai ls">\n         <thead ><tr><th>T reatments  &amp; Tool s Used</th ></tr></th ead>\n         <tbody >\n'+(null !=(stack1= helpers.if .call(alia s1,null!=d epth0?dept h0.toolsUs ed:depth0, {name:"if" ,hash:{},f n:containe r.program( 26,data,0) ,inverse:c ontainer.n oop,data:d ata}))?sta ck1:"")+"         "+( null!=(sta ck1=helper s.if.call( alias1,nul l!=depth0? depth0.tre atmentsUse d:depth0,{ name:"if", hash:{},fn :container .program(2 9,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+'\n         </ tbody>\n     </table> \n    <tab le class=" table tabl e-striped  table-bord ered pain- diary-entr y-detail-t able" summ ary="Sleep  Quality a nd Movemen t Interfer ence">\n         <the ad><tr><th >Health Im pact &amp;  Comments< /th></tr>< /thead>\n         <tb ody>\n         '+(nul l!=(stack1 =helpers.i f.call(ali as1,null!= depth0?dep th0.moveme ntImpact:d epth0,{nam e:"if",has h:{},fn:co ntainer.pr ogram(32,d ata,0),inv erse:conta iner.noop, data:data} ))?stack1: "")+"\n         "+(nu ll!=(stack 1=helpers. if.call(al ias1,null! =depth0?de pth0.activ ityInterfe rence:dept h0,{name:" if",hash:{ },fn:conta iner.progr am(34,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +"\n         "+(null! =(stack1=h elpers.if. call(alias 1,null!=de pth0?depth 0.moodEffe ct:depth0, {name:"if" ,hash:{},f n:containe r.program( 36,data,0) ,inverse:c ontainer.n oop,data:d ata}))?sta ck1:"")+"\ n        " +(null!=(s tack1=help ers.if.cal l(alias1,n ull!=depth 0?depth0.d epressionL evel:depth 0,{name:"i f",hash:{} ,fn:contai ner.progra m(38,data, 0),inverse :container .noop,data :data}))?s tack1:"")+ "\n         "+(null!= (stack1=he lpers.if.c all(alias1 ,null!=dep th0?depth0 .sleepOutc ome:depth0 ,{name:"if ",hash:{}, fn:contain er.program (40,data,0 ),inverse: container. noop,data: data}))?st ack1:"")+" \n         "+(null!=( stack1=hel pers.if.ca ll(alias1, null!=dept h0?depth0. comment:de pth0,{name :"if",hash :{},fn:con tainer.pro gram(42,da ta,0),inve rse:contai ner.noop,d ata:data}) )?stack1:" ")+'\n     </table>\n     <table  class="ta ble table- striped ta ble-border ed pain-di ary-entry- detail-tab le" summar y="Pain De scription  Details">\ n        < thead><tr> <th colspa n="2" scop e="col">Pa in Descrip tion</th>< /tr></thea d>\n         <tbody>\ n        ' +(null!=(s tack1=help ers.if.cal l(alias1,n ull!=depth 0?depth0.p ainSymptom s:depth0,{ name:"if", hash:{},fn :container .program(4 4,data,0), inverse:co ntainer.no op,data:da ta}))?stac k1:"")+"\n         "+ (null!=(st ack1=helpe rs.if.call (alias1,nu ll!=depth0 ?depth0.im provedBy:d epth0,{nam e:"if",has h:{},fn:co ntainer.pr ogram(46,d ata,0),inv erse:conta iner.noop, data:data} ))?stack1: "")+"\n         "+(nu ll!=(stack 1=helpers. if.call(al ias1,null! =depth0?de pth0.worse nedBy:dept h0,{name:" if",hash:{ },fn:conta iner.progr am(48,data ,0),invers e:containe r.noop,dat a:data}))? stack1:"") +'\n         </tbody> \n    </ta ble>\n</di v>\n\n<div  class="ce nter-butto ns">\n     <a href="# reportDail yPainDiary " class="b tn btn-sec ondary gra ph-view"   role="butt on"><img s rc="img/ic on-arrowBa ck-black.s vg" class= "back" alt ="" title= "" aria-hi dden="true "/> Back</ a>\n</div> \n'},useDa ta:!0}),th is.VPC.Tem plate.repo rtPainDiar yEntries=H andlebars. template({ 1:function (container ,depth0,he lpers,part ials,data) {var alias 1=containe r.lambda,a lias2=cont ainer.esca peExpressi on;return'              <li data -page="'+a lias2(alia s1(depth0, depth0))+' "><a href= "#">'+alia s2(alias1( depth0,dep th0))+"</a ></li>\n"} ,compiler: [7,">= 4.0 .0"],main: function(c ontainer,d epth0,help ers,partia ls,data){v ar stack1; return'<di v id="pati entHeaderS ection" da ta-spy="af fix" data- offset-top ="160"></d iv>\n<div  class="tab le-respons ive" id="t able-table t-view">\n     <table  id="pain- diary-entr ies-table"  class="ta ble table- striped ta ble-border ed pain-di ary-entrie s-table" s ummary="Li st of Pain  Diary Ent ries.">\n         <th ead>\n         <tr>\n              <th scop e="col" da ta-sort="d ateCreated " class="v pc-sortabl e">Date Su bmitted<sp an class=" sr-only">S elect to s ort</span> <span clas s="glyphic on glyphic on-chevron -down" ari a-hidden=" true"></sp an></th>\n              <th scop e="col" da ta-sort="p ainRating"  class="vp c-sortable ">Pain Rat ing<span c lass="sr-o nly">Selec t to sort< /span><spa n class="g lyphicon g lyphicon-c hevron-dow n" aria-hi dden="true "></span>< /th>\n             <t h scope="c ol" >Tools  Used</th> \n         </tr>\n         </the ad>\n         <tbody  id="pain-d iary-entry "></tbody> \n    </ta ble>\n     <div class ="complete d-diary-pa gination"> \n         <ul class= "paginatio n">\n             <li >\n                 < a href="#"  class="pr evious-pag e" aria-la bel="Previ ous">\n                      <sp an aria-hi dden="true ">&laquo;< /span>\n                  </a>\n              </li>\n' +(null!=(s tack1=help ers.each.c
  38   all(null!= depth0?dep th0:contai ner.nullCo ntext||{}, null!=dept h0?depth0. pages:dept h0,{name:" each",hash :{},fn:con tainer.pro gram(1,dat a,0),inver se:contain er.noop,da ta:data})) ?stack1:"" )+'             <li>\ n                 <a  href="#" c lass="next -page" ari a-label="N ext">\n                      <sp an aria-hi dden="true ">&raquo;< /span>\n                  </a>\n              </li>\n         </u l>\n    </ div>\n</di v>\n'},use Data:!0}), this.VPC.T emplate.re portPainDi aryEntry=H andlebars. template({ compiler:[ 7,">= 4.0. 0"],main:f unction(co ntainer,de pth0,helpe rs,partial s,data){va r helper,a lias1=null !=depth0?d epth0:cont ainer.null Context||{ },alias2=h elpers.hel perMissing ,alias3=co ntainer.es capeExpres sion;retur n"<td>"+al ias3((help ers.shortD ate||depth 0&&depth0. shortDate| |alias2).c all(alias1 ,null!=dep th0?depth0 .dateCreat ed:depth0, {name:"sho rtDate",ha sh:{},data :data}))+" </td>\n<td >"+alias3( (helper=nu ll!=(helpe r=helpers. painRating ||(null!=d epth0?dept h0.painRat ing:depth0 ))?helper: alias2,"fu nction"==t ypeof help er?helper. call(alias 1,{name:"p ainRating" ,hash:{},d ata:data}) :helper))+ " of 10</t d>\n<td>"+ alias3((he lpers.comm aToolsUsed ||depth0&& depth0.com maToolsUse d||alias2) .call(alia s1,null!=d epth0?dept h0.toolsUs ed:depth0, {name:"com maToolsUse d",hash:{} ,data:data }))+"</td> "},useData :!0}),this .VPC.Templ ate.report PainDiaryP honeEntrie s=Handleba rs.templat e({1:funct ion(contai ner,depth0 ,helpers,p artials,da ta){var al ias1=conta iner.lambd a,alias2=c ontainer.e scapeExpre ssion;retu rn'             <li d ata-page=" '+alias2(a lias1(dept h0,depth0) )+'"><a hr ef="#">'+a lias2(alia s1(depth0, depth0))+" </a></li>\ n"},compil er:[7,">=  4.0.0"],ma in:functio n(containe r,depth0,h elpers,par tials,data ){var stac k1;return' <div id="t able-phone -view">\n     <div id ="daily-ph one-data"> </div>\n     <div cla ss="comple ted-diary- pagination ">\n         <ul clas s="paginat ion">\n             < li>\n                  <a href=" #" class=" previous-p age" aria- label="Pre vious">\n                      < span aria- hidden="tr ue">&laquo ;</span>\n                  </a> \n             </li>\ n'+(null!= (stack1=he lpers.each .call(null !=depth0?d epth0:cont ainer.null Context||{ },null!=de pth0?depth 0.pages:de pth0,{name :"each",ha sh:{},fn:c ontainer.p rogram(1,d ata,0),inv erse:conta iner.noop, data:data} ))?stack1: "")+'             <li >\n                 < a href="#"  class="ne xt-page" a ria-label= "Next">\n                      < span aria- hidden="tr ue">&raquo ;</span>\n                  </a> \n             </li>\ n        < /ul>\n     </div>\n</ div>\n'},u seData:!0} ),this.VPC .Template. reportPain DiaryPhone Entry=Hand lebars.tem plate({com piler:[7," >= 4.0.0"] ,main:func tion(conta iner,depth 0,helpers, partials,d ata){var h elper,alia s1=null!=d epth0?dept h0:contain er.nullCon text||{},a lias2=help ers.helper Missing,al ias4=conta iner.escap eExpressio n;return'< a href="#' +alias4((h elper=null !=(helper= helpers._i d||(null!= depth0?dep th0._id:de pth0))?hel per:alias2 ,"function "==typeof  helper?hel per.call(a lias1,{nam e:"_id",ha sh:{},data :data}):he lper))+'"  class="pro gress-phon e-links" a ria-label= "Pain Diar y Entry su bmitted on  '+alias4( (helpers.f ormatISODa teString|| depth0&&de pth0.forma tISODateSt ring||alia s2).call(a lias1,null !=depth0?d epth0.date Created:de pth0,{name :"formatIS ODateStrin g",hash:{} ,data:data }))+'. Cli ck for mor e details. ">\n<div c lass="pane l-body pai n-diary-ph one-entrie s-prov">\n     <img s rc="img/ic on-arrowFo rward.svg"  class="co mpleted-di ary-phone- arrow" alt ="" aria-h idden="tru e"/>\n     <div class ="row">\n         <di v class="c ol-xs-4">< label for= "date-crea ted">Date  Submitted< /label></d iv>\n         <div cl ass="col-x s-8" id="d ate-create d">'+alias 4((helpers .shortDate ||depth0&& depth0.sho rtDate||al ias2).call (alias1,nu ll!=depth0 ?depth0.da teCreated: depth0,{na me:"shortD ate",hash: {},data:da ta}))+'</d iv>\n    < /div>\n     <div clas s="row">\n         <d iv class=" col-xs-4"> <label for ="pain-rat ing">Pain  Rating</la bel></div> \n         <div class ="col-xs-8 " id="pain -rating">' +alias4((h elper=null !=(helper= helpers.pa inRating|| (null!=dep th0?depth0 .painRatin g:depth0)) ?helper:al ias2,"func tion"==typ eof helper ?helper.ca ll(alias1, {name:"pai nRating",h ash:{},dat a:data}):h elper))+'  of 10</div >\n    </d iv>\n    < div class= "row">\n         <div  class="co l-xs-4"><l abel for=" pain-sympt oms">Tools  Used</lab el></div>\ n        < div class= "col-xs-8"  id="pain- symptoms"> '+alias4(( helpers.co mmaToolsUs ed||depth0 &&depth0.c ommaToolsU sed||alias 2).call(al ias1,null! =depth0?de pth0.tools Used:depth 0,{name:"c ommaToolsU sed",hash: {},data:da ta}))+"</d iv>\n    < /div>\n</d iv>\n</a>\ n"},useDat a:!0}),VPC .View.Moda lBase=Back bone.Mario nette.Item View.exten d({initial ize:functi on(){},sho w:function (){$(".mod al-contain er .modal" ).modal("s how")},hid e:function (){$(".mod al-contain er .modal" ).modal("h ide")},onS how:functi on(){},onR ender:func tion(){thi s.$el.html (this.temp late(this. model))}}) ,VPC.View. eula=VPC.V iew.ModalB ase.extend ({template :VPC.Templ ate.eulaMo dal,events :{"click # eula-decli ne":"decli ne","click  #eula-acc ept":"acce pt","shown .bs.modal  #eula-moda l":"onModa lShown","h idden.bs.m odal #eula -modal":"o nModalHidd en"},decli ne:functio n(){App_Ut ils.Return ToLaunchpa d()},accep t:function (){App_Uti ls.SetLoca lStorage(" VPC_Eula", {accept_da te:(new Da te).getTim e()}),App.
  39   vent.trigg er("eula:a ccepted"), this.hide( )},onModal Shown:func tion(){App _Utils.Mod alContaine rShown(),A pp.vent.tr igger("eul a:shown")} ,onModalHi dden:funct ion(){App_ Utils.Moda lContainer Hidden(),A pp.vent.tr igger("eul a:hidden") }}),VPC.Vi ew.layout= Marionette .LayoutVie w.extend({ el:"div.co ntainer-fl uid",templ ate:VPC.Te mplate.lay out,region s:{header: "header",f ooter:"foo ter",conte nt:"sectio n.content" ,modal:"se ction.moda l-containe r",timeout :"section. timeout"}, events:{"c lick #btnE rrorClose" :"onErrorC lose"},scr oll:functi on(){$(".s crollbar-g radient"). length<1&& $("body"). append('<d iv class=" scrollbar- gradient"> <div>'),$( window).on ("resize s croll",fun ction(){$( window).sc rollTop()+ $(window). height()== $(document ).height() &&$(".scro llbar-grad ient:visib le")?$(".s crollbar-g radient"). hide():$(" .scrollbar -gradient: hidden")&& $(".scroll bar-gradie nt").show( )});!funct ion(){if(" number"==t ypeof wind ow.innerWi dth)return  window.in nerWidth>d ocument.do cumentElem ent.client Width;var  overflowSt yle,rootEl em=documen t.document Element||d ocument.bo dy;void 0! ==rootElem .currentSt yle&&(over flowStyle= rootElem.c urrentStyl e.overflow ),overflow Style=over flowStyle| |window.ge tComputedS tyle(rootE lem,"").ov erflow;var  overflowY Style;void  0!==rootE lem.curren tStyle&&(o verflowYSt yle=rootEl em.current Style.over flowY),ove rflowYStyl e=overflow YStyle||wi ndow.getCo mputedStyl e(rootElem ,"").overf lowY;var c ontentOver flows=root Elem.scrol lHeight>ro otElem.cli entHeight, overflowSh own=/^(vis ible|auto) $/.test(ov erflowStyl e)||/^(vis ible|auto) $/.test(ov erflowYSty le),always ShowScroll ="scroll"= ==overflow Style||"sc roll"===ov erflowYSty le;return  contentOve rflows&&ov erflowShow n||alwaysS howScroll} ()?$(".scr ollbar-gra dient").hi de():$(".s crollbar-g radient"). show()},re nder:funct ion(){this .$el.html( this.templ ate()),$(' [data-togg le="popove r"]').popo ver(),this .scroll()} ,onErrorCl ose:functi on(){App.v ent.trigge r("reset:e rror")}}), VPC.View.r esources=B ackbone.Ma rionette.I temView.ex tend({temp late:VPC.T emplate.re sources}), VPC.View.t imeoutModa l=Backbone .Marionett e.ItemView .extend({t emplate:VP C.Template .timeoutMo dal,events :{"click # logout":"l ogout","cl ick #stay" :"stay"},l imit:120,i nitialize: function() {VPC.Model .LastAcces sedTime=ne w VPC.Mode l.lastAcce ssedTime,A pp.KeepAli veModal=!1 },start:fu nction(){c onsole.log (">>> time outModal:  start... " );var jwtC ookie=App_ Utils.GetC ookie(App. ngJwtCooki eName),use r=""===jwt Cookie?{}: App_Utils. ParseJwt(j wtCookie); if(console .log(">>>  latest jwt Cookie fro m timeoutM odal =",jw tCookie),u ser.exp){v ar now=Mat h.round((n ew Date).g etTime()/1 e3),timeLe ft=Number( user.exp)- now;consol e.log(">>>  exp minus  now =",ti meLeft),Ap p.KeepAliv eTimeLeft= timeLeft,t his.keepAl ive()}else  console.w arn("JWT e xp claim i s unavaila ble."),cle arInterval (App.KeepA liveInterv al),App_Ut ils.VAMFLo gout()},ke epAlive:fu nction(){v ar self=th is;App.Kee pAliveCoun t=0,App.Ke epAliveInt erval&&cle arInterval (App.KeepA liveInterv al),App.Ke epAliveInt erval=setI nterval(fu nction(){A pp.KeepAli veCount++, App.KeepAl iveTimeLef t--,App.Ke epAliveCou nt>self.li mit&&!App. KeepAliveM odal&&self .start(),A pp.KeepAli veTimeLeft <=self.lim it&&((!App .KeepAlive Modal||App .KeepAlive TimeLeft>0 &&App.Keep AliveTimeL eft<=self. limit)&&se lf.show(), App.KeepAl iveTimeLef t<=0&&(cle arInterval (App.KeepA liveInterv al),self.l ogout()),s elf.modalC ountdown() ),App.debu g&&($("#de bug").leng th||$("bod y").append ("<div id= 'debug' st yle='posit ion:absolu te; right: 50px; top: 45px;'></d iv>"),$("# debug").ht ml(self.ca lculateTim eRemaining (App.KeepA liveTimeLe ft)))},1e3 ),App.vent .trigger(" keepAlive: started")} ,logout:fu nction(){A pp_Utils.V AMFLogout( )},stay:fu nction(){c learInterv al(App.Kee pAliveInte rval),cons ole.log("> >> timeout : stay...  url =",App _Utils.Get DomainPath ()+App.ngJ wtPath);va r self=thi s;$.ajax({ url:App_Ut ils.GetDom ainPath()+ App.ngJwtP ath,succes s:function (response) {console.l og(">>> ne w jwt toke n =",respo nse),self. start()},e rror:funct ion(){App. vent.trigg er("websit e:error"," Cannot ref resh sessi on countdo wn. You wi ll be logg ed out in  approximat ely 2 minu tes.")},co mplete:fun ction(){co nsole.log( ">>> ajax  call to re fresh JWT  completed. ..")}}),th is.hide(), App.vent.t rigger("ti meoutModal :hidden")} ,show:func tion(){App _Utils.Set ModalConta iner("#tim eout-modal "),App.Kee pAliveModa l=!0,$("#t imeout-mod al").modal ("show"),$ ("#timeout -modal").o n("shown.b s.modal",f unction(){ App.vent.t rigger("ti meoutModal :visible") })},hide:f unction(){ $("#timeou t-modal"). on("hidden .bs.modal" ,function( ){App_Util s.FocusOnL oad()}),Ap p.KeepAliv eModal=!1, $("#timeou t-modal"). modal("hid e")},modal Countdown: function() {this.calc ulatePerce ntRemainin g(App.Keep AliveTimeL eft,this.l imit);$("# timeout-mo dal .time- remaining" ).html(thi s.calculat eTimeRemai ning(App.K eepAliveTi meLeft))}, calculateP ercentRema ining:func tion(a,b){ return(a/b *100).toFi xed(2)},ca lculateTim eRemaining :function( a){var min utes=Math. floor(a/60 ),seconds= a-60*minut es;minutes >0&&(secon ds=seconds <10?"0"+se conds:seco nds);var f ormattedVa lue="";ret urn format tedValue+= minutes>0? minutes+": "+seconds+ " minutes" :seconds+"  seconds"} ,onRender: function() {this.$el. html(this. template(t his.model) ),App_Util s.FocusOnM odal()},on ModalShown :function( e){var mod alId=$(e.c urrentTarg et).attr(" id");$("#" +modalId).
  40   removeAttr ("aria-hid den"),App_ Utils.Moda lContainer Shown()},o nModalHidd en:functio n(e){App_U tils.Modal ContainerH idden();va r modalId= $(e.curren tTarget).a ttr("id"); $("#"+moda lId).attr( "aria-hidd en",!0)}}) ,VPC.View. assessment s=Backbone .Marionett e.LayoutVi ew.extend( {template: VPC.Templa te.assessm ents,model :VPC.Model .Patient,c lassName:" assessment s",collect ion:new VP C.Collecti on.Monthly Assessment s,regions: {assessmen tsRegion:" #assessmen ts-region" ,assessmen tsPhoneReg ion:"#asse ssments-ph one-region ",patientH eader:"#pa tientHeade rSection"} ,events:{" click #ass essments-e ntry > tr" :"showDeta ils","clic k .panel": "showDetai ls","click  #titleMen u":"select MenuDropdo wnOpen","c lick .icon -info":"on IconClick" },collecti onEvents:{ sync:"rend er"},initi alize:func tion(optio ns){this.i d=options. id;var _se lf=this;Ap p.vent.on( "assessmen ts:missing ",function (){$("#ass essments-r egion").ht ml('<p cla ss="missin g-record c enter">No  Monthly Ch eck-In rec ords found  for this  user.</p>' )});var _s elf=this,m onthlyData =new VPC.C ollection. MonthlyAss essments,m onthlyUrl= App_Resour ces.GetVPC ResourcePa th("staffM onthlyAsse ssments",{ "unique-id ":VPC.Data .search_pa tient.edip i,"assigni ng-authori ty":"EDIPI "});monthl yData.fetc h({TYPE:"G ET",dataTy pe:"json", contentTyp e:"applica tion/json" ,cache:!1, url:monthl yUrl,succe ss:functio n(response ){_self.co llection=r esponse,_s elf.id?(_s elf.assess mentsRegio n.show(new  VPC.View. assessment sDetails({ model:_sel f.collecti on.get(_se lf.id)}),{ preventDes troy:!0}), _self.asse ssmentsPho neRegion.h ide()):0== _self.coll ection.len gth?($("#c ontent-tit le").html( "<span>Com pleted Mon thly Check -Ins</span >"),_self. assessment sRegion.sh ow(new Mar ionette.It emView({te mplate:_.t emplate('< p class="m issing-rec ord center ">No Month ly Check-I n records  found for  this user. </p>')}))) :(_self.as sessmentsR egion.show (new VPC.V iew.assess mentsEntri es({collec tion:month lyData,chi ldView:VPC .View.asse ssmentsEnt ry}),{prev entDestroy :!0}),_sel f.assessme ntsPhoneRe gion.show( new VPC.Vi ew.assessm entsPhoneE ntries({co llection:_ self.colle ction,chil dView:VPC. View.asses smentsPhon eEntry}),{ preventDes troy:!0})) ,App.vent. trigger("a ssessments :loaded")} ,error:fun ction(mode l,response ,options){ console.lo g("error m odel",mode l),console .log("erro r response ",response ),console. log("error  options", options);v ar errorMe ssage="Err or fetchin g monthly  assessment s!  Error  Code: "+re sponse.sta tus+" Erro r Message:  "+respons e.statusTe xt;App.ven t.trigger( "website:e rror",erro rMessage)} ,complete: function() {$("#asses sments-reg ion").remo veClass("s pinner-bac kground")} })},onRend er:functio n(){this.p atientHead er.show(ne w VPC.View .patientHe ader({mode l:this.mod el})),setT imeout(fun ction(){Ap p_Utils.Fo cusOnLoad( )},300)},s howDetails :function( e){var sel ected=$(e. currentTar get).attr( "id");this .assessmen tsRegion.s how(new VP C.View.ass essmentsDe tails({mod el:this.co llection.g et(selecte d)}),{prev entDestroy :!0}),this .assessmen tsPhoneReg ion.empty( ),VPC.Rout er.navigat e("assessm ents/"+sel ected)},te mplateHelp ers:functi on(){retur n{reportPa ge:"assess ments"}},s electMenuD ropdownOpe n:function (){App_Uti ls.SelectT itleMenu(" providerVi ew","#asse ssments-co ntent")},o nDomRefres h:function (){$('[dat a-toggle=" popover"]' ).popover( ),App_Util s.Initiali zeAffix("# patientHea derSection ")},onIcon Click:func tion(event ){console. log("on on IconClick. .."),setTi meout(App_ Utils.Moda lContainer Shown("#mo nthly-info -header"), 0)}}),VPC. View.asses smentsDeta ils=Backbo ne.Marione tte.ItemVi ew.extend( {template: VPC.Templa te.assessm entsDetail s,classNam e:"assessm ents-detai ls",events :{"click . back":"goB ack"},init ialize:fun ction(){if (this.mode l){var _se lf=this,qu estions=ne w VPC.Coll ection.Ass essmentQue stions;que stions.fet ch({succes s:function (){_self.m odel.set(" assessment Questions" ,questions .toJSON()) ,_self.ren der()}})}} ,goBack:fu nction(e){ e.preventD efault(),w indow.hist ory.back() },onRender :function( ){$("#cont ent-title" ).html("<s pan>Comple ted Monthl y Check-In  Detail</s pan>"),set Timeout(fu nction(){A pp_Utils.F ocusOnLoad ()},600)}} ),VPC.View .assessmen tsEntries= Backbone.M arionette. CompositeV iew.extend ({template :VPC.Templ ate.assess mentsEntri es,classNa me:"assess ments-entr ies",child ViewContai ner:"#asse ssments-en try",reord erOnSort:! 0,events:{ "click th[ data-sort] ":"sort"," click .pag ination a" :"paginate ","shown.b s.modal #m onthlyInfo ":"onModal Shown","hi dden.bs.mo dal #month lyInfo":"o nModalHidd en"},initi alize:func tion(){thi s.itemsPer Page=5,thi s.currentP age=1,this .pages},on Render:fun ction(){va r _self=th is;$("#con tent-title ").html("< span>Compl eted Month ly Check-I ns</span>" );var coll ection=thi s.collecti on;this.$( "[data-sor t]").each( function(i ,el){var $ el=$(el),$ span=$el.f ind("span" );$el.data ("sort")== =collectio n.sortFiel d?($span.a ddClass("a ctive-sort "),1===col lection.so rtDirectio n?($span.a ddClass("g lyphicon-c hevron-dow n"),$span. removeClas s("glyphic on-chevron -up")):($s pan.remove Class("gly phicon-che vron-down" ),$span.ad dClass("gl yphicon-ch evron-up") )):($span. addClass(" glyphicon- chevron-do wn"),$span .removeCla ss("glyphi con-chevro n-up"))}), setTimeout (function( ){App_Util s.FocusOnL oad(),$(". pagination  li").remo veClass("a ctive"),$( 'li[data-p age="'+_se lf.current Page+'"]') .addClass( "active")} ,300)},fil ter:functi on(child,i ndex,colle
  41   ction){var  start=(th is.current Page-1)*th is.itemsPe rPage,end= start+this .itemsPerP age;if(ind ex>=start& &index<end )return ch ild},templ ateHelpers :function( ){return t his.pages= Math.ceil( this.colle ction.leng th/5),{pag es:_.range (1,this.pa ges+1),ent ries:this. collection .toJSON()} },sort:fun ction(e){$ ('li[data- page="'+th is.current Page+'"]') .removeCla ss("active "),e.preve ntDefault( );var sort =$(e.curre ntTarget). data("sort ");sort=== this.colle ction.sort Field?this .collectio n.sortDire ction*=-1: this.colle ction.sort Direction= 1,this.col lection.so rtField=so rt,this.co llection.s ort(),this .currentPa ge=1,this. render()}, paginate:f unction(e) {e.prevent Default(); var $el=$( e.currentT arget);ret urn $el.ha sClass("pr evious-pag e")?1!==th is.current Page&&(thi s.currentP age-=1,thi s.render() ,!1):$el.h asClass("n ext-page") ?this.curr entPage!== this.pages &&(this.cu rrentPage+ =1,this.re nder(),!1) :(this.cur rentPage=p arseInt($e l.text()), this.rende r(),!1)},o nDomRefres h:function (){$('[dat a-toggle=" popover"]' ).popover( )},onModal Shown:func tion(event ){var moda lId=$(even t.currentT arget).att r("id");$( "header, . va-title-a rea, .app- title-area , .title-b ack-btn, # content-ti tle, .moda l-hide, #t able-table t-view, #t itleMenu,  #patientHe aderSectio n, footer,  .scrollba r-gradient ").attr("a ria-hidden ",!0),$("# "+modalId) .removeAtt r("aria-hi dden"),App _Utils.Foc usOnModal( )},onModal Hidden:fun ction(even t){var mod alId=$(eve nt.current Target).at tr("id");$ ("header,  .va-title- area, .app -title-are a, .title- back-btn,  #content-t itle, .mod al-hide, # table-tabl et-view, # titleMenu,  #patientH eaderSecti on, footer , .scrollb ar-gradien t").remove Attr("aria -hidden"), $("#"+moda lId).attr( "aria-hidd en",!0)}}) ,VPC.View. assessment sEntry=Bac kbone.Mari onette.Ite mView.exte nd({templa te:VPC.Tem plate.asse ssmentsEnt ry,tagName :"tr",init ialize:fun ction(){th is.$el.pro p("id",thi s.model.ge t("_id"))} ,onRender: function() {setTimeou t(function (){App_Uti ls.FocusOn Load()},30 0)}}),VPC. View.asses smentsGrap h=Backbone .Marionett e.ItemView .extend({t emplate:VP C.Template .assessmen tsGraph,cl assName:"a ssessments -graph",ch ildViewCon tainer:"di v",reorder OnSort:!0, lastDate:" ",events:{ "click .pa nel-click- area":"pop upGraph"," shown.bs.m odal #grap h-modal":" onModalSho wn","hidde n.bs.modal  #graph-mo dal":"onMo dalHidden" },initiali ze:functio n(){var co llection;i f(this.col lection){v ar firstRo w,lastRow, firstDate, lastDate,p reviousPGI C,bFirst=! 1,painInte nsityTotal =0,sleepQu alityTotal =0,painInt erferenceT otal=0,sle epQualityT otal=0,dep ressionTot al=0,lastP GIC=-1,row Count=0;fi rstRow=thi s.collecti on.at(0),l astDate=fi rstRow.get ("dateCrea ted");var  lastYear=n ew Date(la stDate);la stYear=las tYear.setF ullYear(la stYear.get FullYear() -1);var sh owCollecti on=new VPC .Collectio n.MonthlyA ssessments ;this.coll ection.eac h(function (monthRow) {var creat eDate=mont hRow.get(" dateCreate d"),compar eDate=new  Date(creat eDate);if( compareDat e>lastYear ){0==bFirs t?(firstRo w=monthRow ,firstDate =monthRow. get("dateC reated"),b First=!0,p reviousPGI C=monthRow .get("over allStatus" ),lastDate =monthRow. get("dateC reated")): (-1!=lastP GIC&&(prev iousPGIC=l astPGIC),l astPGIC=mo nthRow.get ("overallS tatus")),l astRow=mon thRow,pain IntensityT otal+=mont hRow.get(" painIntens ity"),slee pQualityTo tal+=month Row.get("s leepQualit y");var pa inAvg=(mon thRow.get( "painInter ferenceGen eral")+mon thRow.get( "painInter ferenceLif e"))/2;pai nInterfere nceTotal+= painAvg,de pressionTo tal+=month Row.get("p leasureLev el"),depre ssionTotal +=monthRow .get("depr ession"),c ompareDate .setDate(1 ),monthRow .set("date Created",c ompareDate .toISOStri ng()),show Collection .add(month Row),rowCo unt++}}),t his.model= new Backbo ne.Model,t his.model. set("lastD ate",first Date),this .model.set ("painInte nsity",fir stRow.get( "painInten sity")),th is.model.s et("painIn tensityAvg ",Math.rou nd(painInt ensityTota l/rowCount *100)/100) ,this.mode l.set("sle epQuality" ,firstRow. get("sleep Quality")) ,this.mode l.set("sle epQualityA vg",Math.r ound(sleep QualityTot al/rowCoun t*100)/100 ),this.mod el.set("de pression", firstRow.g et("depres sion")+fir stRow.get( "pleasureL evel")),th is.model.s et("depres sionAvg",M ath.round( depression Total/rowC ount*100)/ 100);var p ainIntAvg= (firstRow. get("painI nterferenc eGeneral") +firstRow. get("painI nterferenc eLife"))/2 ;this.mode l.set("pai nInterfere nceAvg",pa inIntAvg), this.model .set("pain IntTotalAv g",Math.ro und(painIn terference Total/rowC ount*100)/ 100);var o verallStat us=firstRo w.get("ove rallStatus ");this.mo del.set("o verallStat us",overal lStatus),3 ==overallS tatus?(thi s.model.se t("worseSt atus",!1), this.model .set("bett erStatus", !1),this.m odel.set(" sameStatus ",!0)):ove rallStatus >3?(this.m odel.set(" worseStatu s",!1),thi s.model.se t("betterS tatus",!0) ,this.mode l.set("sam eStatus",! 1)):overal lStatus<3? (this.mode l.set("wor seStatus", !0),this.m odel.set(" betterStat us",!1),th is.model.s et("sameSt atus",!1)) :console.l og("Someth ing wrong  with lastP GIC: "+ove rallStatus );var mont hlyData=ne w VPC.Coll ection.Mon thlyAssess ments(show Collection .toJSON()) ;if(-11=== showCollec tion.lengt h){var bla nkRow=new  VPC.Model. MonthlyAss essment,d= new Date(f irstDate); d.setDate( d.getDate( )-30),blan kRow.set(" dateCreate d",d.toISO String()), blankRow.s et("painIn tensity",0 ),blankRow .set("pain Interferen ceGeneral" ,0),blankR ow.set("pa inInterfer enceLife",
  42   0),blankRo w.set("sle epQuality" ,0),blankR ow.set("pl easureLeve l",0),blan kRow.set(" depression ",0),blank Row.set("p gic",0),mo nthlyData. add(blankR ow),d=new  Date(lastD ate),d.set Date(d.get Date()+30) ;var blank Row2=new V PC.Model.M onthlyAsse ssment;bla nkRow2.set ("dateCrea ted",d.toI SOString() ),blankRow 2.set("pai nIntensity ",0),blank Row2.set(" painInterf erenceGene ral",0),bl ankRow2.se t("painInt erferenceL ife",0),bl ankRow2.se t("sleepQu ality",0), blankRow2. set("pleas ureLevel", 0),blankRo w2.set("de pression", 0),blankRo w2.set("pg ic",0),mon thlyData.a dd(blankRo w2)}collec tion=month lyData.toJ SON(),this .graphData ={},this.g raphData.p ainIntensi ty=collect ion.map(fu nction(mod el){return {date:mode l.reportDa te(),point :model.pai nIntensity }}),this.g raphData.p ainInterfe rence=coll ection.map (function( model){ret urn{date:m odel.repor tDate(),po int:model. painInterf erence()}} ),this.gra phData.sle epQuality= collection .map(funct ion(model) {return{da te:model.r eportDate( ),point:mo del.sleepQ uality}}), this.graph Data.depre ssion=coll ection.map (function( model){ret urn{date:m odel.repor tDate(),po int:model. depression Score()}}) ,this.grap hData.over allStatus= collection .map(funct ion(model) {return{da te:model.r eportDate( ),point:mo del.overal lStatus}}) }},showLin eGraph:fun ction(){va r margin={ top:30,rig ht:30,bott om:30,left :30
  43   },width=40 0-margin.l eft-margin .right,hei ght=200-ma rgin.top-m argin.bott om,parseDa te=d3.time .format("% m/%d/%Y"). parse,x=(d 3.time.for mat("%b"), d3.time.sc ale().rang e([0,width ])),y=d3.s cale.linea r().range( [height,0] ),xAxis=d3 .svg.axis( ).scale(x) .tickForma t(d3.time. format("%b ")).orient ("bottom") .ticks(d3. time.month s,1),value line=d3.sv g.line().x (function( d){return  x(d.date)} ).y(functi on(d){retu rn y(d.poi nt)});for( var key in  this.grap hData){var  svg=d3.se lect(this. el).select ("#"+key). append("di v").classe d("svg-con tainer",!0 ).append(" svg").attr ("preserve AspectRati o","xMinYM in meet"). attr("view Box","0 0  400 200"). classed("s vg-content -responsiv e",!0).att r("alt","G raphical r epresentat ion of sco res").attr ("aria-lab el","Graph ical repre sentation  of scores,  click the  View Tabu lar Data b utton on t his page t o see scor es in a ta ble format ").append( "g").attr( "transform ","transla te("+margi n.left+"," +margin.to p+")");thi s.graphDat a[key].for Each(funct ion(d){d.d ate=parseD ate(d.date ),d.point= +d.point}) ,x.domain( d3.extent( this.graph Data[key], function(d ){return d .date}));v ar yAxis,f ormatyAxis =d3.format (".0f");yA xis="depre ssion"==ke y?d3.svg.a xis().scal e(y).orien t("left"). tickValues ([0,1,2,3, 4,5,6]).ti ckFormat(f ormatyAxis ):d3.svg.a xis().scal e(y).orien t("left"). ticks(d3.p oint,1),"d epression" ==key?y.do main([0,6] ):y.domain ([0,10]),s vg.append( "path").at tr("class" ,"line").a ttr("d",va lueline(th is.graphDa ta[key])), svg.append ("g").attr ("class"," x axis").a ttr("trans form","tra nslate(0," +height+") ").attr("y ",6).call( xAxis),svg .append("g ").attr("c lass","y a xis").call (yAxis).ap pend("text ").attr("t ransform", "rotate(-9 0)").attr( "y",6).att r("dy",".7 1em"),svg. append("g" ).selectAl l("scatter -dots").da ta(this.gr aphData[ke y]).enter( ).append(" svg:circle ").attr("c x",functio n(d,i){ret urn x(d.da te)}).attr ("cy",func tion(d){re turn y(d.p oint)}).at tr("r",6). style("fil l","#0000F F").on("mo useover",f unction(d) {div.trans ition().du ration(200 ).style("o pacity",.9 ),div.html ("Date: "+ parseDate( d.date)+"< br/> Point : "+d.poin t).style(" left",d3.e vent.pageX +"px").sty le("top",d 3.event.pa geY-28+"px ")}).on("m ouseout",f unction(d) {div.trans ition().du ration(500 ).style("o pacity",0) })}},onRen der:functi on(){this. showLineGr aph(),setT imeout(fun ction(){Ap p_Utils.Fo cusOnLoad( ),App.vent .trigger(" assessment Graph:rend er")},900) },popupGra ph:functio n(e){var h eading=$(e .currentTa rget).pare nt().find( ".panel-he ading").ht ml(),graph =$(e.curre ntTarget). html();$(" #graph-mod al").find( ".modal-ti tle").html (heading), $("#graph- modal").fi nd(".modal -body").ht ml(graph), $("#graph- modal").mo dal("show" )},templat eHelpers:f unction(){ return{ass essments:t his.collec tion.toJSO N()}},onMo dalShown:f unction(ev ent){var m odalId=$(e vent.curre ntTarget). attr("id") ;$("header , #errorSe ction, .ti tle-back-b tn, #conte nt-title,  #titleMenu , #patient HeaderSect ion, .moda l-hide, fo oter, .scr ollbar-gra dient").at tr("aria-h idden",!0) ,$("#"+mod alId).remo veAttr("ar ia-hidden" ),App_Util s.FocusOnM odal()},on ModalHidde n:function (event){va r modalId= $(event.cu rrentTarge t).attr("i d");$("hea der, #erro rSection,  .title-bac k-btn, #co ntent-titl e, #titleM enu, #pati entHeaderS ection, .m odal-hide,  footer, . scrollbar- gradient") .removeAtt r("aria-hi dden"),$(" #"+modalId ).attr("ar ia-hidden" ,!0)}}),VP C.View.ass essmentsGr aphReports =Backbone. Marionette .LayoutVie w.extend({ template:V PC.Templat e.assessme ntsGraphRe ports,clas sName:"ass essments", regions:{a ssessments Region:"#a ssessments -graphs-re gion",pati entHeader: "#patientH eaderSecti on"},event s:{"click  .tabular": "showTabul ar","click  .back":"g oBack","cl ick .graph icalView": "goBack"," click #tit leMenu":"s electMenuD ropdownOpe n"},goBack :function( e){e.preve ntDefault( ),"tabular "==this.ac tion?windo w.history. back():win dow.locati on.hash="p rogress"}, collection Events:{sy nc:"render "},initial ize:functi on(){var _ self=this, monthlyDat a=new VPC. Collection .MonthlyAs sessments, monthlyUrl =App_Resou rces.GetVP CResourceP ath("staff MonthlyAss essments", {"unique-i d":VPC.Dat a.search_p atient.edi pi,"assign ing-author ity":"EDIP I"});month lyData.fet ch({TYPE:" GET",dataT ype:"json" ,contentTy pe:"applic ation/json ",cache:!1 ,url:month lyUrl,succ ess:functi on(respons e){_self.c ollection= monthlyDat a,_self.re nder(),App .vent.trig ger("month lyCheckInG raph:rende red")},err or:functio n(model,re sponse,opt ions){if(4 04==respon se.status) console.lo g("Monthly  Assessmen ts records  not found ");else{co nsole.log( "error mod el",model) ,console.l og("error  response", response), console.lo g("error o ptions",op tions);var  errorMess age="Error  fetching  monthly as sessments!   Error Co de: "+resp onse.statu s+" Error  Message: " +response. statusText ;App.vent. trigger("w ebsite:err or",errorM essage)}}, complete:f unction(){ $("#assess ments-grap hs-region" ).removeCl ass("spinn er-backgro und")}}),t his.action =this.opti ons.action },onRender :function( ){this.pat ientHeader .show(new  VPC.View.p atientHead er({model: this.model })),this.s howGraphs( ),setTimeo ut(functio n(){App_Ut ils.FocusO nLoad()},9 00)},showG raphs:func tion(e){e& &e.prevent Default(), this.colle ction&&thi s.collecti on.length> 0?this.ass essmentsRe gion.show( new VPC.Vi ew.assessm entsGraph( {collectio n:this.col lection}), {preventDe stroy:!0}) :this.asse ssmentsReg ion.show(n ew Marione tte.ItemVi ew({templa
  44   te:VPC.Tem plate.asse ssmentsGra phMissing} )),this.ac tion="grap h",VPC.Rou ter.naviga te("assess ments-grap h"),setTim eout(funct ion(){App_ Utils.Focu sOnLoad()} ,300)},for matDatetoM onth:funct ion(dateSt ring){if(d ateString) {var newDa te=new Dat e(dateStri ng),monthN ames=["Jan ","Feb","M ar","Apr", "May","Jun ","Jul","A ug","Sep", "Oct","Nov ","Dec"],m onth=month Names[newD ate.getMon th()];retu rn(month=m onth.lengt h>1?month: "0"+month) +" - "+new Date.getFu llYear()}r eturn date String},sh owTabular: function(e ){e&&e.pre ventDefaul t();var _s elf=this;t his.select ed=$(e.cur rentTarget ).data("id ");var tab Label=$(e. currentTar get).attr( "aria-labe l");this.t abularView =!0;var co lName=this .selected; if(this.co llection)i f(this.col lection.le ngth>0){va r myCollec tion=new B ackbone.Co llection,m axScore="d epressionS core"===co lName&&"6" ||"10";myC ollection. comparator =function( a,b){retur n new Date (a.get("da teCreated" ))>new Dat e(b.get("d ateCreated "))?1:-1}; var firstR ow=this.co llection.a t(0),lastD ate=firstR ow.get("da teCreated" ),lastYear =new Date( lastDate); lastYear=l astYear.se tFullYear( lastYear.g etFullYear ()-1),this .collectio n.each(fun ction(asse ssment){va r oldDate= assessment .get("date Created"); if(new Dat e(oldDate) >lastYear) {var newDa te=_self.f ormatDatet oMonth(old Date),sear chRow=myCo llection.w here({repo rtDate:new Date});0!= myCollecti on.length& &0!=search Row.length ||null!=as sessment.g et(colName )&&(assess ment.set(" reportDate ",newDate) ,assessmen t.set("sco re",assess ment.get(c olName)),a ssessment. set("maxSc ore",maxSc ore),myCol lection.pu sh(assessm ent))}}),t his.collec tion.lengt h>0&&(myCo llection.s ort(),this .assessmen tsRegion.s how(new Ma rionette.I temView({t emplate:VP C.Template .painDiary GraphDetai lsTab,coll ection:myC ollection} ),{prevent Destroy:!0 })),window .scrollTo( 0,0)}else  this.asses smentsRegi on.show(ne w Marionet te.ItemVie w({templat e:VPC.Temp late.asses smentsGrap hMissing}) );this.act ion="tabul ar",$("#co ntent-titl e").text(t abLabel),V PC.Router. navigate(" assessment s-graph/ta bular"),se tTimeout(f unction(){ App_Utils. FocusOnLoa d()},300)} ,showTabul arOld:func tion(e){e& &e.prevent Default(), this.colle ction&&thi s.collecti on.length> 0?this.ass essmentsRe gion.show( new VPC.Vi ew.assessm entsTabula r({collect ion:this.c ollection} ),{prevent Destroy:!0 }):this.as sessmentsR egion.show (new Mario nette.Item View({temp late:VPC.T emplate.as sessmentsG raphMissin g})),VPC.R outer.navi gate("asse ssments-gr aph/tabula r")},templ ateHelpers :function( ){return{r eportPage: "assessmen tsGraphRep orts"}},se lectMenuDr opdownOpen :function( ){App_Util s.SelectTi tleMenu("p roviderVie w","#asses sments-gra phs-region ")},onDomR efresh:fun ction(){Ap p_Utils.In itializeAf fix("#pati entHeaderS ection")}} ),VPC.View .assessmen tsPhoneEnt ries=Backb one.Marion ette.Compo siteView.e xtend({tem plate:VPC. Template.a ssessments PhoneEntri es,childVi ewContaine r:"#monthl y-data-reg ion",reord erOnSort:! 0,events:{ "click .pa gination a ":"paginat e"},initia lize:funct ion(){this .itemsPerP age=5,this .currentPa ge=1,this. pages},onR ender:func tion(){var  _self=thi s,collecti on=this.co llection;t his.$("[da ta-sort]") .each(func tion(i,el) {var $el=$ (el),$span =$el.find( "span");$e l.data("so rt")===col lection.so rtField?($ span.addCl ass("activ e-sort"),1 ===collect ion.sortDi rection?($ span.addCl ass("glyph icon-chevr on-down"), $span.remo veClass("g lyphicon-c hevron-up" )):($span. removeClas s("glyphic on-chevron -down"),$s pan.addCla ss("glyphi con-chevro n-up"))):( $span.addC lass("glyp hicon-chev ron-down") ,$span.rem oveClass(" glyphicon- chevron-up "))}),setT imeout(fun ction(){Ap p_Utils.Fo cusOnLoad( ),$(".pagi nation li" ).removeCl ass("activ e"),$('li[ data-page= "'+_self.c urrentPage +'"]').add Class("act ive")},300 )},filter: function(c hild,index ,collectio n){var sta rt=(this.c urrentPage -1)*this.i temsPerPag e,end=star t+this.ite msPerPage; if(index>= start&&ind ex<end)ret urn child} ,templateH elpers:fun ction(){re turn this. pages=Math .ceil(this .collectio n.length/5 ),{pages:_ .range(1,t his.pages+ 1),entries :this.coll ection.toJ SON()}},pa ginate:fun ction(e){e .preventDe fault();va r $el=$(e. currentTar get);retur n $el.hasC lass("prev ious-page" )?1!==this .currentPa ge&&(this. currentPag e-=1,this. render(),! 1):$el.has Class("nex t-page")?t his.curren tPage!==th is.pages&& (this.curr entPage+=1 ,this.rend er(),!1):( this.curre ntPage=par seInt($el. text()),th is.render( ),!1)}}),V PC.View.as sessmentsP honeEntry= Backbone.M arionette. ItemView.e xtend({tem plate:VPC. Template.a ssessments PhoneEntry ,className :"panel pa nel-defaul t",tagName :"div",ini tialize:fu nction(){t his.$el.pr op("id",th is.model.g et("_id")) },onRender :function( ){setTimeo ut(functio n(){App_Ut ils.FocusO nLoad()},3 00)}}),VPC .View.asse ssmentsTab ular=Backb one.Marion ette.ItemV iew.extend ({template :VPC.Templ ate.assess mentsTabul ar,classNa me:"assess ments-tabu lar",reord erOnSort:! 0,events:{ "click th[ data-sort] ":"sort"}, initialize :function( ){},onRend er:functio n(){App.ve nt.trigger ("assessme ntTabular: rendered") ;var colle ction=this .collectio n;this.$(" [data-sort ]").each(f unction(i, el){var $e l=$(el),$s pan=$el.fi nd("span") ;$el.data( "sort")=== collection .sortField ?($span.ad dClass("ac tive-sort" ),1===coll ection.sor tDirection ?($span.ad dClass("gl yphicon-ch evron-down "),$span.r emoveClass ("glyphico n-chevron- up")):($sp an.removeC lass("glyp hicon-chev ron-down") ,$span.add Class("gly
  45   phicon-che vron-up")) ):($span.a ddClass("g lyphicon-c hevron-dow n"),$span. removeClas s("glyphic on-chevron -up"))}),s etTimeout( function() {App_Utils .FocusOnLo ad()},900) },template Helpers:fu nction(){r eturn{asse ssments:th is.collect ion.toJSON ()}},sort: function(e ){e.preven tDefault() ;var sort= $(e.curren tTarget).d ata("sort" );sort===t his.collec tion.sortF ield?this. collection .sortDirec tion*=-1:t his.collec tion.sortD irection=1 ,this.coll ection.sor tField=sor t,this.col lection.so rt(),this. render()}} ),VPC.View .footer=Ba ckbone.Mar ionette.It emView.ext end({templ ate:VPC.Te mplate.foo ter,render :function( ){return t his.$el.ht ml(this.te mplate(VPC .Data)),th is}}),VPC. View.heade r=Backbone .Marionett e.LayoutVi ew.extend( {template: VPC.Templa te.header, errors:{er ror:[]},fa iledResour ces:{resou rce:[]},ev ents:{"cli ck .aboutM odal":"abo ut","click  .helpModa l":"help", "click #lo gout":"log out","clic k #header- login-link ":"userMen uDropdown" ,"click #n av-dropdow n":"report sMenuDropd own","clic k #phoneFe aturesMenu Link":"ham burgerMenu Dropdown", "click #bt nErrorClos e":"clearE rrors","sh own.bs.mod al #about- modal":"on ModalShown ","hidden. bs.modal # about-moda l":"onModa lHidden"," shown.bs.m odal #help -modal":"o nModalShow n","hidden .bs.modal  #help-moda l":"onModa lHidden"}, initialize :function( ){var that =this;VPC. Data.View. Header={ap p:VPC.Data .app},App. vent.on("w ebsite:err or",functi on(data){t hat.errors .error.pus h(data),$( "#errorSec tion").htm l(VPC.Temp late.error Banner({er rors:that. errors,hel p:VPC.Data .app.help} ))}),windo w.addEvent Listener(" offline",f unction(e) {App.vent. trigger("w ebsite:err or","Your  internet c onnection  appears to  be unavai lable.  Pl ease try a gain when  you regain  connectiv ity.")}),A pp.vent.on ("resource s:failed", function(d ata){that. failedReso urces.reso urce.push( data),$("# content"). empty(),th at.render( )}),App.ve nt.on("res et:error", function() {that.erro rs.error=[ ],$("#erro rSection") .empty()}) ,App.vent. on("userSe lected:cha nge",funct ion(userSe lected){VP C.Data.Vie w.Header.u serSelecte d=userSele cted,that. render()}) ,VPC.Data. View.Heade r=VPC.Data .View.Head er||{mhpus er:null,sh owNav:!1,l aunchpad:" ",app:VPC. Data.app}, App.vent.o n("load:us er",functi on(options ){console. log(">>> [ Provider]  App.vamfUs er =",App. vamfUser), VPC.Model. User=new V PC.Model.u ser({mhpus er:App.vam fUser}),VP C.Data.Vie w.Header.m hpuser=VPC .Model.Use r.get("mhp user"),VPC .Data.View .Header.la unchpad=Ap p_Utils.Ne xtGenLaunc hpadRedire ct(),conso le.log(">> > NG launc hpad =",VP C.Data.Vie w.Header.l aunchpad), VPC.Data.V iew.Header .showNav=! 0,VPC.Layo ut.timeout .show(VPC. Data.View. TimeoutMod al=new VPC .View.time outModal), App.vent.t rigger("us er:loaded" ),VPC.Data .View.Time outModal.s tart(),tha t.render() ,App.vent. trigger("u ser:loaded ")})},clea rErrors:fu nction(){t his.errors .error=[]} ,serialize Data:funct ion(){retu rn VPC.Dat a},onRende r:function (){this.$e l.html(thi s.template (VPC.Data. View.Heade r)),$("#er rorSection ").html(VP C.Template .resourceF ailedBanne r({resourc es:this.fa iledResour ces,help:V PC.Data.ap p.help})), $("#errorS ection").a ppend(VPC. Template.e rrorBanner ({errors:t his.errors ,help:VPC. Data.app.h elp}))},ab out:functi on(){VPC.L ayout.moda l.show(VPC .View.Abou t=new VPC. View.about ),VPC.View .About.sho w()},help: function() {VPC.Layou t.modal.sh ow(VPC.Vie w.Help=new  VPC.View. help),VPC. View.Help. show()},ap pCleanup:f unction(){ App.KeepAl iveInterva l&&clearIn terval(App .KeepAlive Interval), App_Utils. AppCleanup ()},logout :function( ){App_Util s.VAMFLogo ut()},user MenuDropdo wn:functio n(){$("#he ader-login ").on("sho wn.bs.drop down",func tion(event ){$("#head er-login-l ink").attr ("aria-exp anded",!0) ,setTimeou t(function (){$("#use rMenu li:f irst-child  a").focus ()},1500), $("#logo-v a, #skipNa v, .app-ti tle-area,  .alert, #e rrorSectio n, #conten t, footer,  .scrollba r-gradient ").attr("a ria-hidden ","true")} ),$("#head er-login") .on("hidde n.bs.dropd own",funct ion(event) {$("#heade r-login-li nk").attr( "aria-expa nded",!1), $("#logo-v a, #skipNa v, .app-ti tle-area,  .alert, #e rrorSectio n, #conten t, footer,  .scrollba r-gradient ").removeA ttr("aria- hidden")}) },reportsM enuDropdow n:function (){$("#men u-list").o n("shown.b s.dropdown ",function (){$("#nav -dropdown" ).attr("ar ia-expande d",!0),set Timeout(fu nction(){$ ("#tabletR eportsMenu  li:first- child a"). focus()},1 500),$(".v a-title-ar ea, #app-t itle-h1, # home, #abo ut, #help,  .alert, # errorSecti on, #conte nt, footer , .scrollb ar-gradien t").attr(" aria-hidde n","true") }),$("#men u-list").o n("hidden. bs.dropdow n",functio n(){$("#na v-dropdown ").attr("a ria-expand ed",!1),$( ".va-title -area, #ap p-title-h1 , #home, # about, #he lp, .alert , #errorSe ction, #co ntent, foo ter, .scro llbar-grad ient").rem oveAttr("a ria-hidden ")})},hamb urgerMenuD ropdown:fu nction(){$ ("#hamburg er-list"). on("shown. bs.dropdow n",functio n(){$("#ph oneFeature sMenuLink" ).attr("ar ia-expande d",!0),set Timeout(fu nction(){$ ("#phoneFe aturesMenu  li:first- child a"). focus()},1 500),$(".v a-title-ar ea, #app-t itle-h1, . alert, #er rorSection , #content , footer,  .scrollbar -gradient" ).attr("ar ia-hidden" ,"true")}) ,$("#hambu rger-list" ).on("hidd en.bs.drop down",func tion(){$(" #phoneFeat uresMenuLi nk").attr( "aria-expa nded",!1), $(".va-tit le-area, # app-title- h1, .alert , #errorSe ction, #co ntent, foo ter, .scro llbar-grad ient").rem oveAttr("a ria-hidden ")})},onMo
  46   dalShown:f unction(ev ent){App_U tils.Heade rModalShow n($(event. currentTar get).attr( "id"))},on ModalHidde n:function (event){Ap p_Utils.He aderModalH idden($(ev ent.curren tTarget).a ttr("id")) }}),VPC.Vi ew.home=Ba ckbone.Mar ionette.It emView.ext end({templ ate:VPC.Te mplate.hom e,model:VP C.Model.Pa tient,view s:{provide rSearch:vo id 0},ui:{ providerSe arch:"a.pr ovider_sea rch"},even ts:{"show. bs.modal # ProviderSe arch":"ini tSearchMod al","show. bs.modal # PatientSea rchDetails ":"initSea rchDetails Modal","hi dden.bs.mo dal #Patie ntSearchDe tails":"se tSearchFoc us","click  @ui.provi derSearch" :"loadSear ch"},initi alize:func tion(){VPC .Data.sear ch_patient ||(VPC.Dat a.userSele cted=!1,Ap p.vent.tri gger("user Selected:c hange",!1) )},loadSea rch:functi on(){this. views.prov iderSearch =new VPC.V iew.provid erSearch({ el:$("#Pro viderSearc h .modal-b ody")}),th is.views.p roviderSea rch.render ()},initSe archModal: function() {App_Utils .SetMainMo dal("#Prov iderSearch ")},initSe archDetail sModal:fun ction(){Ap p_Utils.Se tMainModal ("#Patient SearchDeta ils")},set SearchFocu s:function (){var $se arch=$(".p rovider_se arch");$se arch&&$sea rch.focus( )},render: function() {return th is.$el.htm l(this.tem plate),App _Utils.Foc usOnLoad() ,this}}),V PC.View.pa inDiaryGra ph=Backbon e.Marionet te.ItemVie w.extend({ template:V PC.Templat e.painDiar yGraph,cla ssName:"pa in-diary-g raph",chil dViewConta iner:"div" ,reorderOn Sort:!0,po pupGraph:f unction(e) {var headi ng=$(e.cur rentTarget ).parent() .find(".pa nel-headin g").html() ,graph=$(e .currentTa rget).html ();$("#gra ph-modal") .find(".mo dal-title" ).html(hea ding),$("# graph-moda l").find(" .modal-bod y").html(g raph),$("# graph-moda l").modal( "show")},t emplateHel pers:funct ion(){retu rn{painDia ry:this.co llection.t oJSON(),re portPage:" pain-diary -graph"}}, onShow:fun ction(){$( "#current- date").dat epicker({c learBtn:!1 ,multidate :!1,autocl ose:!0,tod ayBtn:!0,t odayHighli ght:!0,end Date:new D ate}).on(" hide",func tion(){thi s.firstHid e?this.fir stHide=!1: $(this).is (":focus") ||(this.fi rstHide=!0 ,this.focu s())}).on( "show",fun ction(){th is.firstHi de&&$(this ).datepick er("hide") })},onRend er:functio n(){$('[da ta-toggle= "popover"] ').popover (),setTime out(functi on(){App_U tils.Focus OnLoad()}, 300)},onDo mRefresh:f unction(){ $('[data-t oggle="pop over"]').p opover()}} ),VPC.View .painDiary GraphDetai ls=Backbon e.Marionet te.LayoutV iew.extend ({template :VPC.Templ ate.painDi aryGraphDe tails,clas sName:"pai n-diary-gr aph-detail s",reorder OnSort:!0, regions:{g raphRegion :"#graph", dateRegion :"#dateReg ion",tabRe gion:"#tab Region"},e vents:{},i nitialize: function() {var colle ction=this .collectio n.toJSON() ;this.id=t his.option s.id;var i d=this.id; this.id||V PC.Router. navigate(" pain-diary -graph");v ar myHeade r=id.repla ce(/-([a-z ]) /g,func tion(g){re turn g[1]. toUpperCas e()});myHe ader=myHea der.replac e(/([a-z]) ([A-Z])/g, "$1 $2"),$ ("#tabular -title").h tml(myHead er),$("#ta bular-titl e").addCla ss("text-c apitalize" );var coll ection=thi s.collecti on.toJSON( );this.gra phData=col lection.ma p(function (model){re turn{date: model.repo rtDate,sco re:model.s core}})},o nRender:fu nction(){$ ('[data-to ggle="popo ver"]').po pover(),th is.buildGr aph(),setT imeout(fun ction(){Ap p_Utils.Fo cusOnLoad( )},900)},o nShow:func tion(){thi s.dateRegi on.show(ne w VPC.View .painDiary GraphDetai lsDate({mo del:this.m odel}))},t emplateHel pers:funct ion(){retu rn{painDia ry:this.co llection.t oJSON(),re portPage:" pain-diary -graph"}}, buildGraph :function( ){var marg in={top:20 ,right:0,b ottom:20,l eft:25},in ner_width= 370-margin .left-marg in.right,i nner_heigh t=180-marg in.top-mar gin.bottom ,x=d3.scal e.ordinal( ).rangeRou ndBands([0 ,inner_wid th],.1),y= d3.scale.l inear().ra nge([inner _height,0] ),xAxis=d3 .svg.axis( ).scale(x) .orient("b ottom"),sv g=d3.selec t(this.el) .select("# graph").ap pend("div" ).classed( "svg-conta iner",!0). append("sv g").attr(" preserveAs pectRatio" ,"xMinYMin  meet").at tr("viewBo x","0 0 38 0 190").at tr("alt"," Graphical  representa tion of sc ores").att r("aria-la bel","Grap hical repr esentation  of scores .  The sco res are al so listed  in a tabul ar format  at the bot tom of thi s page."). classed("s vg-content -responsiv e",!0).app end("g").a ttr("trans form","tra nslate("+m argin.left +","+margi n.top+")") ,gradient= svg.append ("svg:defs ").append( "svg:linea rGradient" ).attr("id ","gradien t").attr(" x1","0%"). attr("y1", "0%").attr ("x2","0%" ).attr("y2 ","100%"). attr("spre adMethod", "pad");gra dient.appe nd("svg:st op").attr( "offset"," 0%").attr( "stop-colo r","#4D4E5 2").attr(" stop-opaci ty",1),gra dient.appe nd("svg:st op").attr( "offset"," 100%").att r("stop-co lor","#4D4 E52").attr ("stop-opa city",1),s vg.append( "svg:rect" ).attr("wi dth",370). attr("heig ht",180).s tyle("fill ","url(#gr adient)"), x.domain(t his.graphD ata.map(fu nction(d){ return d.d ate})),y.d omain([0,1 0]),svg.ap pend("g"). attr("clas s","x axis ").attr("t ransform", "translate (0,"+inner _height+") ").call(xA xis).selec tAll("text ").attr("y ",0).attr( "x",-2).at tr("transf orm","rota te(310)"). style("tex t-anchor", "end"),svg .append("g ").attr("c lass","y a xis").call (function( ){return d 3.svg.axis ().scale(y ).orient(" left").tic kValues([1 ,2,3,4,5,6 ,7,8,9,10] )}().tickS ize(-inner _width,0,0 ).tickForm at(d3.form at("d"))), svg.select All(".bar" ).data(thi s.graphDat a).enter() .append("r ect").attr ("class"," bar").attr ("x",funct ion(d){ret urn x(d.da te)}).attr ("width",x
  47   .rangeBand ()).attr(" y",functio n(d){retur n y(d.scor e)}).attr( "height",f unction(d) {return is NaN(y(d.sc ore))?inne r_height:i nner_heigh t-y(d.scor e)})},onDo mRefresh:f unction(){ $('[data-t oggle="pop over"]').p opover()}} ),VPC.View .painDiary GraphDetai lsDate=Mar ionette.It emView.ext end({templ ate:VPC.Te mplate.pai nDiaryGrap hDetailsDa te,ui:{gra phDate:"#t xtGraphDat e"},onRend er:functio n(){this.u i.graphDat e.datepick er({clearB tn:!1,mult idate:!1,a utoclose:! 0,todayBtn :!0,todayH ighlight:! 0,orientat ion:"top", endDate:ne w Date}).o n("hide",f unction(){ this.first Hide?this. firstHide= !1:$(this) .is(":focu s")||(this .firstHide =!0,this.f ocus())}). on("show", function() {this.firs tHide&&$(t his).datep icker("hid e")})}}),V PC.View.pa inDiaryGra phReports= Backbone.M arionette. LayoutView .extend({t emplate:VP C.Template .painDiary GraphRepor ts,classNa me:"pain-d iary-repor ts",collec tion:new V PC.Collect ion.PainDi aries,curr entDate:"" ,tabularDa te:"",cate gory:"",we ekDate:"", selected:" ",tabularV iew:!1,pai nDairyView :!0,region s:{painDia ryRegion:" #pain-diar y-graphs-r egion",pai nDiaryRow: "#pain-dia ry-row",pa tientHeade r:"#patien tHeaderSec tion",pain DiaryHeade r:"#header -region"}, ui:{curDat e:"#curren t-date",pa inDiaryRow :"#pain-di ary-row"}, events:{"c lick .grap h-details" :"showDeta ils","clic k .graphic alView":"g raphicalVi ew","click  #btnPainD iaryPrevio us":"nextD ateClicked ","click # btnPainDia ryNext":"n extDateCli cked","cli ck #btnCur rentDateGo ":"onDateC hange","cl ick #btnGr aphDateGo" :"onWeekCh ange","cli ck #btnGra phPrevious ":"onWeekN avigate"," click #btn GraphNext" :"onWeekNa vigate","c lick #titl eMenu":"se lectMenuDr opdownOpen ","click . tabular":" showTabula r","click  .graph-vie w":"goBack ","click . title-back -btn":"goB ack"},coll ectionEven ts:{sync:" onCollecti onLoad"},g oBack:func tion(e){e. preventDef ault(),1== this.tabul arView?thi s.showDeta ils():1==t his.painDa iryView?VP C.Router.n avigate("p rogressRep orts",{tri gger:!0,re place:!0}) :(this.sho wDateRegio n(),this.u i.painDiar yRow.remov eClass("hi dden"),thi s.painDair yView=!0), this.tabul arView=!1} ,graphical View:funct ion(){this .showDetai ls()},init ialize:fun ction(opti ons){var d ailyData=n ew VPC.Col lection.Pa inDiaries, _self=this ;this.curr entDate="" ;var daily Url=App_Re sources.Ge tVPCResour cePath("st aff-pain-d iary-entri es",{"uniq ue-id":VPC .Data.sear ch_patient .edipi,"as signing-au thority":" EDIPI"});d ailyData.f etch({TYPE :"GET",dat aType:"jso n",content Type:"appl ication/js on",cache: !1,url:dai lyUrl,succ ess:functi on(respons e){_self.c ollection= response," details"== =_self.act ion?_self. showTabula r():0==_se lf.collect ion.length ?_self.sho wMissingRe gion():(_s elf.showDa teRegion() ,_self.pai nDiaryRow. empty())}, error:func tion(model ,response, options){c onsole.log ("error mo del",model ),console. log("error  response" ,response) ,console.l og("error  options",o ptions);va r errorMes sage="Erro r fetching  daily ass essments!   Error Cod e: "+respo nse.status +" Error M essage: "+ response.s tatusText; App.vent.t rigger("we bsite:erro r",errorMe ssage)},co mplete:fun ction(){$( "#pain-dia ry-graphs- region").r emoveClass ("spinner- background ")}}),this .action=th is.options .action,th is.$el.dat a("view_ob ject",this )},onColle ctionLoad: function() {this.show Graphs()}, onRender:f unction(){ $('[data-t oggle="pop over"]').p opover(),t his.patien tHeader.sh ow(new VPC .View.pati entHeader( {model:thi s.model})) ,0==this.c ollection. length&&th is.showMis singRegion (),setTime out(functi on(){App_U tils.Focus OnLoad()}, 900)},form atISODate: function(d ateString) {if(dateSt ring){var  subDate=da teString.s ubstring(0 ,10),date= subDate.sp lit("-");i f(date.len gth>1)retu rn date[1] +"/"+date[ 2]+"/"+dat e[0]}retur n dateStri ng},format DatetoDay: function(d ateString) {if(dateSt ring){var  newDate=ne w Date(dat eString),w eekday=new  Array(7); weekday[0] ="Sun ",we ekday[1]=" Mon ",week day[2]="Tu e ",weekda y[3]="Wed  ",weekday[ 4]="Thu ", weekday[5] ="Fri ",we ekday[6]=" Sat ";var  day=weekda y[newDate. getDay()], month=(1+n ewDate.get Month()).t oString(); month=mont h.length>1 ?month:"0" +month;var  day2=newD ate.getDat e().toStri ng();retur n day2=day 2.length>1 ?day2:"0"+ day2,day+"  "+month+" /"+day2}re turn dateS tring},onD ateChange: function(e ){e&&e.pre ventDefaul t(),this.t abularView =!1,this.p ainDairyVi ew=!0;var  today=new  Date,curre ntDate=$(" #current-d ate").val( );this.tab ularDate=$ ("#current -date").va l();var bO k=currentD ate.match( /[0-9]{2}\ /[0-9]{2}\ /(20)\d{2} $/);if(isN aN(Date.pa rse(curren tDate))||! bOk)this.s howInvalid Date();els e{new Date (currentDa te)<today? ($("#curre ntDateErro r").addCla ss("hidden "),current Date===thi s.currentD ate&&curre ntDate!=th is.current Date||(thi s.showGrap hByDate(cu rrentDate) ,this.curr entDate=cu rrentDate) ):this.sho wInvalidDa te()}},nex tDateClick ed:functio n(e){e&&e. preventDef ault();var  currentDa te=$(e.cur rentTarget ).data("li nk");curre ntDate!==t his.curren tDate&&(th is.showGra phByDate(c urrentDate ),this.cur rentDate=c urrentDate )},showEmp tyRegion:f unction(){ this.ui.pa inDiaryRow .addClass( "hidden")} ,showInval idDate:fun ction(){$( "#currentD ateError") .removeCla ss("hidden "),this.pa inDiaryRow .empty()}, showMissin gRegion:fu nction(){$ ("#current DateError" ).addClass ("hidden") ,this.pain DiaryRow.s how(new Ma rionette.I temView({t emplate:VP C.Template .painDiary GraphMissi ng})),this .painDiary Header.emp ty(),this. painDiaryH eader.show (new Backb
  48   one.Marion ette.ItemV iew({templ ate:VPC.Te mplate.pai nDiaryGrap hHeader})) },showDate Region:fun ction(){th is.painDai ryView=!0, this.painD iaryRegion .show(new  VPC.View.p ainDiaryGr aph({model :new Backb one.Model( {currentDa te:this.cu rrentDate, previousDa te:"",next Date:""}), collection :this.coll ection},{p reventDest roy:!0})), this.painD iaryHeader .empty(),t his.painDi aryHeader. show(new B ackbone.Ma rionette.I temView({t emplate:VP C.Template .painDiary GraphHeade r}))},show GraphByDat e:function (currentDa te){this.p ainDairyVi ew=!1;var  currentMod el,_self=t his;if(isN aN(Date.pa rse(curren tDate)))th is.showInv alidDate() ;else if(0 ==this.col lection.le ngth)this. showMissin gRegion(); else if(th is.collect ion.length >0){$("#cu rrentDateE rror").add Class("hid den");var  endDate=ne w Date(_se lf.nextMon thDate(cur rentDate)) ,cDate=new  Date(curr entDate),r angeFilter =function( painDiaryI tem){var t empDate=pa inDiaryIte m.get("dat eCreated") ,entryDate =new Date( _self.form atISODate( tempDate)) ;return en tryDate>=c Date&&entr yDate<=end Date},fCol lection=th is.collect ion.filter (rangeFilt er),tRatin g=0,tMovem ent=0,tAct ivity=0,tM ood=0,tDep ression=0, tSleep=0;i f(fCollect ion.forEac h(function (pain){var  jPain=JSO N.parse(JS ON.stringi fy(pain)); tRating+=i sNaN(jPain .painRatin g)?0:jPain .painRatin g,tMovemen t+=isNaN(j Pain.movem entImpact) ?0:jPain.m ovementImp act,tActiv ity+=isNaN (jPain.act ivityInter ference)?0 :jPain.act ivityInter ference,tM ood+=isNaN (jPain.moo dEffect)?0 :jPain.moo dEffect,tD epression+ =isNaN(jPa in.depress ionLevel)? 0:jPain.de pressionLe vel,tSleep +=isNaN(jP ain.sleepO utcome)?0: jPain.slee pOutcome}) ,fCollecti on.length> 0){current Model=new  VPC.Model. PainDiary; var num=tR ating/fCol lection.le ngth;curre ntModel.se t("painRat ing",num.t oFixed(1)) ,num=tMove ment/fColl ection.len gth,curren tModel.set ("movement Impact",nu m.toFixed( 1)),num=tA ctivity/fC ollection. length,cur rentModel. set("activ ityInterfe rence",num .toFixed(1 )),num=tMo od/fCollec tion.lengt h,currentM odel.set(" moodEffect ",num.toFi xed(1)),nu m=tDepress ion/fColle ction.leng th,current Model.set( "depressio nLevel",nu m.toFixed( 1)),num=tS leep/fColl ection.len gth,curren tModel.set ("sleepOut come",num. toFixed(1) ),this.pai nDiaryRow. empty(),th is.painDia ryRow.show (new Mario nette.Item View({mode l:currentM odel,templ ate:VPC.Te mplate.pai nDiaryGrap hRow}))}el se this.sh owMissingR egion()}}, nextMonthD ate:functi on(dateStr ing){var d =new Date( dateString ),mon=d.ge tMonth();r eturn d.se tMonth(mon +1),d},las tMonthDate :function( dateString ){var d=ne w Date(dat eString),m on=d.getMo nth();retu rn d.setMo nth(mon-1) ,d},getWee kGraphData :function( newDate){v ar _self=t his,lastMo nth=this.l astMonthDa te(newDate ),nextMont h=this.nex tMonthDate (newDate), dailyData= new VPC.Co llection.P ainDiaries ,dailyUrl= App_Resour ces.GetVPC ResourcePa th("staff- pain-diary -entries-b y-date",{" unique-id" :VPC.Data. search_pat ient.edipi ,"assignin g-authorit y":"EDIPI" }),selecte dDate=new  Date(newDa te),parms= "?startDat e="+select edDate.toI SOString() .substring (0,10)+"&e ndDate="+n extMonth,l astPos=Bac kbone.hist ory.fragme nt.split(" /").length -1,id=Back bone.histo ry.fragmen t.split("/ ")[lastPos ].replace( /-([a-z])/ g,function (g){return  g[1].toUp perCase()} );dailyDat a.fetch({u rl:dailyUr l+parms,TY PE:"GET",d ataType:"j son",conte ntType:"ap plication/ json",succ ess:functi on(respons e){var myC ollection= new Backbo ne.Collect ion;myColl ection.com parator=fu nction(mod el){return  new Date( model.get( "dateCreat ed"))},dai lyData.eac h(function (painDiary ){var oldD ate=painDi ary.get("d ateCreated "),newDate =_self.for matDatetoD ay(oldDate );0==myCol lection.wh ere({repor tDate:newD ate}).leng th&&(painD iary.set(" reportDate ",newDate) ,painDiary .set("scor e",painDia ry.get(id) ),painDiar y.set("max Score","10 "),myColle ction.push (painDiary ))}),myCol lection=_s elf.fillCo llection(m yCollectio n,newDate, nextMonth) ,myCollect ion.sort() ,_self.pai nDiaryRegi on.show(ne w VPC.View .painDiary GraphDetai ls({model: new Backbo ne.Model({ currentDat e:newDate, previousDa te:lastMon th,nextDat e:nextMont h}),collec tion:myCol lection,id :id}),{pre ventDestro y:!0})},er ror:functi on(model,r esponse,op tions){if( 404==respo nse.status ){_self.pa inDiaryReg ion.empty( );var empt yCollectio n=new Back bone.Colle ction;empt yCollectio n=_self.fi llCollecti on(emptyCo llection,n ewDate,nex tMonth),_s elf.painDi aryRegion. show(new V PC.View.pa inDiaryGra phDetails( {model:new  Backbone. Model({cur rentDate:n ewDate,pre viousDate: lastMonth, nextDate:n extMonth}) ,collectio n:emptyCol lection,id :id}))}els e{console. log("error  model",mo del),conso le.log("er ror respon se",respon se),consol e.log("err or options ",options) ;var error Message="E rror fetch ing monthl y assessme nts!  Erro r Code: "+ response.s tatus+" Er ror Messag e: "+respo nse.status Text;App.v ent.trigge r("website :error",er rorMessage )}}})},onW eekChange: function(e ){e&&e.pre ventDefaul t();var ne wDate=$("# txtGraphDa te").val() ,today=new  Date,bOk= newDate.ma tch(/[0-9] {2}\/[0-9] {2}\/(20)\ d{2}$/);if (isNaN(Dat e.parse(ne wDate))||! bOk)$("#da teErrorReg ion").remo veClass("h idden");el se{var dtS tartDate=n ew Date(ne wDate);$(" #dateError Region").a ddClass("h idden"),dt StartDate< today?(thi s.tabularD ate=newDat e,this.cur rentDate=n ewDate,new Date!==thi s.weekDate &&(this.we ekDate=new Date,this. showDetail s()),this. tabularVie w=!1,this. painDairyV iew=!1):$( "#dateErro rRegion").
  49   removeClas s("hidden" )}},onWeek Navigate:f unction(e) {e&&e.prev entDefault ();var new Date=$(e.c urrentTarg et).data(" link");new Date!==thi s.weekDate &&(this.we ekDate=new Date,this. getWeekGra phData(new Date))},fi llCollecti on:functio n(myCollec tion,start Date,endDa te){var _s elf=this,l oopDate=ne w Date(sta rtDate),lo opEndDate= new Date(e ndDate);if (loopEndDa te.setDate (loopEndDa te.getDate ()+1),0==m yCollectio n.length)f or(;loopDa te<loopEnd Date;){var  emptyRow= new VPC.Mo del.PainDi ary;emptyR ow.set("da teCreated" ,loopDate. toISOStrin g()),empty Row.set("r eportDate" ,_self.for matDatetoD ay(loopDat e.toISOStr ing())),em ptyRow.set ("score",0 ),emptyRow .set("maxS core","10" ),myCollec tion.push( emptyRow), loopDate.s etDate(loo pDate.getD ate()+1)}e lse for(;l oopDate<lo opEndDate; ){var newD ate=_self. formatDate toDay(loop Date.toISO String()), searchRow= myCollecti on.where({ reportDate :newDate}) ;if(0==sea rchRow.len gth){var e mptyRow=ne w VPC.Mode l.PainDiar y;emptyRow .set("date Created",l oopDate.to ISOString( )),emptyRo w.set("rep ortDate",n ewDate),em ptyRow.set ("score",0 ),emptyRow .set("maxS core","10" ),myCollec tion.push( emptyRow)} loopDate.s etDate(loo pDate.getD ate()+1)}r eturn myCo llection}, showGraphs :function( e){this.pa inDairyVie w=!1,e&&e. preventDef ault()
  50   ;var curre ntModel,pr eviousDate ,nextDate, tempDate,_ self=this, currentDat e=$("#curr ent-date") .val();if( 0==this.co llection.l ength)this .showEmpty Region();e lse if(cur rentDate&& void 0!=cu rrentDate) if(1==this .collectio n.length)c urrentMode l=this.col lection[0] ,tempDate= currentMod el.get("da teCreated" ),nextDate =this.form atISODate( tempDate), previousDa te=nextDat e;else{var  lockPrevi ous=!1,loc kNext=!1;t his.collec tion.each( function(p ainDiaryIt em){tempDa te=painDia ryItem.get ("dateCrea ted");var  entryDate= _self.form atISODate( tempDate); lockPrevio us&&!lockN ext&&entry Date!=curr entDate&&( nextDate=_ self.forma tISODate(t empDate),l ockNext=!0 ),entryDat e==current Date?(curr entModel=p ainDiaryIt em,lockPre vious=!0): lockPrevio us||(previ ousDate=en tryDate)}) ,void 0==n extDate&&( nextDate=c urrentDate ),void 0== previousDa te&&(previ ousDate=cu rrentDate) }else if(c urrentMode l=this.col lection.at (0),tempDa te=current Model.get( "dateCreat ed"),previ ousDate=th is.formatI SODate(tem pDate),cur rentDate=p reviousDat e,this.col lection.le ngth>0){va r nextMode l=this.col lection.at (1);tempDa te=nextMod el.get("da teCreated" ),nextDate =this.form atISODate( tempDate)} else nextD ate=curren tDate;if(t his.painDi aryRegion. show(new V PC.View.pa inDiaryGra ph({model: new Backbo ne.Model({ currentDat e:currentD ate,previo usDate:pre viousDate, nextDate:n extDate}), collection :this.coll ection},{p reventDest roy:!0})), void 0!=cu rrentModel ){var x=ne w Marionet te.ItemVie w({model:c urrentMode l,template :VPC.Templ ate.painDi aryGraphRo w,onRender :function( ){App.vent .trigger(" painDiaryG raphRow:re nder")}}); this.painD iaryRegion .show(x),t his.showEm ptyRegion( )}App.vent .trigger(" painDiaryG raph:show" ),setTimeo ut(functio n(){App_Ut ils.FocusO nLoad()},3 00)},showD etails:fun ction(e){t his.tabula rView=!1,t his.painDa iryView=!1 ,e&&e.prev entDefault ();var _se lf=this;e& &(this.sel ected=$(e. currentTar get).data( "id"),this .currentDa te=$("#cur rent-date" ).val(),th is.tabular Date=$("#c urrent-dat e").val()) ,this.cate gory=this. selected;v ar id=this .selected. replace(/- ([a-z])/g, function(g ){return g [1].toUppe rCase()}); "enjoyment Interferen ce"==id?id ="movement Impact":"s leepQualit y"==id?id= "sleepOutc ome":"mood Interferen ce"==id?id ="moodEffe ct":"gener alActivity Interferen ce"==id&&( id="activi tyInterfer ence");var  headerId= this.selec ted.replac e(/-/g," " ).replace( /(\s{1,}|\ b)(\w)/g,f unction(st r,space,p1 ){return s pace+p1.to UpperCase( )}),startD ate=new Da te(this.cu rrentDate) ,startISOD ate=startD ate.toISOS tring(),co mpareDate= new Date(s tartISODat e.substrin g(0,10)),n extWeek=th is.nextMon thDate(sta rtDate),pr eviousWeek =this.last MonthDate( startDate) ,previousD ate=this.f ormatISODa te(previou sWeek.toIS OString()) ,nextDate= this.forma tISODate(n extWeek.to ISOString( )),myColle ction=new  Backbone.C ollection; myCollecti on.compara tor=functi on(model){ return new  Date(mode l.get("dat eCreated") )},this.co llection.e ach(functi on(painDia ry){var ol dDate=pain Diary.get( "dateCreat ed"),recor dDate=new  Date(oldDa te);if(rec ordDate>=c ompareDate &&recordDa te<nextWee k){var new Date=_self .formatDat etoDay(old Date),sear chRow=myCo llection.w here({repo rtDate:new Date});0!= myCollecti on.length& &0!=search Row.length ||(painDia ry.set("re portDate", newDate),p ainDiary.s et("score" ,painDiary .get(id)), painDiary. set("maxSc ore","10") ,myCollect ion.push(p ainDiary)) }}),nextWe ek.setDate (nextWeek. getDate()- 1),myColle ction=_sel f.fillColl ection(myC ollection, startDate, nextWeek), myCollecti on.sort(), this.painD iaryRegion .empty(),t his.painDi aryRegion. show(new V PC.View.pa inDiaryGra phDetails( {model:new  Backbone. Model({cur rentDate:t his.curren tDate,prev iousDate:p reviousDat e,nextDate :nextDate} ),collecti on:myColle ction,id:h eaderId}), {preventDe stroy:!0}) ,this.show EmptyRegio n(),this.p ainDiaryHe ader.show( new Backbo ne.Marione tte.ItemVi ew({templa te:VPC.Tem plate.pain DiaryGraph SubHeader, model:new  Backbone.M odel({cate gory:this. category.r eplace(/-/ g," "),hid den:"hidde n"})})),se tTimeout(f unction(){ App_Utils. FocusOnLoa d()},300)} ,templateH elpers:fun ction(){re turn{repor tPage:"pai nDiaryGrap hReports"} },selectMe nuDropdown Open:funct ion(){App_ Utils.Sele ctTitleMen u("provide rView","#p ain-diary- graph-cont ent")},onD omRefresh: function() {$('[data- toggle="po pover"]'). popover()} ,showTabul ar:functio n(event){t his.tabula rView=!0,t his.painDa iryView=!1 ,event.pre ventDefaul t(),this.p ainDiaryHe ader.show( new Backbo ne.Marione tte.ItemVi ew({templa te:VPC.Tem plate.pain DiaryGraph SubHeader, model:new  Backbone.M odel({cate gory:this. category.r eplace(/-/ g," "),hid den:""})}) );var _sel f=this,sel ected=this .category, id=selecte d.replace( /-([a-z])/ g,function (g){return  g[1].toUp perCase()} );"enjoyme ntInterfer ence"==id? id="moveme ntImpact": "sleepQual ity"==id?i d="sleepOu tcome":"mo odInterfer ence"==id? id="moodEf fect":"gen eralActivi tyInterfer ence"==id& &(id="acti vityInterf erence");v ar startDa te=new Dat e(this.tab ularDate), startISODa te=startDa te.toISOSt ring(),com pareDate=n ew Date(st artISODate .substring (0,10)),ne xtWeek=thi s.nextMont hDate(star tDate),myC ollection= new Backbo ne.Collect ion;myColl ection.com parator=fu nction(mod el){return  new Date( model.get( "dateCreat ed"))},thi s.collecti on.each(fu nction(pai nDiary){va r oldDate= painDiary. get("dateC reated"),r ecordDate= new Date(o ldDate);if (recordDat e>=compare Date&&reco rdDate<nex tWeek){var
  51    newDate=_ self.forma tDatetoDay (oldDate), searchRow= myCollecti on.where({ reportDate :newDate}) ;0!=myColl ection.len gth&&0!=se archRow.le ngth||null !=painDiar y.get(id)& &(painDiar y.set("rep ortDate",n ewDate),pa inDiary.se t("score", painDiary. get(id)),p ainDiary.s et("maxSco re","10"), myCollecti on.push(pa inDiary))} }),myColle ction.sort (),this.co llection.l ength>0&&t his.painDi aryRegion. show(new M arionette. ItemView({ template:V PC.Templat e.painDiar yGraphDeta ilsTab,col lection:my Collection }),{preven tDestroy:! 0}),setTim eout(funct ion(){App_ Utils.Focu sOnLoad()} ,300)}}),V PC.View.pa tientHeade r=Backbone .Marionett e.ItemView .extend({t emplate:VP C.Template .patientHe ader,model :VPC.Model .Patient}) ,VPC.View. progressRe ports=Back bone.Mario nette.Layo utView.ext end({templ ate:VPC.Te mplate.pro gressRepor ts,model:V PC.Model.P atient,reg ions:{pati entHeader: "#patientH eaderSecti on"},onDom Refresh:fu nction(){$ ('[data-to ggle="popo ver"]').po pover(),Ap p_Utils.In itializeAf fix("#pati entHeaderS ection")}, onRender:f unction(){ this.patie ntHeader.s how(new VP C.View.pat ientHeader ({model:th is.model}) ),setTimeo ut(functio n(){App_Ut ils.FocusO nLoad()},3 00)}}),VPC .View.prov iderSearch =Backbone. Marionette .ItemView. extend({te mplate:VPC .Template. provider_s earch,resu lts:VPC.Vi ew.Provide rSearchRes ults,ui:{f orm:"form. patient_se arch",quer y:"input#p atientName ",patients :"ul.searc h_patients "},events: {"submit @ ui.form":" search"},i nitialize: function() {this.mode l=new Back bone.Model },search:f unction(ev ent){event .preventDe fault(),th is.results .collectio n.query(th is.ui.quer y.val()),A pp.vent.tr igger("spi nner:start ")},onRend er:functio n(){$("#pa tientSearc hToolTip") .popover() ,this.resu lts=new VP C.View.Pro viderSearc hResults({ el:this.ui .patients, parent:thi s,collecti on:new VPC .Collectio n.SearchPa tients})}} ),VPC.View .SearchDet ails=Backb one.Marion ette.ItemV iew.extend ({model:VP C.Model.Se archPatien t,template :VPC.Templ ate.provid er_search_ details,lo okupIdenti fier:!1,ui :{patient: "button.se lect_patie nt",close: "button.cl ose-detail s"},events :{"click @ ui.patient ":"select_ patient"," click @ui. close":"cl ose_detail s"},modelE vents:{cha nge:"rende r",sync:"_ fetchIdent ifier"},in itialize:f unction(){ this._fetc hDetails() },_fetchDe tails:func tion(){thi s.model.fe tch()},_fe tchIdentif ier:functi on(){var i dentifierS ervice,_th is=this;if (!1===this .lookupIde ntifier){t his.lookup Identifier =!0,identi fierServic e=App_Reso urces.GetV PCResource Path("getE dipiFromDf n",{assign ingAuthori ty:this.mo del.get("p atientIden tifier").a ssigningAu thority,un iqueId:thi s.model.ge t("patient Identifier ").uniqueI d});var ed ipi="UNKNO WN";(new B ackbone.Mo del).fetch ({cache:!1 ,url:ident ifierServi ce,success :function( model,resp onse,optio ns){"null" ===(edipi= response)& &App.vent. trigger("w ebsite:err or","Patie nt's EDIPI  is not fo und. The a pplication  will not  work prope rly.")},er ror:functi on(model,r esponse,op tions){},c omplete:fu nction(mod el,respons e,options) {_this.mod el.set("ed ipi",edipi ),App.vent .trigger(" spinner:st op")}})}}, select_pat ient:funct ion(event) {event.pre ventDefaul t(),VPC.Da ta.search_ patient=th is.model.t oJSON(),se ssionStora ge.setItem ("search_p atient",JS ON.stringi fy(VPC.Dat a.search_p atient)),$ ("#Provide rSearch"). modal("hid e"),$("#Pa tientSearc hDetails") .modal("hi de"),$("#P atientSear chDetails" ).on("hidd en.bs.moda l",functio n(e){VPC.R outer.navi gate("prog ressReport s",{trigge r:!0,repla ce:!0})}), VPC.Data.u serSelecte d=!0,App.v ent.trigge r("userSel ected:chan ge",!0)},c lose_detai ls:functio n(){$("#Pr oviderSear ch").modal ("show")}, onRender:f unction(){ App.vent.t rigger("sp inner:stop ")}}),VPC. View.Searc hNoPatient =Backbone. Marionette .ItemView. extend({ta gName:"li" ,className :"nopatien t",templat e:VPC.Temp late.provi der_search _nopatient ,onRender: function() {App.vent. trigger("s pinner:sto p")}}),VPC .View.Sear chPatient= Backbone.M arionette. ItemView.e xtend({tag Name:"li", className: "search_pa tient",mod el:VPC.Mod el.SearchP atient,tem plate:VPC. Template.p rovider_se arch_patie nt,ui:{pat ient:"a"}, events:{"c lick @ui.p atient":"s elect_pati ent"},sele ct_patient :function( event){eve nt.prevent Default(); new VPC.Vi ew.SearchD etails({el :$("#Patie ntSearchDe tails div. modal-body "),model:t his.model} );VPC.Data .search_pa tient=this .model.toJ SON(),$("# ProviderSe arch").mod al("hide") ,App.vent. trigger("s pinner:sta rt")}}),VP C.View.Pro viderSearc hResults=B ackbone.Ma rionette.C ollectionV iew.extend ({childVie w:VPC.View .SearchPat ient,empty View:VPC.V iew.Search NoPatient, collection :VPC.Colle ction.Sear chPatients ,error:nul l,collecti onEvents:{ reset:"ren der",error :"showDeta iledError" },showDeta iledError: function(o ptions){th is.error=t his.collec tion.error ,this.rend er()},onRe nder:funct ion(){var  $container =$(".searc h_patients _container ");this.is Empty()||t his.collec tion.lengt h<5||this. error?($co ntainer.re moveClass( "results") ,$("ul.sea rch_patien ts li").le ngth>0&&$( "ul.search _patients  li:first-c hild a").f ocus()):$c ontainer.a ddClass("r esults"),t his.error& &($("ul.se arch_patie nts li.nop atient").h tml("<pre> "+this.err or+"</pre> "),this.er ror=null), App.vent.t rigger("sp inner:stop ")}}),VPC. View.repor tDailyPain Diary=Back bone.Mario nette.Layo utView.ext end({templ ate:VPC.Te mplate.rep ortDailyPa inDiary,cl assName:"p ain-diary- layout",co llection:n ew VPC.Col lection.Pa inDiaries, regions:{p
  52   ainDiaryRe gion:"#pai n-diary-re gion",pain DiaryPhone Region:"#p ain-diary- phone-regi on",patien tHeader:"# patientHea derSection "},events: {"click tb ody > tr": "showDetai ls","click  .panel":" showDetail s","click  #titleMenu ":"selectM enuDropdow nOpen"},co llectionEv ents:{sync :"showEntr ies"},init ialize:fun ction(){th is.id=this .options.i d;var _sel f=this,dai lyData=new  VPC.Colle ction.Pain Diaries,da ilyUrl=App _Resources .GetVPCRes ourcePath( "staff-pai n-diary-en tries",{"u nique-id": VPC.Data.s earch_pati ent.edipi, "assigning -authority ":"EDIPI"} );dailyDat a.fetch({T YPE:"GET", dataType:" json",cont entType:"a pplication /json",cac he:!1,url: dailyUrl,s uccess:fun ction(resp onse){_sel f.collecti on=respons e,_self.re nder()},er ror:functi on(model,r esponse,op tions){if( 404==respo nse.status )console.l og("Daily  Assessment s records  not found" );else{con sole.log(" error mode l",model), console.lo g("error r esponse",r esponse),c onsole.log ("error op tions",opt ions);var  errorMessa ge="Error  fetching d aily asses sments!  E rror Code:  "+respons e.status+"  Error Mes sage: "+re sponse.sta tusText;Ap p.vent.tri gger("webs ite:error" ,errorMess age)}},com plete:func tion(){$(" #pain-diar y-region") .removeCla ss("spinne r-backgrou nd")}})},s howEntries :function( ){this.col lection&&( this.painD iaryRegion .empty(),t his.painDi aryPhoneRe gion.empty (),this.id ?(this.pai nDiaryRegi on.show(ne w VPC.View .reportPai nDiaryDeta ils({model :this.coll ection.get (this.id)} ),{prevent Destroy:!0 }),this.pa inDiaryPho neRegion.e mpty()):th is.collect ion.length >0?(this.p ainDiaryRe gion.show( new VPC.Vi ew.reportP ainDiaryEn tries({col lection:th is.collect ion,childV iew:VPC.Vi ew.reportP ainDiaryEn try}),{pre ventDestro y:!0}),thi s.painDiar yPhoneRegi on.show(ne w VPC.View .reportPai nDiaryPhon eEntries({ collection :this.coll ection,chi ldView:VPC .View.repo rtPainDiar yPhoneEntr y}),{preve ntDestroy: !0})):(thi s.painDiar yRegion.sh ow(new Mar ionette.It emView({te mplate:VPC .Template. painDiaryE ntryMissin g})),this. painDiaryP honeRegion .show(new  Marionette .ItemView( {template: VPC.Templa te.painDia ryPhoneEnt ryMissing} ))))},onRe nder:funct ion(){this .patientHe ader.show( new VPC.Vi ew.patient Header({mo del:this.m odel})),th is.collect ion&&(this .painDiary Region.emp ty(),this. painDiaryP honeRegion .empty(),t his.id?(th is.painDia ryRegion.s how(new VP C.View.rep ortPainDia ryDetails( {model:thi s.collecti on.get(thi s.id)}),{p reventDest roy:!0}),t his.painDi aryPhoneRe gion.empty ()):this.c ollection. length>0?( this.painD iaryRegion .show(new  VPC.View.r eportPainD iaryEntrie s({collect ion:this.c ollection, childView: VPC.View.r eportPainD iaryEntry} ),{prevent Destroy:!0 }),this.pa inDiaryPho neRegion.s how(new VP C.View.rep ortPainDia ryPhoneEnt ries({coll ection:thi s.collecti on,childVi ew:VPC.Vie w.reportPa inDiaryPho neEntry}), {preventDe stroy:!0}) ):(this.pa inDiaryReg ion.show(n ew Marione tte.ItemVi ew({templa te:VPC.Tem plate.pain DiaryEntry Missing})) ,this.pain DiaryPhone Region.sho w(new Mari onette.Ite mView({tem plate:VPC. Template.p ainDiaryPh oneEntryMi ssing})))) ,setTimeou t(function (){App_Uti ls.FocusOn Load()},90 0)},showDe tails:func tion(e){$( "#content- title").ht ml("<span> Completed  Pain Diary  Entry Det ail</span> "),$("#int ro-text-ta blet-diary ").attr("s tyle","dis play:none; "),$("#int ro-text-ph one-diary" ).attr("st yle","disp lay:none;" );var sele cted=$(e.c urrentTarg et).attr(" id");selec ted&&(this .painDiary Region.sho w(new VPC. View.repor tPainDiary Details({m odel:this. collection .get(selec ted)}),{pr eventDestr oy:!0}),th is.painDia ryPhoneReg ion.empty( ),VPC.Rout er.navigat e("pain-di ary-detail s/"+select ed))},temp lateHelper s:function (){return{ reportPage :"reportDa ilyPainDia ry"}},sele ctMenuDrop downOpen:f unction(){ App_Utils. SelectTitl eMenu("pro viderView" ,"#pain-di ary-conten t")},onDom Refresh:fu nction(){A pp_Utils.I nitializeA ffix("#pat ientHeader Section")} }),VPC.Vie w.reportDa ilyPainDia ryGraph=Ba ckbone.Mar ionette.It emView.ext end({templ ate:VPC.Te mplate.rep ortDailyPa inDiaryGra ph,events: {"click #t itleMenu": "selectMen uDropdownO pen"},temp lateHelper s:function (){return{ reportPage :"reportDa ilyPainDia ryGraph"}} ,selectMen uDropdownO pen:functi on(){App_U tils.Selec tTitleMenu ("provider View","#gr aph-conten t")}}),VPC .View.repo rtMonthlyC heckIn=Bac kbone.Mari onette.Ite mView.exte nd({templa te:VPC.Tem plate.repo rtMonthlyC heckIn,onR ender:func tion(){thi s.$el.html (this.temp late())},t emplateHel pers:funct ion(){retu rn{reportP age:"repor tMonthlyCh eckIn"}}}) ,VPC.View. reportMont hlyGraph=B ackbone.Ma rionette.I temView.ex tend({temp late:VPC.T emplate.re portMonthl yGraph,eve nts:{"clic k #titleMe nu":"selec tMenuDropd ownOpen"}, templateHe lpers:func tion(){ret urn{report Page:"repo rtMonthlyG raph"}},se lectMenuDr opdownOpen :function( ){App_Util s.SelectTi tleMenu("p roviderVie w","#graph -content") }}),VPC.Vi ew.reportP ainDiaryDe tails=Back bone.Mario nette.Item View.exten d({templat e:VPC.Temp late.repor tPainDiary Details,ev ents:{"cli ck .graph- view":"goB ack"},init ialize:fun ction(){co nsole.log( JSON.strin gify(this. model))},o nRender:fu nction(){s etTimeout( function() {App_Utils .FocusOnLo ad()},300) },goBack:f unction(e) {e.prevent Default(), window.his tory.back( )}}),VPC.V iew.report PainDiaryE ntries=Bac kbone.Mari onette.Com positeView .extend({t emplate:VP C.Template .reportPai nDiaryEntr ies,classN ame:"pain- diary-entr ies",child ViewContai ner:"tbody ",reorderO nSort:!0,e
  53   vents:{"cl ick th[dat a-sort]":" sort","cli ck .pagina tion a":"p aginate"}, initialize :function( ){this.ite msPerPage= 7,this.cur rentPage=1 ,this.page s},onRende r:function (){var _se lf=this;if (this.coll ection){va r collecti on=this.co llection;t his.$("[da ta-sort]") .each(func tion(i,el) {var $el=$ (el),$span =$el.find( "span");$e l.data("so rt")===col lection.so rtField?($ span.addCl ass("activ e-sort"),1 ===collect ion.sortDi rection?($ span.addCl ass("glyph icon-chevr on-down"), $span.remo veClass("g lyphicon-c hevron-up" )):($span. addClass(" glyphicon- chevron-up "),$span.r emoveClass ("glyphico n-chevron- down"))):( $span.addC lass("glyp hicon-chev ron-down") ,$span.rem oveClass(" glyphicon- chevron-up "))}),setT imeout(fun ction(){Ap p_Utils.Fo cusOnLoad( ),$(".pagi nation li" ).removeCl ass("activ e"),$('li[ data-page= "'+_self.c urrentPage +'"]').add Class("act ive"),App. vent.trigg er("painDi aryEntries :rendered" )},300)}}, filter:fun ction(chil d,index,co llection){ var start= (this.curr entPage-1) *this.item sPerPage,e nd=start+t his.itemsP erPage;if( index>=sta rt&&index< end)return  child},te mplateHelp ers:functi on(){if(th is.collect ion){var p ageStart=1 ;this.page s=Math.cei l(this.col lection.le ngth/this. itemsPerPa ge);var pa geEnd=this .pages;if( this.pages >9){this.c urrentPage >6?(pageSt art=this.c urrentPage -5,pageEnd =this.curr entPage+5> this.pages ?this.page s:this.cur rentPage+5 ):pageEnd= 10}return{ pages:_.ra nge(pageSt art,pageEn d+1),entri es:this.co llection.t oJSON()}}} ,sort:func tion(e){e. preventDef ault();var  sort=$(e. currentTar get).data( "sort");so rt===this. collection .sortField ?this.coll ection.sor tDirection *=-1:this. collection .sortDirec tion=1,thi s.collecti on.sortFie ld=sort,th is.collect ion.sort() ,this.curr entPage=1, this.rende r()},pagin ate:functi on(e){e.pr eventDefau lt();var $ el=$(e.cur rentTarget );return $ el.hasClas s("previou s-page")?1 !==this.cu rrentPage& &(this.cur rentPage-= 1,this.ren der(),!1): $el.hasCla ss("next-p age")?this .currentPa ge!==this. pages&&(th is.current Page+=1,th is.render( ),!1):(thi s.currentP age=parseI nt($el.tex t()),this. render(),! 1)},onDomR efresh:fun ction(){Ap p_Utils.In itializeAf fix("#pati entHeaderS ection")}} ),VPC.View .reportPai nDiaryEntr y=Backbone .Marionett e.ItemView .extend({t emplate:VP C.Template .reportPai nDiaryEntr y,tagName: "tr",initi alize:func tion(){thi s.$el.prop ("id",this .model.get ("_id"))}} ),VPC.View .reportPai nDiaryPhon eEntries=B ackbone.Ma rionette.C ompositeVi ew.extend( {template: VPC.Templa te.reportP ainDiaryPh oneEntries ,className :"pain-dia ry-entries ",childVie wContainer :"#daily-p hone-data" ,reorderOn Sort:!0,ev ents:{"cli ck .pagina tion a":"p aginate"}, initialize :function( ){this.ite msPerPage= 7,this.cur rentPage=1 ,this.page s},onRende r:function (){var _se lf=this,co llection=t his.collec tion;this. $("[data-s ort]").eac h(function (i,el){var  $el=$(el) ,$span=$el .find("spa n");$el.da ta("sort") ===collect ion.sortFi eld?($span .addClass( "active-so rt"),1===c ollection. sortDirect ion?($span .addClass( "glyphicon -chevron-d own"),$spa n.removeCl ass("glyph icon-chevr on-up")):( $span.addC lass("glyp hicon-chev ron-up"),$ span.remov eClass("gl yphicon-ch evron-down "))):($spa n.addClass ("glyphico n-chevron- down"),$sp an.removeC lass("glyp hicon-chev ron-up"))} ),setTimeo ut(functio n(){App_Ut ils.FocusO nLoad(),$( ".paginati on li").re moveClass( "active"), $('li[data -page="'+_ self.curre ntPage+'"] ').addClas s("active" ),App.vent .trigger(" painDiaryE ntries:ren dered")},3 00)},filte r:function (child,ind ex,collect ion){var s tart=(this .currentPa ge-1)*this .itemsPerP age,end=st art+this.i temsPerPag e;if(index >=start&&i ndex<end)r eturn chil d},templat eHelpers:f unction(){ var pageSt art=1;this .pages=Mat h.ceil(thi s.collecti on.length/ this.items PerPage);v ar pageEnd =this.page s;if(this. pages>9){t his.curren tPage>6?(p ageStart=t his.curren tPage-5,pa geEnd=this .currentPa ge+5>this. pages?this .pages:thi s.currentP age+5):pag eEnd=10}re turn{pages :_.range(p ageStart,p ageEnd+1), entries:th is.collect ion.toJSON ()}},pagin ate:functi on(e){e.pr eventDefau lt();var $ el=$(e.cur rentTarget );return $ el.hasClas s("previou s-page")?1 !==this.cu rrentPage& &(this.cur rentPage-= 1,this.ren der(),!1): $el.hasCla ss("next-p age")?this .currentPa ge!==this. pages&&(th is.current Page+=1,th is.render( ),!1):(thi s.currentP age=parseI nt($el.tex t()),this. render(),! 1)}}),VPC. View.repor tPainDiary PhoneEntry =Backbone. Marionette .ItemView. extend({te mplate:VPC .Template. reportPain DiaryPhone Entry,clas sName:"pan el panel-d efault",ta gName:"div ",initiali ze:functio n(){this.$ el.prop("i d",this.mo del.get("_ id"))},onR ender:func tion(){set Timeout(fu nction(){A pp_Utils.F ocusOnLoad ()},300)}, templateHe lpers:func tion(){ret urn{report Page:"repo rtPainDiar yPhoneEntr y"}}}),VPC .Router=Ba ckbone.Mar ionette.Ap pRouter.ex tend({rout es:{"":"ho me",home:" home",prog ressReport s:"progres sReports", reportDail yPainDiary :"reportDa ilyPainDia ry",report DailyPainD iaryGraph: "reportDai lyPainDiar yGraph",re portMonthl yCheckIn:" reportMont hlyCheckIn ",reportMo nthlyGraph :"reportMo nthlyGraph ","assessm ents-graph (/:action) ":"assessm entsGraph" ,"pain-dia ry-details (/:id)":"r eportDaily PainDiary" ,"pain-dia ry-graph(/ :action)": "painDiary Graph","*p ath":""},g etPatientM odel:funct ion(){var  patientMod el;return  VPC.Data.s earch_pati ent?patien tModel=new  VPC.Model .Patient(V PC.Data.se arch_patie nt):App.de bug&&(pati entModel=n ew VPC.Mod
  54   el.Patient ,patientMo del.set("p atientIden tifier",{u niqueId:Ap p_Resource s.GetUserP atientId() ,assigning Authority: App_Resour ces.GetUse rAssigning Authority( )}),patien tModel.set ("displayN ame","PCPa tient, One "),patient Model.set( "dateOfBir th","Jan 0 1, 1950"), patientMod el.set("ag e","66"),p atientMode l.set("gen der","MALE "),patient Model.set( "ssn","000 -00-0000") ),patientM odel},home :function( ){document .title="Pa in Coach-H ome",VPC.L ayout.cont ent.empty( ),VPC.Layo ut.content .show(new  VPC.View.h ome)},repo rtDailyPai nDiary:fun ction(id){ document.t itle="Comp leted Pain  Diary Ent ries",VPC. Layout.con tent.empty (),VPC.Lay out.conten t.show(new  VPC.View. reportDail yPainDiary ({id:id,mo del:this.g etPatientM odel()}))} ,reportDai lyPainDiar yGraph:fun ction(){do cument.tit le="Pain D iary Graph ",VPC.Layo ut.content .empty(),V PC.Layout. content.sh ow(new VPC .View.repo rtDailyPai nDiaryGrap h({model:t his.getPat ientModel( )}))},prog ressReport s:function (){documen t.title="P rogress Re ports",VPC .Layout.co ntent.empt y(),VPC.La yout.conte nt.show(ne w VPC.View .progressR eports({mo del:this.g etPatientM odel()}))} ,providerS earch:func tion(){VPC .Layout.co ntent.empt y(),VPC.La yout.conte nt.show(ne w VPC.View .providerS earch)},re portMonthl yGraph:fun ction(){do cument.tit le="Monthl y Check-In  Graph",VP C.Layout.c ontent.emp ty(),VPC.L ayout.cont ent.show(n ew VPC.Vie w.reportMo nthlyGraph ({model:th is.getPati entModel() }))},repor tMonthlyCh eckIn:func tion(id){d ocument.ti tle=id?"Co mpleted Mo nthly Chec k-Ins Deta ils":"Comp leted Mont hly Check- Ins",VPC.L ayout.cont ent.empty( ),VPC.Layo ut.content .show(new  VPC.View.a ssessments ({id:id,mo del:this.g etPatientM odel()}))} ,assessmen tsGraph:fu nction(act ion){docum ent.title= "Monthly C heck-In Gr aph",VPC.L ayout.cont ent.empty( ),VPC.Layo ut.content .show(new  VPC.View.a ssessments GraphRepor ts({action :action,mo del:this.g etPatientM odel()}))} ,painDiary Graph:func tion(actio n){documen t.title="P ain Diary  Graph",VPC .Layout.co ntent.empt y(),VPC.La yout.conte nt.show(ne w VPC.View .painDiary GraphRepor ts({action :action,mo del:this.g etPatientM odel()}))} }),window. App=new VP C.App({con tainer:"di v.containe r-fluid"}) ,App.ngDev ="https:// vhaecedevu cp04. DNS    ece.io",Ap p.debug="l ocalhost"= ==window.l ocation.ho stname,App .debug&&co nsole.warn ("*** WARN ING: Runni ng on loca lhost - no t ALL func tions are  available!  Must manu ally enabl e cookie i njection i n app_util s.js for l ocalhost.  ***"),App. vamfUser={ },App.ngCo ntext="/pa incoachpro vider/",Ap p.ngVistaC ookieName= "vamfvista id_v1",App .ngIdpCook ieName="va mfidpselec ted_v1",Ap p.ngJwtCoo kieName="v amfjwtv1", App.ngUser Service="u sers/v1",A pp.ngSessi onPath=App .ngUserSer vice+"/ses sion",App. ngLogoutPa th=App.ngU serService +"/logout" ,App.ngLog inPath=App .ngUserSer vice+"/log in?scope=S TAFF&redir ect_uri="+ App.ngCont ext,App.ng JwtPath="j wt",App.ng Launchpad= "launchpad /",App.ngV istaDataSe rvices="Vi staDataSer vices/v1", App.ngVDSP atient=App .ngVistaDa taServices +"/patient /{assignin g-authorit y}/{patien t-id}",App .ngVDSPati entsBySite =App.ngVis taDataServ ices+"/pat ients/site /{site-cod e}",App.re sourceErro rHandler=f unction(co llection,r esponse,op tions){Bac kbone.hist ory.start( );var erro rMessage=" Error retr ieving res ource dire ctories!    Error Code : "+respon se.status+ " Error Me ssage: "+r esponse.st atusText,x ={resource :[]};x.res ource.push (errorMess age),$("#e rrorSectio n").html(V PC.Templat e.resource FailedBann er({resour ces:x,help :VPC.Data. app.help}) ),App.vent .trigger(" resources: failed",co llection.k ey)},App.l oadResourc es=functio n(){if(App _Utils.Set VAMFUser() ,!_.isEmpt y(App.vamf User)&&App .vamfUser. authentica ted){var r eady=0,rea dyCheck=fu nction(){1 ===ready&& App.vent.t rigger("re sources:lo aded")},su ccessHandl er=functio n(collecti on,respons e,options) {ready++,r eadyCheck( )};!functi on(){var c ookie=App_ Utils.GetC ookie(App. ngJwtCooki eName);VPC .Resources .App=new A pp_Resourc es.Collect ion.AppRes ources,VPC .Resources .VPCResour ces=new VP C.Collecti on.VPCReso urces,App. debug?(con sole.log(" >>> [Provi der] local host... se tting x-va mf-jwt hea der to acc ess MT..." ),VPC.Reso urces.App. fetch({suc cess:funct ion(){VPC. Resources. VPCResourc es.fetch({ headers:{" x-vamf-jwt ":cookie}, success:su ccessHandl er,error:A pp.resourc eErrorHand ler}),succ essHandler ()},error: App.resour ceErrorHan dler})):VP C.Resource s.App.fetc h({success :function( ){VPC.Reso urces.VPCR esources.f etch({succ ess:succes sHandler,e rror:App.r esourceErr orHandler} ),successH andler()}, error:App. resourceEr rorHandler })}()}},Ap p.on("star t",functio n(){consol e.log(">>>  Provider  start...") ,App.isPro vider=!0,V PC.Layout= new VPC.Vi ew.layout, VPC.Layout .render(), App.loadRe sources()} ),App.vent .on("resou rces:loade d",functio n(){consol e.log("res ources loa ded..."),V PC.Layout. header.sho w(VPC.View .Header=ne w VPC.View .header),V PC.Layout. footer.sho w(new VPC. View.foote r),VPC.Rou ter=new VP C.Router,B ackbone.hi story.star t(),App_Ut ils.SetCal lHandler() ,App.vent. trigger("l oad:user", {init:!0}) }),App.ven t.on("spin ner:start" ,function( ){$("div.m ask").remo veAttr("ar ia-hidden" ).addClass ("loading" )}),App.ve nt.on("spi nner:stop" ,function( ){$("div.m ask").attr ("aria-hid den","true ").removeC lass("load ing")});
  55   //# source MappingURL =app.js.ma p