@pih/esm-audit-app 2.1.1-pre.142 → 2.1.1-pre.148

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/README.md +97 -3
  3. package/dist/115.js +1 -1
  4. package/dist/115.js.map +1 -1
  5. package/dist/117.js +1 -1
  6. package/dist/117.js.map +1 -1
  7. package/dist/508.js +1 -1
  8. package/dist/508.js.map +1 -1
  9. package/dist/514.js +1 -0
  10. package/dist/514.js.map +1 -0
  11. package/dist/912.js +1 -1
  12. package/dist/912.js.map +1 -1
  13. package/dist/main.js +1 -1
  14. package/dist/main.js.map +1 -1
  15. package/dist/pih-esm-audit-app.js +1 -1
  16. package/dist/pih-esm-audit-app.js.buildmanifest.json +38 -38
  17. package/dist/routes.json +1 -1
  18. package/package.json +1 -1
  19. package/src/audit/audit-search.component.tsx +58 -0
  20. package/src/audit/audit.component.tsx +63 -16
  21. package/src/audit/audit.resource.ts +429 -10
  22. package/src/audit/audit.scss +21 -0
  23. package/src/audit/date-range-picker.test-stub.tsx +40 -0
  24. package/src/audit/date-range.test.ts +128 -0
  25. package/src/audit/date-range.ts +120 -0
  26. package/src/audit/encounter-audit.component.test.tsx +15 -5
  27. package/src/audit/encounter-audit.component.tsx +5 -1
  28. package/src/audit/encounter-filters.component.tsx +40 -18
  29. package/src/audit/encounter-filters.test.ts +1 -2
  30. package/src/audit/encounter-filters.ts +2 -27
  31. package/src/audit/patient-record.component.test.tsx +3 -5
  32. package/src/audit/patient-record.component.tsx +13 -2
  33. package/src/audit/patient-search.component.tsx +1 -1
  34. package/src/audit/provider-encounters.component.test.tsx +227 -0
  35. package/src/audit/provider-encounters.component.tsx +160 -0
  36. package/src/audit/provider-search.component.test.tsx +72 -0
  37. package/src/audit/provider-search.component.tsx +116 -0
  38. package/src/audit/user-encounters.component.test.tsx +422 -0
  39. package/src/audit/user-encounters.component.tsx +233 -0
  40. package/src/audit/user-encounters.test.ts +176 -0
  41. package/src/audit/user-encounters.ts +166 -0
  42. package/src/audit/user-search.component.test.tsx +89 -0
  43. package/src/audit/user-search.component.tsx +111 -0
  44. package/src/config-schema.ts +6 -5
  45. package/src/root.component.test.tsx +48 -3
  46. package/src/types.ts +34 -0
  47. package/translations/en.json +31 -0
  48. package/translations/es.json +31 -0
  49. package/translations/fr.json +31 -0
  50. package/dist/446.js +0 -1
  51. package/dist/446.js.map +0 -1
@@ -3,4 +3,4 @@
3
3
  │ 94.js (1.918 MiB)
4
4
  
5
5
 
6
- Rspack compiled with 1 warning in 26.35 s
6
+ Rspack compiled with 1 warning in 29.15 s
package/README.md CHANGED
@@ -12,8 +12,16 @@ The dashboard is a three step drill-down. Each step keeps its position in the pa
12
12
  so a particular encounter's audit trail can be linked to and the browser's back button walks back
13
13
  up the drill-down.
14
14
 
15
- 1. **Patient search** — find the patient by name or identifier
16
- (`GET /ws/rest/v1/patient?q=…`).
15
+ 1. **Find the record** — three tabs:
16
+ - **Patients** — by name or identifier (`GET /ws/rest/v1/patient?q=…`).
17
+ - **Users** — by username, system id or the person's name (`GET /ws/rest/v1/user?q=…`), then the
18
+ encounters whose observations that account recorded or deleted. This is the one view that
19
+ genuinely answers "what did this account change", and it depends on pihcore — see below.
20
+ - **Providers** — by name or provider identifier (`GET /ws/rest/v1/provider?q=…`), then the
21
+ encounters that provider is recorded on. See the caveat below on what that does and does not
22
+ mean.
23
+
24
+ Every tab drills into the same encounter audit trail at step 3.
17
25
  2. **Encounter list** — every encounter recorded for that patient, most recent first
18
26
  (`GET /ws/rest/v1/encounter?patient=…&order=desc`, paged by the server through
19
27
  `useOpenmrsPagination`), narrowable by encounter type and by the date the encounter happened. The type dropdown offers only the types this patient's own encounters
@@ -72,6 +80,92 @@ come from once deleted encounters are shown — otherwise a type used only by a
72
80
  would be missing from the dropdown. Both hooks build the same url, so SWR serves the second one
73
81
  from cache rather than reading it twice.
74
82
 
83
+ ### The Users tab depends on pihcore
84
+
85
+ The core REST API cannot search observations by the account that touched them: neither the obs
86
+ resource, the observation search handler, core's own `ObsSearchCriteria` nor FHIR's
87
+ `ObservationSearchParams` has a creator or voidedBy field. Those columns can be read off an
88
+ observation but not searched on.
89
+
90
+ `openmrs-module-pihcore` adds the endpoint that can:
91
+
92
+ ```
93
+ GET /ws/rest/v1/pihcore/obsaudit?createdBy=<user>&voidedBy=<user>&startDate=<date>&endDate=<date>
94
+ ```
95
+
96
+ `createdBy` and `voidedBy` accept a user uuid, username or system id, and results come back paged
97
+ in the standard obs representation, most recent audit action first. `startDate` and `endDate` bound
98
+ when the change was made rather than when the observation was taken, and are what the tab's
99
+ **Changed between** picker sends — as bare calendar dates, since the endpoint reads a date-only
100
+ `endDate` as the whole of that day. Narrowing the range narrows the trail on the server, so it is
101
+ also the way to make a long-serving account's history quick to read.
102
+
103
+ The tab's **Encounter type** filter is different in kind: the endpoint takes no encounter type, so
104
+ it is applied after the merge. It offers every type in the system rather than only those the trail
105
+ holds, because lazy discovery means the types in a trail are unknown until all of it has been read.
106
+ Filling a page of a rare type therefore reads further than filling a page of any type; when the
107
+ scan gives up before the trail runs out, the view says so and suggests narrowing the dates. **The Users tab is inert without
108
+ a pihcore version that provides it**, and it requires the `App: coreapps.systemAdministration`
109
+ privilege that endpoint is gated on.
110
+
111
+ Two consequences shape the tab. The endpoint's two filters narrow rather than widen, so "touched"
112
+ takes two searches — one for each parameter. And it answers in observations while an auditor reads a
113
+ record in encounters, so the observations have to be collapsed into one row per encounter.
114
+
115
+ The collapse is done lazily rather than by reading the whole trail. Both searches return
116
+ observations by audit date descending, which means the first time an encounter appears in the merged
117
+ stream is its most recent change — so encounters come out of the merge already in the order the list
118
+ wants, and reading can stop as soon as enough of them are certain to fill the page on screen. Paging
119
+ forward reads further; paging back costs nothing, because what has been read is kept.
120
+
121
+ "Certain" is the subtle part, and `src/audit/user-encounters.ts` is where it lives. An observation
122
+ not yet read can only be older than the last row read from its search, so an encounter is safe to
123
+ show only once its most recent change is later than both searches' positions; a search that has not
124
+ been read at all constrains everything, which is why it is tracked separately from one that is
125
+ exhausted. Getting this wrong would make the first page reshuffle as the second was read.
126
+
127
+ The per-encounter counts cannot come from that scan, since an encounter's other observations may sit
128
+ far further down the trail. They are read per row instead — `obs?encounter=…&includeAll=true`,
129
+ attributed by creator and voiding user — so they are exact, and cost one small request per row
130
+ actually on screen.
131
+
132
+ Because the number of encounters an account has touched is unknown until its whole trail has been
133
+ read, which is the very thing being avoided, the list has no total to page against: it shows the
134
+ range on screen with previous and next buttons rather than a page count.
135
+
136
+ ### Caveat: searching by provider is not searching by who edited
137
+
138
+ The Providers tab lists the encounters a provider is **recorded on**, which is not the same as the
139
+ ones that account entered or changed — an encounter someone entered without being a provider on it
140
+ will not appear. The view says as much and names the entering user per row, and the Users tab is
141
+ what answers the other question.
142
+
143
+ Both go through pihcore, since core cannot search encounters by either. `EncounterSearchCriteria`
144
+ carries a providers field but no webservices search handler exposes it, the free-text encounter
145
+ search only matches patient name and identifier when no patient is given, and there is no `doGetAll`
146
+ to enumerate and filter client-side:
147
+
148
+ ```
149
+ GET /ws/rest/v1/pihcore/encounteraudit?provider=<uuid or identifier>
150
+ GET /ws/rest/v1/pihcore/encounteraudit?createdBy=<user>&changedBy=<user>&voidedBy=<user>
151
+ ```
152
+
153
+ Filters narrow, at least one user or provider is required, and results are paged in the standard
154
+ encounter representation — including `auditInfo`, which is why one paged request serves a whole page
155
+ with nothing read per row. `encounterType`, `startDate` and `endDate` narrow it further;
156
+ `encounterType` accepts a uuid or a type name, and the dates bound whatever the search is about: the
157
+ named audit action's column where there is one, and the encounter's own datetime for a provider
158
+ search.
159
+
160
+ The Providers tab's encounter type and date filters are those parameters, so the page count and
161
+ totals stay right — which is also why its type dropdown offers every type in the system rather than
162
+ only those on screen. The Patients tab shares the same filter bar but supplies the patient's own
163
+ types, since there they can be known.
164
+
165
+ This replaced an earlier route through FHIR (`Encounter?participant=`), which worked but needed a
166
+ `_tag` to avoid a paging crash in fhir2's combined encounter-and-visit bundle provider, and a
167
+ follow-up REST read per row because FHIR carries no `auditInfo`.
168
+
75
169
  ### Caveat: what the activity view costs
76
170
 
77
171
  Encounters carry their own `auditInfo`, so who created, changed or deleted each one comes free with
@@ -113,4 +207,4 @@ for information about how to provide configuration files.
113
207
  | ----------------------- | -------------------------------------------------- | -------------------------------------------------- |
114
208
  | `patientSearchPageSize` | `10` | Patients per page of search results. |
115
209
  | `encountersPageSize` | `10` | Encounters per page of a patient's encounter list. |
116
- | `patientChartUrl` | `${openmrsSpaBase}/patient/${patientUuid}/chart` | Where the patient's name in the encounter audit links to. |
210
+ | `patientDashboardUrl` | `${openmrsBase}/pihcore/router/programDashboard.page?patientId=${patientUuid}` | Where the patient's name in the encounter audit links to. Points at the OpenMRS 2.x clinician dashboard, so it is a full page load. |
package/dist/115.js CHANGED
@@ -1 +1 @@
1
- (globalThis.webpackChunk_pih_esm_audit_app=globalThis.webpackChunk_pih_esm_audit_app||[]).push([["115"],{4767(e,t,a){var n={"./en.json":["4300","117"],"./fr.json":["4055","508"],"./es.json":["3099","912"]};function i(e){if(!a.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],i=t[0];return a.e(t[1]).then(function(){return a(i)})}i.keys=()=>Object.keys(n),i.id=4767,e.exports=i},7403(e,t,a){"use strict";a.d(t,{_:()=>n});var n={name:"audit",slot:"audit-dashboard-slot",title:"Audit"}},5390(e,t,a){"use strict";a.r(t),a.d(t,{auditDashboardLink:()=>_,startupApp:()=>f,importTranslation:()=>m,root:()=>h});var n=a(6178),i={patientSearchPageSize:{_type:n.Type.Number,_description:"How many patients to show per page of patient search results.",_default:10,_validators:[n.validators.inRange(1,100)]},encountersPageSize:{_type:n.Type.Number,_description:"How many encounters to show per page of a patient's encounter list.",_default:10,_validators:[n.validators.inRange(1,100)]},patientChartUrl:{_type:n.Type.String,_description:"The URL of the patient chart to link to from the audit trail. May contain the template variables ${openmrsSpaBase}, ${openmrsBase} and ${patientUuid}.",_default:"${openmrsSpaBase}/patient/${patientUuid}/chart",_validators:[n.validators.isUrlWithTemplateParameters(["patientUuid"])]}},r=a(7403),o=a(9485),s=a.n(o),u=a(7703),p=a(761);function c(){var e=(0,p.useTranslation)().t,t=(0,u.useLocation)().pathname,a=(0,o.useMemo)(function(){return t.split("/").map(function(e){return decodeURIComponent(e)}).includes(r._.name)},[t]);return s().createElement(n.ConfigurableLink,{to:"".concat(window.spaBase,"/home/").concat(r._.name),className:"cds--side-nav__link ".concat(a?"active-left-nav-link":"")},e("audit",r._.title))}var l="@pih/esm-audit-app",d={featureName:"audit",moduleName:l},m=a(4767),h=(0,n.getAsyncLifecycle)(function(){return Promise.all([a.e("689"),a.e("455"),a.e("711"),a.e("323"),a.e("446")]).then(a.bind(a,3933))},d),_=(0,n.getSyncLifecycle)(function(){return s().createElement(u.BrowserRouter,null,s().createElement(c,null))},d);function f(){(0,n.defineConfigSchema)(l,i),(0,n.registerBreadcrumbs)([{path:"".concat(window.spaBase,"/home/").concat(r._.name),title:r._.title}])}}}]);
1
+ (globalThis.webpackChunk_pih_esm_audit_app=globalThis.webpackChunk_pih_esm_audit_app||[]).push([["115"],{4767(e,t,a){var n={"./en.json":["4300","117"],"./fr.json":["4055","508"],"./es.json":["3099","912"]};function i(e){if(!a.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],i=t[0];return a.e(t[1]).then(function(){return a(i)})}i.keys=()=>Object.keys(n),i.id=4767,e.exports=i},7403(e,t,a){"use strict";a.d(t,{_:()=>n});var n={name:"audit",slot:"audit-dashboard-slot",title:"Audit"}},5390(e,t,a){"use strict";a.r(t),a.d(t,{auditDashboardLink:()=>_,startupApp:()=>f,importTranslation:()=>h,root:()=>m});var n=a(6178),i={patientSearchPageSize:{_type:n.Type.Number,_description:"How many patients to show per page of patient search results.",_default:10,_validators:[n.validators.inRange(1,100)]},encountersPageSize:{_type:n.Type.Number,_description:"How many encounters to show per page of a patient's encounter list.",_default:10,_validators:[n.validators.inRange(1,100)]},patientDashboardUrl:{_type:n.Type.String,_description:"The dashboard the patient's name in the encounter audit links to. This is the OpenMRS 2.x clinician dashboard rather than a page in this app, so it is a full page load. May contain the template variables ${openmrsBase}, ${openmrsSpaBase} and ${patientUuid}.",_default:"${openmrsBase}/pihcore/router/programDashboard.page?patientId=${patientUuid}",_validators:[n.validators.isUrlWithTemplateParameters(["patientUuid"])]}},r=a(7403),o=a(9485),s=a.n(o),p=a(7703),u=a(761);function c(){var e=(0,u.useTranslation)().t,t=(0,p.useLocation)().pathname,a=(0,o.useMemo)(function(){return t.split("/").map(function(e){return decodeURIComponent(e)}).includes(r._.name)},[t]);return s().createElement(n.ConfigurableLink,{to:"".concat(window.spaBase,"/home/").concat(r._.name),className:"cds--side-nav__link ".concat(a?"active-left-nav-link":"")},e("audit",r._.title))}var d="@pih/esm-audit-app",l={featureName:"audit",moduleName:d},h=a(4767),m=(0,n.getAsyncLifecycle)(function(){return Promise.all([a.e("689"),a.e("455"),a.e("711"),a.e("323"),a.e("514")]).then(a.bind(a,8601))},l),_=(0,n.getSyncLifecycle)(function(){return s().createElement(p.BrowserRouter,null,s().createElement(c,null))},l);function f(){(0,n.defineConfigSchema)(d,i),(0,n.registerBreadcrumbs)([{path:"".concat(window.spaBase,"/home/").concat(r._.name),title:r._.title}])}}}]);
package/dist/115.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"115.js","sources":["webpack://@pih/esm-audit-app/./translations|lazy|nonrecursive|/.json$/","webpack://@pih/esm-audit-app/./src/dashboard.meta.ts","webpack://@pih/esm-audit-app/./src/config-schema.ts","webpack://@pih/esm-audit-app/./src/dashboard-link.component.tsx","webpack://@pih/esm-audit-app/./src/index.ts"],"names":["Promise","Error","i","Object","dashboardMeta","configSchema","Type","validators","AuditLink","t","useTranslation","pathname","useLocation","isActive","useMemo","segment","decodeURIComponent","ConfigurableLink","window","moduleName","options","importTranslation","require","root","getAsyncLifecycle","auditDashboardLink","getSyncLifecycle","BrowserRouter","startupApp","defineConfigSchema","registerBreadcrumbs"],"mappings":"qHAAA,IAAI,EAAM,CACR,YAAa,CACX,OACA,MACD,CACD,YAAa,CACX,OACA,MACD,CACD,YAAa,CACX,OACA,MACD,AACH,EACA,SAAS,EAAuB,CAAG,EACjC,GAAG,CAAC,EAAoB,CAAC,CAAC,EAAK,GAC7B,OAAOA,QAAQ,OAAO,GAAG,IAAI,CAAC,WAC5B,IAAI,EAAI,AAAIC,MAAM,uBAAyB,EAAM,IAEjD,OADA,EAAE,IAAI,CAAG,mBACH,CACR,GAGF,IAAI,EAAM,CAAG,CAAC,EAAI,CAAEC,EAAK,CAAG,CAAC,EAAE,CAC/B,OAAO,EAAoB,CAAC,CAAC,CAAG,CAAC,EAAE,EAAE,IAAI,CAAC,WACxC,OAAO,EAAoBA,EAC7B,EACF,CAEA,EAAuB,IAAI,CAAG,IAAOC,OAAO,IAAI,CAAC,GACjD,EAAuB,EAAE,CAAG,KAC5B,EAAO,OAAO,CAAG,C,4CCzBV,IAAMC,EAAgB,CAC3B,KAAM,QACN,KAAM,uBACN,MAAO,OACT,C,sICFaC,EAAe,CAC1B,sBAAuB,CACrB,MAAOC,EAAAA,IAAAA,CAAAA,MAAW,CAClB,aAAc,gEACd,SAAU,GACV,YAAa,CAACC,EAAAA,UAAAA,CAAAA,OAAkB,CAAC,EAAG,KAAK,AAC3C,EACA,mBAAoB,CAClB,MAAOD,EAAAA,IAAAA,CAAAA,MAAW,CAClB,aAAc,sEACd,SAAU,GACV,YAAa,CAACC,EAAAA,UAAAA,CAAAA,OAAkB,CAAC,EAAG,KAAK,AAC3C,EACA,gBAAiB,CACf,MAAOD,EAAAA,IAAAA,CAAAA,MAAW,CAClB,aACE,yJAEF,SAAU,iDACV,YAAa,CAACC,EAAAA,UAAAA,CAAAA,2BAAsC,CAAC,CAAC,cAAc,EAAE,AACxE,CACF,E,gDCvBA,SAASC,IACP,IAAQC,EAAMC,AAAAA,GAAAA,EAAAA,cAAAA,AAAAA,IAAND,CAAC,CACDE,EAAaC,AAAAA,GAAAA,EAAAA,WAAAA,AAAAA,IAAbD,QAAQ,CACVE,EAAWC,AAAAA,GAAAA,EAAAA,OAAAA,AAAAA,EACf,W,OACEH,EACG,KAAK,CAAC,KACN,GAAG,CAAC,SAACI,CAAO,E,OAAKC,mBAAmBD,E,GACpC,QAAQ,CAACX,EAAAA,CAAAA,CAAAA,IAAkB,C,EAChC,CAACO,EAAS,EAGZ,OACE,kBAACM,EAAAA,gBAAgBA,CAAAA,CACf,GAAK,GAAyBb,MAAAA,CAAvBc,OAAO,OAAO,CAAC,UAA2B,OAAnBd,EAAAA,CAAAA,CAAAA,IAAkB,EAChD,UAAY,uBAA6D,OAAvCS,EAAW,uBAAyB,G,EACrEJ,EAAE,QAASL,EAAAA,CAAAA,CAAAA,KAAmB,EAGrC,CCbA,IAAMe,EAAa,qBACbC,EAAU,CACd,YAAa,QACbD,WAAAA,CACF,EAEaE,EAAoBC,EAAAA,MAEpBC,EAAOC,AAAAA,GAAAA,EAAAA,iBAAAA,AAAAA,EAAkB,W,OAAM,0F,EAA4BJ,GAE3DK,EAAqBC,AAAAA,GAAAA,EAAAA,gBAAAA,AAAAA,EDSnB,WACb,OACE,kBAACC,EAAAA,aAAaA,CAAAA,KACZ,kBAACnB,EAAAA,MAGP,ECfkEY,GAE3D,SAASQ,IACdC,AAAAA,GAAAA,EAAAA,kBAAAA,AAAAA,EAAmBV,EAAYd,GAC/ByB,AAAAA,GAAAA,EAAAA,mBAAAA,AAAAA,EAAoB,CAClB,CACE,KAAO,GAAyB1B,MAAAA,CAAvBc,OAAO,OAAO,CAAC,UAA2B,OAAnBd,EAAAA,CAAAA,CAAAA,IAAkB,EAClD,MAAOA,EAAAA,CAAAA,CAAAA,KAAmB,AAC5B,EACD,CACH,C"}
1
+ {"version":3,"file":"115.js","sources":["webpack://@pih/esm-audit-app/./translations|lazy|nonrecursive|/.json$/","webpack://@pih/esm-audit-app/./src/dashboard.meta.ts","webpack://@pih/esm-audit-app/./src/config-schema.ts","webpack://@pih/esm-audit-app/./src/dashboard-link.component.tsx","webpack://@pih/esm-audit-app/./src/index.ts"],"names":["Promise","Error","i","Object","dashboardMeta","configSchema","Type","validators","AuditLink","t","useTranslation","pathname","useLocation","isActive","useMemo","segment","decodeURIComponent","ConfigurableLink","window","moduleName","options","importTranslation","require","root","getAsyncLifecycle","auditDashboardLink","getSyncLifecycle","BrowserRouter","startupApp","defineConfigSchema","registerBreadcrumbs"],"mappings":"qHAAA,IAAI,EAAM,CACR,YAAa,CACX,OACA,MACD,CACD,YAAa,CACX,OACA,MACD,CACD,YAAa,CACX,OACA,MACD,AACH,EACA,SAAS,EAAuB,CAAG,EACjC,GAAG,CAAC,EAAoB,CAAC,CAAC,EAAK,GAC7B,OAAOA,QAAQ,OAAO,GAAG,IAAI,CAAC,WAC5B,IAAI,EAAI,AAAIC,MAAM,uBAAyB,EAAM,IAEjD,OADA,EAAE,IAAI,CAAG,mBACH,CACR,GAGF,IAAI,EAAM,CAAG,CAAC,EAAI,CAAEC,EAAK,CAAG,CAAC,EAAE,CAC/B,OAAO,EAAoB,CAAC,CAAC,CAAG,CAAC,EAAE,EAAE,IAAI,CAAC,WACxC,OAAO,EAAoBA,EAC7B,EACF,CAEA,EAAuB,IAAI,CAAG,IAAOC,OAAO,IAAI,CAAC,GACjD,EAAuB,EAAE,CAAG,KAC5B,EAAO,OAAO,CAAG,C,4CCzBV,IAAMC,EAAgB,CAC3B,KAAM,QACN,KAAM,uBACN,MAAO,OACT,C,sICFaC,EAAe,CAC1B,sBAAuB,CACrB,MAAOC,EAAAA,IAAAA,CAAAA,MAAW,CAClB,aAAc,gEACd,SAAU,GACV,YAAa,CAACC,EAAAA,UAAAA,CAAAA,OAAkB,CAAC,EAAG,KAAK,AAC3C,EACA,mBAAoB,CAClB,MAAOD,EAAAA,IAAAA,CAAAA,MAAW,CAClB,aAAc,sEACd,SAAU,GACV,YAAa,CAACC,EAAAA,UAAAA,CAAAA,OAAkB,CAAC,EAAG,KAAK,AAC3C,EACA,oBAAqB,CACnB,MAAOD,EAAAA,IAAAA,CAAAA,MAAW,CAClB,aACE,oQAGF,SAAU,+EACV,YAAa,CAACC,EAAAA,UAAAA,CAAAA,2BAAsC,CAAC,CAAC,cAAc,EAAE,AACxE,CACF,E,gDCxBA,SAASC,IACP,IAAQC,EAAMC,AAAAA,GAAAA,EAAAA,cAAAA,AAAAA,IAAND,CAAC,CACDE,EAAaC,AAAAA,GAAAA,EAAAA,WAAAA,AAAAA,IAAbD,QAAQ,CACVE,EAAWC,AAAAA,GAAAA,EAAAA,OAAAA,AAAAA,EACf,W,OACEH,EACG,KAAK,CAAC,KACN,GAAG,CAAC,SAACI,CAAO,E,OAAKC,mBAAmBD,E,GACpC,QAAQ,CAACX,EAAAA,CAAAA,CAAAA,IAAkB,C,EAChC,CAACO,EAAS,EAGZ,OACE,kBAACM,EAAAA,gBAAgBA,CAAAA,CACf,GAAK,GAAyBb,MAAAA,CAAvBc,OAAO,OAAO,CAAC,UAA2B,OAAnBd,EAAAA,CAAAA,CAAAA,IAAkB,EAChD,UAAY,uBAA6D,OAAvCS,EAAW,uBAAyB,G,EACrEJ,EAAE,QAASL,EAAAA,CAAAA,CAAAA,KAAmB,EAGrC,CCbA,IAAMe,EAAa,qBACbC,EAAU,CACd,YAAa,QACbD,WAAAA,CACF,EAEaE,EAAoBC,EAAAA,MAEpBC,EAAOC,AAAAA,GAAAA,EAAAA,iBAAAA,AAAAA,EAAkB,W,OAAM,0F,EAA4BJ,GAE3DK,EAAqBC,AAAAA,GAAAA,EAAAA,gBAAAA,AAAAA,EDSnB,WACb,OACE,kBAACC,EAAAA,aAAaA,CAAAA,KACZ,kBAACnB,EAAAA,MAGP,ECfkEY,GAE3D,SAASQ,IACdC,AAAAA,GAAAA,EAAAA,kBAAAA,AAAAA,EAAmBV,EAAYd,GAC/ByB,AAAAA,GAAAA,EAAAA,mBAAAA,AAAAA,EAAoB,CAClB,CACE,KAAO,GAAyB1B,MAAAA,CAAvBc,OAAO,OAAO,CAAC,UAA2B,OAAnBd,EAAAA,CAAAA,CAAAA,IAAkB,EAClD,MAAOA,EAAAA,CAAAA,CAAAA,KAAmB,AAC5B,EACD,CACH,C"}
package/dist/117.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_pih_esm_audit_app=globalThis.webpackChunk_pih_esm_audit_app||[]).push([["117"],{4300(e){e.exports=JSON.parse('{"action":"Action","activityLog":"Activity log","addedLater":"Added later","addedLaterLegend":"recorded after the encounter itself was created","age":"Age","allEncounterTypes":"All encounter types","audit":"Audit","auditTrail":"Audit trail","auditViews":"Audit views","backToEncounters":"Back to encounters","backToPatientSearch":"Back to patient search","birthdate":"Date of birth","cannotIncludeDeletedEncounters":"Deleted encounters can only be listed for a patient who has an identifier.","change":"Change","changedBy":"Changed by","changedByUser":"Changed by {{user}}","clearFilters":"Clear filters","createdBy":"Created by","deleted":"Deleted","deletedBy":"Deleted by","deletedEncountersUnavailable":"Deleted encounters unavailable","deletedLegend":"removed from the encounter","deletionReason":"Reason for deletion","detail":"Detail","edited":"Edited","editedLegend":"the value was changed after it was first recorded","encounter":"Encounter","encounterAudit":"Encounter audit","encounterChangedAction":"Changed encounter","encounterCreatedAction":"Created encounter","encounterDate":"Encounter date","encounterDateRange":"Encounter date range","encounterDeleted":"Deleted encounter","encounterDeletedAction":"Deleted encounter","encounterDeletedSubtitle":"This encounter has been deleted. Its observations are shown as they were left.","encounterNotFound":"That encounter could not be found.","encounters":"Encounters","encountersCreated":"Encounters created","encounterSummary":"Encounter summary","encounterType":"Encounter type","firstActivity":"First activity","form":"Form","gender":"Gender","identifier":"Identifier","includeDeletedEncounters":"Include deleted encounters","lastActivity":"Last activity","location":"Location","noActivity":"There is no recorded activity to show.","noEncountersFound":"This patient has no encounters to audit.","noEncountersMatchFilters":"No encounters match these filters.","noObservations":"This encounter has no observations.","noPatientsFound":"No patients match \\"{{searchTerm}}\\".","noProviders":"No providers are recorded for this encounter.","obsDeletedAction":"Deleted observation","obsDeletedCount":"Observations deleted","obsEditedAction":"Edited observation","obsEditedCount":"Observations edited","observations":"Observations","obsRecordedAction":"Recorded observation","obsRecordedCount":"Observations recorded","patient":"Patient","patientName":"Patient name","patientSearchResults":"Patient search results","previousValue":"Previous value","previousValueLegend":"the value that an edit replaced","provider":"Provider","providerName":"Provider name","providers":"Providers","questionConcept":"Question concept","readingObservations":"Reading observations from {{read}} of {{total}} encounters…","recordActivity":"Patient activity","recordedBy":"Recorded by","role":"Role","searchForPatient":"Search for a patient by name or identifier","searchToBegin":"Enter a patient name or identifier to begin auditing their records.","showConceptDescriptions":"Show concept descriptions","showDeletedObs":"Show deleted observations","showEveryone":"Show everyone","showOnlyThisUser":"Show only this user\'s activity","status":"Status","unknownUser":"Unknown user","user":"User","value":"Value","visit":"Visit","wasPreviously":"was {{value}}","when":"When","whoTouchedThisRecord":"Who modified this patient record"}')}}]);
1
+ "use strict";(globalThis.webpackChunk_pih_esm_audit_app=globalThis.webpackChunk_pih_esm_audit_app||[]).push([["117"],{4300(e){e.exports=JSON.parse('{"action":"Action","activityLog":"Activity log","addedLater":"Added later","addedLaterLegend":"recorded after the encounter itself was created","age":"Age","allEncounterTypes":"All encounter types","audit":"Audit","auditTrail":"Audit trail","auditViews":"Audit views","backToEncounters":"Back to encounters","backToPatientSearch":"Back to patient search","backToProviderSearch":"Back to provider search","backToUserSearch":"Back to user search","birthdate":"Date of birth","cannotIncludeDeletedEncounters":"Deleted encounters can only be listed for a patient who has an identifier.","change":"Change","changedBetween":"Changed between","changedBy":"Changed by","changedByUser":"Changed by {{user}}","clearFilters":"Clear filters","createdBy":"Created by","deleted":"Deleted","deletedBy":"Deleted by","deletedEncountersUnavailable":"Deleted encounters unavailable","deletedLegend":"removed from the encounter","deletionReason":"Reason for deletion","detail":"Detail","edited":"Edited","editedLegend":"the value was changed after it was first recorded","encounter":"Encounter","encounterAudit":"Encounter audit","encounterChangedAction":"Changed encounter","encounterCreatedAction":"Created encounter","encounterDate":"Encounter date","encounterDateRange":"Encounter date range","encounterDeleted":"Deleted encounter","encounterDeletedAction":"Deleted encounter","encounterDeletedSubtitle":"This encounter has been deleted. Its observations are shown as they were left.","encounterNotFound":"That encounter could not be found.","encounterRange":"Encounters {{from}}–{{to}}","encounters":"Encounters","encountersCreated":"Encounters created","encounterSummary":"Encounter summary","encounterType":"Encounter type","firstActivity":"First activity","form":"Form","gender":"Gender","identifier":"Identifier","includeDeletedEncounters":"Include deleted encounters","lastActivity":"Last activity","lastChanged":"Last changed","location":"Location","lookingForMoreEncounters":"Looking for more encounters…","name":"Name","nextPage":"Next","noActivity":"There is no recorded activity to show.","noEncountersFound":"This patient has no encounters to audit.","noEncountersMatchFilters":"No encounters match these filters.","noObservations":"This encounter has no observations.","noPatientsFound":"No patients match \\"{{searchTerm}}\\".","noProviderEncounters":"This provider is not recorded on any encounters.","noProviderEncountersMatch":"No encounters for this provider match these filters.","noProviders":"No providers are recorded for this encounter.","noProvidersFound":"No providers match \\"{{searchTerm}}\\".","noUserEncounters":"This user has not recorded or deleted any observations.","noUserEncountersMatch":"This user did not change any observations matching these filters.","noUsersFound":"No users match \\"{{searchTerm}}\\".","obsDeletedAction":"Deleted observation","obsDeletedCount":"Observations deleted","obsEditedAction":"Edited observation","obsEditedCount":"Observations edited","observations":"Observations","obsRecordedAction":"Recorded observation","obsRecordedCount":"Observations recorded","partialUserScan":"Part of the trail","patient":"Patient","patientName":"Patient name","patients":"Patients","patientSearchResults":"Patient search results","previousPage":"Previous","previousValue":"Previous value","previousValueLegend":"the value that an edit replaced","provider":"Provider","providerEncountersScope":"These are the encounters this provider is recorded on, which is not the same as the ones they entered or changed — the last column names who did that, and the Users tab searches by it.","providerName":"Provider name","providers":"Providers","providerSearchResults":"Provider search results","questionConcept":"Question concept","readingObservations":"Reading observations from {{read}} of {{total}} encounters…","readingUserObservations":"Read {{obsRead}} observations so far…","recordActivity":"Patient activity","recordedAsProvider":"Recorded as provider","recordedBy":"Recorded by","retired":"Retired","role":"Role","searchBy":"Search by","searchForPatient":"Search for a patient by name or identifier","searchForProvider":"Search for a provider by name or identifier","searchForUser":"Search for a user by name or username","searchProviderToBegin":"Enter a provider name or identifier to see the encounters they are recorded on.","searchToBegin":"Enter a patient name or identifier to begin auditing their records.","searchUserToBegin":"Enter a name or username to see the encounters that user has modified.","showConceptDescriptions":"Show concept descriptions","showDeletedObs":"Show deleted observations","showEveryone":"Show everyone","showOnlyThisUser":"Show only this user\'s activity","status":"Status","unknownUser":"Unknown user","user":"User","username":"Username","users":"Users","userScanStoppedEarly":"Stopped after reading {{obsRead}} observation changes without filling the page. Narrow the date range to search further back.","userSearchResults":"User search results","value":"Value","visit":"Visit","wasPreviously":"was {{value}}","when":"When","whoTouchedThisRecord":"Who modified this patient record"}')}}]);
package/dist/117.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"117.js","sources":["webpack://@pih/esm-audit-app/json|/home/runner/work/openmrs-esm-pihemr/openmrs-esm-pihemr/packages/esm-audit-app/translations/en.json"],"names":["JSON"],"mappings":"8HAAA,EAAO,OAAO,CAAGA,KAAK,KAAK,CAAC,wyG"}
1
+ {"version":3,"file":"117.js","sources":["webpack://@pih/esm-audit-app/json|/home/runner/work/openmrs-esm-pihemr/openmrs-esm-pihemr/packages/esm-audit-app/translations/en.json"],"names":["JSON"],"mappings":"8HAAA,EAAO,OAAO,CAAGA,KAAK,KAAK,CAAC,kiK"}
package/dist/508.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_pih_esm_audit_app=globalThis.webpackChunk_pih_esm_audit_app||[]).push([["508"],{4055(e){e.exports=JSON.parse('{"action":"Action","activityLog":"Journal d\'activit\xe9","addedLater":"Ajout\xe9 ult\xe9rieurement","addedLaterLegend":"enregistr\xe9 apr\xe8s la cr\xe9ation de la rencontre","age":"\xc2ge","allEncounterTypes":"Tous les types de rencontre","audit":"Audit","auditTrail":"Piste d\'audit","auditViews":"Vues d\'audit","backToEncounters":"Retour aux rencontres","backToPatientSearch":"Retour \xe0 la recherche de patient","birthdate":"Date de naissance","cannotIncludeDeletedEncounters":"Les rencontres supprim\xe9es ne peuvent \xeatre list\xe9es que pour un patient poss\xe9dant un num\xe9ro d\'identification.","change":"Modification","changedBy":"Modifi\xe9 par","changedByUser":"Modifi\xe9 par {{user}}","clearFilters":"Effacer les filtres","createdBy":"Cr\xe9\xe9 par","deleted":"Supprim\xe9","deletedBy":"Supprim\xe9 par","deletedEncountersUnavailable":"Rencontres supprim\xe9es indisponibles","deletedLegend":"retir\xe9 de la rencontre","deletionReason":"Motif de la suppression","detail":"D\xe9tail","edited":"Modifi\xe9","editedLegend":"la valeur a \xe9t\xe9 modifi\xe9e apr\xe8s son premier enregistrement","encounter":"Rencontre","encounterAudit":"Audit de la rencontre","encounterChangedAction":"Rencontre modifi\xe9e","encounterCreatedAction":"Rencontre cr\xe9\xe9e","encounterDate":"Date de rencontre","encounterDateRange":"P\xe9riode des rencontres","encounterDeleted":"Rencontre supprim\xe9e","encounterDeletedAction":"Rencontre supprim\xe9e","encounterDeletedSubtitle":"Cette rencontre a \xe9t\xe9 supprim\xe9e. Ses observations sont affich\xe9es telles qu\'elles ont \xe9t\xe9 laiss\xe9es.","encounterNotFound":"Cette rencontre est introuvable.","encounters":"Rencontres","encountersCreated":"Rencontres cr\xe9\xe9es","encounterSummary":"R\xe9sum\xe9 de la rencontre","encounterType":"Type de rencontre","firstActivity":"Premi\xe8re activit\xe9","form":"Fiche","gender":"Sexe","identifier":"Num\xe9ro d\'identification","includeDeletedEncounters":"Inclure les rencontres supprim\xe9es","lastActivity":"Derni\xe8re activit\xe9","location":"Lieu","noActivity":"Aucune activit\xe9 enregistr\xe9e \xe0 afficher.","noEncountersFound":"Ce patient n\'a aucune rencontre \xe0 auditer.","noEncountersMatchFilters":"Aucune rencontre ne correspond \xe0 ces filtres.","noObservations":"Cette rencontre n\'a aucune observation.","noPatientsFound":"Aucun patient ne correspond \xe0 \xab {{searchTerm}} \xbb.","noProviders":"Aucun prestataire de service n\'est enregistr\xe9 pour cette rencontre.","obsDeletedAction":"Observation supprim\xe9e","obsDeletedCount":"Observations supprim\xe9es","obsEditedAction":"Observation modifi\xe9e","obsEditedCount":"Observations modifi\xe9es","observations":"Observations","obsRecordedAction":"Observation enregistr\xe9e","obsRecordedCount":"Observations enregistr\xe9es","patient":"Patient","patientName":"Nom du patient","patientSearchResults":"R\xe9sultats de la recherche de patients","previousValue":"Valeur pr\xe9c\xe9dente","previousValueLegend":"la valeur remplac\xe9e par une modification","provider":"Prestataire de service","providerName":"Nom du prestataire de service","providers":"Prestataires de service","questionConcept":"Concept de la question","readingObservations":"Lecture des observations de {{read}} rencontres sur {{total}}…","recordActivity":"Activit\xe9 du patient","recordedBy":"Enregistr\xe9 par","role":"R\xf4le","searchForPatient":"Rechercher un patient par nom ou num\xe9ro d\'identification","searchToBegin":"Saisissez le nom ou le num\xe9ro d\'identification d\'un patient pour commencer l\'audit de son dossier.","showConceptDescriptions":"Afficher les descriptions des concepts","showDeletedObs":"Afficher les observations supprim\xe9es","showEveryone":"Afficher tout le monde","showOnlyThisUser":"Afficher uniquement l\'activit\xe9 de cet utilisateur","status":"Statut","unknownUser":"Utilisateur inconnu","user":"Utilisateur","value":"Valeur","visit":"Visite","wasPreviously":"\xe9tait {{value}}","when":"Quand","whoTouchedThisRecord":"Qui a modifi\xe9 ce dossier patient"}')}}]);
1
+ "use strict";(globalThis.webpackChunk_pih_esm_audit_app=globalThis.webpackChunk_pih_esm_audit_app||[]).push([["508"],{4055(e){e.exports=JSON.parse('{"action":"Action","activityLog":"Journal d\'activit\xe9","addedLater":"Ajout\xe9 ult\xe9rieurement","addedLaterLegend":"enregistr\xe9 apr\xe8s la cr\xe9ation de la rencontre","age":"\xc2ge","allEncounterTypes":"Tous les types de rencontre","audit":"Audit","auditTrail":"Piste d\'audit","auditViews":"Vues d\'audit","backToEncounters":"Retour aux rencontres","backToPatientSearch":"Retour \xe0 la recherche de patient","backToProviderSearch":"Retour \xe0 la recherche de prestataire","backToUserSearch":"Retour \xe0 la recherche d\'utilisateur","birthdate":"Date de naissance","cannotIncludeDeletedEncounters":"Les rencontres supprim\xe9es ne peuvent \xeatre list\xe9es que pour un patient poss\xe9dant un num\xe9ro d\'identification.","change":"Modification","changedBetween":"Modifi\xe9 entre","changedBy":"Modifi\xe9 par","changedByUser":"Modifi\xe9 par {{user}}","clearFilters":"Effacer les filtres","createdBy":"Cr\xe9\xe9 par","deleted":"Supprim\xe9","deletedBy":"Supprim\xe9 par","deletedEncountersUnavailable":"Rencontres supprim\xe9es indisponibles","deletedLegend":"retir\xe9 de la rencontre","deletionReason":"Motif de la suppression","detail":"D\xe9tail","edited":"Modifi\xe9","editedLegend":"la valeur a \xe9t\xe9 modifi\xe9e apr\xe8s son premier enregistrement","encounter":"Rencontre","encounterAudit":"Audit de la rencontre","encounterChangedAction":"Rencontre modifi\xe9e","encounterCreatedAction":"Rencontre cr\xe9\xe9e","encounterDate":"Date de rencontre","encounterDateRange":"P\xe9riode des rencontres","encounterDeleted":"Rencontre supprim\xe9e","encounterDeletedAction":"Rencontre supprim\xe9e","encounterDeletedSubtitle":"Cette rencontre a \xe9t\xe9 supprim\xe9e. Ses observations sont affich\xe9es telles qu\'elles ont \xe9t\xe9 laiss\xe9es.","encounterNotFound":"Cette rencontre est introuvable.","encounterRange":"Rencontres {{from}}–{{to}}","encounters":"Rencontres","encountersCreated":"Rencontres cr\xe9\xe9es","encounterSummary":"R\xe9sum\xe9 de la rencontre","encounterType":"Type de rencontre","firstActivity":"Premi\xe8re activit\xe9","form":"Fiche","gender":"Sexe","identifier":"Num\xe9ro d\'identification","includeDeletedEncounters":"Inclure les rencontres supprim\xe9es","lastActivity":"Derni\xe8re activit\xe9","lastChanged":"Derni\xe8re modification","location":"Lieu","lookingForMoreEncounters":"Recherche d\'autres rencontres…","name":"Nom","nextPage":"Suivant","noActivity":"Aucune activit\xe9 enregistr\xe9e \xe0 afficher.","noEncountersFound":"Ce patient n\'a aucune rencontre \xe0 auditer.","noEncountersMatchFilters":"Aucune rencontre ne correspond \xe0 ces filtres.","noObservations":"Cette rencontre n\'a aucune observation.","noPatientsFound":"Aucun patient ne correspond \xe0 \xab {{searchTerm}} \xbb.","noProviderEncounters":"Ce prestataire de service n\'est enregistr\xe9 sur aucune rencontre.","noProviderEncountersMatch":"Aucune rencontre de ce prestataire de service ne correspond \xe0 ces filtres.","noProviders":"Aucun prestataire de service n\'est enregistr\xe9 pour cette rencontre.","noProvidersFound":"Aucun prestataire de service ne correspond \xe0 \xab {{searchTerm}} \xbb.","noUserEncounters":"Cet utilisateur n\'a enregistr\xe9 ni supprim\xe9 aucune observation.","noUserEncountersMatch":"Cet utilisateur n\'a modifi\xe9 aucune observation correspondant \xe0 ces filtres.","noUsersFound":"Aucun utilisateur ne correspond \xe0 \xab {{searchTerm}} \xbb.","obsDeletedAction":"Observation supprim\xe9e","obsDeletedCount":"Observations supprim\xe9es","obsEditedAction":"Observation modifi\xe9e","obsEditedCount":"Observations modifi\xe9es","observations":"Observations","obsRecordedAction":"Observation enregistr\xe9e","obsRecordedCount":"Observations enregistr\xe9es","partialUserScan":"Une partie de la piste","patient":"Patient","patientName":"Nom du patient","patients":"Patients","patientSearchResults":"R\xe9sultats de la recherche de patients","previousPage":"Pr\xe9c\xe9dent","previousValue":"Valeur pr\xe9c\xe9dente","previousValueLegend":"la valeur remplac\xe9e par une modification","provider":"Prestataire de service","providerEncountersScope":"Voici les rencontres sur lesquelles ce prestataire de service est enregistr\xe9, ce qui n\'est pas la m\xeame chose que celles qu\'il a saisies ou modifi\xe9es — la derni\xe8re colonne indique qui l\'a fait, et l\'onglet Utilisateurs permet d\'effectuer une recherche sur ce crit\xe8re.","providerName":"Nom du prestataire de service","providers":"Prestataires de service","providerSearchResults":"R\xe9sultats de la recherche de prestataires de service","questionConcept":"Concept de la question","readingObservations":"Lecture des observations de {{read}} rencontres sur {{total}}…","readingUserObservations":"{{obsRead}} observations lues jusqu\'\xe0 pr\xe9sent…","recordActivity":"Activit\xe9 du patient","recordedAsProvider":"Enregistr\xe9 comme prestataire de service","recordedBy":"Enregistr\xe9 par","retired":"Retir\xe9","role":"R\xf4le","searchBy":"Rechercher par","searchForPatient":"Rechercher un patient par nom ou num\xe9ro d\'identification","searchForProvider":"Rechercher un prestataire de service par nom ou num\xe9ro d\'identification","searchForUser":"Rechercher un utilisateur par nom ou nom d\'utilisateur","searchProviderToBegin":"Saisissez le nom ou le num\xe9ro d\'identification d\'un prestataire de service pour voir les rencontres sur lesquelles il est enregistr\xe9.","searchToBegin":"Saisissez le nom ou le num\xe9ro d\'identification d\'un patient pour commencer l\'audit de son dossier.","searchUserToBegin":"Saisissez un nom ou un nom d\'utilisateur pour voir les rencontres que cet utilisateur a modifi\xe9es.","showConceptDescriptions":"Afficher les descriptions des concepts","showDeletedObs":"Afficher les observations supprim\xe9es","showEveryone":"Afficher tout le monde","showOnlyThisUser":"Afficher uniquement l\'activit\xe9 de cet utilisateur","status":"Statut","unknownUser":"Utilisateur inconnu","user":"Utilisateur","username":"Nom d\'utilisateur","users":"Utilisateurs","userScanStoppedEarly":"Arr\xeat apr\xe8s la lecture de {{obsRead}} modifications d\'observations sans avoir rempli la page. R\xe9duisez la p\xe9riode pour chercher plus loin en arri\xe8re.","userSearchResults":"R\xe9sultats de la recherche d\'utilisateurs","value":"Valeur","visit":"Visite","wasPreviously":"\xe9tait {{value}}","when":"Quand","whoTouchedThisRecord":"Qui a modifi\xe9 ce dossier patient"}')}}]);
package/dist/508.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"508.js","sources":["webpack://@pih/esm-audit-app/json|/home/runner/work/openmrs-esm-pihemr/openmrs-esm-pihemr/packages/esm-audit-app/translations/fr.json"],"names":["JSON"],"mappings":"8HAAA,EAAO,OAAO,CAAGA,KAAK,KAAK,CAAC,k9H"}
1
+ {"version":3,"file":"508.js","sources":["webpack://@pih/esm-audit-app/json|/home/runner/work/openmrs-esm-pihemr/openmrs-esm-pihemr/packages/esm-audit-app/translations/fr.json"],"names":["JSON"],"mappings":"8HAAA,EAAO,OAAO,CAAGA,KAAK,KAAK,CAAC,0yM"}
package/dist/514.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_pih_esm_audit_app=globalThis.webpackChunk_pih_esm_audit_app||[]).push([["514"],{42(e,n,t){t.d(n,{A:()=>l});var r=t(1452),a=t.n(r),o=t(4567),i=t.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-audit__audit__container___HZMlh{background-color:#fff;min-height:100%;padding-bottom:2rem}.-esm-audit__audit__pageHeader___r23U5{margin-bottom:1rem}.-esm-audit__audit__section___KZ-eK{padding:0 1rem}.-esm-audit__audit__sectionHeading___pjcJg{font-size:var(--cds-productive-heading-02-font-size, 1rem);font-weight:var(--cds-productive-heading-02-font-weight, 600);line-height:var(--cds-productive-heading-02-line-height, 1.375);letter-spacing:var(--cds-productive-heading-02-letter-spacing, 0);color:#525252;margin:1rem 0 .5rem}.-esm-audit__audit__contextHeader___razrT{display:flex;flex-direction:column;gap:.25rem;margin-bottom:1rem}.-esm-audit__audit__contextTitle___KEBbE{font-size:var(--cds-productive-heading-03-font-size, 1.25rem);font-weight:var(--cds-productive-heading-03-font-weight, 400);line-height:var(--cds-productive-heading-03-line-height, 1.4);letter-spacing:var(--cds-productive-heading-03-letter-spacing, 0);color:#161616}.-esm-audit__audit__contextSubtitle___unIFr{font-size:var(--cds-body-long-01-font-size, 0.875rem);font-weight:var(--cds-body-long-01-font-weight, 400);line-height:var(--cds-body-long-01-line-height, 1.42857);letter-spacing:var(--cds-body-long-01-letter-spacing, 0.16px);color:#525252}.-esm-audit__audit__backButton___MCinc{margin-left:-1rem}.-esm-audit__audit__searchInput___5aMMM{max-width:30rem;margin-bottom:1rem}.-esm-audit__audit__toolbar___A3xOC{display:flex;flex-wrap:wrap;align-items:center;gap:1rem;margin-bottom:.5rem}.-esm-audit__audit__tableContainer___pvh-U{margin-bottom:.5rem}.-esm-audit__audit__clickableRow___w4j7d{cursor:pointer}.-esm-audit__audit__summaryList___5quU8{background-color:#f4f4f4;margin-bottom:1rem}.-esm-audit__audit__summaryLabel___oDwAG{font-size:var(--cds-productive-heading-01-font-size, 0.875rem);font-weight:var(--cds-productive-heading-01-font-weight, 600);line-height:var(--cds-productive-heading-01-line-height, 1.28572);letter-spacing:var(--cds-productive-heading-01-letter-spacing, 0.16px);color:#525252;width:14rem}.-esm-audit__audit__summaryValue___p7\\+jg{font-size:var(--cds-body-short-01-font-size, 0.875rem);font-weight:var(--cds-body-short-01-font-weight, 400);line-height:var(--cds-body-short-01-line-height, 1.28572);letter-spacing:var(--cds-body-short-01-letter-spacing, 0.16px);color:#161616}.-esm-audit__audit__voidedRow___GCQm0 td{color:#525252;text-decoration:line-through}.-esm-audit__audit__obsConcept___k4mfi{font-size:var(--cds-body-short-01-font-size, 0.875rem);font-weight:var(--cds-body-short-01-font-weight, 400);line-height:var(--cds-body-short-01-line-height, 1.28572);letter-spacing:var(--cds-body-short-01-letter-spacing, 0.16px)}.-esm-audit__audit__obsDescription___TJScI{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:#525252;padding:0 0 .5rem;text-decoration:none}.-esm-audit__audit__legend___yHuXy{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin-bottom:1rem}.-esm-audit__audit__legendItem___sArAJ{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:#525252;display:flex;align-items:center;gap:.25rem}.-esm-audit__audit__emptyState___tS7Z8{font-size:var(--cds-body-long-01-font-size, 0.875rem);font-weight:var(--cds-body-long-01-font-weight, 400);line-height:var(--cds-body-long-01-line-height, 1.42857);letter-spacing:var(--cds-body-long-01-letter-spacing, 0.16px);color:#525252;padding:1rem 0}.-esm-audit__audit__inlineNotification___EONmr{max-width:none;margin-bottom:1rem}.-esm-audit__audit__linkButton___WKcH2{font-size:var(--cds-body-short-01-font-size, 0.875rem);font-weight:var(--cds-body-short-01-font-weight, 400);line-height:var(--cds-body-short-01-line-height, 1.28572);letter-spacing:var(--cds-body-short-01-letter-spacing, 0.16px);background:none;border:none;color:#0f62fe;cursor:pointer;padding:0;text-align:left}.-esm-audit__audit__linkButton___WKcH2:hover,.-esm-audit__audit__linkButton___WKcH2:focus{text-decoration:underline}.-esm-audit__audit__filters___70gqR{display:flex;flex-wrap:wrap;align-items:flex-end;gap:1rem;margin-bottom:1rem}.-esm-audit__audit__filterControl___xGqPg{min-width:16rem}.-esm-audit__audit__clearFilters___6jJDY{margin-bottom:.125rem}.-esm-audit__audit__logHeader___fftIW{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}.-esm-audit__audit__selectedRow___sz0uv td{background-color:#edf5ff}.-esm-audit__audit__lazyPagination___yIxZq{display:flex;align-items:center;gap:.5rem;padding:.5rem 0;border-top:1px solid #e0e0e0}.-esm-audit__audit__paginationRange___CBYOT{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:#525252;margin-right:auto}.-esm-audit__audit__discovering___4616Q{min-height:auto;margin-right:.5rem}","",{version:3,sources:["webpack://./../../node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/audit/audit.scss","webpack://./../../node_modules/@carbon/layout/scss/generated/_spacing.scss","webpack://./../../node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CCzDF,sCACE,qBDIc,CCHd,eAAA,CACA,mBCkCW,CD/Bb,uCACE,kBCoBW,CDjBb,oCACE,cAAA,CAGF,2CEg1BI,0DAAA,CAAA,6DAAA,CAAA,+DAAA,CAAA,iEAAA,CF90BF,aDbQ,CCcR,mBAAA,CAGF,0CACE,YAAA,CACA,qBAAA,CACA,UCXW,CDYX,kBCGW,CAAA,yCCm0BT,6DAAA,CAAA,6DAAA,CAAA,6DAAA,CAAA,iEAAA,CFj0BF,aDrBe,CCwBjB,4CE8zBI,qDAAA,CAAA,oDAAA,CAAA,wDAAA,CAAA,6DAAA,CF5zBF,aD/BQ,CCkCV,uCACE,iBAAA,CAGF,wCACE,eAAA,CACA,kBChBW,CDmBb,oCACE,YAAA,CACA,cAAA,CACA,kBAAA,CACA,QCvBW,CDwBX,mBClCW,CDqCb,2CACE,mBCtCW,CD0Cb,yCACE,cAAA,CAGF,wCACE,wBDlEM,CCmEN,kBCtCW,CDyCb,yCE0xBI,8DAAA,CAAA,6DAAA,CAAA,iEAAA,CAAA,sEAAA,CFxxBF,aDnEQ,CCoER,WAAA,CAGF,0CEoxBI,sDAAA,CAAA,qDAAA,CAAA,yDAAA,CAAA,8DAAA,CFlxBF,aDpEe,CCwEjB,yCACE,aD9EQ,CC+ER,4BAAA,CAGF,uCEywBI,sDAAA,CAAA,qDAAA,CAAA,yDAAA,CAAA,8DAAA,CFrwBJ,2CEqwBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CFnwBF,aDxFQ,CCyFR,iBAAA,CACA,oBAAA,CAGF,mCACE,YAAA,CACA,cAAA,CACA,kBAAA,CACA,cAAA,CACA,kBC1EW,CD6Eb,uCEsvBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CFpvBF,aDvGQ,CCwGR,YAAA,CACA,kBAAA,CACA,UCjGW,CDoGb,uCE8uBI,qDAAA,CAAA,oDAAA,CAAA,wDAAA,CAAA,6DAAA,CF5uBF,aD/GQ,CCgHR,cAAA,CAGF,+CACE,cAAA,CACA,kBC7FW,CDiGb,uCEkuBI,sDAAA,CAAA,qDAAA,CAAA,yDAAA,CAAA,8DAAA,CFhuBF,eAAA,CACA,WAAA,CACA,aD7Ge,CC8Gf,cAAA,CACA,SAAA,CACA,eAAA,CAEA,0FAEE,yBAAA,CAIJ,oCACE,YAAA,CACA,cAAA,CACA,oBAAA,CACA,QCpHW,CDqHX,kBCrHW,CDwHb,0CACE,eAAA,CAIF,yCACE,qBClJW,CDqJb,sCACE,YAAA,CACA,cAAA,CACA,kBAAA,CACA,SC/IW,CDmJb,2CACE,wBD3Jc,CC+JhB,2CACE,YAAA,CACA,kBAAA,CACA,SC3JW,CD4JX,eAAA,CACA,4BAAA,CAGF,4CE6qBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CF3qBF,aDhLQ,CCiLR,iBAAA,CAIF,wCACE,eAAA,CACA,kBCzKW",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@carbon/type';\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.container {\n background-color: $ui-background;\n min-height: 100%;\n padding-bottom: layout.$spacing-07;\n}\n\n.pageHeader {\n margin-bottom: layout.$spacing-05;\n}\n\n.section {\n padding: 0 layout.$spacing-05;\n}\n\n.sectionHeading {\n @include type.type-style('productive-heading-02');\n color: $text-02;\n margin: layout.$spacing-05 0 layout.$spacing-03;\n}\n\n.contextHeader {\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-02;\n margin-bottom: layout.$spacing-05;\n}\n\n.contextTitle {\n @include type.type-style('productive-heading-03');\n color: $color-gray-100;\n}\n\n.contextSubtitle {\n @include type.type-style('body-long-01');\n color: $text-02;\n}\n\n.backButton {\n margin-left: -#{layout.$spacing-05};\n}\n\n.searchInput {\n max-width: 30rem;\n margin-bottom: layout.$spacing-05;\n}\n\n.toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: layout.$spacing-05;\n margin-bottom: layout.$spacing-03;\n}\n\n.tableContainer {\n margin-bottom: layout.$spacing-03;\n}\n\n/* The whole row is the target for opening a patient or an encounter. */\n.clickableRow {\n cursor: pointer;\n}\n\n.summaryList {\n background-color: $ui-01;\n margin-bottom: layout.$spacing-05;\n}\n\n.summaryLabel {\n @include type.type-style('productive-heading-01');\n color: $text-02;\n width: 14rem;\n}\n\n.summaryValue {\n @include type.type-style('body-short-01');\n color: $color-gray-100;\n}\n\n/* Voided rows keep the legacy admin page's struck-through, muted look. */\n.voidedRow td {\n color: $text-02;\n text-decoration: line-through;\n}\n\n.obsConcept {\n @include type.type-style('body-short-01');\n}\n\n.obsDescription {\n @include type.type-style('label-01');\n color: $text-02;\n padding: 0 0 layout.$spacing-03;\n text-decoration: none;\n}\n\n.legend {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: layout.$spacing-03 layout.$spacing-05;\n margin-bottom: layout.$spacing-05;\n}\n\n.legendItem {\n @include type.type-style('label-01');\n color: $text-02;\n display: flex;\n align-items: center;\n gap: layout.$spacing-02;\n}\n\n.emptyState {\n @include type.type-style('body-long-01');\n color: $text-02;\n padding: layout.$spacing-05 0;\n}\n\n.inlineNotification {\n max-width: none;\n margin-bottom: layout.$spacing-05;\n}\n\n/* A table cell that opens a drill-down: looks like a link, behaves like a button. */\n.linkButton {\n @include type.type-style('body-short-01');\n background: none;\n border: none;\n color: $interactive-01;\n cursor: pointer;\n padding: 0;\n text-align: left;\n\n &:hover,\n &:focus {\n text-decoration: underline;\n }\n}\n\n.filters {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n gap: layout.$spacing-05;\n margin-bottom: layout.$spacing-05;\n}\n\n.filterControl {\n min-width: 16rem;\n}\n\n/* Sits on the same baseline as the filter inputs, which carry their own labels. */\n.clearFilters {\n margin-bottom: layout.$spacing-01;\n}\n\n.logHeader {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: layout.$spacing-03;\n}\n\n/* Marks the user whose events the activity log is showing. */\n.selectedRow td {\n background-color: $color-blue-10;\n}\n\n/* Paging a list whose length is not known: a range and two buttons, no page count. */\n.lazyPagination {\n display: flex;\n align-items: center;\n gap: layout.$spacing-03;\n padding: layout.$spacing-03 0;\n border-top: 1px solid $ui-03;\n}\n\n.paginationRange {\n @include type.type-style('label-01');\n color: $text-02;\n margin-right: auto;\n}\n\n/* Sits inline with the paging controls, so the row does not jump as it appears and goes. */\n.discovering {\n min-height: auto;\n margin-right: layout.$spacing-03;\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n","//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.4,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('regular'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n font-weight: font-family.font-weight('light'),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n caption-01: $caption-01,\n caption-02: $caption-02,\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n) !default;\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n"],sourceRoot:""}]),i.locals={container:"-esm-audit__audit__container___HZMlh",pageHeader:"-esm-audit__audit__pageHeader___r23U5",section:"-esm-audit__audit__section___KZ-eK",sectionHeading:"-esm-audit__audit__sectionHeading___pjcJg",contextHeader:"-esm-audit__audit__contextHeader___razrT",contextTitle:"-esm-audit__audit__contextTitle___KEBbE",contextSubtitle:"-esm-audit__audit__contextSubtitle___unIFr",backButton:"-esm-audit__audit__backButton___MCinc",searchInput:"-esm-audit__audit__searchInput___5aMMM",toolbar:"-esm-audit__audit__toolbar___A3xOC",tableContainer:"-esm-audit__audit__tableContainer___pvh-U",clickableRow:"-esm-audit__audit__clickableRow___w4j7d",summaryList:"-esm-audit__audit__summaryList___5quU8",summaryLabel:"-esm-audit__audit__summaryLabel___oDwAG",summaryValue:"-esm-audit__audit__summaryValue___p7+jg",voidedRow:"-esm-audit__audit__voidedRow___GCQm0",obsConcept:"-esm-audit__audit__obsConcept___k4mfi",obsDescription:"-esm-audit__audit__obsDescription___TJScI",legend:"-esm-audit__audit__legend___yHuXy",legendItem:"-esm-audit__audit__legendItem___sArAJ",emptyState:"-esm-audit__audit__emptyState___tS7Z8",inlineNotification:"-esm-audit__audit__inlineNotification___EONmr",linkButton:"-esm-audit__audit__linkButton___WKcH2",filters:"-esm-audit__audit__filters___70gqR",filterControl:"-esm-audit__audit__filterControl___xGqPg",clearFilters:"-esm-audit__audit__clearFilters___6jJDY",logHeader:"-esm-audit__audit__logHeader___fftIW",selectedRow:"-esm-audit__audit__selectedRow___sz0uv",lazyPagination:"-esm-audit__audit__lazyPagination___yIxZq",paginationRange:"-esm-audit__audit__paginationRange___CBYOT",discovering:"-esm-audit__audit__discovering___4616Q"};let l=i},8601(e,n,t){t.r(n),t.d(n,{default:()=>ne});var r=t(9485),a=t.n(r),o=t(7703),i=t(761),l=t(6178),u=t(9610);function c(e){return e?(0,l.formatDatetime)((0,l.parseDate)(e),{mode:"wide",noToday:!0}):""}function s(e,n){var t,r=c(n);return(null==e?void 0:e.display)&&r?"".concat(e.display," — ").concat(r):null!=(t=null==e?void 0:e.display)?t:r}var d=t(1123);function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function m(e){return String(e).padStart(2,"0")}function f(e){if(!(!e||Number.isNaN(e.getTime())))return"".concat(e.getFullYear(),"-").concat(m(e.getMonth()+1),"-").concat(m(e.getDate()))}function g(e){if(!e)return null;var n,t=function(e){if(Array.isArray(e))return e}(n=e.split("-").map(Number))||function(e){var n,t,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),3!==a.length);o=!0);}catch(e){i=!0,t=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw t}}return a}}(n)||function(e){if(e){if("string"==typeof e)return p(e,3);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,3)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],a=t[1],o=t[2];return r&&a&&o?new Date(r,a-1,o):null}function y(e){var n,t,r=Intl.DateTimeFormat().resolvedOptions().timeZone,a=null==e||null==(n=e.start)?void 0:n.toDate(r),o=null==e||null==(t=e.end)?void 0:t.toDate(r);return!a||!o||a>o||1793>a.getFullYear()?{}:{fromDate:f(a),toDate:f(o)}}function h(e){return b(e)?[g(e.fromDate),g(e.toDate)]:void 0}function b(e){return!!(e.fromDate||e.toDate)}var v={from:"createdOnOrAfter",to:"createdOnOrBefore"},A={from:"voidedOnOrAfter",to:"voidedOnOrBefore"},E={from:"encounterDatetimeOnOrAfter",to:"encounterDatetimeOnOrBefore"};function C(e,n){var t="";return e.fromDate&&(t+="&".concat(n.from,"=").concat(e.fromDate)),e.toDate&&(t+="&".concat(n.to,"=").concat(e.toDate)),t}function _(e){return!!(e.encounterType||e.fromDate||e.toDate)}function w(e){var n="";return e.encounterType&&(n+="&encounterType=".concat(e.encounterType.uuid)),e.fromDate&&(n+="&fromdate=".concat(e.fromDate,"T00:00:00")),e.toDate&&(n+="&todate=".concat(e.toDate,"T23:59:59")),n}function $(e,n){var t;if(n.encounterType&&(null==(t=e.encounterType)?void 0:t.uuid)!==n.encounterType.uuid)return!1;if(n.fromDate||n.toDate){var r=e.encounterDatetime?f(new Date(e.encounterDatetime)):void 0;if(!r||n.fromDate&&r<n.fromDate||n.toDate&&r>n.toDate)return!1}return!0}function k(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var x=["deleted","supersededValue"];function S(e){return x.includes(e)}function D(e){if(!e)return null;var n=new Date(e).getTime();return Number.isNaN(n)?null:n}function N(e){var n;return null==e?"":(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"?null!=(n=e.display)?n:"":String(e)}function T(e){var n,t;return null!=(n=null==(t=e.user)?void 0:t.uuid)?n:"unknown"}function z(e,n,t,r,a,o){return n?{key:"".concat(a,":").concat(e),action:e,timestamp:n,user:t,encounter:r,concept:o}:null}var I={obs:[],exhausted:!1};function B(e,n){var t,r,a;return null!=(t="created"===n?null==(r=e.auditInfo)?void 0:r.dateCreated:null==(a=e.auditInfo)?void 0:a.dateVoided)?t:""}function M(e,n){return e.exhausted?null:0===e.obs.length?"￿":B(e.obs[e.obs.length-1],n)||"￿"}function O(e,n){var t,r=0===(t=[M(e,"created"),M(n,"voided")].filter(function(e){return null!==e})).length?null:t.sort().pop(),a=new Map,o=function(e,n){var t=!0,r=!1,o=void 0;try{for(var i,l=e.obs[Symbol.iterator]();!(t=(i=l.next()).done);t=!0){var u=i.value,c=u.encounter;if(null==c?void 0:c.uuid){var s=B(u,n),d=a.get(c.uuid);d?s>d.lastActivity&&(d.lastActivity=s):a.set(c.uuid,{encounter:c,lastActivity:s})}}}catch(e){r=!0,o=e}finally{try{t||null==l.return||l.return()}finally{if(r)throw o}}};return o(e,"created"),o(n,"voided"),Array.from(a.values()).filter(function(e){return null===r||e.lastActivity>r}).sort(function(e,n){return n.lastActivity.localeCompare(e.lastActivity)||e.encounter.uuid.localeCompare(n.encounter.uuid)})}function F(e,n){return n?e.filter(function(e){var t;return(null==(t=e.encounter.encounterType)?void 0:t.uuid)===n}):e}function P(e,n){return!e.exhausted||!n.exhausted}function j(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function U(e,n,t,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,a)}function L(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){U(o,r,a,i,l,"next",e)}function l(e){U(o,r,a,i,l,"throw",e)}i(void 0)})}}function R(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||K(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||K(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,n){if(e){if("string"==typeof e)return j(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,n)}}function q(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:u(0)}),l(i,"throw",{value:u(1)}),l(i,"return",{value:u(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function u(l){return function(u){var c=[l,u];if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&c[0]?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=n.call(e,o)}catch(e){c=[6,e],r=0}finally{t=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var V="custom:(uuid,display,identifiers:(uuid,identifier,preferred,identifierType:(uuid,display)),person:(display,gender,age,birthdate,dead))",G="custom:(uuid,display,encounterDatetime,voided,patient:(uuid),encounterType:(uuid,display),form:(uuid,display),location:(uuid,display),encounterProviders:(uuid,voided,provider:(uuid,display),encounterRole:(uuid,display)),auditInfo)",W={},Y="custom:(uuid,display,username,systemId,retired,person:(uuid,display))",J="".concat(l.restBaseUrl,"/pihapps/obs");function X(e){return"&sortBy=".concat(e,"-desc&sortBy=obsId-desc")}var Z="custom:(uuid,display,identifier,retired,person:(uuid,display,gender))",Q={fetcher:l.openmrsFetch};function ee(e){return L(function(e){var n,t,r,a,o,i,u,c,s,d,p,m,f=arguments;return q(this,function(g){switch(g.label){case 0:n=f.length>1&&void 0!==f[1]?f[1]:{},r=[],a=e.includes("?")?"&":"?",o=null!=(t=n.maxRows)?t:2500,g.label=1;case 1:if(!(r.length<o))return[3,3];return d=Math.min(100,o-r.length),[4,(0,l.openmrsFetch)("".concat(e).concat(a,"startIndex=").concat(r.length,"&limit=").concat(d))];case 2:if(m=null!=(u=null==(p=g.sent())||null==(c=p.data)?void 0:c.results)?u:[],(i=r).push.apply(i,H(m)),null==(s=n.onProgress)||s.call(n,r.length),m.length<d)return[3,3];return[3,1];case 3:return r.length>=1e5&&console.warn("Stopped reading ".concat(e," after ").concat(1e5," rows; results are incomplete.")),[2,r]}})}).apply(this,arguments)}function en(e,n,t){return L(function(){var r,a;function o(){return L(function(){var n;return q(this,function(o){switch(o.label){case 0:if(!(a<e.length))return[3,2];return[4,t(e[n=a++])];case 1:return r[n]=o.sent(),[3,0];case 2:return[2]}})})()}return q(this,function(t){switch(t.label){case 0:return r=Array(e.length),a=0,[4,Promise.all(Array.from({length:Math.min(n,e.length)},o))];case 1:return t.sent(),[2,r]}})})()}function et(e){var n,t=null==e?void 0:e.identifiers;if(null==t?void 0:t.length)return(null!=(n=t.find(function(e){return e.preferred}))?n:t[0]).identifier}function er(e){var n,t;return null!=(n=et(e))?n:null==e||null==(t=e.person)?void 0:t.display}function ea(e){var n=er(e);return e&&n?"".concat(l.restBaseUrl,"/encounter?q=").concat(encodeURIComponent(n),"&includeAll=true&v=").concat(G)+"&limit=".concat(100):null}function eo(e,n){return(null!=e?e:[]).filter(function(e){var t;return(null==(t=e.patient)?void 0:t.uuid)===(null==n?void 0:n.uuid)})}function ei(e,n,t){var a=e&&!n?"".concat(l.restBaseUrl,"/encounter?patient=").concat(e.uuid,"&v=").concat(G)+"".concat(w(t),"&order=desc&limit=").concat(100):null,o=(0,l.useOpenmrsFetchAll)(a,Q),i=(0,l.useOpenmrsFetchAll)(n?ea(e):null,Q);return{encounters:(0,r.useMemo)(function(){if(!n){var r;return null!=(r=o.data)?r:[]}return eo(i.data,e).filter(function(e){return $(e,t)}).sort(function(e,n){var t,r;return(null!=(t=n.encounterDatetime)?t:"").localeCompare(null!=(r=e.encounterDatetime)?r:"")})},[i.data,t,n,e,o.data]),error:n?i.error:o.error,isLoading:n?i.isLoading:o.isLoading}}function el(){var e=(0,l.useOpenmrsFetchAll)("".concat(l.restBaseUrl,"/encountertype?v=custom:(uuid,display)&limit=").concat(100),Q),n=e.data,t=e.error,a=e.isLoading;return{encounterTypes:(0,r.useMemo)(function(){return(null!=n?n:[]).slice().sort(function(e,n){var t,r;return(null!=(t=e.display)?t:"").localeCompare(null!=(r=n.display)?r:"")})},[n]),error:t,isLoading:a}}var eu=["encounterDatetime-desc","encounterId-desc"];function ec(e,n){return L(function(){var t,r,a,o;return q(this,function(i){switch(i.label){case 0:return[4,(0,l.openmrsFetch)("".concat(e,"&startIndex=").concat(n.obs.length,"&limit=").concat(100))];case 1:return o=null!=(t=null==(a=i.sent())||null==(r=a.data)?void 0:r.results)?t:[],[2,{obs:H(n.obs).concat(H(o)),exhausted:o.length<100}]}})})()}var es=t(2591),ed=t.n(es),ep=t(1740),em=t.n(ep),ef=t(8128),eg=t.n(ef),ey=t(3236),eh=t.n(ey),eb=t(3051),ev=t.n(eb),eA=t(3656),eE=t.n(eA),eC=t(42),e_={};e_.styleTagTransform=eE(),e_.setAttributes=eh(),e_.insert=eg().bind(null,"head"),e_.domAPI=em(),e_.insertStyleElement=ev(),ed()(eC.A,e_);let ew=eC.A&&eC.A.locals?eC.A.locals:void 0;function e$(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ek(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return e$(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e$(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ex(e){var n,t,o,c,s,p,m,f,g,y,h,b,v,A,E=e.onSelectPatient,C=(0,i.useTranslation)().t,_=(0,l.useConfig)(),w=ek((0,r.useState)(""),2),$=w[0],k=w[1],x=ek((0,r.useState)(1),2),S=x[0],D=x[1],N=ek((0,r.useState)(null!=(A=_.patientSearchPageSize)?A:10),2),T=N[0],z=N[1],I=(0,l.useDebounce)($.trim(),300),B=(0,r.useMemo)(function(){return Array.from(new Set([T,10,20,50])).sort(function(e,n){return e-n})},[T]),M=(f=(S-1)*T,g=I?"".concat(l.restBaseUrl,"/patient?q=").concat(encodeURIComponent(I),"&v=").concat(V)+"&startIndex=".concat(f,"&limit=").concat(T,"&totalCount=true"):null,h=(y=(0,d.Ay)(g,l.openmrsFetch)).data,b=y.error,v=y.isLoading,{patients:null!=(n=null==h||null==(c=h.data)?void 0:c.results)?n:[],totalCount:null!=(t=null!=(o=null==h||null==(s=h.data)?void 0:s.totalCount)?o:null==h||null==(m=h.data)||null==(p=m.results)?void 0:p.length)?t:0,error:b,isLoading:v}),O=M.patients,F=M.totalCount,P=M.error,j=M.isLoading;return(0,r.useEffect)(function(){D(1)},[I]),a().createElement("div",null,a().createElement(u.vji,{className:ew.searchInput,labelText:C("searchForPatient","Search for a patient by name or identifier"),placeholder:C("searchForPatient","Search for a patient by name or identifier"),onChange:function(e){return k(e.target.value)},size:"lg",value:$}),I?P?a().createElement(l.ErrorState,{error:P,headerTitle:C("patientSearchResults","Patient search results")}):j?a().createElement(u.OOb,{columnCount:5,compact:!0,role:"progressbar",showHeader:!1,showToolbar:!1}):0===O.length?a().createElement("p",{className:ew.emptyState},C("noPatientsFound",'No patients match "{{searchTerm}}".',{searchTerm:I})):a().createElement(a().Fragment,null,a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm",useZebraStyles:!0},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,C("patientName","Patient name")),a().createElement(u.A0N,null,C("identifier","Identifier")),a().createElement(u.A0N,null,C("gender","Gender")),a().createElement(u.A0N,null,C("age","Age")),a().createElement(u.A0N,null,C("birthdate","Date of birth")))),a().createElement(u.BFY,null,O.map(function(e){var n,t,r,o,i,c;return a().createElement(u.Hjg,{className:ew.clickableRow,key:e.uuid,onClick:function(){return E(e.uuid)}},a().createElement(u.nA6,null,a().createElement("button",{className:ew.linkButton,onClick:function(n){n.stopPropagation(),E(e.uuid)},type:"button"},null!=(n=null==(t=e.person)?void 0:t.display)?n:e.display)),a().createElement(u.nA6,null,et(e)),a().createElement(u.nA6,null,null==(r=e.person)?void 0:r.gender),a().createElement(u.nA6,null,null==(o=e.person)?void 0:o.age),a().createElement(u.nA6,null,(c=null==(i=e.person)?void 0:i.birthdate)?(0,l.formatDate)((0,l.parseDate)(c),{mode:"wide",time:!1,noToday:!0}):""))})))),a().createElement(u.dKS,{onChange:function(e){var n=e.page,t=e.pageSize;D(n),z(t)},page:S,pageSize:T,pageSizes:B,size:"sm",totalItems:F})):a().createElement("p",{className:ew.emptyState},C("searchToBegin","Enter a patient name or identifier to begin auditing their records.")))}function eS(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eD(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return eS(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eS(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eN(e){var n,t,o,c,s,p,m,f,g,y,h,b,v,A,E=e.onSelectProvider,C=(0,i.useTranslation)().t,_=(0,l.useConfig)(),w=eD((0,r.useState)(""),2),$=w[0],k=w[1],x=eD((0,r.useState)(1),2),S=x[0],D=x[1],N=eD((0,r.useState)(null!=(A=_.patientSearchPageSize)?A:10),2),T=N[0],z=N[1],I=(0,l.useDebounce)($.trim(),300),B=(0,r.useMemo)(function(){return Array.from(new Set([T,10,20,50])).sort(function(e,n){return e-n})},[T]),M=(f=(S-1)*T,g=I?"".concat(l.restBaseUrl,"/provider?q=").concat(encodeURIComponent(I),"&v=").concat(Z)+"&startIndex=".concat(f,"&limit=").concat(T,"&totalCount=true"):null,h=(y=(0,d.Ay)(g,l.openmrsFetch)).data,b=y.error,v=y.isLoading,{providers:null!=(n=null==h||null==(c=h.data)?void 0:c.results)?n:[],totalCount:null!=(t=null!=(o=null==h||null==(s=h.data)?void 0:s.totalCount)?o:null==h||null==(m=h.data)||null==(p=m.results)?void 0:p.length)?t:0,error:b,isLoading:v}),O=M.providers,F=M.totalCount,P=M.error,j=M.isLoading;return(0,r.useEffect)(function(){D(1)},[I]),a().createElement("div",null,a().createElement(u.vji,{className:ew.searchInput,labelText:C("searchForProvider","Search for a provider by name or identifier"),onChange:function(e){return k(e.target.value)},placeholder:C("searchForProvider","Search for a provider by name or identifier"),size:"lg",value:$}),I?P?a().createElement(l.ErrorState,{error:P,headerTitle:C("providerSearchResults","Provider search results")}):j?a().createElement(u.OOb,{columnCount:3,compact:!0,role:"progressbar",showHeader:!1,showToolbar:!1}):0===O.length?a().createElement("p",{className:ew.emptyState},C("noProvidersFound",'No providers match "{{searchTerm}}".',{searchTerm:I})):a().createElement(a().Fragment,null,a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm",useZebraStyles:!0},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,C("providerName","Provider name")),a().createElement(u.A0N,null,C("identifier","Identifier")),a().createElement(u.A0N,null,C("gender","Gender")))),a().createElement(u.BFY,null,O.map(function(e){var n,t,r;return a().createElement(u.Hjg,{className:ew.clickableRow,key:e.uuid,onClick:function(){return E(e.uuid)}},a().createElement(u.nA6,null,a().createElement("button",{className:ew.linkButton,onClick:function(n){n.stopPropagation(),E(e.uuid)},type:"button"},null!=(n=null==(t=e.person)?void 0:t.display)?n:e.display)),a().createElement(u.nA6,null,e.identifier),a().createElement(u.nA6,null,null==(r=e.person)?void 0:r.gender))})))),a().createElement(u.dKS,{onChange:function(e){var n=e.page,t=e.pageSize;D(n),z(t)},page:S,pageSize:T,pageSizes:B,size:"sm",totalItems:F})):a().createElement("p",{className:ew.emptyState},C("searchProviderToBegin","Enter a provider name or identifier to see the encounters they are recorded on.")))}function eT(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ez(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return eT(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eT(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eI(e){var n,t,o,c,s,p,m,f,g,y,h,b,v,A,E=e.onSelectUser,C=(0,i.useTranslation)().t,_=(0,l.useConfig)(),w=ez((0,r.useState)(""),2),$=w[0],k=w[1],x=ez((0,r.useState)(1),2),S=x[0],D=x[1],N=ez((0,r.useState)(null!=(A=_.patientSearchPageSize)?A:10),2),T=N[0],z=N[1],I=(0,l.useDebounce)($.trim(),300),B=(0,r.useMemo)(function(){return Array.from(new Set([T,10,20,50])).sort(function(e,n){return e-n})},[T]),M=(f=(S-1)*T,g=I?"".concat(l.restBaseUrl,"/user?q=").concat(encodeURIComponent(I),"&v=").concat(Y)+"&startIndex=".concat(f,"&limit=").concat(T,"&totalCount=true"):null,h=(y=(0,d.Ay)(g,l.openmrsFetch)).data,b=y.error,v=y.isLoading,{users:null!=(n=null==h||null==(c=h.data)?void 0:c.results)?n:[],totalCount:null!=(t=null!=(o=null==h||null==(s=h.data)?void 0:s.totalCount)?o:null==h||null==(m=h.data)||null==(p=m.results)?void 0:p.length)?t:0,error:b,isLoading:v}),O=M.users,F=M.totalCount,P=M.error,j=M.isLoading;return(0,r.useEffect)(function(){D(1)},[I]),a().createElement("div",null,a().createElement(u.vji,{className:ew.searchInput,labelText:C("searchForUser","Search for a user by name or username"),onChange:function(e){return k(e.target.value)},placeholder:C("searchForUser","Search for a user by name or username"),size:"lg",value:$}),I?P?a().createElement(l.ErrorState,{error:P,headerTitle:C("userSearchResults","User search results")}):j?a().createElement(u.OOb,{columnCount:3,compact:!0,role:"progressbar",showHeader:!1,showToolbar:!1}):0===O.length?a().createElement("p",{className:ew.emptyState},C("noUsersFound",'No users match "{{searchTerm}}".',{searchTerm:I})):a().createElement(a().Fragment,null,a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm",useZebraStyles:!0},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,C("name","Name")),a().createElement(u.A0N,null,C("username","Username")),a().createElement(u.A0N,null,C("status","Status")))),a().createElement(u.BFY,null,O.map(function(e){var n,t,r;return a().createElement(u.Hjg,{className:ew.clickableRow,key:e.uuid,onClick:function(){return E(e.uuid)}},a().createElement(u.nA6,null,a().createElement("button",{className:ew.linkButton,onClick:function(n){n.stopPropagation(),E(e.uuid)},type:"button"},null!=(n=null==(r=e.person)?void 0:r.display)?n:e.display)),a().createElement(u.nA6,null,null!=(t=e.username)?t:e.systemId),a().createElement(u.nA6,null,e.retired?a().createElement(u.vwO,{type:"gray"},C("retired","Retired")):null))})))),a().createElement(u.dKS,{onChange:function(e){var n=e.page,t=e.pageSize;D(n),z(t)},page:S,pageSize:T,pageSizes:B,size:"sm",totalItems:F})):a().createElement("p",{className:ew.emptyState},C("searchUserToBegin","Enter a name or username to see the encounters that user has modified.")))}var eB=["patients","users","providers"];function eM(e){var n=e.tab,t=e.onSelectTab,r=e.onSelectPatient,o=e.onSelectUser,l=e.onSelectProvider,c=(0,i.useTranslation)().t;return a().createElement("div",{className:ew.section},a().createElement(u.tUM,{onChange:function(e){return t(eB[e.selectedIndex])},selectedIndex:Math.max(0,eB.indexOf(n))},a().createElement(u.wbY,{"aria-label":c("searchBy","Search by")},a().createElement(u.ozo,null,c("patients","Patients")),a().createElement(u.ozo,null,c("users","Users")),a().createElement(u.ozo,null,c("providers","Providers"))),a().createElement(u.T2N,null,a().createElement(u.KpK,null,a().createElement(ex,{onSelectPatient:r})),a().createElement(u.KpK,null,a().createElement(eI,{onSelectUser:o})),a().createElement(u.KpK,null,a().createElement(eN,{onSelectProvider:l})))))}function eO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eF(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return eO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eO(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eP(e){var n=e.obsTree,t=(0,i.useTranslation)(),o=t.t,l=t.i18n,c=eF((0,r.useState)(!0),2),d=c[0],p=c[1],m=eF((0,r.useState)(!1),2),f=m[0],g=m[1],y=(0,r.useMemo)(function(){return{edited:{label:o("edited","Edited"),type:"blue",legend:o("editedLegend","the value was changed after it was first recorded")},addedAfterEncounter:{label:o("addedLater","Added later"),type:"teal",legend:o("addedLaterLegend","recorded after the encounter itself was created")},deleted:{label:o("deleted","Deleted"),type:"red",legend:o("deletedLegend","removed from the encounter")},supersededValue:{label:o("previousValue","Previous value"),type:"gray",legend:o("previousValueLegend","the value that an edit replaced")}}},[o]),h=(0,r.useMemo)(function(){return function e(n,t){var r=!0,a=!1,o=void 0;try{for(var i,l=n[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var u=i.value;t.set(u.obs.uuid,u.obs),e(u.children,t)}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return t}(n,new Map)},[n]),b=(0,r.useMemo)(function(){return function e(n,t){return n.flatMap(function(n){var r;return!t&&S(n.status)?[]:[n].concat(function(e){if(Array.isArray(e))return k(e)}(r=e(n.children,t))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e){if(e){if("string"==typeof e)return k(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,void 0)}}(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())})}(n,d)},[n,d]),v=(0,r.useMemo)(function(){return Array.from(h.values()).some(function(e){return e.voided})},[h]);return a().createElement(a().Fragment,null,a().createElement("h3",{className:ew.sectionHeading},o("observations","Observations")),a().createElement("div",{className:ew.toolbar},a().createElement(u.Sc0,{checked:d,disabled:!v,id:"show-deleted-obs",labelText:o("showDeletedObs","Show deleted observations"),onChange:function(e,n){return p(n.checked)}}),a().createElement(u.Sc0,{checked:f,id:"show-obs-descriptions",labelText:o("showConceptDescriptions","Show concept descriptions"),onChange:function(e,n){return g(n.checked)}})),a().createElement("div",{className:ew.legend},Object.entries(y).map(function(e){var n=eF(e,2),t=n[0],r=n[1];return a().createElement("span",{className:ew.legendItem,key:t},a().createElement(u.vwO,{type:r.type},r.label),r.legend)})),0===b.length?a().createElement("p",{className:ew.emptyState},o("noObservations","This encounter has no observations.")):a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm"},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,o("questionConcept","Question concept")),a().createElement(u.A0N,null,o("value","Value")),a().createElement(u.A0N,null,o("change","Change")),a().createElement(u.A0N,null,o("recordedBy","Recorded by")),a().createElement(u.A0N,null,o("deletedBy","Deleted by")))),a().createElement(u.BFY,null,b.map(function(e){var n,t,r,i,c,d,p,m,g=e.obs,b=e.status,v=e.depth,A=e.children,E="unchanged"===b?void 0:y[b],C=g.previousVersion?h.get(g.previousVersion.uuid):void 0,_=f?function(e,n){var t,r=null==(t=e.concept)?void 0:t.descriptions;if(null==r?void 0:r.length){var a=null==n?void 0:n.split(/[-_]/)[0],o=r.find(function(e){var n;return(null==(n=e.locale)?void 0:n.split(/[-_]/)[0])===a});return(null!=o?o:r[0]).description}}(g,null==l?void 0:l.language):void 0,w=A.length>0,$={paddingInlineStart:"".concat(1.5*v,"rem")};return a().createElement(a().Fragment,{key:g.uuid},a().createElement(u.Hjg,{className:S(b)?ew.voidedRow:void 0},a().createElement(u.nA6,null,a().createElement("span",{className:ew.obsConcept,style:$},w?a().createElement("strong",null,null==(n=g.concept)?void 0:n.display):null==(t=g.concept)?void 0:t.display)),a().createElement(u.nA6,null,w?null:N(g.value),C?a().createElement("div",{className:ew.obsDescription},o("wasPreviously","was {{value}}",{value:N(C.value)})):null,g.comment?a().createElement("div",{className:ew.obsDescription},g.comment):null),a().createElement(u.nA6,null,E?a().createElement(u.vwO,{type:E.type},E.label):null),a().createElement(u.nA6,null,a().createElement("div",null,s(null==(r=g.auditInfo)?void 0:r.creator,null==(i=g.auditInfo)?void 0:i.dateCreated)),(null==(c=g.auditInfo)?void 0:c.changedBy)?a().createElement("div",{className:ew.obsDescription},o("changedByUser","Changed by {{user}}",{user:s(g.auditInfo.changedBy,g.auditInfo.dateChanged)})):null),a().createElement(u.nA6,null,g.voided?a().createElement(a().Fragment,null,a().createElement("div",null,s(null==(d=g.auditInfo)?void 0:d.voidedBy,null==(p=g.auditInfo)?void 0:p.dateVoided)),(null==(m=g.auditInfo)?void 0:m.voidReason)?a().createElement("div",{className:ew.obsDescription},g.auditInfo.voidReason):null):null)),_?a().createElement(u.Hjg,null,a().createElement(u.nA6,{colSpan:5},a().createElement("div",{className:ew.obsDescription,style:$},_))):null)})))))}function ej(e){var n,t,o,p,m,f,g,y,h,b,v,A,E,C,_,w,$,k,x,S,N,T,z,I,B=e.encounterUuid,M=e.onBackToEncounters,O=(0,i.useTranslation)().t,F=(0,l.useConfig)(),P=(o=B?"".concat(l.restBaseUrl,"/encounter/").concat(B,"?v=").concat("custom:(uuid,display,encounterDatetime,voided,patient:(uuid,display,identifiers:(uuid,identifier,preferred)),location:(uuid,display),form:(uuid,display,version),encounterType:(uuid,display),visit:(uuid,display,startDatetime,visitType:(uuid,display)),encounterProviders:(uuid,voided,provider:(uuid,display,identifier),encounterRole:(uuid,display)),auditInfo)"):null,p=(0,d.Ay)(o,l.openmrsFetch),m=B?"".concat(l.restBaseUrl,"/obs?encounter=").concat(B,"&includeAll=true&v=").concat("custom:(uuid,display,obsDatetime,voided,comment,formFieldPath,value:ref,concept:(uuid,display,descriptions:(description,locale)),obsGroup:(uuid),previousVersion:(uuid,display),auditInfo)","&limit=").concat(100):null,f=(0,l.useOpenmrsFetchAll)(m,Q),g=null==(t=p.data)?void 0:t.data,y=(0,r.useMemo)(function(){var e;return function(e,n){var t=new Set(e.map(function(e){var n;return null==(n=e.previousVersion)?void 0:n.uuid}).filter(function(e){return!!e})),r=new Map(e.map(function(e){return[e.uuid,{obs:e,status:function(e,n,t){if(e.voided)return t.has(e.uuid)?"supersededValue":"deleted";if(e.previousVersion)return"edited";var r,a,o=D(null==(r=e.auditInfo)?void 0:r.dateCreated),i=D(null==n||null==(a=n.auditInfo)?void 0:a.dateCreated);return null!==o&&null!==i&&o!==i?"addedAfterEncounter":"unchanged"}(e,n,t),depth:0,children:[]}]})),a=[],o=!0,i=!1,l=void 0;try{for(var u,c=r.values()[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s,d=u.value,p=(null==(s=d.obs.obsGroup)?void 0:s.uuid)?r.get(d.obs.obsGroup.uuid):void 0;p?p.children.push(d):a.push(d)}}catch(e){i=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}var m=function(e,n){e.sort(function(e,n){return function(e,n){var t,r,a,o,i,l,u,c,s,d,p=null!=(t=null!=(r=e.formFieldPath)?r:null==(u=e.concept)?void 0:u.display)?t:"",m=null!=(a=null!=(o=n.formFieldPath)?o:null==(c=n.concept)?void 0:c.display)?a:"";if(p!==m)return p.localeCompare(m);var f=null!=(i=D(null==(s=e.auditInfo)?void 0:s.dateCreated))?i:0,g=null!=(l=D(null==(d=n.auditInfo)?void 0:d.dateCreated))?l:0;return f!==g?g-f:e.uuid.localeCompare(n.uuid)}(e.obs,n.obs)});var t=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var l=o.value;l.depth=n,m(l.children,n+1)}}catch(e){r=!0,a=e}finally{try{t||null==i.return||i.return()}finally{if(r)throw a}}};return m(a,0),a}(null!=(e=f.data)?e:[],g)},[f.data,g]),{encounter:g,obsTree:y,error:null!=(n=p.error)?n:f.error,isLoading:p.isLoading||f.isLoading}),j=P.encounter,U=P.obsTree,L=P.error,R=P.isLoading;if(L)return a().createElement("div",{className:ew.section},a().createElement(eU,{onClick:function(){return M(void 0)}}),a().createElement(l.ErrorState,{error:L,headerTitle:O("encounterAudit","Encounter audit")}));if(R)return a().createElement("div",{className:ew.section},a().createElement(eU,{onClick:function(){return M(void 0)}}),a().createElement(u.rrI,{heading:!0,paragraph:!0,role:"progressbar"}));if(!j)return a().createElement("div",{className:ew.section},a().createElement(eU,{onClick:function(){return M(void 0)}}),a().createElement("p",{className:ew.emptyState},O("encounterNotFound","That encounter could not be found.")));var H=null==(v=j.patient)?void 0:v.uuid,K=[{label:O("patient","Patient"),value:H?a().createElement(l.ConfigurableLink,{to:F.patientDashboardUrl,templateParams:{patientUuid:H}},null==(A=j.patient)?void 0:A.display):null==(E=j.patient)?void 0:E.display},{label:O("identifier","Identifier"),value:et(j.patient)},{label:O("encounterDate","Encounter date"),value:c(j.encounterDatetime)},{label:O("location","Location"),value:null==(C=j.location)?void 0:C.display},{label:O("visit","Visit"),value:null==(_=j.visit)?void 0:_.display},{label:O("encounterType","Encounter type"),value:null==(w=j.encounterType)?void 0:w.display},{label:O("form","Form"),value:function(e){var n;if(null==(n=e.form)?void 0:n.display)return e.form.version?"".concat(e.form.display," v").concat(e.form.version):e.form.display}(j)},{label:O("createdBy","Created by"),value:s(null==($=j.auditInfo)?void 0:$.creator,null==(k=j.auditInfo)?void 0:k.dateCreated)}];(null==(x=j.auditInfo)?void 0:x.changedBy)&&K.push({label:O("changedBy","Changed by"),value:s(j.auditInfo.changedBy,j.auditInfo.dateChanged)}),j.voided&&(K.push({label:O("deletedBy","Deleted by"),value:s(null==(T=j.auditInfo)?void 0:T.voidedBy,null==(z=j.auditInfo)?void 0:z.dateVoided)}),(null==(I=j.auditInfo)?void 0:I.voidReason)&&K.push({label:O("deletionReason","Reason for deletion"),value:j.auditInfo.voidReason}));var q=(null!=(h=j.encounterProviders)?h:[]).filter(function(e){return!e.voided});return a().createElement("div",{className:ew.section},a().createElement(eU,{onClick:function(){return M(H)}}),a().createElement("div",{className:ew.contextHeader},a().createElement("span",{className:ew.contextTitle},null!=(b=null==(S=j.encounterType)?void 0:S.display)?b:O("encounter","Encounter"),j.voided?a().createElement(u.vwO,{type:"red"},O("deleted","Deleted")):null),a().createElement("span",{className:ew.contextSubtitle},[null==(N=j.patient)?void 0:N.display,c(j.encounterDatetime)].filter(Boolean).join(" \xb7 "))),j.voided?a().createElement(u.jeF,{className:ew.inlineNotification,hideCloseButton:!0,kind:"warning",lowContrast:!0,subtitle:O("encounterDeletedSubtitle","This encounter has been deleted. Its observations are shown as they were left."),title:O("encounterDeleted","Deleted encounter")}):null,a().createElement("h3",{className:ew.sectionHeading},O("encounterSummary","Encounter summary")),a().createElement(u.r9c,{className:ew.summaryList,isCondensed:!0},a().createElement(u.GRJ,null,K.map(function(e){return a().createElement(u.Cvq,{key:e.label},a().createElement(u.Um2,{className:ew.summaryLabel,noWrap:!0},e.label),a().createElement(u.Um2,{className:ew.summaryValue},e.value))}))),a().createElement("h3",{className:ew.sectionHeading},O("providers","Providers")),0===q.length?a().createElement("p",{className:ew.emptyState},O("noProviders","No providers are recorded for this encounter.")):a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm"},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,O("role","Role")),a().createElement(u.A0N,null,O("providerName","Provider name")),a().createElement(u.A0N,null,O("identifier","Identifier")))),a().createElement(u.BFY,null,q.map(function(e){var n,t,r;return a().createElement(u.Hjg,{key:e.uuid},a().createElement(u.nA6,null,null==(n=e.encounterRole)?void 0:n.display),a().createElement(u.nA6,null,null==(t=e.provider)?void 0:t.display),a().createElement(u.nA6,null,null==(r=e.provider)?void 0:r.identifier))})))),a().createElement(eP,{obsTree:U}))}function eU(e){var n=e.onClick,t=(0,i.useTranslation)().t;return a().createElement(u.$nd,{className:ew.backButton,kind:"ghost",onClick:n,renderIcon:l.ArrowLeftIcon,size:"sm"},t("backToEncounters","Back to encounters"))}function eL(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eR(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function eH(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n.push.apply(n,t)}return n})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function eK(e,n){if(e){if("string"==typeof e)return eL(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eL(e,n)}}function eq(e){var n,t,o=e.encounterTypes,c=e.isLoadingTypes,s=e.filters,d=e.onChange,p=(0,i.useTranslation)().t,m=(0,r.useMemo)(function(){return new Date},[]),f=(0,r.useMemo)(function(){var e=s.encounterType;return e&&!o.some(function(n){return n.uuid===e.uuid})?((function(e){if(Array.isArray(e))return eL(e)})(o)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||eK(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e]):o},[o,s.encounterType]),g=function(e){if(Array.isArray(e))return e}(n=(0,r.useState)(0))||function(e){var n,t,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),2!==a.length);o=!0);}catch(e){i=!0,t=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw t}}return a}}(n)||eK(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=g[0],v=g[1];return a().createElement("div",{className:ew.filters},a().createElement(u.a32,{className:ew.filterControl,disabled:c||0===f.length,id:"encounter-type-filter",items:f,itemToString:function(e){var n;return null!=(n=null==e?void 0:e.display)?n:""},onChange:function(e){var n=e.selectedItem;return d(eH(eR({},s),{encounterType:null!=n?n:void 0}))},placeholder:p("allEncounterTypes","All encounter types"),selectedItem:null!=(t=s.encounterType)?t:null,size:"sm",titleText:p("encounterType","Encounter type")}),a().createElement(l.OpenmrsDateRangePicker,{className:ew.filterControl,defaultValue:h(s),id:"encounter-date-range-filter",labelText:p("encounterDateRange","Encounter date range"),maxDate:m,onChangeRaw:function(e){var n=y(e),t=n.fromDate,r=n.toDate;(t!==s.fromDate||r!==s.toDate)&&d(eH(eR({},s),{fromDate:t,toDate:r}))},key:b,size:"sm"}),_(s)?a().createElement(u.$nd,{className:ew.clearFilters,kind:"ghost",onClick:function(){v(function(e){return e+1}),d({})},size:"sm"},p("clearFilters","Clear filters")):null)}function eV(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eG(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return eV(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eV(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eW(e){var n,t,o,s,p,m,f,g,y,h,b,v=e.patient,A=e.includeDeleted,E=e.filters,C=e.onSelectEncounter,_=(0,i.useTranslation)().t,w=eG((0,r.useState)(null),2),$=w[0],k=w[1],x=eG((0,r.useState)(1),2),S=x[0],D=x[1],N=(t=(n=ei(v,A,E)).encounters,o=n.error,s=n.isLoading,m=(p=R((0,r.useState)(0),2))[0],f=p[1],g=(0,r.useMemo)(function(){return t.map(function(e){return e.uuid})},[t]),y=(0,d.Ay)(g.length?["audit-activity-obs",g]:null,function(){return L(function(){var e,n;return q(this,function(t){switch(t.label){case 0:return f(0),e=0,[4,en(g,5,function(n){return L(function(){var t;return q(this,function(r){switch(r.label){case 0:return[4,ee("".concat(l.restBaseUrl,"/obs?encounter=").concat(n,"&includeAll=true&v=").concat("custom:(uuid,voided,concept:(uuid,display),previousVersion:(uuid),auditInfo)"))];case 1:return t=r.sent(),f(e+=1),[2,t]}})})()})];case 1:return n=t.sent(),[2,Object.fromEntries(g.map(function(e,t){return[e,n[t]]}))]}})})()}),h=(0,r.useMemo)(function(){var e;return function(e,n){var t=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var u=i.value,c=u.auditInfo;t.push(z("encounterCreated",null==c?void 0:c.dateCreated,null==c?void 0:c.creator,u,u.uuid),z("encounterChanged",null==c?void 0:c.dateChanged,null==c?void 0:c.changedBy,u,u.uuid),u.voided?z("encounterDeleted",null==c?void 0:c.dateVoided,null==c?void 0:c.voidedBy,u,u.uuid):null);var s=null!=(g=n[u.uuid])?g:[],d=new Set(s.map(function(e){var n;return null==(n=e.previousVersion)?void 0:n.uuid}).filter(function(e){return!!e})),p=!0,m=!1,f=void 0;try{for(var g,y,h=s[Symbol.iterator]();!(p=(y=h.next()).done);p=!0){var b,v=y.value,A=v.auditInfo,E=null==(b=v.concept)?void 0:b.display;t.push(z(v.previousVersion?"obsEdited":"obsRecorded",null==A?void 0:A.dateCreated,null==A?void 0:A.creator,u,v.uuid,E),v.voided&&!d.has(v.uuid)?z("obsDeleted",null==A?void 0:A.dateVoided,null==A?void 0:A.voidedBy,u,v.uuid,E):null)}}catch(e){m=!0,f=e}finally{try{p||null==h.return||h.return()}finally{if(m)throw f}}}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return t.filter(function(e){return null!==e}).sort(function(e,n){return n.timestamp.localeCompare(e.timestamp)})}(t,null!=(e=y.data)?e:{})},[t,y.data]),b=(0,r.useMemo)(function(){return function(e){var n=new Map,t=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var l,u,c=o.value,s=T(c),d=n.get(s);d||(d={userUuid:s,userDisplay:null!=(l=null==(u=c.user)?void 0:u.display)?l:"",counts:{encounterCreated:0,encounterChanged:0,encounterDeleted:0,obsRecorded:0,obsEdited:0,obsDeleted:0},firstActivity:c.timestamp,lastActivity:c.timestamp,totalEvents:0},n.set(s,d)),d.counts[c.action]+=1,d.totalEvents+=1,c.timestamp<d.firstActivity&&(d.firstActivity=c.timestamp),c.timestamp>d.lastActivity&&(d.lastActivity=c.timestamp)}}catch(e){r=!0,a=e}finally{try{t||null==i.return||i.return()}finally{if(r)throw a}}return Array.from(n.values()).sort(function(e,n){return n.totalEvents-e.totalEvents||e.userDisplay.localeCompare(n.userDisplay)})}(h)},[h]),{events:h,userActivity:b,scanProgress:{read:m,total:g.length},error:null!=o?o:y.error,isLoading:s||y.isLoading}),I=N.events,B=N.userActivity,M=N.scanProgress,O=N.error,F=N.isLoading,P=(0,r.useMemo)(function(){return B.find(function(e){return e.userUuid===$})},[$,B]),j=(0,r.useMemo)(function(){return $?I.filter(function(e){return T(e)===$}):I},[I,$]);(0,r.useEffect)(function(){D(1)},[$]);var U=Math.min(S,Math.max(1,Math.ceil(j.length/20))),H=j.slice((U-1)*20,20*U),K=(0,r.useMemo)(function(){return{encounterCreated:{label:_("encounterCreatedAction","Created encounter"),type:"teal"},encounterChanged:{label:_("encounterChangedAction","Changed encounter"),type:"blue"},encounterDeleted:{label:_("encounterDeletedAction","Deleted encounter"),type:"red"},obsRecorded:{label:_("obsRecordedAction","Recorded observation"),type:"gray"},obsEdited:{label:_("obsEditedAction","Edited observation"),type:"blue"},obsDeleted:{label:_("obsDeletedAction","Deleted observation"),type:"red"}}},[_]);return O?a().createElement(l.ErrorState,{error:O,headerTitle:_("recordActivity","Patient activity")}):F?a().createElement(a().Fragment,null,M.total>0?a().createElement(u.OuH,{description:_("readingObservations","Reading observations from {{read}} of {{total}} encounters…",{read:M.read,total:M.total})}):null,a().createElement(u.rrI,{heading:!0,paragraph:!0,role:"progressbar"})):0===I.length?a().createElement("p",{className:ew.emptyState},_("noActivity","There is no recorded activity to show.")):a().createElement(a().Fragment,null,a().createElement("h3",{className:ew.sectionHeading},_("whoTouchedThisRecord","Who modified this patient record")),a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm",useZebraStyles:!0},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,_("user","User")),a().createElement(u.A0N,null,_("encountersCreated","Encounters created")),a().createElement(u.A0N,null,_("obsRecordedCount","Observations recorded")),a().createElement(u.A0N,null,_("obsEditedCount","Observations edited")),a().createElement(u.A0N,null,_("obsDeletedCount","Observations deleted")),a().createElement(u.A0N,null,_("firstActivity","First activity")),a().createElement(u.A0N,null,_("lastActivity","Last activity")))),a().createElement(u.BFY,null,B.map(function(e){var n=e.userUuid===$;return a().createElement(u.Hjg,{className:n?ew.selectedRow:void 0,key:e.userUuid},a().createElement(u.nA6,null,a().createElement("button",{"aria-pressed":n,className:ew.linkButton,onClick:function(){return k(n?null:e.userUuid)},title:_("showOnlyThisUser","Show only this user's activity"),type:"button"},e.userDisplay||_("unknownUser","Unknown user"))),a().createElement(u.nA6,null,e.counts.encounterCreated),a().createElement(u.nA6,null,e.counts.obsRecorded),a().createElement(u.nA6,null,e.counts.obsEdited),a().createElement(u.nA6,null,e.counts.obsDeleted),a().createElement(u.nA6,null,c(e.firstActivity)),a().createElement(u.nA6,null,c(e.lastActivity)))})))),a().createElement("div",{className:ew.logHeader},a().createElement("h3",{className:ew.sectionHeading},_("activityLog","Activity log")),$?a().createElement(u.fJ8,{dismissTooltipLabel:_("showEveryone","Show everyone"),onClose:function(){return k(null)},text:(null==P?void 0:P.userDisplay)||_("unknownUser","Unknown user"),title:_("showEveryone","Show everyone"),type:"blue"}):null),a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm"},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,_("when","When")),a().createElement(u.A0N,null,_("user","User")),a().createElement(u.A0N,null,_("action","Action")),a().createElement(u.A0N,null,_("detail","Detail")),a().createElement(u.A0N,null,_("encounter","Encounter")))),a().createElement(u.BFY,null,H.map(function(e){var n,t;return a().createElement(u.Hjg,{key:e.key},a().createElement(u.nA6,null,c(e.timestamp)),a().createElement(u.nA6,null,(null==(n=e.user)?void 0:n.display)||_("unknownUser","Unknown user")),a().createElement(u.nA6,null,a().createElement(u.vwO,{type:K[e.action].type},K[e.action].label)),a().createElement(u.nA6,null,e.concept),a().createElement(u.nA6,null,a().createElement("button",{className:ew.linkButton,onClick:function(){return C(e.encounter.uuid)},type:"button"},[null==(t=e.encounter.encounterType)?void 0:t.display,c(e.encounter.encounterDatetime)].filter(Boolean).join(" \xb7 "))))})))),a().createElement(u.dKS,{onChange:function(e){return D(e.page)},page:U,pageSize:20,pageSizes:[20],size:"sm",totalItems:j.length}))}function eY(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eJ(e){var n,t,o=e.patient,s=e.includeDeleted,d=e.filters,p=e.isLoadingPatient,m=e.onSelectEncounter,f=(0,i.useTranslation)().t,g=(0,l.useConfig)(),y=function(e){if(Array.isArray(e))return e}(n=(0,r.useState)(null!=(t=g.encountersPageSize)?t:10))||function(e){var n,t,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),2!==a.length);o=!0);}catch(e){i=!0,t=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw t}}return a}}(n)||function(e){if(e){if("string"==typeof e)return eY(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eY(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=y[0],b=y[1],v=(0,r.useMemo)(function(){return Array.from(new Set([h,10,20,50])).sort(function(e,n){return e-n})},[h]),A=function(e,n,t,a){var o,i=e&&!n?"".concat(l.restBaseUrl,"/encounter?patient=").concat(e.uuid,"&v=").concat(G)+"".concat(w(t),"&order=desc"):null,u=(0,l.useOpenmrsPagination)(i,a,Q),c=(0,l.useOpenmrsFetchAll)(n?ea(e):null,Q),s=R((0,r.useState)(1),2),d=s[0],p=s[1],m=(0,r.useMemo)(function(){return n?eo(c.data,e).filter(function(e){return $(e,t)}).sort(function(e,n){var t,r;return(null!=(t=n.encounterDatetime)?t:"").localeCompare(null!=(r=e.encounterDatetime)?r:"")}):[]},[c.data,t,n,e]);if((0,r.useEffect)(function(){p(1),1!==u.currentPage&&u.goTo(1)},[t,n,null==e?void 0:e.uuid]),n){var f=Math.min(d,Math.max(1,Math.ceil(m.length/a)));return{encounters:m.slice((f-1)*a,f*a),totalCount:m.length,currentPage:f,goTo:p,error:c.error,isLoading:c.isLoading,cannotIncludeDeleted:!!e&&!er(e)}}return{encounters:null!=(o=u.data)?o:[],totalCount:Number.isNaN(u.totalCount)?0:u.totalCount,currentPage:u.currentPage,goTo:u.goTo,error:u.error,isLoading:u.isLoading,cannotIncludeDeleted:!1}}(o,s,d,h),E=A.encounters,C=A.totalCount,k=A.currentPage,x=A.goTo,S=A.error,D=A.isLoading;return S?a().createElement(l.ErrorState,{error:S,headerTitle:f("encounters","Encounters")}):p||D?a().createElement(u.OOb,{columnCount:6,compact:!0,role:"progressbar",showHeader:!1,showToolbar:!1}):0===E.length?a().createElement("p",{className:ew.emptyState},_(d)?f("noEncountersMatchFilters","No encounters match these filters."):f("noEncountersFound","This patient has no encounters to audit.")):a().createElement(a().Fragment,null,a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm",useZebraStyles:!0},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,f("encounterDate","Encounter date")),a().createElement(u.A0N,null,f("encounterType","Encounter type")),a().createElement(u.A0N,null,f("form","Form")),a().createElement(u.A0N,null,f("provider","Provider")),a().createElement(u.A0N,null,f("location","Location")),a().createElement(u.A0N,null,f("status","Status")))),a().createElement(u.BFY,null,E.map(function(e){var n,t,r,o;return a().createElement(u.Hjg,{className:ew.clickableRow,key:e.uuid,onClick:function(){return m(e.uuid)}},a().createElement(u.nA6,null,a().createElement("button",{className:ew.linkButton,onClick:function(n){n.stopPropagation(),m(e.uuid)},type:"button"},c(e.encounterDatetime))),a().createElement(u.nA6,null,null==(n=e.encounterType)?void 0:n.display),a().createElement(u.nA6,null,null==(t=e.form)?void 0:t.display),a().createElement(u.nA6,null,(null!=(o=e.encounterProviders)?o:[]).filter(function(e){return!e.voided}).map(function(e){var n;return null==(n=e.provider)?void 0:n.display}).filter(Boolean).join(", ")),a().createElement(u.nA6,null,null==(r=e.location)?void 0:r.display),a().createElement(u.nA6,null,e.voided?a().createElement(u.vwO,{type:"red"},f("deleted","Deleted")):null))})))),a().createElement(u.dKS,{onChange:function(e){var n=e.page;b(e.pageSize),x(n)},page:k,pageSize:h,pageSizes:v,size:"sm",totalItems:C}))}function eX(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eZ(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return eX(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eX(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var eQ=["encounters","activity"];function e0(e){var n,t,o,c,s,p,m,f,g,y,h,b,v,A,E=e.patientUuid,C=e.view,_=e.onSelectView,w=e.onSelectEncounter,$=e.onBackToSearch,k=(0,i.useTranslation)().t,x=eZ((0,r.useState)(!1),2),S=x[0],D=x[1],N=eZ((0,r.useState)({}),2),T=N[0],z=N[1],I=(n=E?"".concat(l.restBaseUrl,"/patient/").concat(E,"?v=").concat(V):null,o=(t=(0,d.Ay)(n,l.openmrsFetch)).data,c=t.error,s=t.isLoading,{patient:null==o?void 0:o.data,error:c,isLoading:s}),B=I.patient,M=I.error,O=I.isLoading,F=(m=(p=ei(B,S,W)).encounters,f=p.error,g=p.isLoading,{encounterTypes:(0,r.useMemo)(function(){return function(e){var n=new Map,t=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var l,u=o.value;(null==(l=u.encounterType)?void 0:l.uuid)&&n.set(u.encounterType.uuid,u.encounterType)}}catch(e){r=!0,a=e}finally{try{t||null==i.return||i.return()}finally{if(r)throw a}}return Array.from(n.values()).sort(function(e,n){var t,r;return(null!=(t=e.display)?t:"").localeCompare(null!=(r=n.display)?r:"")})}(m)},[m]),error:f,isLoading:g}),P=F.encounterTypes,j=F.isLoading,U=S&&!!B&&!er(B);return a().createElement("div",{className:ew.section},a().createElement(u.$nd,{className:ew.backButton,kind:"ghost",onClick:$,renderIcon:l.ArrowLeftIcon,size:"sm"},k("backToPatientSearch","Back to patient search")),a().createElement("div",{className:ew.contextHeader},a().createElement("span",{className:ew.contextTitle},null!=(y=null!=(h=null==B||null==(b=B.person)?void 0:b.display)?h:null==B?void 0:B.display)?y:""),a().createElement("span",{className:ew.contextSubtitle},[et(B),null==B||null==(v=B.person)?void 0:v.gender,null==B||null==(A=B.person)?void 0:A.age].filter(function(e){return void 0!==e&&""!==e}).join(" \xb7 "))),a().createElement(eq,{encounterTypes:P,filters:T,isLoadingTypes:j,onChange:z}),a().createElement("div",{className:ew.toolbar},a().createElement(u.Sc0,{checked:S,id:"include-deleted-encounters",labelText:k("includeDeletedEncounters","Include deleted encounters"),onChange:function(e,n){return D(n.checked)}})),U?a().createElement(u.jeF,{className:ew.inlineNotification,hideCloseButton:!0,kind:"warning",lowContrast:!0,subtitle:k("cannotIncludeDeletedEncounters","Deleted encounters can only be listed for a patient who has an identifier."),title:k("deletedEncountersUnavailable","Deleted encounters unavailable")}):null,M?a().createElement(l.ErrorState,{error:M,headerTitle:k("encounters","Encounters")}):a().createElement(u.tUM,{onChange:function(e){return _(eQ[e.selectedIndex])},selectedIndex:Math.max(0,eQ.indexOf(C))},a().createElement(u.wbY,{"aria-label":k("auditViews","Audit views")},a().createElement(u.ozo,null,k("encounters","Encounters")),a().createElement(u.ozo,null,k("recordActivity","Patient activity"))),a().createElement(u.T2N,null,a().createElement(u.KpK,null,a().createElement(eJ,{filters:T,includeDeleted:S,isLoadingPatient:O,onSelectEncounter:w,patient:B})),a().createElement(u.KpK,null,a().createElement(eW,{filters:T,includeDeleted:S,onSelectEncounter:w,patient:B})))))}function e1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function e2(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return e1(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e1(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e3(e){var n,t,o,p,m,f,g,y,h,b,v,A,w,$=e.providerUuid,k=e.onSelectEncounter,x=e.onBackToSearch,S=(0,i.useTranslation)().t,D=(0,l.useConfig)(),N=e2((0,r.useState)(null!=(b=D.encountersPageSize)?b:10),2),T=N[0],z=N[1],I=(0,r.useMemo)(function(){return Array.from(new Set([T,10,20,50])).sort(function(e,n){return e-n})},[T]),B=e2((0,r.useState)({}),2),M=B[0],O=B[1],F=(n=$?"".concat(l.restBaseUrl,"/provider/").concat($,"?v=").concat(Z):null,o=(t=(0,d.Ay)(n,l.openmrsFetch)).data,p=t.error,m=t.isLoading,{provider:null==o?void 0:o.data,error:p,isLoading:m}),P=F.provider,j=F.error,U=F.isLoading,L=el(),R=L.encounterTypes,H=L.isLoading,K=(g=(M.encounterType?"&encounterType=".concat(M.encounterType.uuid):"")+C(M,E),y=$?"".concat(l.restBaseUrl,"/pihapps/encounter?provider=").concat($,"&includeVoided=true")+"&sortBy=".concat(eu.join("&sortBy="),"&v=").concat("custom:(uuid,display,encounterDatetime,voided,patient:(uuid,display),encounterType:(uuid,display),form:(uuid,display),location:(uuid,display),auditInfo)").concat(g):null,h=(0,l.useOpenmrsPagination)(y,T,Q),(0,r.useEffect)(function(){1!==h.currentPage&&h.goTo(1)},[g,$]),{encounters:null!=(f=h.data)?f:[],totalCount:Number.isNaN(h.totalCount)?0:h.totalCount,currentPage:h.currentPage,goTo:h.goTo,error:h.error,isLoading:h.isLoading}),q=K.encounters,V=K.totalCount,G=K.currentPage,W=K.goTo,Y=K.error,J=K.isLoading;return a().createElement("div",{className:ew.section},a().createElement(u.$nd,{className:ew.backButton,kind:"ghost",onClick:x,renderIcon:l.ArrowLeftIcon,size:"sm"},S("backToProviderSearch","Back to provider search")),a().createElement("div",{className:ew.contextHeader},a().createElement("span",{className:ew.contextTitle},null!=(v=null!=(A=null==P||null==(w=P.person)?void 0:w.display)?A:null==P?void 0:P.display)?v:""),a().createElement("span",{className:ew.contextSubtitle},null==P?void 0:P.identifier)),a().createElement(eq,{encounterTypes:R,filters:M,isLoadingTypes:H,onChange:O}),a().createElement(u.jeF,{className:ew.inlineNotification,hideCloseButton:!0,kind:"info",lowContrast:!0,subtitle:S("providerEncountersScope","These are the encounters this provider is recorded on, which is not the same as the ones they entered or changed — the last column names who did that, and the Users tab searches by it."),title:S("recordedAsProvider","Recorded as provider")}),j||Y?a().createElement(l.ErrorState,{error:null!=j?j:Y,headerTitle:S("encounters","Encounters")}):U||J?a().createElement(u.OOb,{columnCount:7,compact:!0,role:"progressbar",showHeader:!1,showToolbar:!1}):0===q.length?a().createElement("p",{className:ew.emptyState},_(M)?S("noProviderEncountersMatch","No encounters for this provider match these filters."):S("noProviderEncounters","This provider is not recorded on any encounters.")):a().createElement(a().Fragment,null,a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm",useZebraStyles:!0},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,S("encounterDate","Encounter date")),a().createElement(u.A0N,null,S("patient","Patient")),a().createElement(u.A0N,null,S("encounterType","Encounter type")),a().createElement(u.A0N,null,S("form","Form")),a().createElement(u.A0N,null,S("location","Location")),a().createElement(u.A0N,null,S("status","Status")),a().createElement(u.A0N,null,S("createdBy","Created by")))),a().createElement(u.BFY,null,q.map(function(e){var n,t,r,o,i,l;return a().createElement(u.Hjg,{className:ew.clickableRow,key:e.uuid,onClick:function(){return k(e.uuid)}},a().createElement(u.nA6,null,a().createElement("button",{className:ew.linkButton,onClick:function(n){n.stopPropagation(),k(e.uuid)},type:"button"},c(e.encounterDatetime))),a().createElement(u.nA6,null,null==(n=e.patient)?void 0:n.display),a().createElement(u.nA6,null,null==(t=e.encounterType)?void 0:t.display),a().createElement(u.nA6,null,null==(r=e.form)?void 0:r.display),a().createElement(u.nA6,null,null==(o=e.location)?void 0:o.display),a().createElement(u.nA6,null,e.voided?a().createElement(u.vwO,{type:"red"},S("deleted","Deleted")):null),a().createElement(u.nA6,null,s(null==(i=e.auditInfo)?void 0:i.creator,null==(l=e.auditInfo)?void 0:l.dateCreated)))})))),a().createElement(u.dKS,{onChange:function(e){var n=e.page;z(e.pageSize),W(n)},page:G,pageSize:T,pageSizes:I,size:"sm",totalItems:V})))}function e5(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function e6(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return e5(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e5(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e4(e){var n,t,o,s,p,m,f,g,E,_,w,$,k,x,S,D,N,T,z,B,j,U,H,K,V,G,W,Z,Q,et,er,ea,eo,ei,eu,es,ed,ep,em,ef,eg=e.userUuid,ey=e.onSelectEncounter,eh=e.onBackToSearch,eb=(0,i.useTranslation)().t,ev=null!=(es=(0,l.useConfig)().encountersPageSize)?es:10,eA=e6((0,r.useState)({}),2),eE=eA[0],eC=eA[1],e_=e6((0,r.useState)(0),2),e$=e_[0],ek=e_[1],ex=e6((0,r.useState)(null),2),eS=ex[0],eD=ex[1],eN=new Date,eT=(n=eg?"".concat(l.restBaseUrl,"/user/").concat(eg,"?v=").concat(Y):null,o=(t=(0,d.Ay)(n,l.openmrsFetch)).data,s=t.error,p=t.isLoading,{user:null==o?void 0:o.data,error:s,isLoading:p}),ez=eT.user,eI=eT.error,eB=eT.isLoading,eM=el(),eO=eM.encounterTypes,eF=eM.isLoading,eP=(m=null==eS?void 0:eS.uuid,_=(E=R((0,r.useState)(1),2))[0],w=E[1],k=($=R((0,r.useState)(I),2))[0],x=$[1],D=(S=R((0,r.useState)(I),2))[0],N=S[1],z=(T=R((0,r.useState)(!1),2))[0],B=T[1],U=(j=R((0,r.useState)(!1),2))[0],H=j[1],V=(K=R((0,r.useState)(void 0),2))[0],G=K[1],W="".concat(null!=(f=eE.fromDate)?f:"","..").concat(null!=(g=eE.toDate)?g:""),Z=(0,r.useRef)(null),Q=eg?"".concat(eg).concat(W):null,(0,r.useEffect)(function(){Z.current=Q,w(1),x(I),N(I),H(!1),G(void 0)},[Q]),(0,r.useEffect)(function(){w(1)},[m]),et=(0,r.useMemo)(function(){return F(O(k,D),m)},[k,m,D]),ea=(er=_*ev)+1,(0,r.useEffect)(function(){if(eg&&Q&&!(et.length>=ea)&&P(k,D)){var e=!1,n="".concat(J,"?includeVoided=true&v=").concat("custom:(uuid,voided,obsDatetime,concept:(uuid,display),auditInfo,encounter:(uuid,display,encounterDatetime,voided,encounterType:(uuid,display),form:(uuid,display),location:(uuid,display),patient:(uuid,display)))");return L(function(){var t,r,a,o;return q(this,function(i){switch(i.label){case 0:B(!0),i.label=1;case 1:i.trys.push([1,9,10,11]),t=k,r=D,a=0,i.label=2;case 2:var l,u,c,s;if(!(a<40)||(l=t,u=r,!(o=l.exhausted&&u.exhausted?null:l.exhausted?"voided":u.exhausted||(null!=(c=M(l,"created"))?c:"")>=(null!=(s=M(u,"voided"))?s:"")?"created":"voided")))return[3,8];if("created"!==o)return[3,4];return[4,ec("".concat(n,"&createdBy=").concat(eg).concat(X("dateCreated"))+C(eE,v),t)];case 3:return t=i.sent(),[3,6];case 4:return[4,ec("".concat(n,"&voidedBy=").concat(eg).concat(X("dateVoided"))+C(eE,A),r)];case 5:r=i.sent(),i.label=6;case 6:if(e||Z.current!==Q)return[2];if(F(O(t,r),m).length>=ea)return[3,8];i.label=7;case 7:return a++,[3,2];case 8:return x(t),N(r),H(P(t,r)&&F(O(t,r),m).length<ea),[3,11];case 9:return G(i.sent()),[3,11];case 10:return e||B(!1),[7];case 11:return[2]}})})(),function(){e=!0}}},[k,D,W,eE,et.length,m,Q,eg,ea]),eo=(_-1)*ev,ei=(0,r.useMemo)(function(){return et.slice(eo,eo+ev)},[et,eo,ev]),eu=(0,d.Ay)(eg&&ei.length?["audit-user-obs-counts",eg,ei.map(function(e){return e.encounter.uuid})]:null,function(){return L(function(){var e,n;return q(this,function(t){switch(t.label){case 0:return[4,en(e=ei.map(function(e){return e.encounter.uuid}),5,function(e){return L(function(){return q(this,function(n){switch(n.label){case 0:return[4,ee("".concat(l.restBaseUrl,"/obs?encounter=").concat(e,"&includeAll=true&v=custom:(uuid,voided,auditInfo)"))];case 1:return[2,function(e,n){var t=0,r=0,a=!0,o=!1,i=void 0;try{for(var l,u=e[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c,s,d,p,m=l.value;(null==(s=m.auditInfo)||null==(c=s.creator)?void 0:c.uuid)===n&&(t+=1),(null==(p=m.auditInfo)||null==(d=p.voidedBy)?void 0:d.uuid)===n&&(r+=1)}}catch(e){o=!0,i=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw i}}return{obsCreated:t,obsVoided:r}}(n.sent(),eg)]}})})()})];case 1:return n=t.sent(),[2,Object.fromEntries(e.map(function(e,t){return[e,n[t]]}))]}})})()}),{activity:(0,r.useMemo)(function(){return ei.map(function(e){var n;return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},e,null==(n=eu.data)?void 0:n[e.encounter.uuid])})},[eu.data,ei]),currentPage:_,goTo:w,firstRowOnPage:eo,hasNextPage:et.length>er,obsRead:k.obs.length+D.obs.length,stoppedEarly:U,isDiscovering:z&&ei.length>0,error:null!=V?V:eu.error,isLoading:z&&0===ei.length||ei.length>0&&eu.isLoading}),ej=eP.activity,eU=eP.currentPage,eL=eP.goTo,eR=eP.firstRowOnPage,eH=eP.hasNextPage,eK=eP.obsRead,eq=eP.stoppedEarly,eV=eP.isDiscovering,eG=eP.error,eW=eP.isLoading,eY=b(eE)||!!eS;return a().createElement("div",{className:ew.section},a().createElement(u.$nd,{className:ew.backButton,kind:"ghost",onClick:eh,renderIcon:l.ArrowLeftIcon,size:"sm"},eb("backToUserSearch","Back to user search")),a().createElement("div",{className:ew.contextHeader},a().createElement("span",{className:ew.contextTitle},null!=(ed=null!=(ep=null==ez||null==(ef=ez.person)?void 0:ef.display)?ep:null==ez?void 0:ez.display)?ed:""),a().createElement("span",{className:ew.contextSubtitle},null!=(em=null==ez?void 0:ez.username)?em:null==ez?void 0:ez.systemId)),a().createElement("div",{className:ew.filters},a().createElement(u.a32,{className:ew.filterControl,disabled:eF,id:"user-encounter-type-filter",items:eO,itemToString:function(e){var n;return null!=(n=null==e?void 0:e.display)?n:""},onChange:function(e){var n=e.selectedItem;return eD(null!=n?n:null)},placeholder:eb("allEncounterTypes","All encounter types"),selectedItem:eS,size:"sm",titleText:eb("encounterType","Encounter type")}),a().createElement(l.OpenmrsDateRangePicker,{className:ew.filterControl,defaultValue:h(eE),id:"user-activity-date-range",labelText:eb("changedBetween","Changed between"),maxDate:eN,onChangeRaw:function(e){return eC(y(e))},key:e$,size:"sm"}),eY?a().createElement(u.$nd,{className:ew.clearFilters,kind:"ghost",onClick:function(){eC({}),ek(function(e){return e+1}),eD(null)},size:"sm"},eb("clearFilters","Clear filters")):null),eI||eG?a().createElement(l.ErrorState,{error:null!=eI?eI:eG,headerTitle:eb("encounters","Encounters")}):eB||eW?a().createElement(a().Fragment,null,eK>0?a().createElement(u.OuH,{description:eb("readingUserObservations","Read {{obsRead}} observations so far…",{obsRead:eK})}):null,a().createElement(u.OOb,{columnCount:7,compact:!0,role:"progressbar",showHeader:!1,showToolbar:!1})):0===ej.length?a().createElement("p",{className:ew.emptyState},eY?eb("noUserEncountersMatch","This user did not change any observations matching these filters."):eb("noUserEncounters","This user has not recorded or deleted any observations.")):a().createElement(a().Fragment,null,eq?a().createElement(u.jeF,{className:ew.inlineNotification,hideCloseButton:!0,kind:"info",lowContrast:!0,subtitle:eb("userScanStoppedEarly","Stopped after reading {{obsRead}} observation changes without filling the page. Narrow the date range to search further back.",{obsRead:eK}),title:eb("partialUserScan","Part of the trail")}):null,a().createElement(u.K3K,{className:ew.tableContainer},a().createElement(u.XIK,{size:"sm",useZebraStyles:!0},a().createElement(u.ndF,null,a().createElement(u.Hjg,null,a().createElement(u.A0N,null,eb("lastChanged","Last changed")),a().createElement(u.A0N,null,eb("patient","Patient")),a().createElement(u.A0N,null,eb("encounterType","Encounter type")),a().createElement(u.A0N,null,eb("encounterDate","Encounter date")),a().createElement(u.A0N,null,eb("location","Location")),a().createElement(u.A0N,null,eb("obsRecordedCount","Observations recorded")),a().createElement(u.A0N,null,eb("obsDeletedCount","Observations deleted")))),a().createElement(u.BFY,null,ej.map(function(e){var n,t,r,o=e.encounter,i=e.obsCreated,l=e.obsVoided,s=e.lastActivity;return a().createElement(u.Hjg,{className:ew.clickableRow,key:o.uuid,onClick:function(){return ey(o.uuid)}},a().createElement(u.nA6,null,a().createElement("button",{className:ew.linkButton,onClick:function(e){e.stopPropagation(),ey(o.uuid)},type:"button"},c(s))),a().createElement(u.nA6,null,null==(n=o.patient)?void 0:n.display),a().createElement(u.nA6,null,null==(t=o.encounterType)?void 0:t.display,o.voided?a().createElement(u.vwO,{type:"red"},eb("deleted","Deleted")):null),a().createElement(u.nA6,null,c(o.encounterDatetime)),a().createElement(u.nA6,null,null==(r=o.location)?void 0:r.display),a().createElement(u.nA6,null,i),a().createElement(u.nA6,null,l))})))),a().createElement("div",{className:ew.lazyPagination},a().createElement("span",{className:ew.paginationRange},eb("encounterRange","Encounters {{from}}–{{to}}",{from:eR+1,to:eR+ej.length})),eV?a().createElement(u.OuH,{className:ew.discovering,description:eb("lookingForMoreEncounters","Looking for more encounters…")}):null,a().createElement(u.$nd,{disabled:1===eU,kind:"ghost",onClick:function(){return eL(eU-1)},size:"sm"},eb("previousPage","Previous")),a().createElement(u.$nd,{disabled:!eH,kind:"ghost",onClick:function(){return eL(eU+1)},size:"sm"},eb("nextPage","Next")))))}function e8(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var e7=["patient","user","provider","encounter","view","search"];function e9(){var e,n=(0,i.useTranslation)().t,t=function(e){if(Array.isArray(e))return e}(e=(0,o.useSearchParams)())||function(e){var n,t,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),2!==a.length);o=!0);}catch(e){i=!0,t=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw t}}return a}}(e)||function(e){if(e){if("string"==typeof e)return e8(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e8(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=t[0],c=t[1],s=u.get("patient"),d=u.get("user"),p=u.get("provider"),m=u.get("encounter"),f=function(e,n,t){return e.includes(n)?n:t},g=f(eQ,u.get("view"),"encounters"),y=f(eB,u.get("search"),"patients"),h=(0,r.useCallback)(function(e){var n=new URLSearchParams(u);e7.forEach(function(e){return n.delete(e)}),e.patient&&n.set("patient",e.patient),e.user&&n.set("user",e.user),e.provider&&n.set("provider",e.provider),e.encounter&&n.set("encounter",e.encounter),e.view&&"encounters"!==e.view&&n.set("view",e.view),e.search&&"patients"!==e.search&&n.set("search",e.search),c(n)},[u,c]);return a().createElement("div",{className:ew.container},a().createElement(l.PageHeader,{className:ew.pageHeader},a().createElement(l.PageHeaderContent,{title:n("auditTrail","Audit trail"),illustration:a().createElement(l.PatientSearchPictogram,null)})),m?a().createElement(ej,{encounterUuid:m,onBackToEncounters:function(e){return d?h({user:d}):p?h({provider:p}):h({patient:null!=e?e:s,view:g})}}):d?a().createElement(e4,{onBackToSearch:function(){return h({search:"users"})},onSelectEncounter:function(e){return h({user:d,encounter:e})},userUuid:d}):p?a().createElement(e3,{onBackToSearch:function(){return h({search:"providers"})},onSelectEncounter:function(e){return h({provider:p,encounter:e})},providerUuid:p}):s?a().createElement(e0,{onBackToSearch:function(){return h({search:"patients"})},onSelectEncounter:function(e){return h({patient:s,encounter:e,view:g})},onSelectView:function(e){return h({patient:s,view:e})},patientUuid:s,view:g}):a().createElement(eM,{onSelectPatient:function(e){return h({patient:e})},onSelectProvider:function(e){return h({provider:e})},onSelectTab:function(e){return h({search:e})},onSelectUser:function(e){return h({user:e})},tab:y}))}function ne(){return a().createElement(o.BrowserRouter,null,a().createElement(e9,null))}}}]);