PageSourceSearch

https://pocketdocapp.com/patient-search.17d1d7f7.js

js pocketdocapp.com collected 2026-10-02 00:54:49 UTC 13,994 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpocketdoc_web=self.webpackChunkpocketdoc_web||[]).push([[8223],{32225:function(e,t,r){r.r(t);var n=r(64467),a=r(10467),o=r(80296),i=r(67881),l=r(54756),c=r.n(l),u=r(96540),s=r(52594),d=r(33876),p=r(25381),m=r(39023),h=r(46756),f=r(65088),v=r(91319),g=r(90380),b=r(97933),y=r(98765),w=r(77266),E=r(20207),x=r(56767),A=r(49638),I=r(99634),k=r(90772),O=r(44726),S=r(97101),P=r(20982),R=r(66188),C=r(14740),N=r(31114),j=r(85930),D=r(96763);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var F=(0,p.Yj)().test("nameOrMrn","Invalid MRN format. Please enter exactly 8 digits.",function(e){if(!e)return!0;var t=(e.match(/\d+/g)||[]).map(function(e){return e.length}),r=t.some(function(e){return e>8});return!(t.filter(function(e){return 8===e}).length>1)&&!r}),T=(0,p.Ik)().shape({nameOrMrn:F,dob:(0,p.Yj)().matches(/(\d{2})\/(\d{2})\/(\d{4})/,{message:"Invalid date of birth.",excludeEmptyString:!0}),phone:(0,p.Yj)().matches(/^\d{10}$/,{message:"Invalid phone number.",excludeEmptyString:!0}),email:(0,p.Yj)().email("Invalid email address.")}),V={nameOrMrn:"",dob:"",phone:"",email:""},z=function(e){return!!e.trim().match(/^\d+$/)}
1,W=function(e){var t=e.onPatientSelect,r=e.onRegisterSelect,n=e.initialPhone,i=(0,u.useState)(),l=(0,o.A)(i,2),d=l[0],p=l[1],h=(0,u.useState)(""),g=(0,o.A)(h,2),b=g[0],y=g[1],E=(0,u.useState)(""),k=(0,o.A)(E,2),O=k[0],P=k[1],M=(0,u.useState)(!1),F=(0,o.A)(M,2),W=F[0],B=F[1],$=(0,u.useState)(!1),H=(0,o.A)($,2),pe=H[0],me=H[1],he=(0,u.useState)(null),fe=(0,o.A)(he,2),ve=fe[0],ge=fe[1],be=(0,j.d0)(),ye=(0,u.useRef)(null),we=(0,C.O$)(function(e){return e.flash.searchSource}),Ee=(0,C.E9)(function(e){return e.flash.setSearchSource});(0,u.useEffect)(function(){n&&ye.current&&we===N.Cy.LIVE_SEARCH&&(ye.current&&(ye.current.setFieldValue("nameOrMrn",""),ye.current.setFieldValue("dob",""),ye.current.setFieldValue("phone",""),ye.current.setFieldValue("email","")),ye.current.setFieldValue("phone",n),ye.current.submitForm(),Ee(null))},[n,we]);var xe=function(){var e=(0,a.A)(c().mark(function e(r,n){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null===ve){e.next=1;break}return e.abrupt("return");case 1:return ge(n),e.prev=2,e.next=3,t(r);case 3:return e.prev=3,ge(null),e.finish(3);case 4:case"end":return e.stop()}},e,null,[[2,,3,4]])}));return function(t,r){return e.apply(this,arguments)}}(),Ae=function(){var e=(0,a.A)(c().mark(function e(t,r){var n,a,i,l,u,s,d,m,h,g,b,E;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.setSubmitting,a=r.setFieldValue,P(""),t.nameOrMrn||t.dob||t.phone||t.email){e.next=1;break}return P("A name, MRN, date of birth, phone number, or email must be provided in order to search patients."),e.abrupt("return");case 1:return n(!0),y(""),p(void 0),me(W),e.prev=2,e.next=3,Promise.all([(0,w.A)(t).catch(function(e){return D.error("Epic search failed:",e),f.Cp(e),i=e,[]}),(0,x.A)({name:z(t.nameOrMrn)?void 0:t.nameOrMrn,mrn:z(t.nameOrMrn)?t.nameOrMrn:void 0,phone:t.phone.replace(/[^0-9+]/g,"")||void 0,dob:t.dob||void 0,email:t.email||void 0}).catch(function(e){return D.error("PocketDoc search failed:",e),f.Cp(e),l=e,[]})]);case 3:if(u=e.sent,s=(0,o.A)(u,2),d=s[0],m=s[1],!i&&!l){e.next=4;break}return y("System is down - unable to connect to server. Please try again in a moment."),e.abrupt("return");case 4:h={nameQuery:z(t.nameOrMrn)?void 0:t.nameOrMrn,mrn:z(t.nameOrMrn)?t.nameOrMrn:void 0,dob:t.dob||void 0,phone:t.phone.replace(/[^0-9+]/g,"")||void 0},g=(0,A.n0)(d,m,h),p(g),b=[],t.nameOrMrn&&b.push(z(t.nameOrMrn)?"mrn":"name"),t.dob&&b.push("dob"),t.phone&&b.push("phone"),t.email&&b.push("email"),(0,j.L9)({searchType:b.join(",")||"none",advancedSearch:W,epicResultCount:d.length,pocketDocResultCount:m.length,mergedResultCount:g.length,employeeProperties:be}),0===g.length&&t.phone&&a("phone",""),e.next=6;break;case 5:e.prev=5,E=e.catch(2),y((0,v.getErrorFromResponse)(E)),f.Cp(E);case 6:return e.prev=6,n(!1),e.finish(6);case 7:case"end":return e.stop()}},e,null,[[2,5,6,7]])}));return function(t,r){return e.apply(this,arguments)}}();return u.createElement(m.l1,{innerRef:ye,onSubmit:Ae,initialValues:L(L({},V),{},{phone:n||""}),validationSchema:T},function(e){var t=e.isSubmitting,n=e.values,a=e.setFieldValue;return u.createElement(Y,null,u.createElement(_,null,u.createElement(J,null,"Patient Lookup"),u.createElement(Q,{onClick:function(){return r(n)}},"+ Create New Patient")),u.createElement(U,null,u.createElement(q,null,u.createElement(G,null,u.createElement(K,null,u.createElement(X,null,"Name or MRN"),u.createElement(S.A,{content:'Enter a patient\'s name ("First Last" or "Last, First") or their 8-digit MRN.'},u.createElement(Z,null,u.createElement(ee,{size:"sm",icon:R.iW_})))),u.createElement(s.pd.Formik,{name:"nameOrMrn",autoComplete:"off",disabled:t,autoFocus:!0})),u.createElement(te,null,u.createElement(s.ar,{name:"dob",label:"Date of Birth"},u.createElement(s.J3.Formik,{name:"dob",disabled:t}))),u.createElement(re,null,u.createElement(s.ar,{name:"phone",label:"Phone Number"},u.createElement(s.LR,{name:"phone",value:n.phone,disabled:t,onChange:function(e){return a("phone",e.target.rawValue)}}))),u.createElement(ne,null,u.createElement(ae,{type:"submit",disabled:t},t?u.createElement(s.y$,{size:"small",white:!0}):"Search"))),W&&u.createElement(oe,null,u.createElement(ie,null,u.createElement(s.pd.Formik,{name:"email",label:"Email",disabled:t,autoComplete:"off",placeholder:"[email protected]"}))),u.createElement(le,{type:"button",onClick:function(){return B(!W)}},u.createElement("span",null,"Advanced Search"),u.createElement(ce,{icon:W?R.w2A:R.Jt$})),O&&u.createElement(ue,null,O)),b&&u.createElement(se,{type:"error"},u.createElement(de,null,"An error occurred:")," ",b),u.createElement(I.A,{onResultSelect:xe,onRegisterSelect:function(){return r(n)},searchValues:{dateOfBirth:n.dob,phoneNumber:n.phone}
1,results:d,showEmail:pe,selectingIndex:ve}))})},B=(0,i.DU)(["body{",";}"],{"--tw-bg-opacity":"1",backgroundColor:"rgb(243 244 246 / var(--tw-bg-opacity, 1))"}),$=function(e){var t=e.children;return u.createElement(pe,null,t)},H=function(e){var t,r,n,a=(0,O.Lz)((null==e?void 0:e.nameOrMrn)||"");return{firstName:a.firstName,lastName:a.lastName,phoneNumber:null!==(t=null==e?void 0:e.phone)&&void 0!==t?t:"",email:null!==(r=null==e?void 0:e.email)&&void 0!==r?r:"",dateOfBirth:null!==(n=null==e?void 0:e.dob)&&void 0!==n?n:"",gender:"",address:"",addressLine2:"",city:"",state:"",zip:""}};t.default=function(){var e,t,r=(0,u.useState)("Lookup"),n=(0,o.A)(r,2),i=n[0],l=n[1],s=(0,u.useState)(),d=(0,o.A)(s,2),p=d[0],m=d[1],v=(0,h.W6)(),w=null!==(e=null===(t=(0,h.zy)().state)||void 0===t?void 0:t.callerPhone)&&void 0!==e?e:"",A=(0,C.E9)(function(e){return e.flash.setEpicPatient}),I=(0,C.E9)(function(e){return e.flash.setProfileViewSource}),O=(0,C.O$)(function(e){return e.flash.searchSource}),S=(0,C.E9)(function(e){return e.flash.setSearchSource}),P=(0,j.d0)(),R=(0,b.r)().isLoaded;(0,u.useEffect)(function(){(0,j.zh)({src:O||N.Cy.DIRECT,employeeProperties:P}),S(null)},[]);var M=function(){var e=(0,a.A)(c().mark(function e(t){var r,n,a,o,i,l,u,s,d,p,m,h,b,w,k;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(I(N.IY.SEARCH),!t.childId||!t.pocketDocId){e.next=1;break}return v.push("".concat(g.RN,"/").concat(t.pocketDocId).concat(g.$t,"/").concat(t.childId)),e.abrupt("return");case 1:if(!t.pocketDocId){e.next=2;break}return(0,j.OO)({source:t.source,hasChildren:!(null===(n=t.childrenNames)||void 0===n||!n.length),employeeProperties:P}),v.push("".concat(g.RN,"/").concat(t.pocketDocId)),e.abrupt("return");case 2:if(!(a=null===(r=t.emrIds.find(function(e){return e.Type===y.jv.EPI}))||void 0===r?void 0:r.ID)){e.next=12;break}return e.prev=3,e.next=4,(0,x.A)({epi:a});case 4:if(1!==(o=e.sent).length){e.next=10;break}if(u=o[0],(s=null===(i=u.children)||void 0===i?void 0:i.find(function(e){var t;return null===(t=e.epicPatientIDs)||void 0===t?void 0:t.some(function(e){return e.Type===y.jv.EPI&&e.ID===a})}))||u.patientEpicId===a){e.next=8;break}return e.prev=5,e.next=6,(0,E.A)(u.id);case 6:p=e.sent,s=null===(d=p.children)||void 0===d?void 0:d.find(function(e){var t;return null===(t=e.epicPatientIDs)||void 0===t?void 0:t.some(function(e){return e.Type===y.jv.EPI&&e.ID===a})}),e.next=8;break;case 7:e.prev=7,e.catch(5);case 8:if(!s){e.next=9;break}return v.push("".concat(g.RN,"/").concat(u.id).concat(g.$t,"/").concat(s.id)),e.abrupt("return");case 9:return(0,j.OO)({source:"both",hasChildren:!(null===(l=u.children)||void 0===l||!l.length),employeeProperties:P}),v.push("".concat(g.RN,"/").concat(u.id)),e.abrupt("return");case 10:o.length>1&&f.wd("Multiple PocketDoc patients found for EPI ".concat(a," during search-result selection"),"warning"),e.next=12;break;case 11:e.prev=11,k=e.catch(3),D.error("EPI-based PocketDoc lookup failed:",k),f.Cp(k);case 12:t.epicResult&&((0,j.OO)({source:t.source,hasChildren:!(null===(m=t.childrenNames)||void 0===m||!m.length),employeeProperties:P}),A(t.epicResult),(w=null===(h=t.epicResult.emrIds)||void 0===h||null===(b=h.find(function(e){return e.Type===y.jv.EPI}))||void 0===b?void 0:b.ID)?v.push("".concat(g.RN,"/epic"),{epi:w}):(sessionStorage.removeItem("epicPatientEpi"),v.push("".concat(g.RN,"/epic"))));case 13:case"end":return e.stop()}},e,null,[[3,11],[5,7]])}));return function(t){return e.apply(this,arguments)}}();return u.createElement(me,null,u.createElement(B,null),u.createElement($,null,"Lookup"===i&&u.createElement(W,{onPatientSelect:M,onRegisterSelect:function(e){m(e),l("Register")},initialPhone:w}),"Register"===i&&u.createElement(u.Fragment,null,u.createElement(he,null,u.createElement(fe,{onClick:function(){return l("Lookup")}},"← Back to Search")),u.createElement(k.A,{initialValues:H(p),mapsLoaded:R,onComplete:function(e,t){M({source:"epic",firstName:t.firstName,lastName:t.lastName,dateOfBirth:t.dateOfBirth,phones:t.phone?[t.phone]:[],gender:t.gender,emrIds:t.emrIds,epicResult:{firstName:t.firstName,lastName:t.lastName,dateOfBirth:t.dateOfBirth,phones:t.phone?[t.phone]:[],gender:t.gender,emrIds:t.emrIds}})},onDuplicateSelected:function(e,t){var r,n;A(t);var a=null===(r=t.emrIds)||void 0===r||null===(n=r.find(function(e){return e.Type===y.jv.EPI}))||void 0===n?void 0:n.ID;a?v.push("".concat(g.RN,"/epic"),{epi:a}):(sessionStorage.removeItem("epicPatientEpi"),v.push("".concat(g.RN,"/epic")))}}))))};var Y=(0,i.Ay)("div")({width:"100%"}),_=(0,i.Ay)("div")({display:"flex",alignItems:"center",justifyContent:"space-between"}),J=(0,i.Ay)("p")({fontSize:"1.875rem",fontWeight:"500",lineHeight:"2.25rem","--tw-text-opacity":"1",color:"rgb(19 26 32 / var(--tw-text-opacity, 1))"}),Q=(0,i.Ay)("button")({borderRadius:"0.25rem",borderWidth:"1px","--tw-border-opacity":"1",borderColor:"rgb(229 231 235 / var(--tw-border-opacity, 1))","--tw-bg-opacity":"1",backgroundColor:"rgb(243 244 246 / var(--tw-bg-opacity, 1))",paddingLeft:"1rem",paddingRight:"1rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",fontWeight:"500",lineHeight:"1.25rem","&:hover":{"--tw-bg-opacity":"1",backgroundColor:"rgb(229 231 235 / var(--tw-bg-opacity, 1))"}}),U=(0,i.Ay)(m.lV)({width:"100%"}),q=(0,i.Ay)("div")({marginTop:"1.5rem",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.75rem"}),G=(0,i.Ay)("div")({minWidth:"200px",flex:"1 1 0%"}),K=(0,i.Ay)("div")({display:"flex",alignItems:"center"}),X=(0,i.Ay)("label")({"--tw-text-opacity":"1",color:"rgb(55 65 81 / var(--tw-text-opacity, 1))"}),Z=(0,i.Ay)("span")({marginLeft:"0.25rem"}),ee=(0,i.Ay)(P.g)({"--tw-text-opacity":"1",color:"rgb(156 163 175 / var(--tw-text-opacity, 1))"}),te=(0,i.Ay)("div")({width:"200px"}),re=(0,i.Ay)("div")({width:"200px"}),ne=(0,i.Ay)("div")({marginTop:"1.25rem",display:"flex",alignItems:"center",justifyContent:"center"}),ae=(0,i.Ay)(d.$)({height:"47px",width:"6rem",alignItems:"center",justifyContent:"center"}),oe=(0,i.Ay)("div")({marginTop:"0.75rem",display:"flex",alignItems:"flex-start",ga
1p:"0.75rem"}),ie=(0,i.Ay)("div")({width:"300px"}),le=(0,i.Ay)("button")({marginTop:"0.5rem",display:"flex",alignItems:"center",fontSize:"0.875rem",fontWeight:"500",lineHeight:"1.25rem","--tw-text-opacity":"1",color:"rgb(5 150 105 / var(--tw-text-opacity, 1))","&:hover":{"--tw-text-opacity":"1",color:"rgb(4 120 87 / var(--tw-text-opacity, 1))"}}),ce=(0,i.Ay)(P.g)({marginLeft:"0.375rem",height:"0.625rem",width:"0.625rem"}),ue=(0,i.Ay)("div")({marginTop:"0.5rem",fontSize:"0.875rem",lineHeight:"1.25rem","--tw-text-opacity":"1",color:"rgb(239 68 68 / var(--tw-text-opacity, 1))"}),se=(0,i.Ay)(s.IC)({marginTop:"1rem"}),de=(0,i.Ay)("strong")({fontWeight:"500"}),pe=(0,i.Ay)("div")({display:"flex",flexDirection:"column",alignItems:"flex-start",borderRadius:"0.5rem","--tw-bg-opacity":"1",backgroundColor:"rgb(255 255 255 / var(--tw-bg-opacity, 1))",padding:"2rem","--tw-shadow":"0 1px 2px 0 rgba(0, 0, 0, 0.05)","--tw-shadow-colored":"0 1px 2px 0 var(--tw-shadow-color)",boxShadow:"var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
1dow)"}),me=(0,i.Ay)("div")({marginLeft:"auto",marginRight:"auto",maxWidth:"72rem"}),he=(0,i.Ay)("div")({marginBottom:"1.5rem",width:"100%"}),fe=(0,i.Ay)("button").withConfig({componentId:"sc-9wk30s-0"})({fontSize:"0.875rem",fontWeight:"500",lineHeight:"1.25rem","--tw-text-opacity":"1",color:"rgb(107 114 128 / var(--tw-text-opacity, 1))","&:hover":{"--tw-text-opacity":"1",color:"rgb(55 65 81 / var(--tw-text-opacity, 1))"}})}}]);

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.