PageSourceSearch

https://novellia.com/_next/static/chunks/pages/patient/allergies-7d6cab890269c9b8.js

js novellia.com collected 2026-09-24 22:15:13 UTC 7,912 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="37006f2b-2f3b-4fbd-857d-008a58150db8",e._sentryDebugIdIdentifier="sentry-dbid-37006f2b-2f3b-4fbd-857d-008a58150db8")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4731],{98456:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/patient/allergies",function(){return n(83915)}])},98289:function(e,t,n){"use strict";n.d(t,{M:function(){return u}});var i=n(85893),a=n(22218),l=n(19645),r=n(71124),o=n(51039),s=n(4975),c=n(84653);let u={SM:r.$u.SM,MD:r.$u.MD},d=e=>({display:"inline-flex",alignItems:"center",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),flexShrink:0,borderRadius:"".concat(e.shape.borderRadiusTokens[r.cM.EXTRA_SMALL],"px"),backgroundColor:e.palette.layout.muted}),f=e=>({[u.SM]:{height:e.spacing(5),gap:e.spacing(1)},[u.MD]:{height:e.spacing(7),gap:e.spacing(2)}}),g={[u.SM]:a.E4.SM,[u.MD]:a.E4.REG};t.Z=e=>{let{count:t,label:n="records",size:p=u.MD}=e,h="merged"===n?"".concat(t," merged"):(0,o.CZ)(t,"record");return(0,i.jsxs)(c.Z,{sx:e=>({...d(e),...f(e)[p]}),children:[(0,i.jsx)(a.AY,{icon:s.kgl3,size:g[p],colorScheme:r.eL.LAYOUT_ACCENT,colorProperty:r.g8.FOREGROUND,accent:{pathKeys:["1","2"],colorScheme:r.eL.LAYOUT,colorProperty:r.g8.RING}}),p===u.SM?(0,i.jsx)(l.YS,{component:"span",colorScheme:r.eL.LAYOUT,colorProperty:r.g8.FOREGROUND,children:h}):(0,i.jsx)(l.uT,{size:"sm",fontWeight:"semibold",colorScheme:r.eL.LAYOUT,colorProperty:r.g8.FOREGROUND,children:h})]})}},34512:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});let i=(0,n(82457).P)("\n  query PaginatedAllergies(\n    $offset: Int, $limit: Int,\n    $sortBy: AllergySortField, $sortDirection: SortDirection,\n    $searchTerm: String,\n    $clinicalStatuses: [AllergyClinicalStatus!],\n    $criticalities: [AllergyCriticality!],\n    $startDate: DateTime, $endDate: DateTime\n  ) {\n    paginatedAllergies(\n      offset: $offset, limit: $limit,\n      sortBy: $sortBy, sortDirection: $sortDirection,\n      searchTerm: $searchTerm,\n      clinicalStatuses: $clinicalStatuses,\n      criticalities: $criticalities,\n      startDate: $startDate, endDate: $endDate\n    ) {\n      items {\n        novelliaResourceId\n        name\n        clinicalStatus\n        criticality\n        reaction\n        recordedDate\n        recorder\n        pinned\n        recordStatus\n        patientId\n        dataSupportLabel\n        lastEditedAt\n        lastEditedByLabel\n        createdBy {\n          label\n          source\n        }\n        userGeneratedNotes {\n          content\n          id\n          novelliaResourceId\n          patientPortalResourceType\n          readOnly\n          updatedAt\n        }\n        resourceCollections {\n          id\n          name\n          description\n          color\n          icon\n          type\n          entryCount\n        }\n      }\n      pagination {\n        totalCount\n        offset\n        limit\n        hasNextPage\n      }\n    }\n  }\n")},64142:function(e,t,n){"use strict";var i=n(67294),a=n(6812);t.Z=function(e,t){var n,l,r;let{variables:o,skip:s}=t,[c,u]=(0,i.useState)(0),[d,f]=(0,i.useState)([]),[g,p]=(0,i.useState)(0);(0,i.useEffect)(()=>{u(0)},[JSON.stringify(o)]);let{data:h,loading:S,refetch:y}=(0,a.aM)(e,{skip:s,variables:{...o,offset:c,limit:25},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),v=S||!!s,b=Object.values(h||{}).find(e=>e&&"object"==typeof e&&"pagination"in e),m=null!==(n=null==b?void 0:b.items)&&void 0!==n?n:[],C=null!==(l=null==b?void 0:b.pagination)&&void 0!==l?l:null,D=JSON.stringify(m),A=(0,i.useRef)("");(0,i.useEffect)(()=>{A.current=""},[JSON.stringify(o)]),(0,i.useEffect)(()=>{D!==A.current&&(A.current=D,0===c?f(m):f(e=>[...e,...m]))},[D,c,g]);let L=null!==(r=null==C?void 0:C.hasNextPage)&&void 0!==r&&r,E=0===c?m:d,R=(0,i.useCallback)(()=>{L&&u(e=>e+25)},[L]),T=(0,i.useCallback)(async()=>{u(0);let e=Object.values((await y({...o,offset:0,limit:25})).data||{}).find(e=>e&&"object"==typeof e&&"pagination"in e);e&&f(e.items)},[y,o]),$=C?{totalCount:C.totalCount,currentCount:E.length,limit:C.limit,onLoadMore:R}:void 0;return{items:E,pagination:C,paginationConfig:$,loading:v,hasMore:L,showMore:R,refetch:T}}},83915:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var i=n(85893),a=n(67294),l=n(11163),r=n(3352),o=n(96753),s=n(83472),c=n(71413),u=n(34512),d=n(64142),f=n(88840),g=n(52394),p=n(62146);let h=[{value:"status",label:"Status (Active → Resolved)"},{value:"name",label:"Name (A–Z)"},{value:"date",label:"Date (Newest → Oldest)"}],S=[{value:"active",label:"Active"},{value:"resolved",label:"Resolved"}],y=c.$S3.CLINICAL_STATUS,v={status:c.$S3.CLINICAL_STATUS,name:c.$S3.NAME,date:c.$
1S3.DATE},b={active:c.ChL.ACTIVE,resolved:c.ChL.RESOLVED};var m=n(29295);let C={high:"Life-threatening",low:"Non life-threatening","unable-to-assess":"Unable to assess"};var D=()=>{let e=(0,l.useRouter)(),[t,n]=(0,a.useState)(""),[D,A]=(0,a.useState)(null),[L,E]=(0,a.useState)(!1),[R,T]=(0,a.useState)("status"),[$,N]=(0,a.useState)(c.SrV.ASC),[w,I]=(0,a.useState)([]),[O,_]=(0,a.useState)(),[M,k]=(0,a.useState)(),x=v[R]||y,j=w.map(e=>b[e]).filter(Boolean),{items:P,loading:G,paginationConfig:U,refetch:Z}=(0,d.Z)(u.z,{variables:{searchTerm:t||void 0,sortBy:x,sortDirection:$,clinicalStatuses:j.length>0?j:void 0,startDate:O,endDate:M}}),Y=(0,a.useCallback)(t=>{e.push("".concat(f.i,"/allergies/").concat(t))},[e]),B=(0,a.useMemo)(()=>(function(e){let t=new Map;for(let l of e){var n,i,a;let e=(null!==(a=l.name)&&void 0!==a?a:"").toLowerCase(),r=t.get(e);if(!r){t.set(e,{record:l,instanceCount:1});continue}r.instanceCount+=1;let o=(null===(n=r.record.clinicalStatus)||void 0===n?void 0:n.toLowerCase())==="active",s=(null===(i=l.clinicalStatus)||void 0===i?void 0:i.toLowerCase())==="active";if(s&&!o){r.record=l;continue}if(o&&!s)continue;let c=r.record.recordedDate?new Date(r.record.recordedDate).getTime():0;(l.recordedDate?new Date(l.recordedDate).getTime():0)>c&&(r.record=l)}return Array.from(t.values())})(null!=P?P:[]),[P]),V=!!B.length;return(0,i.jsxs)(g.Z,{currType:o.ek.ALLERGY,fullBleed:!0,refetch:Z,children:[(0,i.jsx)(p.Z,{title:"Allergies",searchPlaceholder:"Search allergies",searchValue:t,onSearchChange:n,isLoading:G,isEmpty:!G&&!V,recordTypeLabel:"allergy",sortConfig:{options:h,activeValue:R,onChange:e=>{T(e),"date"===e?N(c.SrV.DESC):N(c.SrV.ASC)}},filterConfig:{title:"Status",filterGroups:[{title:"Allergy status",options:S}],selectedValues:w,onApply:I},dateRangeEnabled:!0,hasActiveDateRange:!!(O||M),onDateRangeChange:(e,t)=>
1{_(e),k(t)},onAddRecord:()=>E(!0),paginationConfig:U,children:B.map(e=>{let{record:t,instanceCount:n}=e;if(!t)return null;let a=function(e,t){let n=[];if(null!=t&&t>1&&n.push({label:"Total incidents",value:String(t)}),e.recordedDate&&n.push({label:"Last incident",value:(0,m.$X)(e.recordedDate)}),e.criticality){let t=C[e.criticality.toLowerCase()];n.push({label:"Severity",value:null!=t?t:e.criticality})}let i=function(e){if(!e)return;let t=Array.isArray(e)?e:[e];if(0!==t.length)return t.length<=2?t.join(", "):"".concat(t.slice(0,2).join(", ")," + ").concat(t.length-2," more")}(e.reaction);return i&&n.push({label:"Reaction",value:i}),n}(t,n);return(0,i.jsx)(s.Z,{record:t,onClick:()=>Y(t.novelliaResourceId),supportingInfo:a.length>0?a:void 0,medicalRecordType:o.ek.ALLERGY,patientPortalResourceType:c.lyM.ALLERGY_INTOLERANCE,refetch:Z,handleEdit:()=>{A(t),E(!0)}},t.novelliaResourceId)})}),(0,i.jsx)(r.Z,{open:L,onClose:()=>{E(!1),A(null)},item:null!=D?D:void 0})]})},A=()=>(0,i.jsx)(D,{})}},function(e){e.O(0,[6513,4090,4612,3144,4457,7932,4925,983,2906,3472,2146,2888,9774,179],function(){return e(e.s=98456)}),_N_E=e.O()}]);

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.