1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3958],{43958:(S,I,e)=>{e.r(I),e.d(I,{PatientNotesPageModule:()=>R});var f=e(36895),v=e(24006),x=e(26627),a=e(50312),M=e(92216),y=e(89383),$=e(15626),m=e(22805),P=e(45924),T=e(61135),s=e(54004),d=e(18505),u=e(34782),p=e(63900),h=e(59468),g=e(95577),O=e(95698),Z=e(28746),E=e(22940),C=e(39300),A=e(48710),N=e(91520),D=e(82388),t=e(94650),L=e(6613);let U=(()=>{var i;class c{constructor(){this.edit=new t.vpe,this.delete=new t.vpe}}return(i=c).\u0275fac=function(n){return new(n||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["patient-note-list-item"]],inputs:{note:"note"},outputs:{edit:"edit",delete:"delete"},decls:7,vars:1,consts:[["lines","none",1,"note-item"],[1,"note-content"],[1,"actions"],["translate","edit",1,"edit-text",2,"margin-right","6px","margin-left","6px",3,"click"],["fill","clear","color","danger","size","small",3,"click"],["name","trash-outline"]],template:function(n,o){1&n&&(t.TgZ(0,"ion-item",0)(1,"ion-label",1),t._uU(2),t.qZA(),t.TgZ(3,"div",2)(4,"ion-text",3),t.NdJ("click",function(){return o.edit.emit(o.note)}),t.qZA(),t.TgZ(5,"ion-button",4),t.NdJ("click",function(){return o.delete.emit(o.note)}),t._UZ(6,"ion-icon",5),t.qZA()()()),2&n&&(t.xp6(2),t.Oqu(o.note.content))},dependencies:[y.Pi,a.YG,a.gu,a.Ie,a.Q$,a.yW],styles:[".note-item[_ngcontent-%COMP%]{--padding-start: 12px;--background: var(--ion-color-light);border-radius:12px;margin-bottom:8px}.note-content[_ngcontent-%COMP%]{white-space:pre-wrap;font-size:15px}.actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:2px;margin-left:12px;align-items:center}"],changeDetection:0}),c})();function B(i,c){1&i&&t._UZ(0,"ion-title",11),2&i&&t.Q6J("translateParams",c.ngIf.user)}function Q(i,c){if(1&i){const l=t.EpF();t.TgZ(0,"patient-note-list-item",16),t.NdJ("edit",function(o){t.CHM(l);const r=t.oxw(3);return t.KtG(r.openEditModal(o))})("delete",function(o){t.CHM(l);const r=t.oxw(3);return t.KtG(r.confirmDelete(o))}),t.qZA()}2&i&&t.Q6J("note",c.$implicit)}function F(i,c){if(1&i&&(t.ynx(0),t.TgZ(1,"ion-list"),t.YNc(2,Q,1,1,"patient-note-list-item",15),t.qZA(),t.BQk()),2&i){const l=t.oxw().ngIf,n=t.oxw();t.xp6(2),t.Q6J("ngForOf",l)("ngForTrackBy",n.trackNote)}}function Y(i,c){1&i&&t._UZ(0,"ion-text",17)}function J(i,c){if(1&i){const l=t.EpF();t.ynx(0),t.YNc(1,F,3,2,"ng-container",9),t.TgZ(2,"ion-infinite-scroll",12),t.NdJ("ionInfinite",function(o){t.CHM(l);const r=t.oxw();return t.KtG(r.loadNotes(o))}),t._UZ(3,"ion-infinite-scroll-content",13),t.qZA(),t.YNc(4,Y,1,0,"ng-template",null,14,t.W1O),t.BQk()}if(2&i){const l=c.ngIf,n=t.MAs(5);t.xp6(1),t.Q6J("ngIf",l.length>0)("ngIfElse",n)}}function W(i,c){1&i&&(t.TgZ(0,"div",18),t._UZ(1,"ion-spinner",19),t.qZA())}const _=[{path:"",component:(()=>{var i;class c{constructor(n,o,r,z,K,G,H){this.router=n,this.patientService=o,this.auth=r,this.alertsService=z,this.patientNotesService=K,this.activatedRoute=G,this.change=H,this.lastPageLoaded=0,this.offset=new T.X(null),this.modalDisabled=!1}ngOnInit(){}get backButtonLink(){return this.router.url.split("/").slice(0,-1).join("/")}ionViewWillEnter(){window;let o=this.activatedRoute.paramMap.pipe((0,s.U)(r=>Number(r.get("patientID"))),(0,d.b)(r=>this.patientId=r),(0,u.d)());this.patient$=o.pipe((0,p.w)(r=>this.patientService.getPatient(r,{include:["user"]})),(0,u.d)(1)),this.reloadNotes()}loadNotes(n){console.log("loadNotes"),this.offset.next(n)}addNewPatientNote(){var n=this.router.url.split("/");n.push("new-note"),this.router.navigate(n)}openEditModal(n){var o=this.router.url.split("/");o.push(String(n.id)),o.push("update-note"),this.router.navigate(o)}trackNote(n,o){return o.id}reloadNotes(){this.lastPageLoaded=0,this.content.scrollToTop(),this.infinite$=this.offset.pipe((0,h.p)(500),(0,g.z)(n=>this.patient$.pipe((0,O.q)(1),(0,p.w)(o=>this.patientNotesService.getMyPatientNotes(o.id,this.options)),(0,d.b)(()=>this.lastPageLoaded+=1),(0,Z.x)(()=>n&&n.target.complete()))),(0,E.R)((n,o)=>n.concat(o),[])),this.change.detectChanges()}get options(){return{page:this.lastPageLoaded+1,pageSize:15,sort:"updatedAt",desc:!0}}confirmDelete(n){this.alertsService.showAlert({title:"alerts.patient_note_delete_confirmation.title",message:"alerts.patient_note_delete_confirmation.message",allowOutsideClick:!0,canSkip:!1,buttonHandler:()=>this.deleteNote(n)})}deleteNote(n){this.patient$.pipe((0,C.h)(o=>!!o),(0,p.w)(o=>this.patientNotesService.deletePatientNote(o.id,n.id))).subscribe(()=>{this.infinite$=null,this.reloadNotes()})}}return(i=c).\u0275fac=function(n){return new(n||i)(t.Y36(x.F0),t.Y36(D.$g),t.Y36(A.e8),t.Y36(L.m),t.Y36(N.i),t.Y36(x.gz),t.Y36(t.sBO))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-patient-notes"]],viewQuery:function(n,o){if(1&n&&t.Gf(a.W2,7),2&n){let r;t.iGM(r=t.CRH())&&(o.content=r.first)}},decls:15,vars:9,consts:[["mode","ios",1,"ion-no-border"],["slot","start"],["text","",3,"defaultHref"],["mode","md","translate","patient_notes.title",3,"translateParams",4,"ngIf"],["slot","end"],[1,"clickable-icon",3,"disabled","click"],["name","add"],["forceOverscroll","false"],[1,"container"],[4,"ngIf","ngIfElse"],["loading",""],["mode","md","translate","patient_notes.title",3,"translateParams"],[3,"ionInfinite"],["loadingSpinner","circles"],["empty",""],[3,"note","edit","delete",4,"ngFor","ngForOf","ngForTrackBy"],[3,"note","edit","delete"],["translate","patient_notes.empty_list"],[1,"loader-container"],["name","circles"]],template:function(n,o){if(1&n&&(t.TgZ(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-buttons",1),t._UZ(3,"ion-back-button",2),t.qZA(),t.YNc(4,B,1,1,"ion-title",3),t.ALo(5,"async"),t.TgZ(6,"ion-buttons",4)(7,"ion-fab-button",5),t.NdJ("click",function(){return o.addNewPatientNote()}),t._UZ(8,"ion-icon",6),t.qZA()()()(),t.TgZ(9,"ion-content",7)(10,"div",8),t.YNc(11,J,6,2,"ng-container",9),t.ALo(12,"async"),t.YNc(13,W,2,0,"ng-template",null,10,t.W1O),t.qZA()()),2&n){const r=t.MAs(14);t.xp6(3),t.Q6J("defaultHref",o.backButtonLink),t.xp6(1),t.Q6J("ngIf",t.lcZ(5,5,o.patient$)),t.xp6(3),t.Q6J("disabled",o.modalDisabled),t.xp6(4),t.Q6J("ngIf",t.lcZ(12,7,o.infinite$))("ngIfElse",r)}},dependencies:[f.sg,f.O5,y.Pi,a.oU,a.Sm,a.W2,a.W4,a.Gu,a.gu,a.ju,a.MB,a.q_,a.PQ,a.yW,a.wd,a.sr,a.cs,U,f.Ov],styles:[".care-search-card[_ngcontent-%COMP%]{padding-top:12px}ion-fab-button[_ngcontent-%COMP%]{height:32px;width:32px;--background: #9AEAA1;--background-activated: none;--background-hover: none;
1--box-shadow: none;--color: #3A7B40}ion-fab-button[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{--ionicon-stroke-width: 48px}.loader-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;min-height:50px}"]}),c})()},{path:"new-note",loadChildren:()=>Promise.all([e.e(8592),e.e(8124)]).then(e.bind(e,88124)).then(i=>i.NewPatientNotePageModule)},{path:":patientNoteID/update-note",loadChildren:()=>Promise.all([e.e(8592),e.e(306)]).then(e.bind(e,40306)).then(i=>i.UpdatePatientNotePageModule)}];let R=(()=>{var i;class c{}return(i=c).\u0275fac=function(n){return new(n||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[f.ez,v.u5,$.K,M.uH,P.O,y.aw,m.$,a.Pc,x.Bz.forChild(_)]}),c})()},91520:(S,I,e)=>{e.d(I,{i:()=>$});var f=e(54004),v=e(66328),x=e(5830),a=e(42561),M=e(94650),y=e(80529);let $=(()=>{var m;class P extends x.s{constructor(s,d){super(),this.http=s,this.datesService=d}getMyPatientNotes(s,d){var u=this.getQueryString(d);return this.http.get(`${v.x$}/patients/${s}/my_notes?${u}`).pipe((0,f.U)(p=>{let h=p.meta;return(p=p.map(g=>this.datesService.momentDates(g,["createdAt"])).map(g=>this.datesService.localDates(g))).meta=h,p}))}getPatientNote(s,d,u){var p=this.getQueryString(u);return this.http.get(`${v.x$}/patients/${s}/my_notes/${d}?${p}`).pipe((0,f.U)(h=>this.datesService.momentDates(h,["createdAt"])),(0,f.U)(h=>this.datesService.localDates(h)))}storePatientNote(s,d){return this.http.post(`${v.x$}/patients/${s}/my_notes`,d)}editPatientNote(s,d,u){return this.http.patch(`${v.x$}/patients/${s}/my_notes/${d}`,u)}deletePatientNote(s,d){return this.http.delete(`${v.x$}/patients/${s}/my_notes/${d}`)}}return(m=P).\u0275fac=function(s){return new(s||m)(M.LFG(y.eN),M.LFG(a.X))},m.\u0275prov=M.Yz7({token:m,factory:m.\u0275fac,providedIn:"root"}),P})()},59468:(S,I,e)=>{e.d(I,{p:()=>$});var f=e(34049),v=e(54482),x=e(25403),a=e(38421),y=e(82805);function $(m,P=f.z,T){const s=(0,y.H)(m,P);return function M(m,P){return(0,v.e)((T,s)=>{const{leading:d=!0,trailing:u=!1}=P??{};let p=!1,h=null,g=null,O=!1;const Z=()=>{g?.unsubscribe(),g=null,u&&(A(),O&&s.complete())},E=()=>{g=null,O&&s.complete()},C=N=>g=(0,a.Xf)(m(N)).subscribe((0,x.x)(s,Z,E)),A=()=>{if(p){p=!1;const N=h;h=null,s.next(N),!O&&C(N)}};T.subscribe((0,x.x)(s,N=>{p=!0,h=N,(!g||g.closed)&&(d?A():C(N))},()=>{O=!0,(!(u&&p&&g)||g.closed)&&s.complete()}))})}(()=>s,T)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.