@pih/esm-pathology-app 1.1.1-pre.28 → 1.1.1-pre.29
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 +4 -4
- package/dist/34.js +1 -1
- package/dist/pih-esm-pathology-app.js.buildmanifest.json +3 -3
- package/package.json +2 -2
- package/src/Pathology-getter/ReportComponent.resource.ts +2 -0
- package/src/Print-to-PDF/Document-Component.tsx +15 -7
- package/src/pathology-report/ReportComponent.tsx +14 -14
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@pih/esm-pathology-app:build: cache hit, replaying output
|
|
1
|
+
@pih/esm-pathology-app:build: cache hit, replaying output 2f382fcceba26a56
|
|
2
2
|
@pih/esm-pathology-app:build: $ webpack --mode production
|
|
3
3
|
@pih/esm-pathology-app:build: assets by path [1m[32m*.js[39m[22m 3.71 MiB
|
|
4
4
|
@pih/esm-pathology-app:build: assets by status [1m[33m3.66 MiB[39m[22m [1m[33m[big][39m[22m
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
@pih/esm-pathology-app:build: runtime modules 37.3 KiB 28 modules
|
|
16
16
|
@pih/esm-pathology-app:build: built modules 6.96 MiB (javascript) 211 KiB (asset) 126 bytes (share-init) 126 bytes (consume-shared) [1m[33m[built][39m[22m
|
|
17
17
|
@pih/esm-pathology-app:build: modules by path [1m../../node_modules/[39m[22m 6.89 MiB 131 modules
|
|
18
|
-
@pih/esm-pathology-app:build: modules by path [1m./[39m[22m 65.
|
|
19
|
-
@pih/esm-pathology-app:build: modules by path [1m./src/[39m[22m 65.
|
|
18
|
+
@pih/esm-pathology-app:build: modules by path [1m./[39m[22m 65.7 KiB (javascript) 211 KiB (asset)
|
|
19
|
+
@pih/esm-pathology-app:build: modules by path [1m./src/[39m[22m 65.5 KiB (javascript) 211 KiB (asset) 7 modules
|
|
20
20
|
@pih/esm-pathology-app:build: modules by path [1m./translations/[39m[22m 172 bytes 2 modules
|
|
21
21
|
@pih/esm-pathology-app:build: provide-module modules 126 bytes
|
|
22
22
|
@pih/esm-pathology-app:build: [1mprovide shared module (default) @carbon/icons-react@11.8.0 = ../../node_modules/@carbon/react/node_modules/@carbon/icons-react/es/index.js[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
@pih/esm-pathology-app:build: 241.js (1.87 MiB)
|
|
35
35
|
@pih/esm-pathology-app:build: 858.js (409 KiB)[39m[22m
|
|
36
36
|
@pih/esm-pathology-app:build:
|
|
37
|
-
@pih/esm-pathology-app:build: webpack 5.73.0 compiled with [1m[33m1 warning[39m[22m in
|
|
37
|
+
@pih/esm-pathology-app:build: webpack 5.73.0 compiled with [1m[33m1 warning[39m[22m in 66796 ms
|
package/dist/34.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_pih_esm_pathology_app=self.webpackChunk_pih_esm_pathology_app||[]).push([[34],{8814:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9601),o=n.n(r),a=n(2609),s=n.n(a)()(o());s.push([e.id,".-esm-pathology__ReportComponent__tableContainer____whij {\n height: 500px;\n overflow-x: auto;\n overflow-y: auto;\n margin: 0 1rem;\n border: 2px solid lightgrey;\n border-radius: 0.25rem;\n}\n\n.-esm-pathology__ReportComponent__filtersContainer___nPCyi {\n border-radius: 0.25rem;\n margin: 0 1rem;\n padding-top: 4%;\n}\n\n.-esm-pathology__ReportComponent__dropdown___D35bi {\n width: 10%;\n height: 2rem;\n background: transparent;\n border: 1px solid var(--omrs-color-ink-lowest-contrast);\n background-clip: padding-box;\n border-radius: 4px;\n margin: 1rem;\n}\n.-esm-pathology__ReportComponent__dropdown___D35bi:disabled {\n opacity: 0.8;\n background: lightgrey;\n cursor: not-allowed;\n}\n.-esm-pathology__ReportComponent__dropdown___D35bi:focus {\n border: 2px solid var(--omrs-color-interaction);\n outline: 0;\n}\n.-esm-pathology__ReportComponent__textBox___gvGk9 {\n background: transparent;\n border: 1px solid var(--omrs-color-ink-lowest-contrast);\n background-clip: padding-box;\n border-radius: 4px;\n margin: 1rem;\n}\n",""]),s.locals={tableContainer:"-esm-pathology__ReportComponent__tableContainer____whij",filtersContainer:"-esm-pathology__ReportComponent__filtersContainer___nPCyi",dropdown:"-esm-pathology__ReportComponent__dropdown___D35bi",textBox:"-esm-pathology__ReportComponent__textBox___gvGk9"};const i=s},3147:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9601),o=n.n(r),a=n(2609),s=n.n(a)()(o());s.push([e.id,".-esm-pathology__pathology__container___cnxz7 {\n padding: 2em;\n}\n",""]),s.locals={container:"-esm-pathology__pathology__container___cnxz7"};const i=s},256:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>se});var r=n(7900),o=n.n(r),a=n(1354),s=n.n(a),i=n(1583),l=n.n(i),u=n(7378),c=n.n(u),p=n(5993),d=n.n(p),m=n(4154),f=n.n(m),y=n(8141),h=n.n(y),v=n(3147),g={};g.styleTagTransform=h(),g.setAttributes=d(),g.insert=c().bind(null,"head"),g.domAPI=l(),g.insertStyleElement=f(),s()(v.Z,g);const b=v.Z&&v.Z.locals?v.Z.locals:void 0;var E=n(4841),x=n(5919),w=n(3565),_=n(5953),U=n(2473),S=n(9151),I=n(4141),D=n(3236),O=n(910),C=n(8),A=n(9513),k=n(8814),B={};B.styleTagTransform=h(),B.setAttributes=d(),B.insert=c().bind(null,"head"),B.domAPI=l(),B.insertStyleElement=f(),s()(k.Z,B);const F=k.Z&&k.Z.locals?k.Z.locals:void 0;function P(e,t,n,r,o,a,s){try{var i=e[a](s),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,o)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){P(a,r,o,s,i,"next",e)}function i(e){P(a,r,o,s,i,"throw",e)}s(void 0)}))}}var R=function(e,t){var n,r,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};function T(e){return N.apply(this,arguments)}function N(){return(N=L((function(e){var t,n,r,o;return R(this,(function(a){switch(a.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/session")];case 1:return t=a.sent(),n=t.data.user.person.uuid,[4,(0,E.openmrsFetch)("/ws/rest/v1/person/".concat(n,"/attribute"))];case 2:return r=a.sent(),[2,(o=r.data.results.filter((function(t){return t.attributeType.uuid===e})))[0]&&o[0].value.uuid]}}))}))).apply(this,arguments)}function Z(e){return G.apply(this,arguments)}function G(){return(G=L((function(e){return R(this,(function(t){switch(t.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/concept/".concat(e,"?v=full"))];case 1:return[2,t.sent().data.answers]}}))}))).apply(this,arguments)}function j(){return(j=L((function(){return R(this,(function(e){switch(e.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/location")];case 1:return[2,e.sent().data.results]}}))}))).apply(this,arguments)}function W(){return W=L((function(e,t){var n,r,o;return R(this,(function(a){switch(a.label){case 0:return[4,T(e)];case 1:return n=a.sent(),r=null,n&&n!=t?[4,(0,E.openmrsFetch)("/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0?location=".concat(n))]:[3,3];case 2:return r=a.sent(),[3,5];case 3:return[4,(0,E.openmrsFetch)("/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0")];case 4:r=a.sent(),a.label=5;case 5:return o=r.data.dataSets[0].rows.map((s=L((function(e){var t;return R(this,(function(n){switch(n.label){case 0:return e.resultsEncounterUuid?(r.data.dataSets[0].rows.findIndex((function(t){return t.encounterUuid==e.encounterUuid})),[4,$(e.resultsEncounterUuid)]):[3,2];case 1:t=n.sent(),e.resultsEncounter=t,n.label=2;case 2:return[2,e]}}))})),function(e){return s.apply(this,arguments)})),[2,Promise.all(o)]}var s}))})),W.apply(this,arguments)}function z(){return(z=L((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:e.patientUuid,obsDatetime:(new Date).toISOString(),concept:t},[4,T(n)];case 1:return a.location=s.sent(),a.encounter=e.encounterUuid,a.value=r,a.voided=!1,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function H(){return(H=L((function(e){var t;return R(this,(function(n){switch(n.label){case 0:return t={voided:!0},[4,(0,E.openmrsFetch)("/ws/rest/v1/obs/".concat(e),{method:"POST",headers:{"content-type":"application/json"},body:t})];case 1:return[2,n.sent()]}}))}))).apply(this,arguments)}function M(){return(M=L((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e,a.voided=!1,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function q(){return(q=L((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e.uuid,a.voided=!e,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs/".concat(t.sampleStatusObsUuid),{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function V(){return(V=L((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e,a.voided=!1,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function X(){return(X=L((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e.uuid,a.voided=!e,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs/".concat(t.referralStatusObsUuid),{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function $(e){return J.apply(this,arguments)}function J(){return(J=L((function(e){return R(this,(function(t){switch(t.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/encounter/".concat(e,"?v=full"))];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}const K=n.p+"00ebb57bb20c59433e84.gif",Q=n.p+"a5fad24f075c978ac04b.ttf",Y=n.p+"5b8bb278fcab4da4972e.ttf";A.Zx.register({family:"GeorgiaBold",src:Q}),A.Zx.register({family:"Georgia",src:Y});var ee=A.mM.create({page:{flexDirection:"row"},section:{margin:10,padding:20,flexGrow:1},textLabels:{padding:7,fontFamily:"GeorgiaBold",fontSize:16,fontWeight:"bold",paddingBottom:30},sentenceLabels:{paddingTop:7,fontFamily:"GeorgiaBold",fontSize:16,fontWeight:"bold",paddingBottom:3},textAnswers:{margin:10,padding:20,fontFamily:"Georgia",fontSize:14},sentenceAnswers:{marginBottom:10,paddingBottom:20,fontFamily:"Georgia",fontSize:14},logo:{width:61}});const te=function(e){return o().createElement(A.BB,{title:"Pathology report \n ".concat(e.encounterInfo.family_name," \n ").concat(e.encounterInfo.given_name," \n ").concat(e.encounterInfo.middle_name," ")},o().createElement(A.T3,{size:"A4",style:ee.page},o().createElement(A.G7,{style:ee.section},o().createElement(A.Ee,{style:ee.logo,src:K}),o().createElement(A.xv,{style:{fontSize:8}},"Butaro Hospital"),o().createElement(A.xv,{style:{position:"absolute",top:0,left:300,width:300}},o().createElement(A.xv,{style:ee.textAnswers},"Lab phone number:"),o().createElement(A.xv,null," ",e.config.LabPhoneNumber)),o().createElement(A.xv,{style:{position:"absolute",top:15,left:300,width:300}},o().createElement(A.xv,{style:ee.textAnswers},"Accession number:"),o().createElement(A.xv,null," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.AccessionNumberconceptUUID&&t.value})))),o().createElement(A.xv,{style:{borderBottom:"1px",textAlign:"center",fontWeight:1500,marginBottom:30,fontFamily:"GeorgiaBold"}},"Pathology Report"),o().createElement(A.xv,{style:{paddingBottom:10}},o().createElement(A.xv,{style:ee.textAnswers},"Patient Name:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.family_name," ",e.encounterInfo.given_name," ",e.encounterInfo.middle_name)),o().createElement(A.xv,{style:{paddingBottom:10,position:"absolute",top:140,left:335}},o().createElement(A.xv,{style:ee.textAnswers},"Surgery Date:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.DateBiopsySpecimenTakenconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"})})))),o().createElement(A.xv,{style:{paddingBottom:10}},o().createElement(A.xv,{style:ee.textAnswers},"Patient Birthdate:"),o().createElement(A.xv,{style:ee.textAnswers}," ",new Date(e.encounterInfo.personBirthdate).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),o().createElement(A.xv,{style:{paddingBottom:10,position:"absolute",top:168,left:335,width:200}},o().createElement(A.xv,{style:ee.textAnswers},"Specimen Reception Date:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.SpecimenSubmissionDateconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"})})))),o().createElement(A.xv,{style:{paddingBottom:10,borderBottom:"1px"}},o().createElement(A.xv,{style:ee.textAnswers},"Patient Gender:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.personGender)),o().createElement(A.xv,{style:{paddingBottom:10,position:"absolute",top:200,left:335,width:250}},o().createElement(A.xv,{style:ee.textAnswers},"Signout Date:"),o().createElement(A.xv,{style:ee.textAnswers}," ",new Date(e.encounterInfo.resultsEncounter.encounterDatetime).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),o().createElement(A.xv,{style:{paddingBottom:10}},o().createElement(A.xv,{style:ee.textLabels},"Sending Physician:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.SendingPhysicianconceptUUID&&t.value})))),o().createElement(A.xv,{style:{paddingBottom:10}},o().createElement(A.xv,{style:ee.textLabels},"Sending Facility:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OtherBiopsyLocationconceptUUID&&t.value})))),o().createElement(A.xv,{style:{paddingBottom:10,fontFamily:"Georgia"}},"Anatomical location:"),o().createElement(A.xv,{style:{paddingBottom:10,paddingLeft:10}},o().createElement(A.xv,{style:ee.textLabels},"i.System:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OrganSystemconceptUUID&&t.value.name.display+", "})))),o().createElement(A.xv,{style:{paddingBottom:10,paddingLeft:10}},o().createElement(A.xv,{style:ee.textLabels},"ii.Organ:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OrganconceptUUID&&t.value.name.display+", "})))),o().createElement(A.xv,{style:{paddingBottom:10,paddingLeft:10}},o().createElement(A.xv,{style:ee.textLabels},"iii.Detail:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.SpecimenDetailconceptUUID&&t.value})))),o().createElement(A.xv,{style:{paddingBottom:10}},o().createElement(A.xv,{style:ee.textLabels},"Procedure type:"),o().createElement(A.xv,{style:ee.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OtherTestsOrProceduresconceptUUID&&t.value})))),o().createElement(A.xv,{style:[ee.sentenceLabels]},"Gross Description:"),o().createElement(A.xv,{style:[ee.sentenceAnswers]},e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.GrossDescriptionconceptUUID&&t.value}))),o().createElement(A.xv,{style:ee.sentenceLabels},"Microscopic Examination:"),o().createElement(A.xv,{style:ee.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.MacroscopicExaminationconceptUUID&&t.value}))),o().createElement(A.xv,{style:ee.sentenceLabels},"Conclusion:"),o().createElement(A.xv,{style:ee.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID&&t.value}))),o().createElement(A.xv,{style:{paddingBottom:10}},o().createElement(A.xv,{style:ee.textLabels},"Validated by pathologist:"),o().createElement(A.xv,{style:[ee.textAnswers,{fontWeight:"bold"}]}," ",e.encounterInfo.approvedBy)))))};function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function re(){return re=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},re.apply(this,arguments)}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){i=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(i)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ne(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const ae=function(){var e=(0,E.useConfig)(),t=oe(o().useState(),2),n=t[0],r=t[1],a=oe(o().useState([]),2),s=a[0],i=a[1],l=oe(o().useState(""),2),u=l[0],c=l[1],p=oe(o().useState([]),2),d=p[0],m=p[1],f=oe(o().useState([]),2),y=f[0],h=f[1],v=oe(o().useState([]),2),g=v[0],b=v[1],k=oe(o().useState(""),2),B=k[0],P=k[1],L=oe(o().useState(""),2),R=L[0],N=L[1],G=oe(o().useState(""),2),$=G[0],J=G[1];o().useEffect((function(){T(e.healthCenterAttrTypeUUID).then(r),function(){return j.apply(this,arguments)}().then(m),Z(e.sampleStatusConceptUUID).then(h),Z(e.referralStatusConceptUUID).then(b),function(e,t){return W.apply(this,arguments)}(e.healthCenterAttrTypeUUID,e.pathologyFullAllowedLocationUUID).then(i)}),[]);var K=s.filter((function(e){var t;return!B||(null===(t=e.sampleStatusObs)||void 0===t?void 0:t.toLowerCase())==B.toLowerCase()})).filter((function(e){var t;return!R||(null===(t=e.referralStatusObs)||void 0===t?void 0:t.toLowerCase())==R.toLowerCase()})).filter((function(e){var t;return!u||(null===(t=e.patientHealthCenter)||void 0===t?void 0:t.toLowerCase())==u.toLowerCase()})).filter((function(e){if($){var t=$.split(/\s+/),n="".concat(e.family_name," ").concat(e.middle_name," ").concat(e.given_name);return t.every((function(e){return new RegExp("\\b"+e,"i").test(n)}))}return!0})),Q=K.map((function(t){return{id:t.encounterId,patientNames:o().createElement("a",{"data-testid":"patientNames",href:"/openmrs/patientDashboard.form?patientId=".concat(t.personId)},t.family_name," ",t.given_name," ",t.middle_name),pathologyRequest:o().createElement("a",{href:"/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=".concat(t.encounterId,"&mode=VIEW")}," ","Link"," "),sendingHospital:t.patientHealthCenter,phoneNumber:t.patientPhoneNumber||"",sampleStatus:o().createElement("select",{onChange:function(e){return ee({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},t)}},o().createElement("option",{value:""}),y.map((function(e){return o().createElement("option",{"data-testid":"sampleStatus-option",value:e.uuid,key:e.uuid,selected:!!t.sampleStatusObs&&t.sampleStatusObs===e.display&&!0},e.display)}))),dateOfRequest:new Date(t.encounterDatetime).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}),referralStatus:o().createElement("select",{onChange:function(e){return ne({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},t)}},o().createElement("option",{"data-testid":"referralStatus-option",value:""}),g.map((function(e){return o().createElement("option",{value:e.uuid,key:e.uuid,selected:t.referralStatusObs&&t.referralStatusObs===e.display},e.display)}))),sampleDropOff:o().createElement("input",{"data-testid":"sampleDropOff",type:"checkbox",checked:Boolean(t.sampleDropoffObs),onChange:function(e){return Y(t)}}),pathologicDiagnosisObs:t.pathologicDiagnosisObs,resultsEncounter:t.resultsEncounterId?o().createElement("a",{"data-testid":"resultsEncounter",href:"/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=".concat(t.resultsEncounterId,"&mode=VIEW")}," ","Results"," "):(!n||n===e.pathologyFullAllowedLocationUUID)&&o().createElement("a",{href:"/openmrs/module/htmlformentry/htmlFormEntry.form?personId=".concat(t.personId,"&patientId=").concat(t.personId,"&returnUrl=&formId=").concat(e.pathologyResultsFromID,"&uuid=").concat(t.encounterUuid)}," ","Fill in results"," "),PDFReport:t.resultsEncounterId&&t.approvedBy&&o().createElement(A.WD,{document:o().createElement(te,{encounterInfo:t,config:e}),fileName:"Pathology Report"},(function(e){return e.loading?"loading...":o().createElement("button",null,"Download")}))}})),Y=function(t){var n=(0,x.Z)(s);t.sampleDropoffObs?function(e){return H.apply(this,arguments)}(t.sampleDropoffObsUuid).then((function(e){if(e.ok){var r=n.findIndex((function(e){return e.encounterUuid==t.encounterUuid}));n[r].sampleDropoffObs="",n[r].sampleDropoffObsUuid="",i(n)}})):function(e,t,n,r){return z.apply(this,arguments)}(t,e.sampleDropOffconceptUUID,e.healthCenterAttrTypeUUID,e.yesConceptUUID).then((function(r){if(r.ok){var o=n.findIndex((function(e){return e.encounterUuid==t.encounterUuid}));n[o].sampleDropoffObs=e.yesConceptName,n[o].sampleDropoffObsUuid=r.data.uuid,i(n)}}))},ee=function(t,n){var r=(0,x.Z)(s);n.sampleStatusObs?function(e,t,n,r){return q.apply(this,arguments)}(t,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].sampleStatusObs=t.display,r[o].sampleStatusObsUuid=e.data.uuid,i(r)}else i(r)})):function(e,t,n,r){return M.apply(this,arguments)}(t.uuid,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].sampleStatusObs=t.display,r[o].sampleStatusObsUuid=e.data.uuid,i(r)}else i(r)}))},ne=function(t,n){var r=(0,x.Z)(s);n.referralStatusObs?function(e,t,n,r){return X.apply(this,arguments)}(t,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].referralStatusObs=t.display,r[o].referralStatusObsUuid=e.data.uuid,i(r)}else i(r)})):function(e,t,n,r){return V.apply(this,arguments)}(t.uuid,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].referralStatusObs=t.display,r[o].referralStatusObsUuid=e.data.uuid,i(r)}else i(r)}))};return o().createElement("div",null,o().createElement("div",{className:F.filtersContainer},o().createElement("label",{htmlFor:"sending-hospital"},"Sending Hospital "),o().createElement("select",{id:"sending-hospital",className:F.dropdown,value:u,onChange:function(e){return c(e.target.value)}},o().createElement("option",{value:""}),d.map((function(t){return n&&n!==e.pathologyFullAllowedLocationUUID?t.uuid===n?o().createElement("option",{value:t.display,key:t.uuid},t.display):null:o().createElement("option",{value:t.display,key:t.uuid},t.display)}))),o().createElement("label",{htmlFor:"sample-status"},"Sample Status "),o().createElement("select",{id:"sample-status",className:F.dropdown,value:B,onChange:function(e){return P(e.target.value)}},o().createElement("option",{value:""}),y.map((function(e){return o().createElement("option",{value:e.display,key:e.uuid},e.display)}))),o().createElement("label",{htmlFor:"referral-status"},"Referral Status "),o().createElement("select",{id:"referral-status",className:F.dropdown,value:R,onChange:function(e){return N(e.target.value)}},o().createElement("option",{value:""}),g.map((function(e){return o().createElement("option",{value:e.display,key:e.uuid},e.display)}))),o().createElement("label",{htmlFor:"patient-name"},"Patient Name "),o().createElement("input",{id:"patient-name",className:F.textBox,type:"text",onChange:function(e){return J(e.target.value)}})),o().createElement("div",{className:F.tableContainer},o().createElement(w.ZP,{rows:Q,headers:[{key:"patientNames",header:"Patient name"},{key:"pathologyRequest",header:"pathology request"},{key:"sendingHospital",header:"Sending Hospital"},{key:"phoneNumber",header:"Phone number"},{key:"sampleStatus",header:"Sample status"},{key:"dateOfRequest",header:"Date of Request"},{key:"referralStatus",header:"Referral status"},{key:"sampleDropOff",header:"Sample drop off?"},{key:"pathologicDiagnosisObs",header:"Pathologic diagnosis"},{key:"resultsEncounter",header:"Results"},{key:"PDFReport",header:"Report"}]},(function(e){var t=e.rows,n=e.headers,r=e.getHeaderProps,a=e.getTableProps;return o().createElement(_.Z,null,o().createElement(U.Z,re({},a()),o().createElement(S.Z,null,o().createElement(I.Z,null,n.map((function(e){return o().createElement(D.Z,re({},r({header:e})),e.header)})))),o().createElement(O.Z,null,t.map((function(e){return o().createElement(I.Z,{key:e.id},e.cells.map((function(e){return o().createElement(C.Z,{key:e.id},e.value)})))})))))}))),o().createElement("div",null))},se=function(){return o().createElement("div",{className:"omrs-main-content ".concat(b.container)},o().createElement(ae,null))}},633:()=>{}}]);
|
|
1
|
+
(self.webpackChunk_pih_esm_pathology_app=self.webpackChunk_pih_esm_pathology_app||[]).push([[34],{8814:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9601),o=n.n(r),a=n(2609),s=n.n(a)()(o());s.push([e.id,".-esm-pathology__ReportComponent__tableContainer____whij {\n height: 500px;\n overflow-x: auto;\n overflow-y: auto;\n margin: 0 1rem;\n border: 2px solid lightgrey;\n border-radius: 0.25rem;\n}\n\n.-esm-pathology__ReportComponent__filtersContainer___nPCyi {\n border-radius: 0.25rem;\n margin: 0 1rem;\n padding-top: 4%;\n}\n\n.-esm-pathology__ReportComponent__dropdown___D35bi {\n width: 10%;\n height: 2rem;\n background: transparent;\n border: 1px solid var(--omrs-color-ink-lowest-contrast);\n background-clip: padding-box;\n border-radius: 4px;\n margin: 1rem;\n}\n.-esm-pathology__ReportComponent__dropdown___D35bi:disabled {\n opacity: 0.8;\n background: lightgrey;\n cursor: not-allowed;\n}\n.-esm-pathology__ReportComponent__dropdown___D35bi:focus {\n border: 2px solid var(--omrs-color-interaction);\n outline: 0;\n}\n.-esm-pathology__ReportComponent__textBox___gvGk9 {\n background: transparent;\n border: 1px solid var(--omrs-color-ink-lowest-contrast);\n background-clip: padding-box;\n border-radius: 4px;\n margin: 1rem;\n}\n",""]),s.locals={tableContainer:"-esm-pathology__ReportComponent__tableContainer____whij",filtersContainer:"-esm-pathology__ReportComponent__filtersContainer___nPCyi",dropdown:"-esm-pathology__ReportComponent__dropdown___D35bi",textBox:"-esm-pathology__ReportComponent__textBox___gvGk9"};const l=s},3147:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9601),o=n.n(r),a=n(2609),s=n.n(a)()(o());s.push([e.id,".-esm-pathology__pathology__container___cnxz7 {\n padding: 2em;\n}\n",""]),s.locals={container:"-esm-pathology__pathology__container___cnxz7"};const l=s},256:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>oe});var r=n(7900),o=n.n(r),a=n(1354),s=n.n(a),l=n(1583),i=n.n(l),c=n(7378),u=n.n(c),p=n(5993),d=n.n(p),m=n(4154),f=n.n(m),y=n(8141),h=n.n(y),v=n(3147),g={};g.styleTagTransform=h(),g.setAttributes=d(),g.insert=u().bind(null,"head"),g.domAPI=i(),g.insertStyleElement=f(),s()(v.Z,g);const b=v.Z&&v.Z.locals?v.Z.locals:void 0;var E=n(4841),x=n(5919),w=n(3565),_=n(5953),S=n(2473),I=n(9151),U=n(4141),D=n(3236),A=n(910),C=n(8),O=n(9513),B=n(8814),k={};k.styleTagTransform=h(),k.setAttributes=d(),k.insert=u().bind(null,"head"),k.domAPI=i(),k.insertStyleElement=f(),s()(B.Z,k);const P=B.Z&&B.Z.locals?B.Z.locals:void 0;function L(e,t,n,r,o,a,s){try{var l=e[a](s),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,o)}function F(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){L(a,r,o,s,l,"next",e)}function l(e){L(a,r,o,s,l,"throw",e)}s(void 0)}))}}var R=function(e,t){var n,r,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};function T(e){return N.apply(this,arguments)}function N(){return(N=F((function(e){var t,n,r,o;return R(this,(function(a){switch(a.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/session")];case 1:return t=a.sent(),n=t.data.user.person.uuid,[4,(0,E.openmrsFetch)("/ws/rest/v1/person/".concat(n,"/attribute"))];case 2:return r=a.sent(),[2,(o=r.data.results.filter((function(t){return t.attributeType.uuid===e})))[0]&&o[0].value.uuid]}}))}))).apply(this,arguments)}function Z(e){return G.apply(this,arguments)}function G(){return(G=F((function(e){return R(this,(function(t){switch(t.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/concept/".concat(e,"?v=full"))];case 1:return[2,t.sent().data.answers]}}))}))).apply(this,arguments)}function W(){return(W=F((function(){return R(this,(function(e){switch(e.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/location")];case 1:return[2,e.sent().data.results]}}))}))).apply(this,arguments)}function j(){return j=F((function(e,t){var n,r,o;return R(this,(function(a){switch(a.label){case 0:return[4,T(e)];case 1:return n=a.sent(),r=null,n&&n!=t?[4,(0,E.openmrsFetch)("/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0?location=".concat(n))]:[3,3];case 2:return r=a.sent(),[3,5];case 3:return[4,(0,E.openmrsFetch)("/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0")];case 4:r=a.sent(),a.label=5;case 5:return o=r.data.dataSets[0].rows.map((s=F((function(e){var t;return R(this,(function(n){switch(n.label){case 0:return e.resultsEncounterUuid?(r.data.dataSets[0].rows.findIndex((function(t){return t.encounterUuid==e.encounterUuid})),[4,V(e.resultsEncounterUuid)]):[3,2];case 1:t=n.sent(),e.resultsEncounter=t,n.label=2;case 2:return[2,e]}}))})),function(e){return s.apply(this,arguments)})),[2,Promise.all(o)]}var s}))})),j.apply(this,arguments)}function z(){return(z=F((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e,a.voided=!1,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function H(){return(H=F((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e.uuid,a.voided=!e,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs/".concat(t.sampleStatusObsUuid),{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function M(){return(M=F((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e,a.voided=!1,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function q(){return(q=F((function(e,t,n,r){var o,a;return R(this,(function(s){switch(s.label){case 0:return a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n},[4,T(r)];case 1:return a.location=s.sent(),a.encounter=t.encounterUuid,a.value=e.uuid,a.voided=!e,o=a,[4,(0,E.openmrsFetch)("/ws/rest/v1/obs/".concat(t.referralStatusObsUuid),{method:"POST",headers:{"content-type":"application/json"},body:o})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function V(e){return X.apply(this,arguments)}function X(){return(X=F((function(e){return R(this,(function(t){switch(t.label){case 0:return[4,(0,E.openmrsFetch)("/ws/rest/v1/encounter/".concat(e,"?v=full"))];case 1:return[2,t.sent().data]}}))}))).apply(this,arguments)}const $=n.p+"00ebb57bb20c59433e84.gif",J=n.p+"a5fad24f075c978ac04b.ttf",K=n.p+"5b8bb278fcab4da4972e.ttf";O.Zx.register({family:"GeorgiaBold",src:J}),O.Zx.register({family:"Georgia",src:K});var Q=O.mM.create({page:{flexDirection:"row"},section:{margin:10,padding:20,flexGrow:1},textLabels:{padding:7,fontFamily:"GeorgiaBold",fontSize:16,fontWeight:"bold",paddingBottom:30},sentenceLabels:{paddingTop:7,fontFamily:"GeorgiaBold",fontSize:16,fontWeight:"bold",paddingBottom:3},textAnswers:{margin:10,padding:20,fontFamily:"Georgia",fontSize:14},sentenceAnswers:{marginBottom:10,paddingBottom:20,fontFamily:"Georgia",fontSize:14},logo:{width:61}});const Y=function(e){return o().createElement(O.BB,{title:"Pathology report \n ".concat(e.encounterInfo.family_name," \n ").concat(e.encounterInfo.given_name," \n ").concat(e.encounterInfo.middle_name," ")},o().createElement(O.T3,{size:"A4",style:Q.page},o().createElement(O.G7,{style:Q.section},o().createElement(O.Ee,{style:Q.logo,src:$}),o().createElement(O.xv,{style:{fontSize:8}},"Butaro Hospital"),o().createElement(O.xv,{style:{position:"absolute",top:0,left:300,width:300}},o().createElement(O.xv,{style:Q.textAnswers},"Lab phone number:"),o().createElement(O.xv,null," ",e.config.LabPhoneNumber)),o().createElement(O.xv,{style:{position:"absolute",top:15,left:300,width:300}},o().createElement(O.xv,{style:Q.textAnswers},"Accession number:"),o().createElement(O.xv,null," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.AccessionNumberconceptUUID&&t.value})))),o().createElement(O.xv,{style:{borderBottom:"1px",textAlign:"center",fontWeight:1500,marginBottom:30,fontFamily:"GeorgiaBold"}},"Pathology Report"),o().createElement(O.xv,{style:{paddingBottom:10}},o().createElement(O.xv,{style:Q.textAnswers},"Patient Name:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.family_name," ",e.encounterInfo.given_name," ",e.encounterInfo.middle_name)),o().createElement(O.xv,{style:{paddingBottom:10,position:"absolute",top:140,left:335}},o().createElement(O.xv,{style:Q.textAnswers},"Surgery Date:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.DateBiopsySpecimenTakenconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"})})))),o().createElement(O.xv,{style:{paddingBottom:10}},o().createElement(O.xv,{style:Q.textAnswers},"Primary care ID :"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.IMBPrimaryCare)),o().createElement(O.xv,{style:{paddingBottom:10}},o().createElement(O.xv,{style:Q.textAnswers},"Patient Birthdate:"),o().createElement(O.xv,{style:Q.textAnswers}," ",new Date(e.encounterInfo.personBirthdate).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),o().createElement(O.xv,{style:{paddingBottom:10,position:"absolute",top:168,left:335,width:200}},o().createElement(O.xv,{style:Q.textAnswers},"Specimen Reception Date:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.SpecimenSubmissionDateconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"})})))),o().createElement(O.xv,{style:{paddingBottom:10,borderBottom:"1px"}},o().createElement(O.xv,{style:Q.textAnswers},"Patient Gender:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.personGender)),o().createElement(O.xv,{style:{paddingBottom:10,position:"absolute",top:200,left:335,width:250}},o().createElement(O.xv,{style:Q.textAnswers},"Signout Date:"),o().createElement(O.xv,{style:Q.textAnswers}," ",new Date(e.encounterInfo.approvedDate).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),o().createElement(O.xv,{style:{paddingBottom:10}},o().createElement(O.xv,{style:Q.textLabels},"Sending Physician:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.SendingPhysicianconceptUUID&&t.value})))),o().createElement(O.xv,{style:{paddingBottom:10}},o().createElement(O.xv,{style:Q.textLabels},"Sending Facility:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OtherBiopsyLocationconceptUUID&&t.value})))),o().createElement(O.xv,{style:{paddingBottom:10,fontFamily:"Georgia"}},"Anatomical location:"),o().createElement(O.xv,{style:{paddingBottom:10,paddingLeft:10}},o().createElement(O.xv,{style:Q.textLabels},"i.System:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OrganSystemconceptUUID&&t.value.name.display+", "})))),o().createElement(O.xv,{style:{paddingBottom:10,paddingLeft:10}},o().createElement(O.xv,{style:Q.textLabels},"ii.Organ:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OrganconceptUUID&&t.value.name.display+", "})))),o().createElement(O.xv,{style:{paddingBottom:10,paddingLeft:10}},o().createElement(O.xv,{style:Q.textLabels},"iii.Detail:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.SpecimenDetailconceptUUID&&t.value})))),o().createElement(O.xv,{style:{paddingBottom:10}},o().createElement(O.xv,{style:Q.textLabels},"Procedure type:"),o().createElement(O.xv,{style:Q.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.OtherTestsOrProceduresconceptUUID&&t.value})))),o().createElement(O.xv,{style:[Q.sentenceLabels]},"Gross Description:"),o().createElement(O.xv,{style:[Q.sentenceAnswers]},e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.GrossDescriptionconceptUUID&&t.value}))),o().createElement(O.xv,{style:Q.sentenceLabels},"Microscopic Examination:"),o().createElement(O.xv,{style:Q.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.MacroscopicExaminationconceptUUID&&t.value}))),o().createElement(O.xv,{style:Q.sentenceLabels},"Conclusion:"),o().createElement(O.xv,{style:Q.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((function(t){return t.concept.uuid==e.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID&&t.value}))),o().createElement(O.xv,{style:{paddingBottom:10}},o().createElement(O.xv,{style:Q.textLabels},"Validated by pathologist:"),o().createElement(O.xv,{style:[Q.textAnswers,{fontWeight:"bold"}]}," ",e.encounterInfo.approvedBy)))))};function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function te(){return te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te.apply(this,arguments)}function ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],s=!0,l=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(l)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ee(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const re=function(){var e=(0,E.useConfig)(),t=ne(o().useState(),2),n=t[0],r=t[1],a=ne(o().useState([]),2),s=a[0],l=a[1],i=ne(o().useState(""),2),c=i[0],u=i[1],p=ne(o().useState([]),2),d=p[0],m=p[1],f=ne(o().useState([]),2),y=f[0],h=f[1],v=ne(o().useState([]),2),g=v[0],b=v[1],B=ne(o().useState(""),2),k=B[0],L=B[1],F=ne(o().useState(""),2),R=F[0],N=F[1],G=ne(o().useState(""),2),V=G[0],X=G[1];o().useEffect((function(){T(e.healthCenterAttrTypeUUID).then(r),function(){return W.apply(this,arguments)}().then(m),Z(e.sampleStatusConceptUUID).then(h),Z(e.referralStatusConceptUUID).then(b),function(e,t){return j.apply(this,arguments)}(e.healthCenterAttrTypeUUID,e.pathologyFullAllowedLocationUUID).then(l)}),[]);var $=s.filter((function(e){var t;return!k||(null===(t=e.sampleStatusObs)||void 0===t?void 0:t.toLowerCase())==k.toLowerCase()})).filter((function(e){var t;return!R||(null===(t=e.referralStatusObs)||void 0===t?void 0:t.toLowerCase())==R.toLowerCase()})).filter((function(e){var t;return!c||(null===(t=e.patientHealthCenter)||void 0===t?void 0:t.toLowerCase())==c.toLowerCase()})).filter((function(e){if(V){var t=V.split(/\s+/),n="".concat(e.family_name," ").concat(e.middle_name," ").concat(e.given_name);return t.every((function(e){return new RegExp("\\b"+e,"i").test(n)}))}return!0})),J=$.map((function(t){return{id:t.encounterId,patientNames:o().createElement("a",{"data-testid":"patientNames",href:"/openmrs/patientDashboard.form?patientId=".concat(t.personId)},t.family_name," ",t.given_name," ",t.middle_name),pathologyRequest:o().createElement("a",{href:"/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=".concat(t.encounterId,"&mode=VIEW")}," ","Link"," "),sendingHospital:t.patientHealthCenter,phoneNumber:t.patientPhoneNumber||"",sampleStatus:o().createElement("select",{onChange:function(e){return K({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},t)}},o().createElement("option",{value:""}),y.map((function(e){return o().createElement("option",{"data-testid":"sampleStatus-option",value:e.uuid,key:e.uuid,selected:!!t.sampleStatusObs&&t.sampleStatusObs===e.display&&!0},e.display)}))),dateOfRequest:new Date(t.encounterDatetime).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}),referralStatus:o().createElement("select",{onChange:function(e){return Q({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},t)}},o().createElement("option",{"data-testid":"referralStatus-option",value:""}),g.map((function(e){return o().createElement("option",{value:e.uuid,key:e.uuid,selected:t.referralStatusObs&&t.referralStatusObs===e.display},e.display)}))),pathologicDiagnosisObs:t.pathologicDiagnosisObs,resultsEncounter:t.resultsEncounterId?o().createElement("a",{"data-testid":"resultsEncounter",href:"/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=".concat(t.resultsEncounterId,"&mode=VIEW")}," ","Results"," "):(!n||n===e.pathologyFullAllowedLocationUUID)&&o().createElement("a",{href:"/openmrs/module/htmlformentry/htmlFormEntry.form?personId=".concat(t.personId,"&patientId=").concat(t.personId,"&returnUrl=&formId=").concat(e.pathologyResultsFromID,"&uuid=").concat(t.encounterUuid)}," ","Fill in results"," "),PDFReport:t.resultsEncounterId&&t.approvedBy&&o().createElement(O.WD,{document:o().createElement(Y,{encounterInfo:t,config:e}),fileName:"Pathology Report"},(function(e){return e.loading?"loading...":o().createElement("button",null,"Download")}))}})),K=function(t,n){var r=(0,x.Z)(s);n.sampleStatusObs?function(e,t,n,r){return H.apply(this,arguments)}(t,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].sampleStatusObs=t.display,r[o].sampleStatusObsUuid=e.data.uuid,l(r)}else l(r)})):function(e,t,n,r){return z.apply(this,arguments)}(t.uuid,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].sampleStatusObs=t.display,r[o].sampleStatusObsUuid=e.data.uuid,l(r)}else l(r)}))},Q=function(t,n){var r=(0,x.Z)(s);n.referralStatusObs?function(e,t,n,r){return q.apply(this,arguments)}(t,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].referralStatusObs=t.display,r[o].referralStatusObsUuid=e.data.uuid,l(r)}else l(r)})):function(e,t,n,r){return M.apply(this,arguments)}(t.uuid,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((function(e){if(e.ok){var o=r.findIndex((function(e){return e.encounterUuid==n.encounterUuid}));r[o].referralStatusObs=t.display,r[o].referralStatusObsUuid=e.data.uuid,l(r)}else l(r)}))};return o().createElement("div",null,o().createElement("div",{className:P.filtersContainer},o().createElement("label",{htmlFor:"sending-hospital"},"Sending Hospital "),o().createElement("select",{id:"sending-hospital",className:P.dropdown,value:c,onChange:function(e){return u(e.target.value)}},o().createElement("option",{value:""}),d.map((function(t){return n&&n!==e.pathologyFullAllowedLocationUUID?t.uuid===n?o().createElement("option",{value:t.display,key:t.uuid},t.display):null:o().createElement("option",{value:t.display,key:t.uuid},t.display)}))),o().createElement("label",{htmlFor:"sample-status"},"Sample Status "),o().createElement("select",{id:"sample-status",className:P.dropdown,value:k,onChange:function(e){return L(e.target.value)}},o().createElement("option",{value:""}),y.map((function(e){return o().createElement("option",{value:e.display,key:e.uuid},e.display)}))),o().createElement("label",{htmlFor:"referral-status"},"Plan Status "),o().createElement("select",{id:"referral-status",className:P.dropdown,value:R,onChange:function(e){return N(e.target.value)}},o().createElement("option",{value:""}),g.map((function(e){return o().createElement("option",{value:e.display,key:e.uuid},e.display)}))),o().createElement("label",{htmlFor:"patient-name"},"Patient Name "),o().createElement("input",{id:"patient-name",className:P.textBox,type:"text",onChange:function(e){return X(e.target.value)}})),o().createElement("div",{className:P.tableContainer},o().createElement(w.ZP,{rows:J,headers:[{key:"patientNames",header:"Patient name"},{key:"pathologyRequest",header:"pathology request"},{key:"sendingHospital",header:"Sending Hospital"},{key:"phoneNumber",header:"Phone number"},{key:"sampleStatus",header:"Sample status"},{key:"dateOfRequest",header:"Date of Request"},{key:"referralStatus",header:"Plan status"},{key:"pathologicDiagnosisObs",header:"Pathologic diagnosis"},{key:"resultsEncounter",header:"Results"},{key:"PDFReport",header:"Report"}]},(function(e){var t=e.rows,n=e.headers,r=e.getHeaderProps,a=e.getTableProps;return o().createElement(_.Z,null,o().createElement(S.Z,te({},a()),o().createElement(I.Z,null,o().createElement(U.Z,null,n.map((function(e){return o().createElement(D.Z,te({},r({header:e})),e.header)})))),o().createElement(A.Z,null,t.map((function(e){return o().createElement(U.Z,{key:e.id},e.cells.map((function(e){return o().createElement(C.Z,{key:e.id},e.value)})))})))))}))),o().createElement("div",null))},oe=function(){return o().createElement("div",{className:"omrs-main-content ".concat(b.container)},o().createElement(re,null))}},633:()=>{}}]);
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"initial": false,
|
|
6
6
|
"entry": false,
|
|
7
7
|
"recorded": false,
|
|
8
|
-
"size":
|
|
8
|
+
"size": 275466,
|
|
9
9
|
"sizes": {
|
|
10
|
-
"javascript":
|
|
10
|
+
"javascript": 59230,
|
|
11
11
|
"asset": 216194,
|
|
12
12
|
"consume-shared": 42
|
|
13
13
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"5b8bb278fcab4da4972e.ttf",
|
|
26
26
|
"a5fad24f075c978ac04b.ttf"
|
|
27
27
|
],
|
|
28
|
-
"hash": "
|
|
28
|
+
"hash": "db815a408f704eb43c04",
|
|
29
29
|
"childrenByOrder": {}
|
|
30
30
|
},
|
|
31
31
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pih/esm-pathology-app",
|
|
3
|
-
"version": "1.1.1-pre.
|
|
3
|
+
"version": "1.1.1-pre.29",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "A pathology app for IMB OpenMRS",
|
|
6
6
|
"browser": "dist/pih-esm-pathology-app.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"css-loader": "^6.7.1"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "21b7dd2c6f49f6b28ff3bf681736a63fadc4e0e1"
|
|
67
67
|
}
|
|
@@ -5,6 +5,7 @@ export interface EncounterResult {
|
|
|
5
5
|
family_name: string;
|
|
6
6
|
given_name: string;
|
|
7
7
|
middle_name: string;
|
|
8
|
+
IMBPrimaryCare: string;
|
|
8
9
|
patientPhoneNumber: { value: string };
|
|
9
10
|
patientHealthCenter: string;
|
|
10
11
|
patientUuid: string;
|
|
@@ -19,6 +20,7 @@ export interface EncounterResult {
|
|
|
19
20
|
resultsEncounterUuid: string;
|
|
20
21
|
resultsEncounter: [];
|
|
21
22
|
approvedBy: string;
|
|
23
|
+
approvedDate: Date;
|
|
22
24
|
approvalObsUuid: string;
|
|
23
25
|
pathologicDiagnosisObs: string;
|
|
24
26
|
}
|
|
@@ -124,6 +124,13 @@ const MyDocument = (props) => (
|
|
|
124
124
|
)}
|
|
125
125
|
</Text>
|
|
126
126
|
</Text>
|
|
127
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
128
|
+
<Text style={styles.textAnswers}>Primary care ID :</Text>
|
|
129
|
+
<Text style={styles.textAnswers}>
|
|
130
|
+
{" "}
|
|
131
|
+
{props.encounterInfo.IMBPrimaryCare}
|
|
132
|
+
</Text>
|
|
133
|
+
</Text>
|
|
127
134
|
<Text style={{ paddingBottom: 10 }}>
|
|
128
135
|
<Text style={styles.textAnswers}>Patient Birthdate:</Text>
|
|
129
136
|
<Text style={styles.textAnswers}>
|
|
@@ -176,13 +183,14 @@ const MyDocument = (props) => (
|
|
|
176
183
|
<Text style={styles.textAnswers}>Signout Date:</Text>
|
|
177
184
|
<Text style={styles.textAnswers}>
|
|
178
185
|
{" "}
|
|
179
|
-
{new Date(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
{new Date(props.encounterInfo.approvedDate).toLocaleString(
|
|
187
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
188
|
+
{
|
|
189
|
+
day: "numeric",
|
|
190
|
+
month: "numeric",
|
|
191
|
+
year: "numeric",
|
|
192
|
+
}
|
|
193
|
+
)}
|
|
186
194
|
</Text>
|
|
187
195
|
</Text>
|
|
188
196
|
|
|
@@ -76,12 +76,12 @@ const ReportComponent = () => {
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
key: "referralStatus",
|
|
79
|
-
header: "
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
key: "sampleDropOff",
|
|
83
|
-
header: "Sample drop off?",
|
|
79
|
+
header: "Plan status",
|
|
84
80
|
},
|
|
81
|
+
// {
|
|
82
|
+
// key: "sampleDropOff",
|
|
83
|
+
// header: "Sample drop off?",
|
|
84
|
+
// },
|
|
85
85
|
{
|
|
86
86
|
key: "pathologicDiagnosisObs",
|
|
87
87
|
header: "Pathologic diagnosis",
|
|
@@ -228,14 +228,14 @@ const ReportComponent = () => {
|
|
|
228
228
|
))}
|
|
229
229
|
</select>
|
|
230
230
|
),
|
|
231
|
-
sampleDropOff: (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
),
|
|
231
|
+
// sampleDropOff: (
|
|
232
|
+
// <input
|
|
233
|
+
// data-testid="sampleDropOff"
|
|
234
|
+
// type="checkbox"
|
|
235
|
+
// checked={Boolean(encounterInfo.sampleDropoffObs)}
|
|
236
|
+
// onChange={(e) => sampleDropOffChange(encounterInfo)}
|
|
237
|
+
// />
|
|
238
|
+
// ),
|
|
239
239
|
pathologicDiagnosisObs: encounterInfo.pathologicDiagnosisObs,
|
|
240
240
|
resultsEncounter: encounterInfo.resultsEncounterId ? (
|
|
241
241
|
<a
|
|
@@ -434,7 +434,7 @@ const ReportComponent = () => {
|
|
|
434
434
|
</option>
|
|
435
435
|
))}
|
|
436
436
|
</select>
|
|
437
|
-
<label htmlFor="referral-status">
|
|
437
|
+
<label htmlFor="referral-status">Plan Status </label>
|
|
438
438
|
<select
|
|
439
439
|
id="referral-status"
|
|
440
440
|
className={styles.dropdown}
|