@ampath/esm-reports-app 1.0.0-next.81 → 1.0.0-next.82
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/README.md +2 -0
- package/dist/410.js +1 -1
- package/dist/{549.css → 544.css} +1 -1
- package/dist/544.css.map +1 -0
- package/dist/544.js +1 -0
- package/dist/544.js.map +1 -0
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/routes.json +1 -1
- package/local-config.json +5 -0
- package/package.json +3 -2
- package/src/common/report-register/report-parents.ts +2 -0
- package/src/dashboard/report-catalog.ts +16 -0
- package/src/reports/moh-643/moh-643.component.tsx +222 -0
- package/src/reports/moh-643/moh-643.rows.ts +77 -0
- package/src/reports/moh-643/moh-643.scss +164 -0
- package/src/reports/moh-643/registers/moh-643-register.component.tsx +112 -0
- package/src/reports/moh-643/registers/moh-643.columns.ts +32 -0
- package/src/reports/moh-645/moh-645.component.tsx +331 -0
- package/src/reports/moh-645/moh-645.scss +147 -0
- package/src/reports/moh-645/registers/moh-645-register.component.tsx +125 -0
- package/src/reports/moh-645/registers/moh-645.columns.ts +40 -0
- package/src/resources/moh-643.resource.ts +61 -0
- package/src/resources/moh-645.resource.ts +61 -0
- package/src/root.component.tsx +8 -0
- package/dist/549.css.map +0 -1
- package/dist/549.js +0 -1
- package/dist/549.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var _ampath_esm_reports_app;!function(){var e="undefined"!=typeof globalThis?globalThis:self;if(void 0===e._FEDERATION_RUNTIME_CORE||void 0===e._OPENMRS_FEDERATION_SDK||void 0===e._OPENMRS_FEDERATION_ERROR_CODES)throw new Error("@ampath/esm-reports-app cannot start: the OpenMRS app shell serving this page does not provide the Module Federation runtime. This app was built with newer OpenMRS tooling than the app shell, so either upgrade @openmrs/esm-app-shell, or rebuild this app with tooling matching the app shell.");var r=e._FEDERATION_RUNTIME_CORE_FROM;r&&r.version&&"2.8"!==String(r.version).split(".").slice(0,2).join(".")&&console.warn("@ampath/esm-reports-app was built against Module Federation 2.8.x but the app shell provides "+r.version+". Shared dependencies may not de-duplicate correctly.")}(),(()=>{"use strict";var e,r,t,n,a,o,i={2464(e,r,t){var n={};function a(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}t.r(n),t.d(n,{Module:()=>p.Module,ModuleFederation:()=>p.ModuleFederation,createInstance:()=>h,getInstance:()=>M,getRemoteEntry:()=>p.getRemoteEntry,getRemoteInfo:()=>p.getRemoteInfo,init:()=>m,loadRemote:()=>g,loadScript:()=>p.loadScript,loadScriptNode:()=>p.loadScriptNode,loadShare:()=>y,loadShareSync:()=>S,preloadRemote:()=>b,registerGlobalPlugins:()=>p.registerGlobalPlugins,registerPlugins:()=>E,registerRemotes:()=>v,registerShared:()=>R});const o=["script"];function i(e){const{webpackRequire:r,moduleToHandlerMapping:t}=e,{consumesLoadingData:n,initializeSharingData:a}=r,{sharedFallback:o,bundlerRuntime:i,libraryType:s}=r.federation;if(n&&!n._updated){const{moduleIdToConsumeDataMapping:a={},initialConsumes:c=[],chunkMapping:l={}}=n;if(Object.entries(a).forEach(([e,n])=>{t[e]||(t[e]={getter:o?i?.getSharedFallbackGetter({shareKey:n.shareKey,factory:n.fallback,webpackRequire:r,libraryType:s}):n.fallback,treeShakingGetter:o?n.fallback:void 0,shareInfo:{shareConfig:{requiredVersion:n.requiredVersion,strictVersion:n.strictVersion,singleton:n.singleton,eager:n.eager,layer:n.layer},scope:Array.isArray(n.shareScope)?n.shareScope:[n.shareScope||"default"],treeShaking:o?{get:n.fallback,mode:n.treeShakingMode}:void 0},shareKey:n.shareKey})}),"initialConsumes"in e){const{initialConsumes:r=[]}=e;c.forEach(e=>{r.includes(e)||r.push(e)})}if("chunkMapping"in e){const{chunkMapping:r={}}=e;Object.entries(l).forEach(([e,t])=>{r[e]||(r[e]=[]),t.forEach(t=>{r[e].includes(t)||r[e].push(t)})})}n._updated=1}if(a&&!a._updated){const{federation:e}=r;if(!e.instance||!a.scopeToSharingDataMapping)return;const t={};for(let[e,r]of Object.entries(a.scopeToSharingDataMapping))for(let n of r)if("object"==typeof n&&null!==n){const{name:r,version:a,factory:o,eager:i,singleton:s,requiredVersion:c,strictVersion:l}=n,p={requiredVersion:`^${a}`},u=function(e){return void 0!==e};u(s)&&(p.singleton=s),u(c)&&(p.requiredVersion=c),u(i)&&(p.eager=i),u(l)&&(p.strictVersion=l);const d={version:a,scope:[e],shareConfig:p,get:o};t[r]?t[r].push(d):t[r]=[d]}e.instance.registerShared(t),a._updated=1}}const s=self._OPENMRS_FEDERATION_SDK;function c(e,r){const t=e.federation.usedExports;if(t)return t[r]}const l="RUNTIME-012",p=self._FEDERATION_RUNTIME_CORE;function u(e,r){return p.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(t=>!("@ampath/esm-reports-app:1.0.0-next.81"!==t.options.id&&(t.options.name!==e||t.options.version||r)&&(t.options.name!==e||!r||t.options.version!==r)))}const d=self._OPENMRS_FEDERATION_ERROR_CODES;function h(e){const r=new((0,p.getGlobalFederationConstructor)()||p.ModuleFederation)({id:`${e.name}@${e.version||Date.now()}`,...e});return(0,p.setGlobalFederationInstance)(r),r}let f=null;function m(e){const r=u(e.name,e.version),t={...e,id:e.id||""};return r?(r.initOptions(t),f||(f=r),r):(f=h(t),f)}function g(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.loadRemote.apply(f,e)}function y(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.loadShare.apply(f,e)}function S(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.loadShareSync.apply(f,e)}function b(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.preloadRemote.apply(f,e)}function v(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.registerRemotes.apply(f,e)}function E(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.registerPlugins.apply(f,e)}function M(e){return e?p.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(e)||null:f}function R(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.registerShared.apply(f,e)}(0,p.setGlobalFederationConstructor)(p.ModuleFederation);const k={global:{...p.helpers.global,getGlobalFederationInstance:u},share:p.helpers.share,utils:p.helpers.utils},_={remotes:function(e){!function(e){const{webpackRequire:r,idToExternalAndNameMapping:t={},idToRemoteMap:n={},chunkMapping:a={}}=e,{remotesLoadingData:o}=r,i=r.federation?.bundlerRuntimeOptions?.remotes?.remoteInfos;if(!o||o._updated||!i)return;const{chunkMapping:s,moduleIdToRemoteDataMapping:c}=o;if(s&&c){for(let[e,r]of Object.entries(c))if(t[e]||(t[e]=[r.shareScope,r.name,r.externalModuleId]),!n[e]&&i[r.remoteName]){const t=i[r.remoteName];n[e]||=[],t.forEach(r=>{n[e].includes(r)||n[e].push(r)})}a&&Object.entries(s).forEach(([e,r])=>{a[e]||(a[e]=[]),r.forEach(r=>{a[e].includes(r)||a[e].push(r)})}),o._updated=1}}(e);const{chunkId:r,promises:t,webpackRequire:n,chunkMapping:i,idToExternalAndNameMapping:c,idToRemoteMap:l}=e;a(n),n.o(i,r)&&i[r].forEach(e=>{let r=n.R;r||(r=[]);const a=c[e],i=l[e]||[];if(r.indexOf(a)>=0)return;if(r.push(a),a.p)return t.push(a.p);const p=r=>{r||(r=new Error("Container missing")),"string"==typeof r.message&&(r.message+=`\nwhile loading "${a[1]}" from ${a[2]}`),n.m[e]=()=>{throw r},a.p=0},u=(e,r,n,o,i,s)=>{try{const c=e(r,n);if(!c||!c.then)return i(c,o,s);{const e=c.then(e=>i(e,o),p);if(!s)return e;t.push(a.p=e)}}catch(e){p(e)}};var d=(e,t,n)=>u(t.get,a[1],r,0,h,n),h=r=>{a.p=1,n.m[e]=e=>{e.exports=r()}};1===i.length&&o.includes(i[0].externalType)&&i[0].name?u(()=>{try{const e=(0,s.decodeName)(i[0].name,s.ENCODE_NAME_PREFIX)+a[1].slice(1),r=n.federation.instance,t=()=>n.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===r.options.shareStrategy){const e=Array.isArray(a[0])?a[0]:[a[0]];return Promise.all(e.map(e=>r.sharedHandler.initializeSharing(e))).then(()=>t())}return t()}catch(e){p(e)}},a[2],0,0,h,1):u(n,a[2],0,0,(e,r,t)=>e?u(n.I,a[0],0,e,d,t):p(),1)})},consumes:function(e){i(e);const{chunkId:r,promises:t,installedModules:n,webpackRequire:o,chunkMapping:s,moduleToHandlerMapping:p}=e;a(o),o.o(s,r)&&s[r].forEach(e=>{if(o.o(n,e))return t.push(n[e]);const r=r=>{n[e]=0,o.m[e]=t=>{delete o.c[e];const n=r(),{shareInfo:a}=p[e];if(a?.shareConfig?.layer&&n&&"object"==typeof n)try{n.hasOwnProperty("layer")&&void 0!==n.layer||(n.layer=a.shareConfig.layer)}catch(e){}t.exports=n}},a=r=>{delete n[e],o.m[e]=t=>{throw delete o.c[e],r}};try{const i=o.federation.instance;if(!i)throw new Error("Federation instance not found!");const{shareKey:s,getter:u,shareInfo:d,treeShakingGetter:h}=p[e],f=c(o,s),m={...d};Array.isArray(m.scope)&&Array.isArray(m.scope[0])&&(m.scope=m.scope[0]),f&&(m.treeShaking={usedExports:f,useIn:[i.options.name]});const g=i.loadShare(s,{customShareInfo:m}).then(e=>{if(!1===e){if("function"!=typeof u)throw new Error(((e,r,t)=>{const n=[`${[r[e]]} #${e}`];return t&&n.push(`args: ${JSON.stringify(t)}`),n.push((e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`)(e)),n.join("\n")})(l,{[l]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'},{shareKey:s}));return h?.()||u()}return e});g.then?t.push(n[e]=g.then(r).catch(a)):r(g)}catch(e){a(e)}})},I:function({shareScopeName:e,webpackRequire:r,initPromises:t,initTokens:n,initScope:i}){const s=Array.isArray(e)?e:[e];var c=[];return s.forEach(s=>{c.push(function(s){i||(i=[]);const c=r.federation.instance;var l=n[s];if(l||(l=n[s]={from:c.name}),i.indexOf(l)>=0)return;i.push(l);const p=t[s];if(p)return p;var u=t=>{var n=e=>{return r="Initialization of sharing external failed: "+e,"undefined"!=typeof console&&console.warn&&console.warn(r);var r};try{var a=r(t);if(!a)return;var o=t=>t&&t.init&&t.init(r.S[s],i,{shareScopeMap:r.S||{},shareScopeKeys:e});if(a.then)return d.push(a.then(o,n));var c=o(a);if(c&&"boolean"!=typeof c&&c.then)return d.push(c.catch(n))}catch(e){n(e)}};const d=c.initializeSharing(s,{strategy:c.options.shareStrategy,initScope:i,from:"build"});a(r);const h=r.federation.bundlerRuntimeOptions.remotes;return h&&Object.keys(h.idToRemoteMap).forEach(e=>{const r=h.idToRemoteMap[e],t=h.idToExternalAndNameMapping[e][2];if(r.length>1)u(t);else if(1===r.length){const e=r[0];o.includes(e.externalType)||u(t)}}),d.length?t[s]=Promise.all(d).then(()=>t[s]=!0):t[s]=!0}(s))}),Promise.all(c).then(()=>!0)},S:{},installInitialConsumes:function(e){i(e);const{moduleToHandlerMapping:r,webpackRequire:t,installedModules:n,initialConsumes:a,asyncLoad:o}=e,s=[];a.forEach(e=>{s.push([e,()=>function(e){const{moduleId:r,moduleToHandlerMapping:t,webpackRequire:n,asyncLoad:a}=e,o=n.federation.instance;if(!o)throw new Error("Federation instance not found!");const{shareKey:i,shareInfo:s}=t[r];try{const e=c(n,i),r={...s};return e&&(r.treeShaking={usedExports:e,useIn:[o.options.name]}),a?o.loadShare(i,{customShareInfo:r}):o.loadShareSync(i,{customShareInfo:r})}catch(e){throw console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.'),console.error("The original error message is as follows: "),e}}({moduleId:e,moduleToHandlerMapping:r,webpackRequire:t,asyncLoad:o})])});const l=(e,a)=>{t.m[e]=o=>{n[e]=0,delete t.c[e];const i=a();if("function"!=typeof i)throw new Error(`Shared module is not available for eager consumption: ${e}`);const s=i(),{shareInfo:c}=r[e];if(c?.shareConfig?.layer&&s&&"object"==typeof s)try{s.hasOwnProperty("layer")&&void 0!==s.layer||(s.layer=c.shareConfig.layer)}catch(e){}o.exports=s}};if(o)return Promise.all(s.map(async([e,r])=>{const t=await r();l(e,()=>t)}));s.forEach(([e,r])=>{l(e,r)})},initContainerEntry:function(e){const{webpackRequire:r,shareScope:t,initScope:n,shareScopeKey:a,remoteEntryInitOptions:o}=e;if(!r.S)return;if(!r.federation||!r.federation.instance||!r.federation.initOptions)return;const i=r.federation.instance;i.initOptions({name:r.federation.initOptions.name,remotes:[],...o});const s=o?.shareScopeKeys,c=o?.shareScopeMap;if(a&&"string"!=typeof a)a.forEach(e=>{if(!s||!c)return void i.initShareScopeMap(e,t,{hostShareScopeMap:o?.shareScopeMap||{}});c[e]||(c[e]={});const r=c[e];i.initShareScopeMap(e,r,{hostShareScopeMap:o?.shareScopeMap||{}})});else{const e=a||"default";Array.isArray(s)?s.forEach(e=>{c[e]||(c[e]={});const r=c[e];i.initShareScopeMap(e,r,{hostShareScopeMap:o?.shareScopeMap||{}})}):i.initShareScopeMap(e,t,{hostShareScopeMap:o?.shareScopeMap||{}})}return r.federation.attachShareScopeMap&&r.federation.attachShareScopeMap(r),Array.isArray(a)?Boolean(r.federation.initOptions.shared)?r.I(a,n):Promise.all(a.map(e=>r.I(e,n))).then(()=>!0):r.I(a||"default",n)},init:function({webpackRequire:e}){const{initOptions:r,runtime:n,sharedFallback:a,bundlerRuntime:o,libraryType:i}=e.federation;if(!r)throw new Error("initOptions is required!");{const n=function(){return{name:"tree-shake-plugin",beforeInit(r){const{userOptions:n,origin:s,options:c}=r,l=n.version||c.version;if(!a)return r;const u=n.shared||{},d=[];Object.keys(u).forEach(r=>{(Array.isArray(u[r])?u[r]:[u[r]]).forEach(t=>{d.push([r,t]),"get"in t&&(t.treeShaking||={},t.treeShaking.get=t.get,t.get=o.getSharedFallbackGetter({shareKey:r,factory:t.get,webpackRequire:e,libraryType:i,version:t.version}))})});const h=k.global.getGlobalSnapshotInfoByModuleInfo({name:s.name,version:l});return h&&"shared"in h?(Object.keys(c.shared||{}).forEach(e=>{c.shared[e].forEach(r=>{d.push([e,r])})}),d.forEach(([e,r])=>{((e,r)=>{const n=h.shared.find(r=>r.sharedName===e);if(!n)return;const{treeShaking:a}=r;if(!a)return;const{secondarySharedTreeShakingName:o,secondarySharedTreeShakingEntry:c,treeShakingStatus:l}=n;a.status!==l&&(a.status=l,c&&i&&o&&(a.get=async()=>{const e=await(0,p.getRemoteEntry)({origin:s,remoteInfo:{name:o,entry:c,type:i,entryGlobalName:o,shareScope:"default"}});return await e.init(s,t.federation.bundlerRuntime),e.get()}))})(e,r)}),r):r}}};r.plugins||=[],r.plugins.push(n())}return n.init(r)},getSharedFallbackGetter:({shareKey:e,factory:r,version:t,webpackRequire:n,libraryType:a="global"})=>{const{runtime:o,instance:i,bundlerRuntime:s,sharedFallback:c}=n.federation;if(!c)return r;const l=c[e];if(!l)return r;const p=t?l.find(e=>e[1]===t):l[0];if(!p)throw new Error(`No fallback item found for shareKey: ${e} and version: ${t}`);return()=>o.getRemoteEntry({origin:n.federation.instance,remoteInfo:{name:p[2],entry:`${n.p}${p[0]}`,type:a,entryGlobalName:p[2],shareScope:"default"}}).then(r=>{if(!r)throw new Error(`Failed to load fallback entry for shareKey: ${e} and version: ${t}`);return r.init(n.federation.instance,s).then(()=>r.get())})}},w={runtime:n,instance:void 0,initOptions:void 0,bundlerRuntime:_,attachShareScopeMap:a,bundlerRuntimeOptions:{}};if(!t.federation.runtime||!t.federation.bundlerRuntime){var I=t.federation;for(var T in t.federation={},w)t.federation[T]=w[T];for(var T in I)t.federation[T]=I[T]}t.federation.instance||(t.federation.instance=t.federation.bundlerRuntime.init({webpackRequire:t}),t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),t.federation.installInitialConsumes&&t.federation.installInitialConsumes())},9421(e,r,t){var n={"./start":()=>Promise.all([t.e(31),t.e(435),t.e(410)]).then(()=>()=>t(5410))},a=(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),o=(e,r,n)=>t.federation.bundlerRuntime.initContainerEntry({webpackRequire:t,shareScope:e,initScope:r,remoteEntryInitOptions:n,shareScopeKey:"default"});t.d(r,{get:()=>a,init:()=>o})}},s={};function c(e){var r=s[e];if(void 0!==r)return r.exports;var t=s[e]={exports:{}},n={id:e,module:t,factory:i[e],require:c};return c.i.forEach(function(e){e(n)}),t=n.module,n.factory.call(t.exports,t,t.exports,n.require),t.exports}c.m=i,c.c=s,c.i=[],c.x=e=>{},c.federation||(c.federation={initOptions:{name:"@ampath/esm-reports-app",remotes:[],shareStrategy:"version-first"},chunkMatcher:function(e){return!/^(31|435|680|987)$/.test(e)},rootOutputDir:"",bundlerRuntimeOptions:{remotes:{remoteInfos:{},webpackRequire:c,idToRemoteMap:{},chunkMapping:{},idToExternalAndNameMapping:{}}}},c.consumesLoadingData={},c.remotesLoadingData={}),c.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return c.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var a=Object.create(null);c.r(a);var o={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;("object"==typeof i||"function"==typeof i)&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(e=>o[e]=()=>t[e]);return o.default=()=>t,c.d(a,o),a},c.d=(e,r)=>{for(var t in r)c.o(r,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((r,t)=>(c.f[t](e,r),r),[])),c.u=e=>e+".js",c.miniCssF=e=>e+".css",c.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@ampath/esm-reports-app:",c.l=(e,r,a,o)=>{if(t[e])t[e].push(r);else{var i,s;if(void 0!==a)for(var l=document.getElementsByTagName("script"),p=0;p<l.length;p++){var u=l[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==n+a){i=u;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",c.nc&&i.setAttribute("nonce",c.nc),i.setAttribute("data-webpack",n+a),i.src=e),t[e]=[r];var d=(r,n)=>{i.onerror=i.onload=null,clearTimeout(h);var a=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(e=>e(n)),r)return r(n)},h=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),s&&document.head.appendChild(i)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{c.S={};var e={},r={};c.I=(t,n)=>{n||(n=[]);var a=r[t];if(a||(a=r[t]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[t])return e[t];c.o(c.S,t)||(c.S[t]={});var o=c.S[t],i="@ampath/esm-reports-app",s=(e,r,t,n)=>{var a=o[e]=o[e]||{},s=a[r];(!s||!s.loaded&&(!n!=!s.eager?n:i>s.from))&&(a[r]={get:t,from:i,eager:!!n})},l=[];return"default"===t&&(s("@openmrs/esm-framework","11.0.1-pre.5776",()=>Promise.all([c.e(961),c.e(600),c.e(478),c.e(295),c.e(31),c.e(680),c.e(435),c.e(987)]).then(()=>()=>c(9295))),s("dayjs","1.11.20",()=>c.e(353).then(()=>()=>c(4353))),s("react-i18next","16.6.6",()=>Promise.all([c.e(478),c.e(311),c.e(31)]).then(()=>()=>c(3311))),s("react-router-dom","6.30.3",()=>Promise.all([c.e(961),c.e(282),c.e(31)]).then(()=>()=>c(282))),s("react","18.3.1",()=>c.e(540).then(()=>()=>c(6540)))),e[t]=l.length?Promise.all(l).then(()=>e[t]=1):1}}})(),(()=>{c.federation.initOptions.shared={"@openmrs/esm-framework":[{version:"11.0.1-pre.5776",get:()=>Promise.all([c.e(961),c.e(600),c.e(478),c.e(295),c.e(31),c.e(680),c.e(435),c.e(987)]).then(()=>()=>c(9295)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"*",strictVersion:!1,singleton:!0,layer:null}}],dayjs:[{version:"1.11.20",get:()=>c.e(353).then(()=>()=>c(4353)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"1.x",strictVersion:!1,singleton:!0,layer:null}}],"react-i18next":[{version:"16.6.6",get:()=>Promise.all([c.e(478),c.e(311),c.e(31)]).then(()=>()=>c(3311)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"16.x",strictVersion:!1,singleton:!0,layer:null}}],"react-router-dom":[{version:"6.30.3",get:()=>Promise.all([c.e(961),c.e(282),c.e(31)]).then(()=>()=>c(282)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"6.x",strictVersion:!1,singleton:!0,layer:null}}],react:[{version:"18.3.1",get:()=>c.e(540).then(()=>()=>c(6540)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"18.x",strictVersion:!1,singleton:!0,layer:null}}]},c.S={};var e={},r={};c.I=(t,n)=>c.federation.bundlerRuntime.I({shareScopeName:t,webpackRequire:c,initPromises:e,initTokens:r,initScope:n})})(),(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var r=globalThis.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e})(),(()=>{var e={};c.consumesLoadingData.moduleIdToConsumeDataMapping={6031:{fallback:()=>c.e(540).then(()=>()=>c(6540)),shareScope:["default"],singleton:!0,requiredVersion:"18.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"react"},6435:{fallback:()=>Promise.all([c.e(961),c.e(282)]).then(()=>()=>c(282)),shareScope:["default"],singleton:!0,requiredVersion:"6.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"react-router-dom"},7693:{fallback:()=>Promise.all([c.e(961),c.e(600),c.e(478),c.e(295),c.e(680),c.e(987)]).then(()=>()=>c(9295)),shareScope:["default"],singleton:!0,requiredVersion:"*",strictVersion:!1,eager:!1,layer:void 0,shareKey:"@openmrs/esm-framework"},7680:{fallback:()=>c.e(353).then(()=>()=>c(4353)),shareScope:["default"],singleton:!0,requiredVersion:"1.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"dayjs"},3987:{fallback:()=>c.e(311).then(()=>()=>c(3311)),shareScope:["default"],singleton:!0,requiredVersion:"16.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"react-i18next"}};var r={};c.consumesLoadingData.chunkMapping={31:[6031],410:[7693],435:[6435],680:[7680],987:[3987]},c.f.consumes=(t,n)=>{c.federation.bundlerRuntime.consumes({chunkMapping:c.consumesLoadingData.chunkMapping,installedModules:e,chunkId:t,moduleToHandlerMapping:r,promises:n,webpackRequire:c})}})(),(()=>{if("undefined"!=typeof document){var e={462:0};c.f.miniCss=(r,t)=>{e[r]?t.push(e[r]):0!==e[r]&&{295:1,549:1}[r]&&t.push(e[r]=(e=>new Promise((r,t)=>{var n=c.miniCssF(e),a=c.p+n;if(((e,r)=>{for(var t=document.getElementsByTagName("link"),n=0;n<t.length;n++){var a=(i=t[n]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(a===e||a===r))return i}var o=document.getElementsByTagName("style");for(n=0;n<o.length;n++){var i;if((a=(i=o[n]).getAttribute("data-href"))===e||a===r)return i}})(n,a))return r();((e,r,t,n,a)=>{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",c.nc&&(o.nonce=c.nc),o.onerror=o.onload=t=>{if(o.onerror=o.onload=null,"load"===t.type)n();else{var i=t&&t.type,s=t&&t.target&&t.target.href||r,c=new Error("Loading CSS chunk "+e+" failed.\n("+i+": "+s+")");c.name="ChunkLoadError",c.code="CSS_CHUNK_LOAD_FAILED",c.type=i,c.request=s,o.parentNode&&o.parentNode.removeChild(o),a(c)}},o.href=r,document.head.appendChild(o)})(e,a,0,r,t)}))(r).then(()=>{e[r]=0},t=>{throw delete e[r],t}))}}})(),a=c.x,o=!1,c.x=()=>{if(o||(o=!0,c(2464)),"function"==typeof a)return a();console.warn("[Module Federation] prevStartup is not a function, skipping startup execution")},(()=>{var e={462:0};c.f.j=(r,t)=>{var n=c.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(31|435|680|987)$/.test(r))e[r]=0;else{var a=new Promise((t,a)=>n=e[r]=[t,a]);t.push(n[2]=a);var o=c.p+c.u(r),i=new Error;c.l(o,t=>{if(c.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,n[1](i)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,a,[o,i,s]=t,l=0;if(o.some(r=>0!==e[r])){for(n in i)c.o(i,n)&&(c.m[n]=i[n]);s&&s(c)}for(r&&r(t);l<o.length;l++)a=o[l],c.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=self.webpackChunk_ampath_esm_reports_app=self.webpackChunk_ampath_esm_reports_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),c.x();var l=c(9421);_ampath_esm_reports_app=l})();
|
|
1
|
+
var _ampath_esm_reports_app;!function(){var e="undefined"!=typeof globalThis?globalThis:self;if(void 0===e._FEDERATION_RUNTIME_CORE||void 0===e._OPENMRS_FEDERATION_SDK||void 0===e._OPENMRS_FEDERATION_ERROR_CODES)throw new Error("@ampath/esm-reports-app cannot start: the OpenMRS app shell serving this page does not provide the Module Federation runtime. This app was built with newer OpenMRS tooling than the app shell, so either upgrade @openmrs/esm-app-shell, or rebuild this app with tooling matching the app shell.");var r=e._FEDERATION_RUNTIME_CORE_FROM;r&&r.version&&"2.8"!==String(r.version).split(".").slice(0,2).join(".")&&console.warn("@ampath/esm-reports-app was built against Module Federation 2.8.x but the app shell provides "+r.version+". Shared dependencies may not de-duplicate correctly.")}(),(()=>{"use strict";var e,r,t,n,a,o,i={2464(e,r,t){var n={};function a(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}t.r(n),t.d(n,{Module:()=>p.Module,ModuleFederation:()=>p.ModuleFederation,createInstance:()=>h,getInstance:()=>M,getRemoteEntry:()=>p.getRemoteEntry,getRemoteInfo:()=>p.getRemoteInfo,init:()=>m,loadRemote:()=>g,loadScript:()=>p.loadScript,loadScriptNode:()=>p.loadScriptNode,loadShare:()=>y,loadShareSync:()=>S,preloadRemote:()=>b,registerGlobalPlugins:()=>p.registerGlobalPlugins,registerPlugins:()=>E,registerRemotes:()=>v,registerShared:()=>R});const o=["script"];function i(e){const{webpackRequire:r,moduleToHandlerMapping:t}=e,{consumesLoadingData:n,initializeSharingData:a}=r,{sharedFallback:o,bundlerRuntime:i,libraryType:s}=r.federation;if(n&&!n._updated){const{moduleIdToConsumeDataMapping:a={},initialConsumes:c=[],chunkMapping:l={}}=n;if(Object.entries(a).forEach(([e,n])=>{t[e]||(t[e]={getter:o?i?.getSharedFallbackGetter({shareKey:n.shareKey,factory:n.fallback,webpackRequire:r,libraryType:s}):n.fallback,treeShakingGetter:o?n.fallback:void 0,shareInfo:{shareConfig:{requiredVersion:n.requiredVersion,strictVersion:n.strictVersion,singleton:n.singleton,eager:n.eager,layer:n.layer},scope:Array.isArray(n.shareScope)?n.shareScope:[n.shareScope||"default"],treeShaking:o?{get:n.fallback,mode:n.treeShakingMode}:void 0},shareKey:n.shareKey})}),"initialConsumes"in e){const{initialConsumes:r=[]}=e;c.forEach(e=>{r.includes(e)||r.push(e)})}if("chunkMapping"in e){const{chunkMapping:r={}}=e;Object.entries(l).forEach(([e,t])=>{r[e]||(r[e]=[]),t.forEach(t=>{r[e].includes(t)||r[e].push(t)})})}n._updated=1}if(a&&!a._updated){const{federation:e}=r;if(!e.instance||!a.scopeToSharingDataMapping)return;const t={};for(let[e,r]of Object.entries(a.scopeToSharingDataMapping))for(let n of r)if("object"==typeof n&&null!==n){const{name:r,version:a,factory:o,eager:i,singleton:s,requiredVersion:c,strictVersion:l}=n,p={requiredVersion:`^${a}`},u=function(e){return void 0!==e};u(s)&&(p.singleton=s),u(c)&&(p.requiredVersion=c),u(i)&&(p.eager=i),u(l)&&(p.strictVersion=l);const d={version:a,scope:[e],shareConfig:p,get:o};t[r]?t[r].push(d):t[r]=[d]}e.instance.registerShared(t),a._updated=1}}const s=self._OPENMRS_FEDERATION_SDK;function c(e,r){const t=e.federation.usedExports;if(t)return t[r]}const l="RUNTIME-012",p=self._FEDERATION_RUNTIME_CORE;function u(e,r){return p.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(t=>!("@ampath/esm-reports-app:1.0.0-next.82"!==t.options.id&&(t.options.name!==e||t.options.version||r)&&(t.options.name!==e||!r||t.options.version!==r)))}const d=self._OPENMRS_FEDERATION_ERROR_CODES;function h(e){const r=new((0,p.getGlobalFederationConstructor)()||p.ModuleFederation)({id:`${e.name}@${e.version||Date.now()}`,...e});return(0,p.setGlobalFederationInstance)(r),r}let f=null;function m(e){const r=u(e.name,e.version),t={...e,id:e.id||""};return r?(r.initOptions(t),f||(f=r),r):(f=h(t),f)}function g(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.loadRemote.apply(f,e)}function y(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.loadShare.apply(f,e)}function S(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.loadShareSync.apply(f,e)}function b(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.preloadRemote.apply(f,e)}function v(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.registerRemotes.apply(f,e)}function E(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.registerPlugins.apply(f,e)}function M(e){return e?p.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(e)||null:f}function R(...e){return(0,p.assert)(f,d.RUNTIME_009,d.runtimeDescMap),f.registerShared.apply(f,e)}(0,p.setGlobalFederationConstructor)(p.ModuleFederation);const k={global:{...p.helpers.global,getGlobalFederationInstance:u},share:p.helpers.share,utils:p.helpers.utils},_={remotes:function(e){!function(e){const{webpackRequire:r,idToExternalAndNameMapping:t={},idToRemoteMap:n={},chunkMapping:a={}}=e,{remotesLoadingData:o}=r,i=r.federation?.bundlerRuntimeOptions?.remotes?.remoteInfos;if(!o||o._updated||!i)return;const{chunkMapping:s,moduleIdToRemoteDataMapping:c}=o;if(s&&c){for(let[e,r]of Object.entries(c))if(t[e]||(t[e]=[r.shareScope,r.name,r.externalModuleId]),!n[e]&&i[r.remoteName]){const t=i[r.remoteName];n[e]||=[],t.forEach(r=>{n[e].includes(r)||n[e].push(r)})}a&&Object.entries(s).forEach(([e,r])=>{a[e]||(a[e]=[]),r.forEach(r=>{a[e].includes(r)||a[e].push(r)})}),o._updated=1}}(e);const{chunkId:r,promises:t,webpackRequire:n,chunkMapping:i,idToExternalAndNameMapping:c,idToRemoteMap:l}=e;a(n),n.o(i,r)&&i[r].forEach(e=>{let r=n.R;r||(r=[]);const a=c[e],i=l[e]||[];if(r.indexOf(a)>=0)return;if(r.push(a),a.p)return t.push(a.p);const p=r=>{r||(r=new Error("Container missing")),"string"==typeof r.message&&(r.message+=`\nwhile loading "${a[1]}" from ${a[2]}`),n.m[e]=()=>{throw r},a.p=0},u=(e,r,n,o,i,s)=>{try{const c=e(r,n);if(!c||!c.then)return i(c,o,s);{const e=c.then(e=>i(e,o),p);if(!s)return e;t.push(a.p=e)}}catch(e){p(e)}};var d=(e,t,n)=>u(t.get,a[1],r,0,h,n),h=r=>{a.p=1,n.m[e]=e=>{e.exports=r()}};1===i.length&&o.includes(i[0].externalType)&&i[0].name?u(()=>{try{const e=(0,s.decodeName)(i[0].name,s.ENCODE_NAME_PREFIX)+a[1].slice(1),r=n.federation.instance,t=()=>n.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===r.options.shareStrategy){const e=Array.isArray(a[0])?a[0]:[a[0]];return Promise.all(e.map(e=>r.sharedHandler.initializeSharing(e))).then(()=>t())}return t()}catch(e){p(e)}},a[2],0,0,h,1):u(n,a[2],0,0,(e,r,t)=>e?u(n.I,a[0],0,e,d,t):p(),1)})},consumes:function(e){i(e);const{chunkId:r,promises:t,installedModules:n,webpackRequire:o,chunkMapping:s,moduleToHandlerMapping:p}=e;a(o),o.o(s,r)&&s[r].forEach(e=>{if(o.o(n,e))return t.push(n[e]);const r=r=>{n[e]=0,o.m[e]=t=>{delete o.c[e];const n=r(),{shareInfo:a}=p[e];if(a?.shareConfig?.layer&&n&&"object"==typeof n)try{n.hasOwnProperty("layer")&&void 0!==n.layer||(n.layer=a.shareConfig.layer)}catch(e){}t.exports=n}},a=r=>{delete n[e],o.m[e]=t=>{throw delete o.c[e],r}};try{const i=o.federation.instance;if(!i)throw new Error("Federation instance not found!");const{shareKey:s,getter:u,shareInfo:d,treeShakingGetter:h}=p[e],f=c(o,s),m={...d};Array.isArray(m.scope)&&Array.isArray(m.scope[0])&&(m.scope=m.scope[0]),f&&(m.treeShaking={usedExports:f,useIn:[i.options.name]});const g=i.loadShare(s,{customShareInfo:m}).then(e=>{if(!1===e){if("function"!=typeof u)throw new Error(((e,r,t)=>{const n=[`${[r[e]]} #${e}`];return t&&n.push(`args: ${JSON.stringify(t)}`),n.push((e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`)(e)),n.join("\n")})(l,{[l]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'},{shareKey:s}));return h?.()||u()}return e});g.then?t.push(n[e]=g.then(r).catch(a)):r(g)}catch(e){a(e)}})},I:function({shareScopeName:e,webpackRequire:r,initPromises:t,initTokens:n,initScope:i}){const s=Array.isArray(e)?e:[e];var c=[];return s.forEach(s=>{c.push(function(s){i||(i=[]);const c=r.federation.instance;var l=n[s];if(l||(l=n[s]={from:c.name}),i.indexOf(l)>=0)return;i.push(l);const p=t[s];if(p)return p;var u=t=>{var n=e=>{return r="Initialization of sharing external failed: "+e,"undefined"!=typeof console&&console.warn&&console.warn(r);var r};try{var a=r(t);if(!a)return;var o=t=>t&&t.init&&t.init(r.S[s],i,{shareScopeMap:r.S||{},shareScopeKeys:e});if(a.then)return d.push(a.then(o,n));var c=o(a);if(c&&"boolean"!=typeof c&&c.then)return d.push(c.catch(n))}catch(e){n(e)}};const d=c.initializeSharing(s,{strategy:c.options.shareStrategy,initScope:i,from:"build"});a(r);const h=r.federation.bundlerRuntimeOptions.remotes;return h&&Object.keys(h.idToRemoteMap).forEach(e=>{const r=h.idToRemoteMap[e],t=h.idToExternalAndNameMapping[e][2];if(r.length>1)u(t);else if(1===r.length){const e=r[0];o.includes(e.externalType)||u(t)}}),d.length?t[s]=Promise.all(d).then(()=>t[s]=!0):t[s]=!0}(s))}),Promise.all(c).then(()=>!0)},S:{},installInitialConsumes:function(e){i(e);const{moduleToHandlerMapping:r,webpackRequire:t,installedModules:n,initialConsumes:a,asyncLoad:o}=e,s=[];a.forEach(e=>{s.push([e,()=>function(e){const{moduleId:r,moduleToHandlerMapping:t,webpackRequire:n,asyncLoad:a}=e,o=n.federation.instance;if(!o)throw new Error("Federation instance not found!");const{shareKey:i,shareInfo:s}=t[r];try{const e=c(n,i),r={...s};return e&&(r.treeShaking={usedExports:e,useIn:[o.options.name]}),a?o.loadShare(i,{customShareInfo:r}):o.loadShareSync(i,{customShareInfo:r})}catch(e){throw console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.'),console.error("The original error message is as follows: "),e}}({moduleId:e,moduleToHandlerMapping:r,webpackRequire:t,asyncLoad:o})])});const l=(e,a)=>{t.m[e]=o=>{n[e]=0,delete t.c[e];const i=a();if("function"!=typeof i)throw new Error(`Shared module is not available for eager consumption: ${e}`);const s=i(),{shareInfo:c}=r[e];if(c?.shareConfig?.layer&&s&&"object"==typeof s)try{s.hasOwnProperty("layer")&&void 0!==s.layer||(s.layer=c.shareConfig.layer)}catch(e){}o.exports=s}};if(o)return Promise.all(s.map(async([e,r])=>{const t=await r();l(e,()=>t)}));s.forEach(([e,r])=>{l(e,r)})},initContainerEntry:function(e){const{webpackRequire:r,shareScope:t,initScope:n,shareScopeKey:a,remoteEntryInitOptions:o}=e;if(!r.S)return;if(!r.federation||!r.federation.instance||!r.federation.initOptions)return;const i=r.federation.instance;i.initOptions({name:r.federation.initOptions.name,remotes:[],...o});const s=o?.shareScopeKeys,c=o?.shareScopeMap;if(a&&"string"!=typeof a)a.forEach(e=>{if(!s||!c)return void i.initShareScopeMap(e,t,{hostShareScopeMap:o?.shareScopeMap||{}});c[e]||(c[e]={});const r=c[e];i.initShareScopeMap(e,r,{hostShareScopeMap:o?.shareScopeMap||{}})});else{const e=a||"default";Array.isArray(s)?s.forEach(e=>{c[e]||(c[e]={});const r=c[e];i.initShareScopeMap(e,r,{hostShareScopeMap:o?.shareScopeMap||{}})}):i.initShareScopeMap(e,t,{hostShareScopeMap:o?.shareScopeMap||{}})}return r.federation.attachShareScopeMap&&r.federation.attachShareScopeMap(r),Array.isArray(a)?Boolean(r.federation.initOptions.shared)?r.I(a,n):Promise.all(a.map(e=>r.I(e,n))).then(()=>!0):r.I(a||"default",n)},init:function({webpackRequire:e}){const{initOptions:r,runtime:n,sharedFallback:a,bundlerRuntime:o,libraryType:i}=e.federation;if(!r)throw new Error("initOptions is required!");{const n=function(){return{name:"tree-shake-plugin",beforeInit(r){const{userOptions:n,origin:s,options:c}=r,l=n.version||c.version;if(!a)return r;const u=n.shared||{},d=[];Object.keys(u).forEach(r=>{(Array.isArray(u[r])?u[r]:[u[r]]).forEach(t=>{d.push([r,t]),"get"in t&&(t.treeShaking||={},t.treeShaking.get=t.get,t.get=o.getSharedFallbackGetter({shareKey:r,factory:t.get,webpackRequire:e,libraryType:i,version:t.version}))})});const h=k.global.getGlobalSnapshotInfoByModuleInfo({name:s.name,version:l});return h&&"shared"in h?(Object.keys(c.shared||{}).forEach(e=>{c.shared[e].forEach(r=>{d.push([e,r])})}),d.forEach(([e,r])=>{((e,r)=>{const n=h.shared.find(r=>r.sharedName===e);if(!n)return;const{treeShaking:a}=r;if(!a)return;const{secondarySharedTreeShakingName:o,secondarySharedTreeShakingEntry:c,treeShakingStatus:l}=n;a.status!==l&&(a.status=l,c&&i&&o&&(a.get=async()=>{const e=await(0,p.getRemoteEntry)({origin:s,remoteInfo:{name:o,entry:c,type:i,entryGlobalName:o,shareScope:"default"}});return await e.init(s,t.federation.bundlerRuntime),e.get()}))})(e,r)}),r):r}}};r.plugins||=[],r.plugins.push(n())}return n.init(r)},getSharedFallbackGetter:({shareKey:e,factory:r,version:t,webpackRequire:n,libraryType:a="global"})=>{const{runtime:o,instance:i,bundlerRuntime:s,sharedFallback:c}=n.federation;if(!c)return r;const l=c[e];if(!l)return r;const p=t?l.find(e=>e[1]===t):l[0];if(!p)throw new Error(`No fallback item found for shareKey: ${e} and version: ${t}`);return()=>o.getRemoteEntry({origin:n.federation.instance,remoteInfo:{name:p[2],entry:`${n.p}${p[0]}`,type:a,entryGlobalName:p[2],shareScope:"default"}}).then(r=>{if(!r)throw new Error(`Failed to load fallback entry for shareKey: ${e} and version: ${t}`);return r.init(n.federation.instance,s).then(()=>r.get())})}},w={runtime:n,instance:void 0,initOptions:void 0,bundlerRuntime:_,attachShareScopeMap:a,bundlerRuntimeOptions:{}};if(!t.federation.runtime||!t.federation.bundlerRuntime){var I=t.federation;for(var T in t.federation={},w)t.federation[T]=w[T];for(var T in I)t.federation[T]=I[T]}t.federation.instance||(t.federation.instance=t.federation.bundlerRuntime.init({webpackRequire:t}),t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),t.federation.installInitialConsumes&&t.federation.installInitialConsumes())},9421(e,r,t){var n={"./start":()=>Promise.all([t.e(31),t.e(435),t.e(410)]).then(()=>()=>t(5410))},a=(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),o=(e,r,n)=>t.federation.bundlerRuntime.initContainerEntry({webpackRequire:t,shareScope:e,initScope:r,remoteEntryInitOptions:n,shareScopeKey:"default"});t.d(r,{get:()=>a,init:()=>o})}},s={};function c(e){var r=s[e];if(void 0!==r)return r.exports;var t=s[e]={exports:{}},n={id:e,module:t,factory:i[e],require:c};return c.i.forEach(function(e){e(n)}),t=n.module,n.factory.call(t.exports,t,t.exports,n.require),t.exports}c.m=i,c.c=s,c.i=[],c.x=e=>{},c.federation||(c.federation={initOptions:{name:"@ampath/esm-reports-app",remotes:[],shareStrategy:"version-first"},chunkMatcher:function(e){return!/^(31|435|680|987)$/.test(e)},rootOutputDir:"",bundlerRuntimeOptions:{remotes:{remoteInfos:{},webpackRequire:c,idToRemoteMap:{},chunkMapping:{},idToExternalAndNameMapping:{}}}},c.consumesLoadingData={},c.remotesLoadingData={}),c.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return c.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var a=Object.create(null);c.r(a);var o={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;("object"==typeof i||"function"==typeof i)&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(e=>o[e]=()=>t[e]);return o.default=()=>t,c.d(a,o),a},c.d=(e,r)=>{for(var t in r)c.o(r,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((r,t)=>(c.f[t](e,r),r),[])),c.u=e=>e+".js",c.miniCssF=e=>e+".css",c.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@ampath/esm-reports-app:",c.l=(e,r,a,o)=>{if(t[e])t[e].push(r);else{var i,s;if(void 0!==a)for(var l=document.getElementsByTagName("script"),p=0;p<l.length;p++){var u=l[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==n+a){i=u;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",c.nc&&i.setAttribute("nonce",c.nc),i.setAttribute("data-webpack",n+a),i.src=e),t[e]=[r];var d=(r,n)=>{i.onerror=i.onload=null,clearTimeout(h);var a=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(e=>e(n)),r)return r(n)},h=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),s&&document.head.appendChild(i)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{c.S={};var e={},r={};c.I=(t,n)=>{n||(n=[]);var a=r[t];if(a||(a=r[t]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[t])return e[t];c.o(c.S,t)||(c.S[t]={});var o=c.S[t],i="@ampath/esm-reports-app",s=(e,r,t,n)=>{var a=o[e]=o[e]||{},s=a[r];(!s||!s.loaded&&(!n!=!s.eager?n:i>s.from))&&(a[r]={get:t,from:i,eager:!!n})},l=[];return"default"===t&&(s("@openmrs/esm-framework","11.0.1-pre.5776",()=>Promise.all([c.e(961),c.e(600),c.e(478),c.e(295),c.e(31),c.e(680),c.e(435),c.e(987)]).then(()=>()=>c(9295))),s("dayjs","1.11.20",()=>c.e(353).then(()=>()=>c(4353))),s("react-i18next","16.6.6",()=>Promise.all([c.e(478),c.e(311),c.e(31)]).then(()=>()=>c(3311))),s("react-router-dom","6.30.3",()=>Promise.all([c.e(961),c.e(282),c.e(31)]).then(()=>()=>c(282))),s("react","18.3.1",()=>c.e(540).then(()=>()=>c(6540)))),e[t]=l.length?Promise.all(l).then(()=>e[t]=1):1}}})(),(()=>{c.federation.initOptions.shared={"@openmrs/esm-framework":[{version:"11.0.1-pre.5776",get:()=>Promise.all([c.e(961),c.e(600),c.e(478),c.e(295),c.e(31),c.e(680),c.e(435),c.e(987)]).then(()=>()=>c(9295)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"*",strictVersion:!1,singleton:!0,layer:null}}],dayjs:[{version:"1.11.20",get:()=>c.e(353).then(()=>()=>c(4353)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"1.x",strictVersion:!1,singleton:!0,layer:null}}],"react-i18next":[{version:"16.6.6",get:()=>Promise.all([c.e(478),c.e(311),c.e(31)]).then(()=>()=>c(3311)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"16.x",strictVersion:!1,singleton:!0,layer:null}}],"react-router-dom":[{version:"6.30.3",get:()=>Promise.all([c.e(961),c.e(282),c.e(31)]).then(()=>()=>c(282)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"6.x",strictVersion:!1,singleton:!0,layer:null}}],react:[{version:"18.3.1",get:()=>c.e(540).then(()=>()=>c(6540)),scope:["default"],shareConfig:{eager:!1,requiredVersion:"18.x",strictVersion:!1,singleton:!0,layer:null}}]},c.S={};var e={},r={};c.I=(t,n)=>c.federation.bundlerRuntime.I({shareScopeName:t,webpackRequire:c,initPromises:e,initTokens:r,initScope:n})})(),(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var r=globalThis.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e})(),(()=>{var e={};c.consumesLoadingData.moduleIdToConsumeDataMapping={6031:{fallback:()=>c.e(540).then(()=>()=>c(6540)),shareScope:["default"],singleton:!0,requiredVersion:"18.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"react"},6435:{fallback:()=>Promise.all([c.e(961),c.e(282)]).then(()=>()=>c(282)),shareScope:["default"],singleton:!0,requiredVersion:"6.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"react-router-dom"},7693:{fallback:()=>Promise.all([c.e(961),c.e(600),c.e(478),c.e(295),c.e(680),c.e(987)]).then(()=>()=>c(9295)),shareScope:["default"],singleton:!0,requiredVersion:"*",strictVersion:!1,eager:!1,layer:void 0,shareKey:"@openmrs/esm-framework"},7680:{fallback:()=>c.e(353).then(()=>()=>c(4353)),shareScope:["default"],singleton:!0,requiredVersion:"1.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"dayjs"},3987:{fallback:()=>c.e(311).then(()=>()=>c(3311)),shareScope:["default"],singleton:!0,requiredVersion:"16.x",strictVersion:!1,eager:!1,layer:void 0,shareKey:"react-i18next"}};var r={};c.consumesLoadingData.chunkMapping={31:[6031],410:[7693],435:[6435],680:[7680],987:[3987]},c.f.consumes=(t,n)=>{c.federation.bundlerRuntime.consumes({chunkMapping:c.consumesLoadingData.chunkMapping,installedModules:e,chunkId:t,moduleToHandlerMapping:r,promises:n,webpackRequire:c})}})(),(()=>{if("undefined"!=typeof document){var e={462:0};c.f.miniCss=(r,t)=>{e[r]?t.push(e[r]):0!==e[r]&&{295:1,544:1}[r]&&t.push(e[r]=(e=>new Promise((r,t)=>{var n=c.miniCssF(e),a=c.p+n;if(((e,r)=>{for(var t=document.getElementsByTagName("link"),n=0;n<t.length;n++){var a=(i=t[n]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(a===e||a===r))return i}var o=document.getElementsByTagName("style");for(n=0;n<o.length;n++){var i;if((a=(i=o[n]).getAttribute("data-href"))===e||a===r)return i}})(n,a))return r();((e,r,t,n,a)=>{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",c.nc&&(o.nonce=c.nc),o.onerror=o.onload=t=>{if(o.onerror=o.onload=null,"load"===t.type)n();else{var i=t&&t.type,s=t&&t.target&&t.target.href||r,c=new Error("Loading CSS chunk "+e+" failed.\n("+i+": "+s+")");c.name="ChunkLoadError",c.code="CSS_CHUNK_LOAD_FAILED",c.type=i,c.request=s,o.parentNode&&o.parentNode.removeChild(o),a(c)}},o.href=r,document.head.appendChild(o)})(e,a,0,r,t)}))(r).then(()=>{e[r]=0},t=>{throw delete e[r],t}))}}})(),a=c.x,o=!1,c.x=()=>{if(o||(o=!0,c(2464)),"function"==typeof a)return a();console.warn("[Module Federation] prevStartup is not a function, skipping startup execution")},(()=>{var e={462:0};c.f.j=(r,t)=>{var n=c.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(31|435|680|987)$/.test(r))e[r]=0;else{var a=new Promise((t,a)=>n=e[r]=[t,a]);t.push(n[2]=a);var o=c.p+c.u(r),i=new Error;c.l(o,t=>{if(c.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,n[1](i)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,a,[o,i,s]=t,l=0;if(o.some(r=>0!==e[r])){for(n in i)c.o(i,n)&&(c.m[n]=i[n]);s&&s(c)}for(r&&r(t);l<o.length;l++)a=o[l],c.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=self.webpackChunk_ampath_esm_reports_app=self.webpackChunk_ampath_esm_reports_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),c.x();var l=c(9421);_ampath_esm_reports_app=l})();
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"ampath-reports-dashboard-link","component":"reportsDashboardLink","slot":"homepage-dashboard-slot","privileges":["O3 View Reports Dashboard"],"meta":{"name":"reports","slot":"ampath-reports-dashboard-slot","title":"Reports"},"online":true,"offline":true},{"component":"root","name":"ampath-reports-dashboard-root","slot":"ampath-reports-dashboard-slot","privileges":["O3 View Reports Dashboard"]}],"pages":[],"version":"1.0.0-next.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"ampath-reports-dashboard-link","component":"reportsDashboardLink","slot":"homepage-dashboard-slot","privileges":["O3 View Reports Dashboard"],"meta":{"name":"reports","slot":"ampath-reports-dashboard-slot","title":"Reports"},"online":true,"offline":true},{"component":"root","name":"ampath-reports-dashboard-root","slot":"ampath-reports-dashboard-slot","privileges":["O3 View Reports Dashboard"]}],"pages":[],"version":"1.0.0-next.82"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampath/esm-reports-app",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.82",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "An AMPATH application for M&E reports",
|
|
6
6
|
"browser": "dist/ampath-esm-reports-app.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "openmrs develop",
|
|
11
11
|
"serve": "webpack serve --mode=development",
|
|
12
|
-
"dev": "openmrs develop --backend=https://
|
|
12
|
+
"dev": "openmrs develop --backend=https://kibana.ampath.or.ke --api-url=/openmrs --config-url=https://ngx.ampath.or.ke/o3-config.json --port=9000",
|
|
13
|
+
"dev:local-config": "openmrs develop --backend=https://kibana.ampath.or.ke --api-url=/openmrs --config-url=https://ngx.ampath.or.ke/o3-config.json --config-file=./local-config.json --port=9000",
|
|
13
14
|
"build": "webpack --mode production",
|
|
14
15
|
"analyze": "webpack --mode=production --env analyze=true",
|
|
15
16
|
"lint": "eslint src --ext js,jsx,ts,tsx --max-warnings 0",
|
|
@@ -26,4 +26,6 @@ export const REPORT_PARENTS: Record<string, ReportParent> = {
|
|
|
26
26
|
'moh-731': { label: 'MOH-731 Report', path: '/moh-731' },
|
|
27
27
|
'moh-740': { label: 'MOH-740 Report', path: '/moh-740' },
|
|
28
28
|
'moh-745': { label: 'MOH-745 Report', path: '/moh-745' },
|
|
29
|
+
'moh-645': { label: 'MOH-645 Report', path: '/moh-645' },
|
|
30
|
+
'moh-643': { label: 'MOH-643 Report', path: '/moh-643' },
|
|
29
31
|
};
|
|
@@ -148,6 +148,22 @@ export const reportCategories: ReportCategory[] = [
|
|
|
148
148
|
icon: Microscope,
|
|
149
149
|
keywords: ['laboratory', 'lab', 'urine', 'parasitology', 'blood chemistry'],
|
|
150
150
|
},
|
|
151
|
+
{
|
|
152
|
+
code: 'MOH 645',
|
|
153
|
+
name: 'Malaria commodities',
|
|
154
|
+
description: 'Monthly summary of AL and artesunate dispensed, and malaria diagnostics.',
|
|
155
|
+
path: '/moh-645',
|
|
156
|
+
icon: HealthCross,
|
|
157
|
+
keywords: ['malaria', 'al', 'artemether', 'artesunate', 'rdt', 'commodities', 'act'],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
code: 'MOH 643',
|
|
161
|
+
name: 'Laboratory commodities',
|
|
162
|
+
description: 'Monthly FCDRR of laboratory reagents: tests done and quantity used.',
|
|
163
|
+
path: '/moh-643',
|
|
164
|
+
icon: Microscope,
|
|
165
|
+
keywords: ['laboratory', 'lab', 'commodities', 'fcdrr', 'hiv', 'cd4', 'viral load', 'reagents'],
|
|
166
|
+
},
|
|
151
167
|
{
|
|
152
168
|
code: 'MOH 505',
|
|
153
169
|
name: 'IDSR epidemic monitoring',
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { formatDate, useSession } from '@openmrs/esm-framework';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
|
|
6
|
+
import { ReportFiltersComponent, type ReportPeriod, useRestorePeriod } from '../../common/report-filters';
|
|
7
|
+
import { showReportError } from '../../common/report-error';
|
|
8
|
+
import { hasReportData, ReportPlaceholder } from '../../common/report-placeholder';
|
|
9
|
+
import { ReportSkeleton } from '../../common/report-skeleton';
|
|
10
|
+
import { ReportPage } from '../../common/report-page';
|
|
11
|
+
import { getMoh643 } from '../../resources/moh-643.resource';
|
|
12
|
+
|
|
13
|
+
import { COMMODITY_ROWS, STOCK_COLUMNS } from './moh-643.rows';
|
|
14
|
+
import styles from './moh-643.scss';
|
|
15
|
+
|
|
16
|
+
interface ClickCellProps {
|
|
17
|
+
value?: number | string | null;
|
|
18
|
+
indicator?: string;
|
|
19
|
+
label: string;
|
|
20
|
+
onOpen: (indicator: string, label: string) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ClickCell: React.FC<ClickCellProps> = ({ value, indicator, label, onOpen }) => {
|
|
24
|
+
if (!indicator) {
|
|
25
|
+
return <td></td>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<td className={styles.clickable} onClick={() => onOpen(indicator, label)}>
|
|
30
|
+
{value ?? 0}
|
|
31
|
+
</td>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const Moh643Component: React.FC = () => {
|
|
36
|
+
const [moh643Data, setMoh643Data] = useState<Record<string, any>>({});
|
|
37
|
+
const isReportGenerated = hasReportData(moh643Data);
|
|
38
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
39
|
+
const [startDate, setStartDate] = useState('');
|
|
40
|
+
const [endDate, setEndDate] = useState('');
|
|
41
|
+
|
|
42
|
+
const session = useSession();
|
|
43
|
+
const locationUuids = session?.sessionLocation?.uuid;
|
|
44
|
+
const facility = session?.sessionLocation?.display ?? '';
|
|
45
|
+
const monthYear = startDate ? dayjs(startDate).format('MMMM YYYY') : '';
|
|
46
|
+
const compiledBy = session?.user?.person?.display ?? session?.user?.display ?? '';
|
|
47
|
+
const compiledOn = formatDate(new Date(), { mode: 'standard', time: false, noToday: true });
|
|
48
|
+
|
|
49
|
+
const navigate = useNavigate();
|
|
50
|
+
|
|
51
|
+
const fetchMoh643ReportData = async ({ startDate, endDate }: ReportPeriod) => {
|
|
52
|
+
setIsLoading(true);
|
|
53
|
+
setStartDate(startDate);
|
|
54
|
+
setEndDate(endDate);
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const data = await getMoh643({
|
|
58
|
+
locationUuids: locationUuids || '',
|
|
59
|
+
startDate,
|
|
60
|
+
endDate,
|
|
61
|
+
});
|
|
62
|
+
const rows = Array.isArray(data?.result) ? data.result : [];
|
|
63
|
+
setMoh643Data(Object.assign({}, ...rows));
|
|
64
|
+
} catch (error) {
|
|
65
|
+
showReportError('the MOH-643 report', error);
|
|
66
|
+
} finally {
|
|
67
|
+
setIsLoading(false);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
useRestorePeriod(fetchMoh643ReportData);
|
|
72
|
+
|
|
73
|
+
const openRegister = (indicator: string, label: string) => {
|
|
74
|
+
const params = new URLSearchParams({
|
|
75
|
+
startDate,
|
|
76
|
+
endDate,
|
|
77
|
+
locationUuids: locationUuids || '',
|
|
78
|
+
indicators: indicator,
|
|
79
|
+
label,
|
|
80
|
+
from: 'moh-643',
|
|
81
|
+
});
|
|
82
|
+
navigate(`/moh-643-register?${params.toString()}`);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<>
|
|
87
|
+
<ReportFiltersComponent
|
|
88
|
+
reportName="MOH-643 Report"
|
|
89
|
+
mode="monthly"
|
|
90
|
+
onGenerate={fetchMoh643ReportData}
|
|
91
|
+
isLoading={isLoading}
|
|
92
|
+
isReportGenerated={isReportGenerated}
|
|
93
|
+
generatedPeriod={{ startDate, endDate }}
|
|
94
|
+
/>
|
|
95
|
+
{isLoading && <ReportSkeleton />}
|
|
96
|
+
{!isLoading && !isReportGenerated && <ReportPlaceholder reportName="MOH-643" />}
|
|
97
|
+
{!isLoading && isReportGenerated && (
|
|
98
|
+
<ReportPage>
|
|
99
|
+
<div className={styles.headerContainer}>
|
|
100
|
+
<div className={styles.mainTitleBox}>
|
|
101
|
+
<h2 className={styles.mainTitle}>Ministry of Health</h2>
|
|
102
|
+
<h3 className={styles.subTitle}>Laboratory Commodities: Monthly Summary Form (MOH 643)</h3>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<table className={styles.topMeta}>
|
|
107
|
+
<tbody>
|
|
108
|
+
<tr>
|
|
109
|
+
<td>
|
|
110
|
+
Name of the facility: <strong>{facility}</strong>
|
|
111
|
+
</td>
|
|
112
|
+
<td>
|
|
113
|
+
MFL code: <strong></strong>
|
|
114
|
+
</td>
|
|
115
|
+
<td>
|
|
116
|
+
County: <strong></strong>
|
|
117
|
+
</td>
|
|
118
|
+
<td>
|
|
119
|
+
Sub County: <strong></strong>
|
|
120
|
+
</td>
|
|
121
|
+
<td>
|
|
122
|
+
Month/Year: <strong>{monthYear}</strong>
|
|
123
|
+
</td>
|
|
124
|
+
</tr>
|
|
125
|
+
</tbody>
|
|
126
|
+
</table>
|
|
127
|
+
|
|
128
|
+
<table className={styles.table}>
|
|
129
|
+
<thead>
|
|
130
|
+
<tr>
|
|
131
|
+
<th className={styles.sectionHeader} colSpan={STOCK_COLUMNS.length + 2}>
|
|
132
|
+
Laboratory commodities
|
|
133
|
+
</th>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<th>Commodity</th>
|
|
137
|
+
<th>Unit pack size</th>
|
|
138
|
+
{STOCK_COLUMNS.map((column) => (
|
|
139
|
+
<th key={column.key} className={styles.rotateUp}>
|
|
140
|
+
{column.label}
|
|
141
|
+
</th>
|
|
142
|
+
))}
|
|
143
|
+
</tr>
|
|
144
|
+
</thead>
|
|
145
|
+
<tbody>
|
|
146
|
+
{COMMODITY_ROWS.map((row, index) => {
|
|
147
|
+
if (row.kind === 'section') {
|
|
148
|
+
return (
|
|
149
|
+
<tr key={`section-${row.label}`}>
|
|
150
|
+
<td className={styles.sectionHeader} colSpan={STOCK_COLUMNS.length + 2}>
|
|
151
|
+
{row.label}
|
|
152
|
+
</td>
|
|
153
|
+
</tr>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
if (row.kind === 'note') {
|
|
157
|
+
return (
|
|
158
|
+
<tr key={`note-${index}`} className={styles.noteRow}>
|
|
159
|
+
<td colSpan={STOCK_COLUMNS.length + 2}>{row.label}</td>
|
|
160
|
+
</tr>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const testsIndicator = row.slug ? `tests_${row.slug}` : undefined;
|
|
165
|
+
const qtyIndicator = row.slug ? `qty_used_${row.slug}` : undefined;
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<tr key={row.label}>
|
|
169
|
+
<td className={styles.commodity}>{row.label}</td>
|
|
170
|
+
<td className={styles.unit}>{row.unit}</td>
|
|
171
|
+
{STOCK_COLUMNS.map((column) => {
|
|
172
|
+
if (column.key === 'qty_used') {
|
|
173
|
+
return (
|
|
174
|
+
<ClickCell
|
|
175
|
+
key={column.key}
|
|
176
|
+
value={qtyIndicator ? moh643Data[qtyIndicator] : null}
|
|
177
|
+
indicator={qtyIndicator}
|
|
178
|
+
label={`${row.label} — quantity used`}
|
|
179
|
+
onOpen={openRegister}
|
|
180
|
+
/>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
if (column.key === 'tests_done') {
|
|
184
|
+
return (
|
|
185
|
+
<ClickCell
|
|
186
|
+
key={column.key}
|
|
187
|
+
value={testsIndicator ? moh643Data[testsIndicator] : null}
|
|
188
|
+
indicator={testsIndicator}
|
|
189
|
+
label={`${row.label} — tests done`}
|
|
190
|
+
onOpen={openRegister}
|
|
191
|
+
/>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
return <td key={column.key}></td>;
|
|
195
|
+
})}
|
|
196
|
+
</tr>
|
|
197
|
+
);
|
|
198
|
+
})}
|
|
199
|
+
</tbody>
|
|
200
|
+
</table>
|
|
201
|
+
|
|
202
|
+
<div className={styles.signOff}>
|
|
203
|
+
<span>
|
|
204
|
+
Compiled by: Name <span className={styles.line}>{compiledBy}</span>
|
|
205
|
+
</span>
|
|
206
|
+
<span>
|
|
207
|
+
Signature <span className={styles.line}></span>
|
|
208
|
+
</span>
|
|
209
|
+
<span>
|
|
210
|
+
Phone no <span className={styles.shortLine}></span>
|
|
211
|
+
</span>
|
|
212
|
+
<span>
|
|
213
|
+
Date <span className={styles.shortLine}>{compiledOn}</span>
|
|
214
|
+
</span>
|
|
215
|
+
</div>
|
|
216
|
+
</ReportPage>
|
|
217
|
+
)}
|
|
218
|
+
</>
|
|
219
|
+
);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export default Moh643Component;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export const STOCK_COLUMNS = [
|
|
2
|
+
{ key: 'beginning', label: 'Beginning balance' },
|
|
3
|
+
{ key: 'received_kemsa', label: 'Received from central warehouse (e.g. KEMSA)' },
|
|
4
|
+
{ key: 'received_other', label: 'Received from other sources' },
|
|
5
|
+
{ key: 'qty_used', label: 'Total quantity used' },
|
|
6
|
+
{ key: 'tests_done', label: 'Number of tests done' },
|
|
7
|
+
{ key: 'qaqc', label: 'QA/QC and repeats' },
|
|
8
|
+
{ key: 'losses', label: 'Losses and wastage' },
|
|
9
|
+
{ key: 'adj_pos', label: 'Positive adjustment' },
|
|
10
|
+
{ key: 'adj_neg', label: 'Negative adjustment' },
|
|
11
|
+
{ key: 'physical', label: 'End of month physical stock count' },
|
|
12
|
+
{ key: 'expiring', label: 'Quantity expiring in less than 6 months' },
|
|
13
|
+
{ key: 'stockout_days', label: 'Days out of stock this month' },
|
|
14
|
+
{ key: 'qty_requested', label: 'Quantity requested for re-supply' },
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
export type Moh643Row =
|
|
18
|
+
| { kind: 'section'; label: string }
|
|
19
|
+
| { kind: 'note'; label: string }
|
|
20
|
+
| { kind: 'item'; label: string; unit: string; slug?: string };
|
|
21
|
+
|
|
22
|
+
export const COMMODITY_ROWS: Moh643Row[] = [
|
|
23
|
+
{ kind: 'section', label: 'Rapid test kits' },
|
|
24
|
+
{ kind: 'item', label: 'Rapid HIV 1+2 Test 1', unit: 'Test', slug: 'hiv_rapid' },
|
|
25
|
+
{ kind: 'item', label: 'Rapid HIV 1+2 Test 2', unit: 'Test' },
|
|
26
|
+
{ kind: 'item', label: 'Rapid HIV 1+2 Test 3', unit: 'Test' },
|
|
27
|
+
{ kind: 'item', label: 'HIV / Syphilis duo kit', unit: 'Test' },
|
|
28
|
+
{ kind: 'item', label: 'HIV self test kit, oral', unit: 'Test' },
|
|
29
|
+
{ kind: 'item', label: 'HIV self test kit, blood based', unit: 'Test' },
|
|
30
|
+
{ kind: 'item', label: 'HIV recency testing', unit: 'Test' },
|
|
31
|
+
{ kind: 'item', label: 'Rapid HBV screening test', unit: 'Test', slug: 'hbv_rapid' },
|
|
32
|
+
{ kind: 'section', label: 'CD4 tests' },
|
|
33
|
+
{ kind: 'item', label: 'Pima CD3/CD4', unit: 'Test', slug: 'cd4' },
|
|
34
|
+
{ kind: 'item', label: 'PIMA', unit: 'Test' },
|
|
35
|
+
{ kind: 'item', label: 'CD4 RDT', unit: 'Test' },
|
|
36
|
+
{ kind: 'section', label: 'Viral load and EID testing' },
|
|
37
|
+
{ kind: 'item', label: 'KIT COBAS 6800/8800 HIV-1 Quantitative 192T CE-IVD', unit: 'Test', slug: 'viral_load' },
|
|
38
|
+
{ kind: 'item', label: 'Aptima HIV-1 Quant Dx Assay / Panther Run Kit', unit: 'Test' },
|
|
39
|
+
{ kind: 'item', label: 'ABBOTT Alinity RealTime HIV-1 Amplification kit', unit: 'Test' },
|
|
40
|
+
{ kind: 'section', label: 'Viral load and EID point of care (PoC)' },
|
|
41
|
+
{ kind: 'item', label: 'GeneXpert Quantitative', unit: 'Test' },
|
|
42
|
+
{ kind: 'item', label: 'mPima Quantitative', unit: 'Test' },
|
|
43
|
+
{ kind: 'item', label: 'HBV Quantitative', unit: 'Test' },
|
|
44
|
+
{ kind: 'item', label: 'DBS Bundles', unit: 'Pieces' },
|
|
45
|
+
{ kind: 'item', label: 'PPT', unit: 'Pieces' },
|
|
46
|
+
{ kind: 'section', label: 'Other HIV related tests' },
|
|
47
|
+
{ kind: 'item', label: 'HPV test', unit: 'Tests' },
|
|
48
|
+
{ kind: 'item', label: 'CrAg test', unit: 'Tests', slug: 'crag' },
|
|
49
|
+
{ kind: 'item', label: 'DRT', unit: 'Tests' },
|
|
50
|
+
{ kind: 'item', label: 'LF TB LAM', unit: 'Tests' },
|
|
51
|
+
{ kind: 'section', label: 'Haematology' },
|
|
52
|
+
{ kind: 'note', label: 'Indicate the type of equipment in your facility (e.g. Celltac 6400, Coulter, Celltac 8222)' },
|
|
53
|
+
{ kind: 'item', label: 'Full haemogram', unit: 'Tests', slug: 'fbc' },
|
|
54
|
+
{ kind: 'item', label: 'Haemoglobin', unit: 'Tests', slug: 'hb' },
|
|
55
|
+
{ kind: 'section', label: 'Biochemistry' },
|
|
56
|
+
{
|
|
57
|
+
kind: 'note',
|
|
58
|
+
label: 'Indicate the type of equipment in your facility (e.g. BTS 330/310/350, Unisysel, Humalyzer 2000/3000, C111 Cobas)',
|
|
59
|
+
},
|
|
60
|
+
{ kind: 'item', label: 'Albumin', unit: 'Tests', slug: 'albumin' },
|
|
61
|
+
{ kind: 'item', label: 'Alkaline phosphatase', unit: 'Tests', slug: 'alp' },
|
|
62
|
+
{ kind: 'item', label: 'ALT (SGPT)', unit: 'Tests', slug: 'alt' },
|
|
63
|
+
{ kind: 'item', label: 'Creatinine', unit: 'Tests', slug: 'creatinine' },
|
|
64
|
+
{ kind: 'item', label: 'Potassium', unit: 'Tests', slug: 'potassium' },
|
|
65
|
+
{ kind: 'item', label: 'Sodium', unit: 'Tests', slug: 'sodium' },
|
|
66
|
+
{ kind: 'item', label: 'Chloride', unit: 'Tests', slug: 'chloride' },
|
|
67
|
+
{ kind: 'item', label: 'Gamma GT', unit: 'Tests', slug: 'ggt' },
|
|
68
|
+
{ kind: 'item', label: 'Glucose test strips', unit: 'Tests', slug: 'glucose' },
|
|
69
|
+
{ kind: 'item', label: 'HDL Cholesterol', unit: 'Tests', slug: 'hdl' },
|
|
70
|
+
{ kind: 'item', label: 'Pregnancy test strips', unit: 'Tests', slug: 'hcg' },
|
|
71
|
+
{ kind: 'item', label: 'Serum Amylase test kit', unit: 'Tests', slug: 'amylase' },
|
|
72
|
+
{ kind: 'item', label: 'Serum protein kit', unit: 'Tests', slug: 'protein' },
|
|
73
|
+
{ kind: 'item', label: 'Total Cholesterol', unit: 'Tests', slug: 'cholesterol' },
|
|
74
|
+
{ kind: 'item', label: 'Triglycerides', unit: 'Tests', slug: 'triglycerides' },
|
|
75
|
+
{ kind: 'item', label: 'Bilirubin', unit: 'Tests', slug: 'bilirubin' },
|
|
76
|
+
{ kind: 'item', label: 'Urea', unit: 'Tests', slug: 'urea' },
|
|
77
|
+
];
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/* MOH-643 laid out for A4, matching MOH-645: geometry in millimetres,
|
|
2
|
+
type in points, one rule weight. Headers rotate because the FCDRR
|
|
3
|
+
has many stock columns. */
|
|
4
|
+
|
|
5
|
+
$ink: #000;
|
|
6
|
+
$bar: #d9d9d9;
|
|
7
|
+
$rule: 1px solid $ink;
|
|
8
|
+
|
|
9
|
+
$text: 6pt;
|
|
10
|
+
$title: 7.5pt;
|
|
11
|
+
$sub: 7pt;
|
|
12
|
+
$meta: 6pt;
|
|
13
|
+
|
|
14
|
+
.headerContainer {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: flex-start;
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.mainTitleBox {
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: 2.5mm;
|
|
23
|
+
text-align: center;
|
|
24
|
+
border: $rule;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.mainTitle {
|
|
28
|
+
margin: 0;
|
|
29
|
+
font-size: $title;
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.subTitle {
|
|
34
|
+
margin: 1mm 0 0;
|
|
35
|
+
font-size: $sub;
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.topMeta {
|
|
40
|
+
width: 100%;
|
|
41
|
+
table-layout: fixed;
|
|
42
|
+
border-collapse: collapse;
|
|
43
|
+
border: $rule;
|
|
44
|
+
border-top: none;
|
|
45
|
+
|
|
46
|
+
td {
|
|
47
|
+
width: 17%;
|
|
48
|
+
padding: 1.2mm;
|
|
49
|
+
font-size: $meta;
|
|
50
|
+
vertical-align: top;
|
|
51
|
+
word-break: break-word;
|
|
52
|
+
border: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
td:first-child {
|
|
56
|
+
width: 32%;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.table {
|
|
61
|
+
width: 100%;
|
|
62
|
+
border-collapse: collapse;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.table th,
|
|
66
|
+
.table td {
|
|
67
|
+
padding: 0.8mm 1mm;
|
|
68
|
+
font-size: $text;
|
|
69
|
+
text-align: center;
|
|
70
|
+
border: $rule;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.table th {
|
|
74
|
+
font-weight: 700;
|
|
75
|
+
background-color: $bar;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.table td:first-child,
|
|
79
|
+
.table th:first-child {
|
|
80
|
+
text-align: left;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.commodity {
|
|
84
|
+
max-width: 42mm;
|
|
85
|
+
word-break: break-word;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.unit {
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.sectionHeader {
|
|
93
|
+
font-weight: 700;
|
|
94
|
+
text-align: center;
|
|
95
|
+
text-transform: uppercase;
|
|
96
|
+
letter-spacing: 0.02em;
|
|
97
|
+
background-color: #cfcfcf;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.noteRow td {
|
|
101
|
+
font-style: italic;
|
|
102
|
+
text-align: left;
|
|
103
|
+
background-color: #f3f3f3;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.table tbody tr:nth-of-type(odd) {
|
|
107
|
+
background-color: #fafafa;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.clickable {
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
font-weight: 600;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.clickable:hover {
|
|
116
|
+
background-color: #e8e8e8;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.rotateUp {
|
|
120
|
+
writing-mode: vertical-rl;
|
|
121
|
+
transform: rotate(180deg);
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
max-height: 38mm;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.signOff {
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-wrap: nowrap;
|
|
129
|
+
align-items: baseline;
|
|
130
|
+
justify-content: space-between;
|
|
131
|
+
gap: 2.5mm;
|
|
132
|
+
padding: 2.5mm;
|
|
133
|
+
font-size: $meta;
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
border: $rule;
|
|
136
|
+
border-top: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.line,
|
|
140
|
+
.shortLine {
|
|
141
|
+
display: inline-block;
|
|
142
|
+
padding: 0 0.5mm;
|
|
143
|
+
margin-left: 1mm;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
font-weight: 600;
|
|
146
|
+
text-align: center;
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
vertical-align: bottom;
|
|
149
|
+
border-bottom: $rule;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.line {
|
|
153
|
+
width: 36mm;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.shortLine {
|
|
157
|
+
width: 22mm;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media print {
|
|
161
|
+
.table tbody tr:nth-of-type(odd) {
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
}
|
|
164
|
+
}
|