PageSourceSearch

https://www.stuffthatworks.health/static/EmrRegPage-DmNumfRX.js

js stuffthatworks.health collected 2026-10-02 04:20:03 UTC 15,360 bytes, 5 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/EmrConsent-BpmBs9Xr.js","static/vendor-BULYPieG.js","static/index-DtBiW3JA.js","static/index-cNMbgwTF.js","static/axios-DM81IqoM.js","static/index-BDlVQLkf.css","static/index-DPHo1nN5.js","static/index-CLrdreZM.js","static/index-B1Ey44YP.js","static/index-xEqTeCEC.js","static/index-77ztTTZc.js","static/reactHelpers-D64BF0VB.js","static/createSvgIcon-D_oRPyUU.js","static/index-CDsYt-OB.js","static/PrivacyContent-DEuW3Gsy.js","static/STWLinkify-XxtN-FQ6.js","static/assign-rOHA1vE4.js","static/_createAssigner-BYa6ISqC.js","static/sortBy-tPEZsVtO.js","static/_baseOrderBy-C7H6rSJt.js","static/STWLinkify-C0CcOt-H.css","static/stringJsxUtils-Cvk8Ycba.js","static/PrivacyContent-ByPuNiOB.css","static/Checkbox-KfUzR4k3.js","static/index-CoP8YZxe.js","static/SwitchBase-DTBs9EOl.js","static/withFormControlContext-bdvWlJl9.js","static/index-DE-k_iRt.js","static/checkbox-7vIHhJix.css","static/index-BQYu3QgF.js","static/index-Hth09u25.js","static/STWInput-BjmdnhxC.js","static/index-DMa9jXzA.js","static/index-Cjk_C4vz.js","static/STWInput-D_yW8sh4.css","static/datepicker-Dh-6NCCA.js","static/datepicker-TI_LyW6Y.css","static/EmrConsent-DFdrp4pF.css"])))=>i.map(i=>d[i]);
2import{cq as T,h3 as ue,dW as pe,b5 as me,D,F as w,_ as he,cm as J,bi as fe,bj as ge}from"./index-cNMbgwTF.js";import{T as e,r as u,at as ne,_ as Ce,R as b,g as ve,ad as we,Z as xe,Y as je,p as X}from"./vendor-BULYPieG.js";import{a as Se}from"./appPageHOC-DqeW18ZL.js";import"./App-BsSdbzRg.js";import{S as Ee}from"./STWInput-BjmdnhxC.js";import{S as Oe}from"./SearchIcon-D0ZbEzCT.js";import{C as Pe}from"./CancelIcon-DpM1bkgQ.js";import{L as Ae}from"./LoadingBox-BvwhTv0p.js";import{s as _e}from"./stringJsxUtils-Cvk8Ycba.js";import{u as ye}from"./uniqBy-CQuBZKyw.js";import"./axios-DM81IqoM.js";import"./_createAssigner-BYa6ISqC.js";import"./sumBy-DixUPtWG.js";import"./_baseOrderBy-C7H6rSJt.js";import"./index-DMa9jXzA.js";import"./index-Cjk_C4vz.js";import"./withFormControlContext-bdvWlJl9.js";import"./reactHelpers-D64BF0VB.js";import"./styleUtils-B9TBjsgZ.js";import"./index-DtBiW3JA.js";import"./assign-rOHA1vE4.js";import"./_baseUniq-5WFdTVpz.js";import"./_arrayIncludes-BTBUhNen.js";import"./noop-DX6rZLP_.js";const ee=({text:r,rootClass:s,children:t})=>e.jsx("div",{className:s,onClick:()=>window.open("https://api.whatsapp.com/send/?phone=17192122127","_blank"),children:e.jsxs("div",{className:"stw-whatsapp",children:[e.jsxs(T,{className:"stw-whatsapp-button",children:[e.jsx("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.873 11.3865C13.6377 11.2687 12.4808 10.6996 12.2651 10.6211C12.0494 10.5427 11.8925 10.5034 11.7357 10.7389C11.5788 10.9744 11.1278 11.5043 10.9905 11.6613C10.8533 11.8182 10.716 11.8379 10.4807 11.7201C10.2454 11.6024 9.48716 11.354 8.58835 10.5525C7.8888 9.92879 7.41653 9.15836 7.27924 8.92286C7.14199 8.68736 7.26463 8.56006 7.38247 8.44276C7.48828 8.3374 7.61775 8.16804 7.73541 8.03065C7.85307 7.89327 7.89229 7.79515 7.97073 7.63818C8.04917 7.48116 8.00995 7.34378 7.9511 7.22603C7.89229 7.10827 7.42169 5.95039 7.22559 5.47939C7.0346 5.02069 6.84058 5.08275 6.69614 5.07556C6.55902 5.06873 6.40201 5.06728 6.24513 5.06728C6.08824 5.06728 5.83334 5.12618 5.6176 5.36164C5.40191 5.59714 4.79402 6.16631 4.79402 7.32414C4.79402 8.48203 5.63723 9.60064 5.75489 9.75766C5.87256 9.91467 7.41423 12.2908 9.77477 13.3097C10.3362 13.5521 10.7746 13.6968 11.1163 13.8053C11.68 13.9843 12.193 13.9591 12.5985 13.8985C13.0505 13.831 13.9907 13.3294 14.1868 12.7799C14.3829 12.2304 14.3829 11.7594 14.3241 11.6613C14.2652 11.5631 14.1084 11.5043 13.873 11.3865ZM9.57732 17.247H9.57415C8.16955 17.2464 6.79191 16.8692 5.5901 16.1563L5.30425 15.9866L2.34165 16.7636L3.13243 13.876L2.94628 13.5799C2.16273 12.334 1.74891 10.894 1.7495 9.41543C1.75121 5.10092 5.26272 1.59077 9.58044 1.59077C11.6712 1.59159 13.6366 2.40662 15.1144 3.88568C16.5923 5.36479 17.4058 7.33087 17.405 9.42176C17.4032 13.7366 13.8917 17.247 9.57732 17.247ZM16.2441 2.7613C14.4661 0.98173 12.1014 0.00122261 9.58212 0.000226974C4.39119 0.000226974 0.166391 4.2234 0.164311 9.41437C0.163632 11.0737 0.597272 12.6934 1.4214 14.1211L0.0853271 18.9998L5.07784 17.6907C6.4534 18.4407 8.00213 18.8359 9.57836 18.8366H9.5822H9.58225C14.7727 18.8366 18.9978 14.6129 19 9.42188C19.0009 6.90626 18.0223 4.54082 16.2441 2.7613Z",fill:"white"})}),r&&e.jsxs("span",{className:"text",children:[" ",r]})]}),t]})});var oe=function(r){var s=r.decode,t=s===void 0?!0:s,o=r.crossOrigin,m=o===void 0?"":o;return function(c){return new Promise(function(p,f){var l=new Image;m&&(l.crossOrigin=m),l.onload=function(){t&&l.decode?l.decode().then(p).catch(f):p()}
2,l.onerror=f,l.src=c})}};function re(r,s){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);s&&(o=o.filter(function(m){return Object.getOwnPropertyDescriptor(r,m).enumerable})),t.push.apply(t,o)}return t}function M(r){for(var s=1;s<arguments.length;s++){var t=arguments[s]!=null?arguments[s]:{};s%2?re(Object(t),!0).forEach(function(o){ne(r,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):re(Object(t)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(t,o))})}return r}var Re=function(s){return s.filter(function(t){return t})},Le=function(s){return Array.isArray(s)?s:[s]},g={},Ne=function(s,t){var o=!1;return new Promise(function(m,c){var p=function(l){return t(l).then(function(){o=!0,m(l)})};s.reduce(function(f,l){return f.catch(function(){if(!o)return p(l)})},p(s.shift())).catch(c)})};function Te(r){var s=r.srcList,t=r.imgPromise,o=t===void 0?oe({decode:!0}):t,m=r.useSuspense,c=m===void 0?!0:m,p=u.useState(!1),f=p[1],l=Re(Le(s)),i=l.join("");if(g[i]||(g[i]={promise:Ne(l,o),cache:"pending",error:null}),g[i].cache==="resolved")return{src:g[i].src,isLoading:!1,error:null};if(g[i].cache==="rejected"){if(c)throw g[i].error;return{isLoading:!1,error:g[i].error,src:void 0}}if(g[i].promise.then(function(E){g[i]=M(M({},g[i]),{},{cache:"resolved",src:E}),c||f(i)}).catch(function(E){g[i]=M(M({},g[i]),{},{cache:"rejected",error:E}),c||f(i)}),c)throw g[i].promise;return{isLoading:!0,src:void 0,error:null}}var be=["decode","src","loader","unloader","container","loaderContainer","unloaderContainer","imgPromise","crossorigin","useSuspense"];function te(r,s){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);s&&(o=o.filter(function(m){return Object.getOwnPropertyDescriptor(r,m).enumerable})),t.push.apply(t,o)}return t}function $e(r){for(var s=1;s<arguments.length;s++){var t=arguments[s]!=null?arguments[s]:{};s%2?te(Object(t),!0).forEach(function(o){ne(r,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):te(Object(t)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(t,o))})}return r}var F=function(s){return s};function ke(r){var s=r.decode,t=s===void 0?!0:s,o=r.src,m=o===void 0?[]:o,c=r.loader,p=c===void 0?null:c,f=r.unloader,l=f===void 0?null:f,i=r.container,E=i===void 0?F:i,h=r.loaderContainer,y=h===void 0?F:h,C=r.unloaderContainer,$=C===void 0?F:C,R=r.imgPromise,L=r.crossorigin,d=r.useSuspense,P=d===void 0?!1:d,I=Ce(r,be);R=R||oe({decode:t,crossOrigin:L});var A=Te({srcList:m,imgPromise:R,useSuspense:P}),_=A.src,U=A.isLoading;return _?E(b.createElement("img",$e({src:_},I))):!P&&U?y(p):!P&&l?$(l):null}const De=({size:r=31})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 31 31",fill:"none",children:[e.jsx("circle",{cx:"15.5",cy:"15.5",r:"15",fill:"#75D678"}),e.jsx("path",{d:"M10.9688 17.0618L14.8359 21.1243L21.2812 10.8118",stroke:"white",strokeWidth:"3.70801",strokeLinecap:"round",strokeLinejoin:"round"})]});var Me=ue();const Ie=ve(Me),se="healthProviderId",Ue=()=>{var Y,Q,z;const r=we(),s=xe(),{userDetails:t,linkGenerator:o,texts:m,appDialog:c,useEmrConsent:p,startFullStory:f,stopFullStory:l}=u.useContext(me),[i,E]=b.useState([]),[h,y]=b.useState([]),[C,$]=b.useState(),[R,L]=b.useState(!1),d=m.emr_page,P=je(),{fetch:I,data:A,error:_}=D(),{fetch:U,data:a}=D(),{fetch:ae,data:N}=D(),{fetch:j}=D(),W=u.useRef(!1),H=u.useRef(!1);u.useEffect(()=>{p.hasConsent===null&&!W.current&&(W.current=!0,p.getConsentStatus()),p.hasConsent===!0&&!H.current&&(H.current=!0,j(w.EMR_BETA_SLACK,"POST",{message:`consented user in EMR Page 
3 path: ${window.location.href}`}))},[p.hasConsent]),u.useEffect(()=>{j(w.EMR_BETA_SLACK,"POST",{message:`user landed on EMR Page 
4 path: ${window.location.href}`}),he(()=>import("./EmrConsent-BpmBs9Xr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))},[]);const k={title:d.popups.error.title,content:e.jsxs("span",{className:"emr-page-dialog-content",children:[e.jsx("img",{className:"image",alt:"building-community",width:"300",src:J("/emrPage/error")}),e.jsx("div",{className:"text",children:d.popups.error.text}),e.jsxs("span",{className:"buttons",children:[e.jsx(ee,{text:d.popups.error.button.whats_app}),e.jsx(T,{variant:"contained",onClick:c.closeDialog,children:d.popups.error.button.cancel})]})]})},q={title:d.popups.success.title,content:e.jsxs("span",{className:"emr-page-dialog-content",children:[e.jsx("img",{className:"image",alt:"building-community",width:"300",src:J("/emrPage/success")}),e.jsx("div",{className:"text",children:_e(d.popups.success.text)}),e.jsx("span",{className:"buttons",children:e.jsx(T,{variant:"contained",onClick:c.closeDialog,children:d.popups.success.button})})]})},V=n=>P.push(o({moduleName:"EmrRegPage",params:{}}),{failed:n});u.useEffect(()=>
4{t&&ae(w.EMR_GET_PATIENT_HEALTH_PROVIDERS,"POST",{patientId:t==null?void 0:t.id})},[t,s]),u.useEffect(()=>{if(N!=null&&N.length){const n=ye(N,"healthProviderId");E(n)}else E([])},[N]),u.useEffect(()=>{U(w.EMR_PROVIDERS,"POST")},[]);const G=u.useRef(!1);u.useEffect(()=>{if(r.service&&(t!=null&&t.id)){const n=new URLSearchParams(window.location.search).get("code"),x=new URLSearchParams(window.location.search).get("error"),v=new URLSearchParams(window.location.search).get("error_description"),S=1e3*60*15,O=fe(se,S);if(n&&(O!=null&&O.id)&&!G.current){G.current=!0;const de={code:n,emrProvider:r.service.toUpperCase(),healthProviderId:O.id,isLocalRedirect:!1};I(w.UPDATE_EMR_CODE,"POST",de),P.replace(window.location.pathname),c.setOpenDialogWithContent("Please wait while we connect to your health provider.","",!0,void 0,void 0,!0)}x&&(c.closeDialog(),c.setOpenDialogWithContent(k.title,k.content,!0),j(w.EMR_BETA_SLACK,"POST",{message:`EMR Error - ${r.service} - ${x}`}),V(!0),console.log({error:x,errorDescription:v}))}},[r.service,t]),u.useEffect(()=>{_&&(c.closeDialog(),c.setOpenDialogWithContent(k.title,k.content,!0),j(w.EMR_BETA_SLACK,"POST",{message:`EMR Error - ${r.service} - ${_}`}),V(!1))},[_]),u.useEffect(()=>{A&&(c.closeDialog(),c.setOpenDialogWithContent(q.title,q.content,!0),j(w.EMR_BETA_SLACK,"POST",{message:`EMR Success - ${r.service} - ${A}`}))},[A]);const ie=(n,x)=>{const v=x.toLowerCase();return n.filter(S=>S.ECMId!=="999999999"&&S.name.toLowerCase().includes(v))};u.useEffect(()=>{a!=null&&a.providers&&y(ie(a==null?void 0:a.providers,C||""))},[a,C]);const B=u.useRef();u.useEffect(()=>{if(clearTimeout(B.current),!!C)return B.current=setTimeout(()=>{j(w.EMR_BETA_SLACK,"POST",{message:`EMR Search - "${C}" - ${h.length} result(s)`})},800),()=>clearTimeout(B.current)},[C,h]);const ce=()=>"?response_type=code&client_id=f2ad0059-c9a7-4533-b69e-a293a46d04ec&redirect_uri=https://www.stuffthatworks.health/emr/epic";u.useEffect(()=>{a!=null&&a.providers&&y(a==null?void 0:a.providers.slice(0,40))},[a]);const le=()=>{j(w.EMR_BETA_SLACK,"POST",{message:"EMR View more providers clicked"}),y(a==null?void 0:a.providers)},Z=(n,x,v,S)=>{j(w.EMR_BETA_SLACK,"POST",{message:`EMR ${S} clicked- ${v.name} - ${v.healthProviderId}`}),ge(se,{id:v==null?void 0:v.healthProviderId}),p.hasConsent!==!0&&(n.preventDefault(),p.handleOpenEmrConsentFlow(x))},K=(n,x)=>{if(!n.signupUrl||!n.authUrl)return null;const v=`${n.authUrl.replace("https//","https://")}${ce()}`,S=n.signupUrl.replace("https//","https://").trim();return e.jsxs("div",{className:"emr-page-provider-container",children:[e.jsx("div",{className:"emr-page-provider-image",children:e.jsx(ke,{src:[n.imageUrl.replace("https//","https://"),"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="],alt:n.name})}),e.jsx("div",{className:"vert-line"}),e.jsxs("div",{className:"emr-page-provider-name",children:[e.jsx("div",{className:"name",children:n.name}),e.jsx("div",{className:"brandName",children:n.brandName})]}),e.jsx("div",{className:"horz-line"}),x?e.jsxs("div",{className:"emr-page-provider-button connected",children:[e.jsx(De,{}),"Connected"]}):e.jsxs("div",{className:"emr-page-provider-button",children:[n.authUrl&&e.jsx(T,{className:"connect",variant:"contained",onClick:O=>Z(O,v,n,"Connect"),href:v,children:"Connect"}),n.signupUrl&&e.jsx(T,{className:"signup",variant:"contained",onClick:O=>Z(O,S,n,"Sign Up"),href:S,children:"Sign Up"})]})]},n.healthProviderId)};return u.useEffect(()=>(f("EmrRegPage"),()=>{l()}),[]),e.jsx("div",{className:X("emr-page-outer fs-unmask"),children:e.jsx("div",{className:"emr-page-container",children:e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"emr-page-title",children:d.title}),e.jsx("div",{className:"emr-page-text",children:d.text}),e.jsx(Ie,{onClickAway:()=>L(!1),children:e.jsxs("div",{className:"search-and-results",children:[e.jsx(Ee,{disabled:!(a!=null&&a.providers),className:X("search-providers fs-unmask"),placeholder:d.search,value:C||"",onKeyDown:n=>{n.key==="Enter"&&L(!1)},onChange:n=>{L(!0),$(n.target.value)},startAdornment:e.jsx(Oe,{}),endAdornment:e.jsx(Pe,{onClick:()=>{$("")}})}),R&&C&&!!(h!=null&&h.length)&&e.jsxs("div",{className:"search-dropdown",children:[" ",h.map(n=>K(n,!1))]})]})}),e.jsxs("div",{className:"need-help",onClick:()=>j(w.EMR_BETA_SLACK,"POST",{message:"EMR Need help (WhatsApp) clicked"}),children:[e.jsx("div",{className:"not-all",children:d.not_all}),e.jsx(ee,{rootClass:"round-wa",children:e.jsx("div",{className:"need-help-text",children:d.need_help})})]}
4),e.jsxs("div",{className:"emr-page-your-providers",children:[e.jsx("div",{className:"mini-title",children:d.your_providers}),e.jsx("div",{className:"emr-page-your-providers-list",children:i!=null&&i.length?i.map(n=>e.jsx(e.Fragment,{children:K(n,!0)})):e.jsx("div",{className:"no-selected-provider",children:d.no_selected_provider})})]}),e.jsxs("div",{className:"mini-title",children:[" ",d.available_providers.replace("%count%",`${C?(h==null?void 0:h.length)||"":((Y=a==null?void 0:a.providers)==null?void 0:Y.length)||""}`||"")]}),(Q=a==null?void 0:a.providers)!=null&&Q.length?h.map(n=>K(n,!1)):e.jsx("div",{children:[0,1,2,3].map(n=>e.jsx(Ae,{rootClass:"emr-page-provider-container loading",heightPx:180,widthPercentage:100},n))}),!C&&h.length<((z=a==null?void 0:a.providers)==null?void 0:z.length)&&e.jsx("div",{className:"view-more",onClick:le,children:d.view_more}),e.jsx(e.Fragment,{})]})})})},dr=Se({pageType:pe.COMMUNITY})(Ue);export{dr as EmrRegPage};
5//# sourceMappingURL=EmrRegPage-DmNumfRX.js.map

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.