@openmrs/esm-active-visits-app 3.1.1-pre.97 → 4.0.1-pre.340
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.
- package/.turbo/turbo-build.log +31 -31
- package/dist/150.js +1 -2
- package/dist/184.js +1 -0
- package/dist/316.js +1 -2
- package/dist/316.js.LICENSE.txt +6 -10
- package/dist/399.js +1 -0
- package/dist/483.js +2 -0
- package/dist/{403.js.LICENSE.txt → 483.js.LICENSE.txt} +0 -0
- package/dist/709.js +1 -0
- package/dist/784.js +1 -2
- package/dist/784.js.LICENSE.txt +2 -7
- package/dist/858.js +1 -2
- package/dist/858.js.LICENSE.txt +2 -0
- package/dist/879.js +1 -2
- package/dist/main.js +1 -0
- package/dist/openmrs-esm-active-visits-app.js +1 -1
- package/dist/openmrs-esm-active-visits-app.js.buildmanifest.json +108 -194
- package/dist/openmrs-esm-active-visits-app.old +1 -2
- package/package.json +7 -14
- package/src/active-visits-widget/active-visits.component.tsx +26 -19
- package/src/active-visits-widget/active-visits.resource.tsx +1 -1
- package/src/active-visits-widget/active-visits.scss +25 -28
- package/src/active-visits-widget/empty-data-illustration.component.tsx +2 -2
- package/src/root.scss +8 -8
- package/src/visits-summary/visit-detail-overview.scss +67 -91
- package/src/visits-summary/visit-detail.component.tsx +18 -23
- package/src/visits-summary/visits-components/encounter-list.component.tsx +13 -14
- package/src/visits-summary/visits-components/encounter-observations.component.tsx +1 -1
- package/src/visits-summary/visits-components/visit-summary.component.tsx +36 -38
- package/dist/150.js.map +0 -1
- package/dist/221.js +0 -2
- package/dist/221.js.map +0 -1
- package/dist/248.js +0 -2
- package/dist/248.js.map +0 -1
- package/dist/260.js +0 -2
- package/dist/260.js.map +0 -1
- package/dist/316.js.map +0 -1
- package/dist/402.js +0 -2
- package/dist/402.js.map +0 -1
- package/dist/403.js +0 -3
- package/dist/403.js.map +0 -1
- package/dist/635.js +0 -3
- package/dist/635.js.LICENSE.txt +0 -16
- package/dist/635.js.map +0 -1
- package/dist/784.js.map +0 -1
- package/dist/785.js +0 -3
- package/dist/785.js.LICENSE.txt +0 -8
- package/dist/785.js.map +0 -1
- package/dist/788.js +0 -2
- package/dist/788.js.map +0 -1
- package/dist/858.js.map +0 -1
- package/dist/879.js.map +0 -1
- package/dist/openmrs-esm-active-visits-app.js.map +0 -1
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=openmrs-esm-active-visits-app.js.map
|
|
1
|
+
var _openmrs_esm_active_visits_app;(()=>{"use strict";var e,r,t,n,o,a,i,s,l,u,p,f,d,c,h={9429:(e,r,t)=>{var n={"./start":()=>t.e(150).then((()=>()=>t(150)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},v={};function m(e){var r=v[e];if(void 0!==r)return r.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,m),t.loaded=!0,t.exports}m.m=h,m.c=v,m.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return m.d(r,{a:r}),r},m.d=(e,r)=>{for(var t in r)m.o(r,t)&&!m.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},m.f={},m.e=e=>Promise.all(Object.keys(m.f).reduce(((r,t)=>(m.f[t](e,r),r)),[])),m.u=e=>e+".js",m.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),m.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@openmrs/esm-active-visits-app:",m.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,s;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var p=l[u];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+o){i=p;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,m.nc&&i.setAttribute("nonce",m.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),s&&document.head.appendChild(i)}},m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},m.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{m.S={};var e={},r={};m.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];m.o(m.S,t)||(m.S[t]={});var a=m.S[t],i="@openmrs/esm-active-visits-app",s=(e,r,t,n)=>{var o=a[e]=a[e]||{},s=o[r];(!s||!s.loaded&&(!n!=!s.eager?n:i>s.from))&&(o[r]={get:t,from:i,eager:!!n})},l=[];return"default"===t&&(s("@openmrs/esm-framework","4.0.0-pre.1",(()=>Promise.all([m.e(858),m.e(206)]).then((()=>()=>m(6858))))),s("dayjs","1.11.5",(()=>m.e(879).then((()=>()=>m(8879))))),s("react-dom","18.2.0",(()=>Promise.all([m.e(316),m.e(206)]).then((()=>()=>m(8316))))),s("react-i18next","11.18.4",(()=>Promise.all([m.e(709),m.e(206)]).then((()=>()=>m(709))))),s("react","18.2.0",(()=>m.e(784).then((()=>()=>m(2784)))))),e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),(()=>{var e;m.g.importScripts&&(e=m.g.location+"");var r=m.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),m.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],s=(typeof i)[0];if(a!=s)return"o"==a&&"n"==s||"s"==s||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(s=e[a]))[0]?"-":(n>0?".":"")+(n=2,s);return t}var i=[];for(a=1;a<e.length;a++){var s=e[a];i.push(0===s?"not("+l()+")":1===s?"("+l()+" || "+l()+")":2===s?i.pop()+" "+i.pop():o(s))}return l();function l(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,s=1,l=!0;;s++,i++){var u,p,f=s<e.length?(typeof e[s])[0]:"";if(i>=r.length||"o"==(p=(typeof(u=r[i]))[0]))return!l||("u"==f?s>n&&!o:""==f!=o);if("u"==p){if(!l||"u"!=f)return!1}else if(l)if(f==p)if(s<=n){if(u!=e[s])return!1}else{if(o?u>e[s]:u<e[s])return!1;u!=e[s]&&(l=!1)}else if("s"!=f&&"n"!=f){if(o||s<=n)return!1;l=!1,s--}else{if(s<=n||p<f!=o)return!1;l=!1}else"s"!=f&&"n"!=f&&(l=!1,s--)}}var d=[],c=d.pop.bind(d);for(i=1;i<e.length;i++){var h=e[i];d.push(1==h?c()|c():2==h?c()&c():h?a(h,r):!c())}return!!c()},i=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},s=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",l=(e,r,t,n)=>{var o=i(e,t);return a(n,o)||"undefined"!=typeof console&&console.warn&&console.warn(s(e,t,o,n)),u(e[t][o])},u=e=>(e.loaded=1,e.get()),p=(e=>function(r,t,n,o){var a=m.I(r);return a&&a.then?a.then(e.bind(e,r,m.S[r],t,n,o)):e(0,m.S[r],t,n,o)})(((e,r,t,n,o)=>r&&m.o(r,t)?l(r,0,t,n):o())),f={},d={5206:()=>p("default","react",[1,18,1,0],(()=>m.e(784).then((()=>()=>m(2784))))),906:()=>p("default","@openmrs/esm-framework",[1,4],(()=>Promise.all([m.e(858),m.e(206)]).then((()=>()=>m(6858))))),2432:()=>p("default","react-dom",[1,18,1,0],(()=>m.e(316).then((()=>()=>m(8316))))),4924:()=>p("default","react-i18next",[1,11],(()=>m.e(709).then((()=>()=>m(709))))),3565:()=>p("default","dayjs",[1,1],(()=>m.e(879).then((()=>()=>m(8879)))))},c={150:[906],206:[5206],272:[2432,4924],399:[3565]},m.f.consumes=(e,r)=>{m.o(c,e)&&c[e].forEach((e=>{if(m.o(f,e))return r.push(f[e]);var t=r=>{f[e]=0,m.m[e]=t=>{delete m.c[e],t.exports=r()}},n=r=>{delete f[e],m.m[e]=t=>{throw delete m.c[e],r}};try{var o=d[e]();o.then?r.push(f[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={661:0};m.f.j=(r,t)=>{var n=m.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^2(06|72)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=m.p+m.u(r),i=new Error;m.l(a,(t=>{if(m.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,s]=t,l=0;if(a.some((r=>0!==e[r]))){for(n in i)m.o(i,n)&&(m.m[n]=i[n]);s&&s(m)}for(r&&r(t);l<a.length;l++)o=a[l],m.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_openmrs_esm_active_visits_app=self.webpackChunk_openmrs_esm_active_visits_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),m.nc=void 0;var g=m(9429);_openmrs_esm_active_visits_app=g})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-active-visits-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1-pre.340",
|
|
4
4
|
"description": "Active visits widget microfrontend for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/openmrs-esm-active-visits-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -34,22 +34,15 @@
|
|
|
34
34
|
"url": "https://github.com/openmrs/openmrs-esm-patient-management/issues"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@carbon/
|
|
38
|
-
"@carbon/icons-react": "^10.18.0",
|
|
39
|
-
"carbon-components-react": "^7.25.0",
|
|
40
|
-
"d3": "^5.16.0",
|
|
37
|
+
"@carbon/react": "^1.8.0",
|
|
41
38
|
"lodash-es": "^4.17.15"
|
|
42
39
|
},
|
|
43
40
|
"peerDependencies": {
|
|
44
|
-
"@openmrs/esm-framework": "
|
|
45
|
-
"carbon-components": "10.x",
|
|
46
|
-
"carbon-icons": "7.x",
|
|
41
|
+
"@openmrs/esm-framework": "4.x",
|
|
47
42
|
"dayjs": "1.x",
|
|
48
|
-
"react": "
|
|
49
|
-
"react-dom": "
|
|
50
|
-
"react-i18next": "11.x"
|
|
51
|
-
"react-router-dom": "5.x",
|
|
52
|
-
"rxjs": "6.x"
|
|
43
|
+
"react": "^18.1.0",
|
|
44
|
+
"react-dom": "^18.1.0",
|
|
45
|
+
"react-i18next": "11.x"
|
|
53
46
|
},
|
|
54
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "f5106f136e894179dbe370620e1613ba2e9776ad"
|
|
55
48
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
DataTable,
|
|
4
4
|
DataTableSkeleton,
|
|
5
5
|
InlineLoading,
|
|
6
|
+
Layer,
|
|
6
7
|
Pagination,
|
|
7
8
|
Search,
|
|
8
9
|
Table,
|
|
@@ -16,10 +17,12 @@ import {
|
|
|
16
17
|
TableToolbarContent,
|
|
17
18
|
TableExpandRow,
|
|
18
19
|
TableExpandHeader,
|
|
20
|
+
TableExpandedRow,
|
|
19
21
|
Tile,
|
|
20
|
-
} from 'carbon
|
|
22
|
+
} from '@carbon/react';
|
|
21
23
|
import {
|
|
22
24
|
useLayoutType,
|
|
25
|
+
isDesktop,
|
|
23
26
|
useConfig,
|
|
24
27
|
usePagination,
|
|
25
28
|
ExtensionSlot,
|
|
@@ -61,13 +64,12 @@ const ActiveVisitsTable = () => {
|
|
|
61
64
|
const config = useConfig();
|
|
62
65
|
const layout = useLayoutType();
|
|
63
66
|
const { activeVisits, isError, isLoading, isValidating } = useActiveVisits();
|
|
64
|
-
const desktopView = layout === 'desktop';
|
|
65
67
|
const pageSizes = config?.activeVisits?.pageSizes ?? [10, 20, 30, 40, 50];
|
|
66
68
|
const [currentPageSize, setPageSize] = useState(config?.activeVisits?.pageSize ?? 10);
|
|
67
69
|
const [searchString, setSearchString] = useState('');
|
|
68
70
|
|
|
69
|
-
const currentPathName
|
|
70
|
-
const fromPage
|
|
71
|
+
const currentPathName = window.location.pathname;
|
|
72
|
+
const fromPage = getOriginFromPathName(currentPathName);
|
|
71
73
|
|
|
72
74
|
const headerData = useMemo(
|
|
73
75
|
() => [
|
|
@@ -147,7 +149,7 @@ const ActiveVisitsTable = () => {
|
|
|
147
149
|
return (
|
|
148
150
|
<div className={styles.activeVisitsContainer}>
|
|
149
151
|
<div className={styles.activeVisitsDetailHeaderContainer}>
|
|
150
|
-
<div className={!
|
|
152
|
+
<div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
|
|
151
153
|
<h4>{t('activeVisits', 'Active Visits')}</h4>
|
|
152
154
|
</div>
|
|
153
155
|
<div className={styles.backgroundDataFetchingIndicator}>
|
|
@@ -157,8 +159,8 @@ const ActiveVisitsTable = () => {
|
|
|
157
159
|
<DataTable
|
|
158
160
|
rows={paginatedActiveVisits}
|
|
159
161
|
headers={headerData}
|
|
160
|
-
size={
|
|
161
|
-
useZebraStyles>
|
|
162
|
+
size={isDesktop(layout) ? 'xs' : 'md'}
|
|
163
|
+
useZebraStyles={activeVisits?.length > 1 ? true : false}>
|
|
162
164
|
{({ rows, headers, getHeaderProps, getTableProps, getBatchActionProps, getRowProps }) => (
|
|
163
165
|
<TableContainer className={styles.tableContainer}>
|
|
164
166
|
<TableToolbar>
|
|
@@ -212,7 +214,7 @@ const ActiveVisitsTable = () => {
|
|
|
212
214
|
</th>
|
|
213
215
|
</TableRow>
|
|
214
216
|
) : (
|
|
215
|
-
<
|
|
217
|
+
<TableExpandedRow className={styles.hiddenRow} colSpan={headers.length + 2} />
|
|
216
218
|
)}
|
|
217
219
|
</React.Fragment>
|
|
218
220
|
))}
|
|
@@ -220,9 +222,12 @@ const ActiveVisitsTable = () => {
|
|
|
220
222
|
</Table>
|
|
221
223
|
{rows.length === 0 && (
|
|
222
224
|
<p
|
|
223
|
-
style={{
|
|
225
|
+
style={{
|
|
226
|
+
height: isDesktop(layout) ? '2rem' : '3rem',
|
|
227
|
+
margin: '1rem 1.5rem',
|
|
228
|
+
}}
|
|
224
229
|
className={`${styles.emptyRow} ${styles.bodyLong01}`}>
|
|
225
|
-
{t('noVisitsFound', 'No visits found')}
|
|
230
|
+
{t('noVisitsFound', 'No matching visits found')}
|
|
226
231
|
</p>
|
|
227
232
|
)}
|
|
228
233
|
<Pagination
|
|
@@ -250,15 +255,17 @@ const ActiveVisitsTable = () => {
|
|
|
250
255
|
}
|
|
251
256
|
return (
|
|
252
257
|
<div className={styles.activeVisitsContainer}>
|
|
253
|
-
<
|
|
254
|
-
<
|
|
255
|
-
<
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
{
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
<Layer>
|
|
259
|
+
<Tile className={styles.tile}>
|
|
260
|
+
<div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
|
|
261
|
+
<h4>{t('activeVisits', 'Active Visits')}</h4>
|
|
262
|
+
</div>
|
|
263
|
+
<EmptyDataIllustration />
|
|
264
|
+
<p className={styles.content}>
|
|
265
|
+
{t('noActiveVisitsForLocation', 'There are no active visits to display for this location.')}
|
|
266
|
+
</p>
|
|
267
|
+
</Tile>
|
|
268
|
+
</Layer>
|
|
262
269
|
</div>
|
|
263
270
|
);
|
|
264
271
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import isToday from 'dayjs/plugin/isToday';
|
|
4
|
-
import
|
|
4
|
+
import last from 'lodash-es/last';
|
|
5
5
|
import { openmrsFetch, Visit, useSession } from '@openmrs/esm-framework';
|
|
6
6
|
|
|
7
7
|
dayjs.extend(isToday);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
1
3
|
@import '../root.scss';
|
|
2
4
|
|
|
3
5
|
.activeVisitsContainer {
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
display: flex;
|
|
13
15
|
justify-content: space-between;
|
|
14
16
|
align-items: center;
|
|
15
|
-
padding:
|
|
17
|
+
padding: spacing.$spacing-04 0 spacing.$spacing-04 spacing.$spacing-05;
|
|
16
18
|
background-color: $ui-background;
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -35,6 +37,10 @@
|
|
|
35
37
|
overflow: hidden;
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
.hiddenRow {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
.emptyRow {
|
|
39
45
|
padding: 0 1rem;
|
|
40
46
|
display: flex;
|
|
@@ -60,43 +66,34 @@
|
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
.action {
|
|
63
|
-
margin-bottom:
|
|
69
|
+
margin-bottom: spacing.$spacing-03;
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
.content {
|
|
67
|
-
@include
|
|
73
|
+
@include type.type-style('heading-compact-01');
|
|
68
74
|
color: $text-02;
|
|
69
|
-
margin-top:
|
|
70
|
-
margin-bottom:
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.desktopHeading {
|
|
74
|
-
h4 {
|
|
75
|
-
@include carbon--type-style('productive-heading-02');
|
|
76
|
-
color: $text-02;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.tabletHeading {
|
|
81
|
-
h4 {
|
|
82
|
-
@include carbon--type-style('productive-heading-03');
|
|
83
|
-
color: $text-02;
|
|
84
|
-
}
|
|
75
|
+
margin-top: spacing.$spacing-05;
|
|
76
|
+
margin-bottom: spacing.$spacing-03;
|
|
85
77
|
}
|
|
86
78
|
|
|
87
79
|
.desktopHeading,
|
|
88
80
|
.tabletHeading {
|
|
89
81
|
text-align: left;
|
|
90
82
|
text-transform: capitalize;
|
|
91
|
-
margin-bottom:
|
|
92
|
-
|
|
93
|
-
h4
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
83
|
+
margin-bottom: spacing.$spacing-05;
|
|
84
|
+
|
|
85
|
+
h4 {
|
|
86
|
+
@include type.type-style('heading-compact-02');
|
|
87
|
+
color: $text-02;
|
|
88
|
+
|
|
89
|
+
&:after {
|
|
90
|
+
content: '';
|
|
91
|
+
display: block;
|
|
92
|
+
width: 2rem;
|
|
93
|
+
padding-top: 3px;
|
|
94
|
+
border-bottom: 0.375rem solid;
|
|
95
|
+
@include brand-03(border-bottom-color);
|
|
96
|
+
}
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
99
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
export const EmptyDataIllustration = ({ width = '
|
|
3
|
+
export const EmptyDataIllustration = ({ width = '64', height = '64' }) => {
|
|
4
4
|
return (
|
|
5
|
-
<svg width={width} height={height} viewBox="0 0
|
|
5
|
+
<svg width={width} height={height} viewBox="0 0 64 64">
|
|
6
6
|
<title>Empty data illustration</title>
|
|
7
7
|
<g fill="none" fillRule="evenodd">
|
|
8
8
|
<path
|
package/src/root.scss
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '@carbon/styles/scss/type';
|
|
2
2
|
@import '~@openmrs/esm-styleguide/src/vars';
|
|
3
3
|
|
|
4
4
|
.productiveHeading01 {
|
|
5
|
-
@include
|
|
5
|
+
@include type.type-style('heading-compact-01');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.productiveHeading02 {
|
|
9
|
-
@include
|
|
9
|
+
@include type.type-style('heading-compact-02');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.bodyLong01 {
|
|
13
|
-
@include
|
|
13
|
+
@include type.type-style('body-01');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.caption01 {
|
|
17
|
-
@include
|
|
17
|
+
@include type.type-style('legal-01');
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.bodyShort02 {
|
|
21
|
-
@include
|
|
21
|
+
@include type.type-style('body-compact-02');
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.text02 {
|
|
25
|
-
color:
|
|
25
|
+
color: $text-02;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.text01 {
|
|
29
|
-
color:
|
|
29
|
+
color: $ui-05;
|
|
30
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
1
3
|
@import '~@openmrs/esm-styleguide/src/vars';
|
|
2
|
-
@import '~carbon-components/src/globals/scss/vars';
|
|
3
|
-
@import '~carbon-components/src/globals/scss/mixins';
|
|
4
4
|
@import '../root.scss';
|
|
5
5
|
|
|
6
6
|
.container {
|
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
.encounterHeading {
|
|
14
14
|
text-align: left;
|
|
15
15
|
width: 100%;
|
|
16
|
-
margin: 0 1rem 1.3125rem
|
|
17
|
-
color:
|
|
16
|
+
margin: 0 1rem 1.3125rem;
|
|
17
|
+
color: $ui-05;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.visitsDetailWidgetContainer {
|
|
21
21
|
background-color: $ui-background;
|
|
22
22
|
width: 100%;
|
|
23
|
-
border: 1px solid
|
|
23
|
+
border: 1px solid $ui-03;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.visitsDetailHeaderContainer {
|
|
27
27
|
display: flex;
|
|
28
28
|
justify-content: space-between;
|
|
29
29
|
align-items: center;
|
|
30
|
-
padding:
|
|
30
|
+
padding: spacing.$spacing-04 0 spacing.$spacing-04 spacing.$spacing-05;
|
|
31
31
|
background-color: $ui-background;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -39,51 +39,16 @@
|
|
|
39
39
|
border-bottom: 0.375rem solid $brand-teal-01;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
height: 2.5rem;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.toggle {
|
|
48
|
-
border: 1px solid #a6c8ff;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.toggle:hover {
|
|
52
|
-
background-color: #edf5ff;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.toggle:active,
|
|
56
|
-
.toggle:focus {
|
|
57
|
-
box-shadow: none;
|
|
58
|
-
background-color: #edf5ff;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.toggleActive {
|
|
62
|
-
background-color: #edf5ff;
|
|
63
|
-
border: 1px solid $link-01;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.toggleActive:active,
|
|
67
|
-
.toggleActive:focus {
|
|
68
|
-
box-shadow: none;
|
|
69
|
-
border: 1px solid $link-01;
|
|
70
|
-
background-color: #edf5ff;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.toggle:first-of-type {
|
|
74
|
-
border-radius: $spacing-02 0 0 $spacing-02;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.toggle:last-of-type {
|
|
78
|
-
border-radius: 0 $spacing-02 $spacing-02 0;
|
|
42
|
+
.contentSwitcher :global(.cds--content-switcher-btn) {
|
|
43
|
+
width: 10rem;
|
|
79
44
|
}
|
|
80
45
|
|
|
81
46
|
.customTable tr[data-parent-row]:nth-child(odd) td {
|
|
82
|
-
background-color:
|
|
47
|
+
background-color: $ui-02;
|
|
83
48
|
}
|
|
84
49
|
|
|
85
50
|
.customTable tbody tr[data-parent-row]:nth-child(even) td {
|
|
86
|
-
background-color:
|
|
51
|
+
background-color: $ui-01;
|
|
87
52
|
}
|
|
88
53
|
|
|
89
54
|
.encounterEmptyState {
|
|
@@ -111,9 +76,15 @@
|
|
|
111
76
|
}
|
|
112
77
|
|
|
113
78
|
.summaryContainer {
|
|
114
|
-
|
|
79
|
+
background-color: $ui-background;
|
|
115
80
|
display: grid;
|
|
116
81
|
grid-template-columns: max-content auto;
|
|
82
|
+
padding: 1rem 0rem;
|
|
83
|
+
margin: 0 1rem;
|
|
84
|
+
|
|
85
|
+
:global(.cds--tabs) {
|
|
86
|
+
max-height: fit-content;
|
|
87
|
+
}
|
|
117
88
|
}
|
|
118
89
|
|
|
119
90
|
.flexSections {
|
|
@@ -122,42 +93,59 @@
|
|
|
122
93
|
|
|
123
94
|
.verticalTabs {
|
|
124
95
|
margin: 1rem 0;
|
|
125
|
-
|
|
96
|
+
scroll-behavior: smooth;
|
|
97
|
+
|
|
98
|
+
> ul {
|
|
99
|
+
flex-direction: column !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:global(.cds--tabs--scrollable .cds--tabs--scrollable__nav-item + .cds--tabs--scrollable__nav-item) {
|
|
103
|
+
margin-left: 0rem;
|
|
104
|
+
}
|
|
126
105
|
|
|
127
|
-
.
|
|
128
|
-
|
|
106
|
+
:global(.cds--tabs--scrollable .cds--tabs--scrollable__nav-link) {
|
|
107
|
+
border-bottom: 0 !important;
|
|
108
|
+
border-left: 2px solid $color-gray-30;
|
|
109
|
+
}
|
|
129
110
|
}
|
|
130
111
|
|
|
131
112
|
.tab {
|
|
132
|
-
|
|
133
|
-
|
|
113
|
+
outline: 0;
|
|
114
|
+
outline-offset: 0;
|
|
134
115
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
116
|
+
&:active,
|
|
117
|
+
&:focus {
|
|
118
|
+
outline: 2px solid var(--brand-03) !important;
|
|
119
|
+
}
|
|
139
120
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
121
|
+
&[aria-selected='true'] {
|
|
122
|
+
border-left: 3px solid var(--brand-03);
|
|
123
|
+
border-bottom: none;
|
|
124
|
+
font-weight: 600;
|
|
125
|
+
margin-left: 0rem !important;
|
|
126
|
+
}
|
|
146
127
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
128
|
+
&[aria-selected='false'] {
|
|
129
|
+
border-bottom: none;
|
|
130
|
+
border-left: 2px solid $ui-03;
|
|
131
|
+
margin-left: 0rem !important;
|
|
132
|
+
}
|
|
151
133
|
}
|
|
152
134
|
|
|
153
|
-
.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
135
|
+
.tablist {
|
|
136
|
+
:global(.cds--tab--list) {
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
max-height: fit-content;
|
|
139
|
+
overflow-x: visible;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
> button :global(.cds--tabs .cds--tabs__nav-link) {
|
|
143
|
+
border-bottom: none;
|
|
144
|
+
}
|
|
157
145
|
}
|
|
158
146
|
|
|
159
147
|
.medicationBlock {
|
|
160
|
-
background-color:
|
|
148
|
+
background-color: $ui-01;
|
|
161
149
|
padding: 0.625rem 6.75rem 0.75rem 1.063rem;
|
|
162
150
|
margin-top: 1.5rem;
|
|
163
151
|
width: 100% !important;
|
|
@@ -167,33 +155,21 @@
|
|
|
167
155
|
margin-top: 0;
|
|
168
156
|
}
|
|
169
157
|
|
|
158
|
+
.diagnosisLabel {
|
|
159
|
+
@include type.type-style('heading-compact-01');
|
|
160
|
+
color: $text-02;
|
|
161
|
+
margin-top: 5px;
|
|
162
|
+
}
|
|
163
|
+
|
|
170
164
|
.diagnosesList {
|
|
171
165
|
display: flex;
|
|
166
|
+
flex-flow: row wrap;
|
|
172
167
|
padding-bottom: 0.5rem;
|
|
173
168
|
margin: 0 1rem;
|
|
174
|
-
border-bottom: 1px solid
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.diagnosis {
|
|
178
|
-
border-radius: 12px;
|
|
179
|
-
height: 1.5rem;
|
|
180
|
-
display: flex;
|
|
181
|
-
align-items: center;
|
|
182
|
-
padding: 0 0.5rem;
|
|
183
|
-
margin: 0 0.5rem 0.5rem 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.primaryDiagnose {
|
|
187
|
-
background-color: #d0e2ff;
|
|
188
|
-
color: #0043ce;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.secondaryDiagnose {
|
|
192
|
-
background-color: #ffd7d9;
|
|
193
|
-
color: #a2191f;
|
|
169
|
+
border-bottom: 1px solid $ui-03;
|
|
194
170
|
}
|
|
195
171
|
|
|
196
172
|
.testSummaryExtension p {
|
|
197
|
-
@include
|
|
173
|
+
@include type.type-style('body-01');
|
|
198
174
|
color: #525252;
|
|
199
175
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { Button, DataTableSkeleton } from 'carbon-components-react';
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
3
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { ContentSwitcher, DataTableSkeleton, Switch } from '@carbon/react';
|
|
4
4
|
import { Encounter, useVisit } from './visit.resource';
|
|
5
|
-
import
|
|
5
|
+
import { formatTime, formatDatetime, parseDate } from '@openmrs/esm-framework';
|
|
6
6
|
import EncounterList from './visits-components/encounter-list.component';
|
|
7
7
|
import VisitSummary from './visits-components/visit-summary.component';
|
|
8
|
-
import
|
|
8
|
+
import styles from './visit-detail-overview.scss';
|
|
9
9
|
|
|
10
10
|
interface VisitDetailComponentProps {
|
|
11
11
|
visitUuid: string;
|
|
@@ -14,8 +14,8 @@ interface VisitDetailComponentProps {
|
|
|
14
14
|
|
|
15
15
|
const VisitDetailComponent: React.FC<VisitDetailComponentProps> = ({ visitUuid, patientUuid }) => {
|
|
16
16
|
const { t } = useTranslation();
|
|
17
|
-
const [
|
|
18
|
-
const { visit,
|
|
17
|
+
const [contentSwitcherIndex, setContentSwitcherIndex] = useState(0);
|
|
18
|
+
const { visit, isLoading } = useVisit(visitUuid);
|
|
19
19
|
|
|
20
20
|
const encounters = useMemo(
|
|
21
21
|
() =>
|
|
@@ -43,25 +43,20 @@ const VisitDetailComponent: React.FC<VisitDetailComponentProps> = ({ visitUuid,
|
|
|
43
43
|
<br />
|
|
44
44
|
<p className={`${styles.bodyLong01} ${styles.text02}`}>{formatDatetime(parseDate(visit?.startDatetime))}</p>
|
|
45
45
|
</h4>
|
|
46
|
-
<div
|
|
47
|
-
<
|
|
48
|
-
className={
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{t('
|
|
53
|
-
</
|
|
54
|
-
<Button
|
|
55
|
-
className={`${styles.toggle} ${!listView ? styles.toggleActive : ''}`}
|
|
56
|
-
size="small"
|
|
57
|
-
kind="ghost"
|
|
58
|
-
onClick={() => setView(false)}>
|
|
59
|
-
{t('visitSummary', 'Visit Summary')}
|
|
60
|
-
</Button>
|
|
46
|
+
<div style={{ margin: '0 1rem' }}>
|
|
47
|
+
<ContentSwitcher
|
|
48
|
+
className={styles.contentSwitcher}
|
|
49
|
+
selectedIndex={contentSwitcherIndex}
|
|
50
|
+
onChange={({ index }) => setContentSwitcherIndex(index)}>
|
|
51
|
+
<Switch name="allEncounters" text={t('allEncounters', 'All Encounters')} />
|
|
52
|
+
<Switch name="visitSummary" text={t('visitSummary', 'Visit Summary')} />
|
|
53
|
+
</ContentSwitcher>
|
|
61
54
|
</div>
|
|
62
55
|
</div>
|
|
63
|
-
{
|
|
64
|
-
|
|
56
|
+
{contentSwitcherIndex === 0 && visit?.encounters && (
|
|
57
|
+
<EncounterList visitUuid={visit.uuid} encounters={encounters} />
|
|
58
|
+
)}
|
|
59
|
+
{contentSwitcherIndex === 1 && <VisitSummary encounters={visit.encounters} patientUuid={patientUuid} />}
|
|
65
60
|
</div>
|
|
66
61
|
);
|
|
67
62
|
} else {
|