@pih/esm-pathology-app 1.0.4 → 1.0.7
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/dist/861.js +1 -1
- package/dist/861.js.map +1 -1
- package/dist/pih-esm-pathology-app.js.buildmanifest.json +3 -3
- package/package.json +2 -2
- package/src/Print-to-PDF/Document-Component.tsx +204 -164
- package/src/pathology-report/ReportComponent.resource.ts +1 -1
- package/src/pathology-report/ReportComponent.tsx +20 -34
package/dist/861.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(self.webpackChunk_pih_esm_pathology_app=self.webpackChunk_pih_esm_pathology_app||[]).push([[861],{64132:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>G});var o=n(80150),a=n.n(o),r=n(93379),s=n.n(r),l=n(7795),i=n.n(l),c=n(90569),u=n.n(c),d=n(3565),p=n.n(d),m=n(19216),y=n.n(m),g=n(44589),E=n.n(g),f=n(56724),h={};h.styleTagTransform=E(),h.setAttributes=p(),h.insert=u().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=y(),s()(f.Z,h);const b=f.Z&&f.Z.locals?f.Z.locals:void 0;var A=n(91208),v=n(6311),x=n(89707),w=n(78529),C=n(78722),U=n(99758),_=n(19586),S=n(7450),I=n(67188),D=n(8601),B=n(74017),k={};k.styleTagTransform=E(),k.setAttributes=p(),k.insert=u().bind(null,"head"),k.domAPI=i(),k.insertStyleElement=y(),s()(B.Z,k);const O=B.Z&&B.Z.locals?B.Z.locals:void 0;async function F(e){const t=(await(0,A.openmrsFetch)("/ws/rest/v1/session")).data.user.person.uuid,n=(await(0,A.openmrsFetch)(`/ws/rest/v1/person/${t}/attribute`)).data.results.filter((t=>t.attributeType.uuid===e));return n[0]&&n.value.uuid}async function L(e){return(await(0,A.openmrsFetch)(`/ws/rest/v1/concept/${e}?v=full`)).data.answers}var R=n(28251),P=n(21016),T=n(97819);D.Zx.register({family:"GeorgiaBold",src:P}),D.Zx.register({family:"Georgia",src:T});const Z=D.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}}),N=e=>a().createElement(D.BB,{title:`Pathology report \n ${e.encounterInfo.family_name} \n ${e.encounterInfo.given_name} \n ${e.encounterInfo.middle_name} `},a().createElement(D.T3,{size:"A4",style:Z.page},a().createElement(D.G7,{style:Z.section},a().createElement(D.Ee,{style:Z.logo,src:R}),a().createElement(D.xv,{style:{fontSize:8}},"Butaro Hospital"),a().createElement(D.xv,{style:{position:"absolute",top:0,left:300,width:300}},a().createElement(D.xv,{style:Z.textAnswers},"Lab phone number:"),a().createElement(D.xv,null," "," ","0784433618")),a().createElement(D.xv,{style:{position:"absolute",top:15,left:300,width:300}},a().createElement(D.xv,{style:Z.textAnswers},"Accession number:"),a().createElement(D.xv,null," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.AccessionNumberconceptUUID&&t.value)))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",borderBottom:"1px",textAlign:"center",fontWeight:1500,marginBottom:30,fontFamily:"GeorgiaBold"}},"Pathology Report"),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textAnswers},"Patient Name:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.family_name," "," ",e.encounterInfo.given_name," "," ",e.encounterInfo.middle_name)),a().createElement(D.xv,{style:{paddingBottom:10,position:"absolute",top:140,left:335}},a().createElement(D.xv,{style:Z.textAnswers},"Surgery Date:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.DateBiopsySpecimenTakenconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))))),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textAnswers},"Patient Birthday:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",new Date(e.encounterInfo.personBirthdate).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),a().createElement(D.xv,{style:{paddingBottom:10,position:"absolute",top:168,left:335,width:200}},a().createElement(D.xv,{style:Z.textAnswers},"Specimen Reception Date:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.SpecimenSubmissionDateconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))))),a().createElement(D.xv,{style:{paddingBottom:10,borderBottom:"1px"}},a().createElement(D.xv,{style:Z.textAnswers},"Patient Gender:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.personGender)),a().createElement(D.xv,{style:{paddingBottom:10,position:"absolute",top:200,left:335,width:250}},a().createElement(D.xv,{style:Z.textAnswers},"Signout Date:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",new Date(e.encounterInfo.resultsEncounter.encounterDatetime).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Sending Physician:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.SendingPhysicianconceptUUID&&t.value)))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Sending Facility:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OtherBiopsyLocationconceptUUID&&t.value)))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10,fontFamily:"Georgia"}},"Anatomical location:"),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10,paddingLeft:10}},a().createElement(D.xv,{style:Z.textLabels},"i.System:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OrganSystemconceptUUID&&t.value.name.display+", ")))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10,paddingLeft:10}},a().createElement(D.xv,{style:Z.textLabels},"ii.Organ:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OrganconceptUUID&&t.value.name.display+", ")))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10,paddingLeft:10}},a().createElement(D.xv,{style:Z.textLabels},"iii.Detail:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.SpecimenDetailconceptUUID&&t.value)))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Procedure type:"),a().createElement(D.xv,{style:Z.textAnswers}," "," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OtherTestsOrProceduresconceptUUID&&t.value)))),a().createElement(D.xv,{style:[Z.sentenceLabels]},"Gross Description:"),a().createElement(D.xv,{style:[Z.sentenceAnswers]},e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.GrossDescriptionconceptUUID&&t.value))),a().createElement(D.xv,{style:Z.sentenceLabels},"Microscopic Examination:"),a().createElement(D.xv,{style:Z.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.MacroscopicExaminationconceptUUID&&t.value))),a().createElement(D.xv,{style:Z.sentenceLabels},"Conclusion:"),a().createElement(D.xv,{style:Z.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID&&t.value))),a().createElement(D.xv,{style:{backgroundColor:"#E4E4E4",paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Validated by pathologist:"),a().createElement(D.xv,{style:[Z.textAnswers,{fontWeight:"bold"}]}," "," ",e.encounterInfo.approvedBy))))),$=()=>{const e=(0,A.useConfig)(),[t,n]=a().useState(),[o,r]=a().useState([]),[s,l]=a().useState(""),[i,c]=a().useState([]),[u,d]=a().useState([]),[p,m]=a().useState([]),[y,g]=a().useState(""),[E,f]=a().useState(""),[h,b]=a().useState("");a().useEffect((()=>{F(e.healthCenterAttrTypeUUID).then(n),async function(){return(await(0,A.openmrsFetch)("/ws/rest/v1/location")).data.results}().then(c),L(e.sampleStatusConceptUUID).then(d),L(e.referralStatusConceptUUID).then(m),async function(e,t){const n=await F(e);let o=null;o=n&&n!=t?await(0,A.openmrsFetch)(`/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0?location=${n}`):await(0,A.openmrsFetch)("/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0");const a=o.data.dataSets[0].rows.map((async e=>{if(e.resultsEncounterUuid){o.data.dataSets[0].rows.findIndex((t=>t.encounterUuid==e.encounterUuid));const t=await async function(e){return(await(0,A.openmrsFetch)(`/ws/rest/v1/encounter/${e}?v=full`)).data}(e.resultsEncounterUuid);e.resultsEncounter=t}return e}));return Promise.all(a)}(e.healthCenterAttrTypeUUID,e.pathologyFullAllowedLocationUUID).then(r)}),[]);const B=o.filter((e=>!y||e.sampleStatusObs?.toLowerCase()==y.toLowerCase())).filter((e=>!E||e.referralStatusObs?.toLowerCase()==E.toLowerCase())).filter((e=>!s||e.patientHealthCenter?.toLowerCase()==s.toLowerCase())).filter((e=>{if(h){const t=h.split(/\s+/),n=`${e.family_name} ${e.middle_name} ${e.given_name}`;return t.every((e=>new RegExp("\\b"+e,"i").test(n)))}return!0})).map((n=>({id:n.encounterId,patientNames:a().createElement("a",{"data-testid":"patientNames",href:`/openmrs/patientDashboard.form?patientId=${n.personId}`},n.family_name," ",n.given_name," ",n.middle_name),pathologyRequest:a().createElement("a",{href:`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${n.encounterId}&mode=VIEW`}," ","Link"," "),sendingHospital:n.patientHealthCenter,phoneNumber:n.patientPhoneNumber||"",sampleStatus:a().createElement("select",{onChange:e=>R({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},n)},a().createElement("option",{value:""}),u.map((e=>a().createElement("option",{"data-testid":"sampleStatus-option",value:e.uuid,key:e.uuid,selected:!!n.sampleStatusObs&&n.sampleStatusObs===e.display&&!0},e.display)))),dateOfRequest:new Date(n.encounterDatetime).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}),referralStatus:a().createElement("select",{onChange:e=>P({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},n)},a().createElement("option",{"data-testid":"referralStatus-option",value:""}),p.map((e=>a().createElement("option",{value:e.uuid,key:e.uuid,selected:n.referralStatusObs&&n.referralStatusObs===e.display},e.display)))),sampleDropOff:a().createElement("input",{"data-testid":"sampleDropOff",type:"checkbox",checked:Boolean(n.sampleDropoffObs),onChange:e=>k(n)}),pathologicDiagnosisObs:n.pathologicDiagnosisObs,resultsEncounter:n.resultsEncounterId?a().createElement("a",{"data-testid":"resultsEncounter",href:`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${n.resultsEncounterId}&mode=VIEW`}," ","Results"," "):(!t||t===e.pathologyFullAllowedLocationUUID)&&a().createElement("a",{href:`/openmrs/module/htmlformentry/htmlFormEntry.form?personId=${n.personId}&patientId=${n.personId}&returnUrl=&formId=${e.pathologyResultsFromID}&uuid=${n.encounterUuid}`}," ","Fill in results"," "),PDFReport:n.resultsEncounterId&&n.approvedBy&&a().createElement(D.WD,{document:a().createElement(N,{encounterInfo:n,config:e}),fileName:"Pathology Report"},(e=>{let{loading:t}=e;return t?"loading...":a().createElement("button",null,"Download")}))}))),k=t=>{const n=(0,v.Z)(o);t.sampleDropoffObs?async function(e){return await(0,A.openmrsFetch)(`/ws/rest/v1/obs/${e}`,{method:"POST",headers:{"content-type":"application/json"},body:{voided:!0}})}(t.sampleDropoffObsUuid).then((e=>{if(e.ok){const e=n.findIndex((e=>e.encounterUuid==t.encounterUuid));n[e].sampleDropoffObs="",n[e].sampleDropoffObsUuid="",r(n)}})):async function(e,t,n,o){const a={person:e.patientUuid,obsDatetime:(new Date).toISOString(),concept:t,location:await F(n),encounter:e.encounterUuid,value:o,voided:!1};return await(0,A.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:a})}(t,e.sampleDropOffconceptUUID,e.healthCenterAttrTypeUUID,e.yesConceptUUID).then((o=>{if(o.ok){const a=n.findIndex((e=>e.encounterUuid==t.encounterUuid));n[a].sampleDropoffObs=e.yesConceptName,n[a].sampleDropoffObsUuid=o.data.uuid,r(n)}}))},R=(t,n)=>{const a=(0,v.Z)(o);n.sampleStatusObs?async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e.uuid,voided:!e};return await(0,A.openmrsFetch)(`/ws/rest/v1/obs/${t.sampleStatusObsUuid}`,{method:"POST",headers:{"content-type":"application/json"},body:a})}(t,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].sampleStatusObs=t.display,a[o].sampleStatusObsUuid=e.data.uuid,r(a)}else r(a)})):async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e,voided:!1};return await(0,A.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:a})}(t.uuid,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].sampleStatusObs=t.display,a[o].sampleStatusObsUuid=e.data.uuid,r(a)}else r(a)}))},P=(t,n)=>{const a=(0,v.Z)(o);n.referralStatusObs?async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e.uuid,voided:!e};return await(0,A.openmrsFetch)(`/ws/rest/v1/obs/${t.referralStatusObsUuid}`,{method:"POST",headers:{"content-type":"application/json"},body:a})}(t,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].referralStatusObs=t.display,a[o].referralStatusObsUuid=e.data.uuid,r(a)}else r(a)})):async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e,voided:!1};return await(0,A.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:a})}(t.uuid,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].referralStatusObs=t.display,a[o].referralStatusObsUuid=e.data.uuid,r(a)}else r(a)}))};return a().createElement("div",null,a().createElement("div",{className:O.filtersContainer},a().createElement("label",{htmlFor:"sending-hospital"},"Sending Hospital "),a().createElement("select",{id:"sending-hospital",className:O.dropdown,value:s,onChange:e=>l(e.target.value)},a().createElement("option",{value:""}),i.map((n=>t&&t!==e.pathologyFullAllowedLocationUUID?n.uuid===t?a().createElement("option",{value:n.display,key:n.uuid},n.display):null:a().createElement("option",{value:n.display,key:n.uuid},n.display)))),a().createElement("label",{htmlFor:"sample-status"},"Sample Status "),a().createElement("select",{id:"sample-status",className:O.dropdown,value:y,onChange:e=>g(e.target.value)},a().createElement("option",{value:""}),u.map((e=>a().createElement("option",{value:e.display,key:e.uuid},e.display)))),a().createElement("label",{htmlFor:"referral-status"},"Referral Status "),a().createElement("select",{id:"referral-status",className:O.dropdown,value:E,onChange:e=>f(e.target.value)},a().createElement("option",{value:""}),p.map((e=>a().createElement("option",{value:e.display,key:e.uuid},e.display)))),a().createElement("label",{htmlFor:"patient-name"},"Patient Name "),a().createElement("input",{id:"patient-name",className:O.textBox,type:"text",onChange:e=>b(e.target.value)})),console.log(o),a().createElement("div",{className:O.tableContainer},a().createElement(x.ZP,{rows:B,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"}]},(e=>{let{rows:t,headers:n,getTableProps:o,getHeaderProps:r,getRowProps:s}=e;return a().createElement(w.Z,o(),a().createElement(C.Z,null,a().createElement(U.Z,null,n.map((e=>a().createElement(_.Z,r({header:e}),e.header))))),a().createElement(S.Z,null,t.map((e=>a().createElement(U.Z,s({row:e}),e.cells.map((e=>a().createElement(I.Z,{key:e.id},e.value))))))))}))),a().createElement("div",null))},G=()=>a().createElement("div",{className:`omrs-main-content ${b.container}`},a().createElement($,null))},74017:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(94015),a=n.n(o),r=n(23645),s=n.n(r)()(a());s.push([e.id,".-esm-pathology__ReportComponent__tableContainer___uOmmk {\n height: 500px;\n overflow-x: auto;\n margin: 0 1rem;\n border: 2px solid lightgrey;\n border-radius: 0.25rem;\n}\n\n.-esm-pathology__ReportComponent__filtersContainer___avnpi {\n border-radius: 0.25rem;\n margin: 0 1rem;\n padding-top: 4%;\n}\n\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe {\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___Lr3Fe:disabled {\n opacity: 0.8;\n background: lightgrey;\n cursor: not-allowed;\n}\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe:focus {\n border: 2px solid var(--omrs-color-interaction);\n outline: 0;\n}\n.-esm-pathology__ReportComponent__textBox___-gvpP {\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","",{version:3,sources:["webpack://./src/pathology-report/ReportComponent.css"],names:[],mappings:"AAAA;EACE,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,2BAA2B;EAC3B,sBAAsB;AACxB;;AAEA;EACE,sBAAsB;EACtB,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,YAAY;EACZ,qBAAqB;EACrB,mBAAmB;AACrB;AACA;EACE,+CAA+C;EAC/C,UAAU;AACZ;AACA;EACE,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd",sourcesContent:[".tableContainer {\n height: 500px;\n overflow-x: auto;\n margin: 0 1rem;\n border: 2px solid lightgrey;\n border-radius: 0.25rem;\n}\n\n.filtersContainer {\n border-radius: 0.25rem;\n margin: 0 1rem;\n padding-top: 4%;\n}\n\n.dropdown {\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.dropdown:disabled {\n opacity: 0.8;\n background: lightgrey;\n cursor: not-allowed;\n}\n.dropdown:focus {\n border: 2px solid var(--omrs-color-interaction);\n outline: 0;\n}\n.textBox {\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"],sourceRoot:""}]),s.locals={tableContainer:"-esm-pathology__ReportComponent__tableContainer___uOmmk",filtersContainer:"-esm-pathology__ReportComponent__filtersContainer___avnpi",dropdown:"-esm-pathology__ReportComponent__dropdown___Lr3Fe",textBox:"-esm-pathology__ReportComponent__textBox___-gvpP"};const l=s},56724:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(94015),a=n.n(o),r=n(23645),s=n.n(r)()(a());s.push([e.id,".-esm-pathology__pathology__container___ny2VS {\n padding: 2em;\n}\n","",{version:3,sources:["webpack://./src/pathology.css"],names:[],mappings:"AAAA;EACE,YAAY;AACd",sourcesContent:[".container {\n padding: 2em;\n}\n"],sourceRoot:""}]),s.locals={container:"-esm-pathology__pathology__container___ny2VS"};const l=s},97819:(e,t,n)=>{"use strict";e.exports=n.p+"5b8bb278fcab4da4972e.ttf"},21016:(e,t,n)=>{"use strict";e.exports=n.p+"a5fad24f075c978ac04b.ttf"},28251:(e,t,n)=>{"use strict";e.exports=n.p+"00ebb57bb20c59433e84.gif"},42480:()=>{},19527:()=>{},69331:()=>{},52361:()=>{},94616:()=>{}}]);
|
|
1
|
+
(self.webpackChunk_pih_esm_pathology_app=self.webpackChunk_pih_esm_pathology_app||[]).push([[861],{64132:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>G});var o=n(80150),a=n.n(o),r=n(93379),s=n.n(r),l=n(7795),i=n.n(l),c=n(90569),u=n.n(c),d=n(3565),p=n.n(d),m=n(19216),y=n.n(m),g=n(44589),f=n.n(g),h=n(56724),E={};E.styleTagTransform=f(),E.setAttributes=p(),E.insert=u().bind(null,"head"),E.domAPI=i(),E.insertStyleElement=y(),s()(h.Z,E);const A=h.Z&&h.Z.locals?h.Z.locals:void 0;var b=n(91208),v=n(6311),x=n(89707),w=n(78529),U=n(78722),_=n(99758),C=n(19586),S=n(7450),I=n(67188),D=n(8601),B=n(74017),O={};O.styleTagTransform=f(),O.setAttributes=p(),O.insert=u().bind(null,"head"),O.domAPI=i(),O.insertStyleElement=y(),s()(B.Z,O);const k=B.Z&&B.Z.locals?B.Z.locals:void 0;async function F(e){const t=(await(0,b.openmrsFetch)("/ws/rest/v1/session")).data.user.person.uuid,n=(await(0,b.openmrsFetch)(`/ws/rest/v1/person/${t}/attribute`)).data.results.filter((t=>t.attributeType.uuid===e));return n[0]&&n[0].value.uuid}async function L(e){return(await(0,b.openmrsFetch)(`/ws/rest/v1/concept/${e}?v=full`)).data.answers}var R=n(28251),P=n(21016),T=n(97819);D.Zx.register({family:"GeorgiaBold",src:P}),D.Zx.register({family:"Georgia",src:T});const Z=D.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}}),N=e=>a().createElement(D.BB,{title:`Pathology report \n ${e.encounterInfo.family_name} \n ${e.encounterInfo.given_name} \n ${e.encounterInfo.middle_name} `},a().createElement(D.T3,{size:"A4",style:Z.page},a().createElement(D.G7,{style:Z.section},a().createElement(D.Ee,{style:Z.logo,src:R}),a().createElement(D.xv,{style:{fontSize:8}},"Butaro Hospital"),a().createElement(D.xv,{style:{position:"absolute",top:0,left:300,width:300}},a().createElement(D.xv,{style:Z.textAnswers},"Lab phone number:"),a().createElement(D.xv,null," 0784433618")),a().createElement(D.xv,{style:{position:"absolute",top:15,left:300,width:300}},a().createElement(D.xv,{style:Z.textAnswers},"Accession number:"),a().createElement(D.xv,null," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.AccessionNumberconceptUUID&&t.value)))),a().createElement(D.xv,{style:{borderBottom:"1px",textAlign:"center",fontWeight:1500,marginBottom:30,fontFamily:"GeorgiaBold"}},"Pathology Report"),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textAnswers},"Patient Name:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.family_name," ",e.encounterInfo.given_name," ",e.encounterInfo.middle_name)),a().createElement(D.xv,{style:{paddingBottom:10,position:"absolute",top:140,left:335}},a().createElement(D.xv,{style:Z.textAnswers},"Surgery Date:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.DateBiopsySpecimenTakenconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))))),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textAnswers},"Patient Birthdate:"),a().createElement(D.xv,{style:Z.textAnswers}," ",new Date(e.encounterInfo.personBirthdate).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),a().createElement(D.xv,{style:{paddingBottom:10,position:"absolute",top:168,left:335,width:200}},a().createElement(D.xv,{style:Z.textAnswers},"Specimen Reception Date:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.SpecimenSubmissionDateconceptUUID&&new Date(t.value).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))))),a().createElement(D.xv,{style:{paddingBottom:10,borderBottom:"1px"}},a().createElement(D.xv,{style:Z.textAnswers},"Patient Gender:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.personGender)),a().createElement(D.xv,{style:{paddingBottom:10,position:"absolute",top:200,left:335,width:250}},a().createElement(D.xv,{style:Z.textAnswers},"Signout Date:"),a().createElement(D.xv,{style:Z.textAnswers}," ",new Date(e.encounterInfo.resultsEncounter.encounterDatetime).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}))),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Sending Physician:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.SendingPhysicianconceptUUID&&t.value)))),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Sending Facility:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OtherBiopsyLocationconceptUUID&&t.value)))),a().createElement(D.xv,{style:{paddingBottom:10,fontFamily:"Georgia"}},"Anatomical location:"),a().createElement(D.xv,{style:{paddingBottom:10,paddingLeft:10}},a().createElement(D.xv,{style:Z.textLabels},"i.System:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OrganSystemconceptUUID&&t.value.name.display+", ")))),a().createElement(D.xv,{style:{paddingBottom:10,paddingLeft:10}},a().createElement(D.xv,{style:Z.textLabels},"ii.Organ:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OrganconceptUUID&&t.value.name.display+", ")))),a().createElement(D.xv,{style:{paddingBottom:10,paddingLeft:10}},a().createElement(D.xv,{style:Z.textLabels},"iii.Detail:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.SpecimenDetailconceptUUID&&t.value)))),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Procedure type:"),a().createElement(D.xv,{style:Z.textAnswers}," ",e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.OtherTestsOrProceduresconceptUUID&&t.value)))),a().createElement(D.xv,{style:[Z.sentenceLabels]},"Gross Description:"),a().createElement(D.xv,{style:[Z.sentenceAnswers]},e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.GrossDescriptionconceptUUID&&t.value))),a().createElement(D.xv,{style:Z.sentenceLabels},"Microscopic Examination:"),a().createElement(D.xv,{style:Z.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.MacroscopicExaminationconceptUUID&&t.value))),a().createElement(D.xv,{style:Z.sentenceLabels},"Conclusion:"),a().createElement(D.xv,{style:Z.sentenceAnswers},e.encounterInfo.resultsEncounter.obs.map((t=>t.concept.uuid==e.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID&&t.value))),a().createElement(D.xv,{style:{paddingBottom:10}},a().createElement(D.xv,{style:Z.textLabels},"Validated by pathologist:"),a().createElement(D.xv,{style:[Z.textAnswers,{fontWeight:"bold"}]}," ",e.encounterInfo.approvedBy))))),$=()=>{const e=(0,b.useConfig)(),[t,n]=a().useState(),[o,r]=a().useState([]),[s,l]=a().useState(""),[i,c]=a().useState([]),[u,d]=a().useState([]),[p,m]=a().useState([]),[y,g]=a().useState(""),[f,h]=a().useState(""),[E,A]=a().useState("");a().useEffect((()=>{F(e.healthCenterAttrTypeUUID).then(n),async function(){return(await(0,b.openmrsFetch)("/ws/rest/v1/location")).data.results}().then(c),L(e.sampleStatusConceptUUID).then(d),L(e.referralStatusConceptUUID).then(m),async function(e,t){const n=await F(e);let o=null;o=n&&n!=t?await(0,b.openmrsFetch)(`/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0?location=${n}`):await(0,b.openmrsFetch)("/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0");const a=o.data.dataSets[0].rows.map((async e=>{if(e.resultsEncounterUuid){o.data.dataSets[0].rows.findIndex((t=>t.encounterUuid==e.encounterUuid));const t=await async function(e){return(await(0,b.openmrsFetch)(`/ws/rest/v1/encounter/${e}?v=full`)).data}(e.resultsEncounterUuid);e.resultsEncounter=t}return e}));return Promise.all(a)}(e.healthCenterAttrTypeUUID,e.pathologyFullAllowedLocationUUID).then(r)}),[]);const B=o.filter((e=>!y||e.sampleStatusObs?.toLowerCase()==y.toLowerCase())).filter((e=>!f||e.referralStatusObs?.toLowerCase()==f.toLowerCase())).filter((e=>!s||e.patientHealthCenter?.toLowerCase()==s.toLowerCase())).filter((e=>{if(E){const t=E.split(/\s+/),n=`${e.family_name} ${e.middle_name} ${e.given_name}`;return t.every((e=>new RegExp("\\b"+e,"i").test(n)))}return!0})).map((n=>({id:n.encounterId,patientNames:a().createElement("a",{"data-testid":"patientNames",href:`/openmrs/patientDashboard.form?patientId=${n.personId}`},n.family_name," ",n.given_name," ",n.middle_name),pathologyRequest:a().createElement("a",{href:`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${n.encounterId}&mode=VIEW`}," ","Link"," "),sendingHospital:n.patientHealthCenter,phoneNumber:n.patientPhoneNumber||"",sampleStatus:a().createElement("select",{onChange:e=>R({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},n)},a().createElement("option",{value:""}),u.map((e=>a().createElement("option",{"data-testid":"sampleStatus-option",value:e.uuid,key:e.uuid,selected:!!n.sampleStatusObs&&n.sampleStatusObs===e.display&&!0},e.display)))),dateOfRequest:new Date(n.encounterDatetime).toLocaleString(["en-GB","en-US","en","fr-RW"],{day:"numeric",month:"numeric",year:"numeric"}),referralStatus:a().createElement("select",{onChange:e=>P({uuid:e.target.value,display:e.target.options[e.target.selectedIndex].text},n)},a().createElement("option",{"data-testid":"referralStatus-option",value:""}),p.map((e=>a().createElement("option",{value:e.uuid,key:e.uuid,selected:n.referralStatusObs&&n.referralStatusObs===e.display},e.display)))),sampleDropOff:a().createElement("input",{"data-testid":"sampleDropOff",type:"checkbox",checked:Boolean(n.sampleDropoffObs),onChange:e=>O(n)}),pathologicDiagnosisObs:n.pathologicDiagnosisObs,resultsEncounter:n.resultsEncounterId?a().createElement("a",{"data-testid":"resultsEncounter",href:`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${n.resultsEncounterId}&mode=VIEW`}," ","Results"," "):(!t||t===e.pathologyFullAllowedLocationUUID)&&a().createElement("a",{href:`/openmrs/module/htmlformentry/htmlFormEntry.form?personId=${n.personId}&patientId=${n.personId}&returnUrl=&formId=${e.pathologyResultsFromID}&uuid=${n.encounterUuid}`}," ","Fill in results"," "),PDFReport:n.resultsEncounterId&&n.approvedBy&&a().createElement(D.WD,{document:a().createElement(N,{encounterInfo:n,config:e}),fileName:"Pathology Report"},(e=>{let{loading:t}=e;return t?"loading...":a().createElement("button",null,"Download")}))}))),O=t=>{const n=(0,v.Z)(o);t.sampleDropoffObs?async function(e){return await(0,b.openmrsFetch)(`/ws/rest/v1/obs/${e}`,{method:"POST",headers:{"content-type":"application/json"},body:{voided:!0}})}(t.sampleDropoffObsUuid).then((e=>{if(e.ok){const e=n.findIndex((e=>e.encounterUuid==t.encounterUuid));n[e].sampleDropoffObs="",n[e].sampleDropoffObsUuid="",r(n)}})):async function(e,t,n,o){const a={person:e.patientUuid,obsDatetime:(new Date).toISOString(),concept:t,location:await F(n),encounter:e.encounterUuid,value:o,voided:!1};return await(0,b.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:a})}(t,e.sampleDropOffconceptUUID,e.healthCenterAttrTypeUUID,e.yesConceptUUID).then((o=>{if(o.ok){const a=n.findIndex((e=>e.encounterUuid==t.encounterUuid));n[a].sampleDropoffObs=e.yesConceptName,n[a].sampleDropoffObsUuid=o.data.uuid,r(n)}}))},R=(t,n)=>{const a=(0,v.Z)(o);n.sampleStatusObs?async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e.uuid,voided:!e};return await(0,b.openmrsFetch)(`/ws/rest/v1/obs/${t.sampleStatusObsUuid}`,{method:"POST",headers:{"content-type":"application/json"},body:a})}(t,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].sampleStatusObs=t.display,a[o].sampleStatusObsUuid=e.data.uuid,r(a)}else r(a)})):async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e,voided:!1};return await(0,b.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:a})}(t.uuid,n,e.sampleStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].sampleStatusObs=t.display,a[o].sampleStatusObsUuid=e.data.uuid,r(a)}else r(a)}))},P=(t,n)=>{const a=(0,v.Z)(o);n.referralStatusObs?async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e.uuid,voided:!e};return await(0,b.openmrsFetch)(`/ws/rest/v1/obs/${t.referralStatusObsUuid}`,{method:"POST",headers:{"content-type":"application/json"},body:a})}(t,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].referralStatusObs=t.display,a[o].referralStatusObsUuid=e.data.uuid,r(a)}else r(a)})):async function(e,t,n,o){const a={person:t.patientUuid,obsDatetime:(new Date).toISOString(),concept:n,location:await F(o),encounter:t.encounterUuid,value:e,voided:!1};return await(0,b.openmrsFetch)("/ws/rest/v1/obs",{method:"POST",headers:{"content-type":"application/json"},body:a})}(t.uuid,n,e.referralStatusConceptUUID,e.healthCenterAttrTypeUUID).then((e=>{if(e.ok){const o=a.findIndex((e=>e.encounterUuid==n.encounterUuid));a[o].referralStatusObs=t.display,a[o].referralStatusObsUuid=e.data.uuid,r(a)}else r(a)}))};return a().createElement("div",null,a().createElement("div",{className:k.filtersContainer},a().createElement("label",{htmlFor:"sending-hospital"},"Sending Hospital "),a().createElement("select",{id:"sending-hospital",className:k.dropdown,value:s,onChange:e=>l(e.target.value)},a().createElement("option",{value:""}),i.map((n=>t&&t!==e.pathologyFullAllowedLocationUUID?n.uuid===t?a().createElement("option",{value:n.display,key:n.uuid},n.display):null:a().createElement("option",{value:n.display,key:n.uuid},n.display)))),a().createElement("label",{htmlFor:"sample-status"},"Sample Status "),a().createElement("select",{id:"sample-status",className:k.dropdown,value:y,onChange:e=>g(e.target.value)},a().createElement("option",{value:""}),u.map((e=>a().createElement("option",{value:e.display,key:e.uuid},e.display)))),a().createElement("label",{htmlFor:"referral-status"},"Referral Status "),a().createElement("select",{id:"referral-status",className:k.dropdown,value:f,onChange:e=>h(e.target.value)},a().createElement("option",{value:""}),p.map((e=>a().createElement("option",{value:e.display,key:e.uuid},e.display)))),a().createElement("label",{htmlFor:"patient-name"},"Patient Name "),a().createElement("input",{id:"patient-name",className:k.textBox,type:"text",onChange:e=>A(e.target.value)})),console.log(o),a().createElement("div",{className:k.tableContainer},a().createElement(x.ZP,{rows:B,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"}]},(e=>{let{rows:t,headers:n,getTableProps:o,getHeaderProps:r,getRowProps:s}=e;return a().createElement(w.Z,o(),a().createElement(U.Z,null,a().createElement(_.Z,null,n.map((e=>a().createElement(C.Z,r({header:e}),e.header))))),a().createElement(S.Z,null,t.map((e=>a().createElement(_.Z,s({row:e}),e.cells.map((e=>a().createElement(I.Z,{key:e.id},e.value))))))))}))),a().createElement("div",null))},G=()=>a().createElement("div",{className:`omrs-main-content ${A.container}`},a().createElement($,null))},74017:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(94015),a=n.n(o),r=n(23645),s=n.n(r)()(a());s.push([e.id,".-esm-pathology__ReportComponent__tableContainer___uOmmk {\n height: 500px;\n overflow-x: auto;\n margin: 0 1rem;\n border: 2px solid lightgrey;\n border-radius: 0.25rem;\n}\n\n.-esm-pathology__ReportComponent__filtersContainer___avnpi {\n border-radius: 0.25rem;\n margin: 0 1rem;\n padding-top: 4%;\n}\n\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe {\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___Lr3Fe:disabled {\n opacity: 0.8;\n background: lightgrey;\n cursor: not-allowed;\n}\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe:focus {\n border: 2px solid var(--omrs-color-interaction);\n outline: 0;\n}\n.-esm-pathology__ReportComponent__textBox___-gvpP {\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","",{version:3,sources:["webpack://./src/pathology-report/ReportComponent.css"],names:[],mappings:"AAAA;EACE,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,2BAA2B;EAC3B,sBAAsB;AACxB;;AAEA;EACE,sBAAsB;EACtB,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,YAAY;EACZ,qBAAqB;EACrB,mBAAmB;AACrB;AACA;EACE,+CAA+C;EAC/C,UAAU;AACZ;AACA;EACE,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd",sourcesContent:[".tableContainer {\n height: 500px;\n overflow-x: auto;\n margin: 0 1rem;\n border: 2px solid lightgrey;\n border-radius: 0.25rem;\n}\n\n.filtersContainer {\n border-radius: 0.25rem;\n margin: 0 1rem;\n padding-top: 4%;\n}\n\n.dropdown {\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.dropdown:disabled {\n opacity: 0.8;\n background: lightgrey;\n cursor: not-allowed;\n}\n.dropdown:focus {\n border: 2px solid var(--omrs-color-interaction);\n outline: 0;\n}\n.textBox {\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"],sourceRoot:""}]),s.locals={tableContainer:"-esm-pathology__ReportComponent__tableContainer___uOmmk",filtersContainer:"-esm-pathology__ReportComponent__filtersContainer___avnpi",dropdown:"-esm-pathology__ReportComponent__dropdown___Lr3Fe",textBox:"-esm-pathology__ReportComponent__textBox___-gvpP"};const l=s},56724:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=n(94015),a=n.n(o),r=n(23645),s=n.n(r)()(a());s.push([e.id,".-esm-pathology__pathology__container___ny2VS {\n padding: 2em;\n}\n","",{version:3,sources:["webpack://./src/pathology.css"],names:[],mappings:"AAAA;EACE,YAAY;AACd",sourcesContent:[".container {\n padding: 2em;\n}\n"],sourceRoot:""}]),s.locals={container:"-esm-pathology__pathology__container___ny2VS"};const l=s},97819:(e,t,n)=>{"use strict";e.exports=n.p+"5b8bb278fcab4da4972e.ttf"},21016:(e,t,n)=>{"use strict";e.exports=n.p+"a5fad24f075c978ac04b.ttf"},28251:(e,t,n)=>{"use strict";e.exports=n.p+"00ebb57bb20c59433e84.gif"},42480:()=>{},19527:()=>{},69331:()=>{},52361:()=>{},94616:()=>{}}]);
|
|
2
2
|
//# sourceMappingURL=861.js.map
|
package/dist/861.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"861.js","mappings":"uTAWIA,EAAU,GAEdA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKnB,QAAe,KAAW,WAAiB,gBAAiBM,E,0HCf/D,EAAU,GAEd,EAAQL,kBAAoB,IAC5B,EAAQC,cAAgB,IAElB,EAAQC,OAAS,SAAc,KAAM,QAE3C,EAAQC,OAAS,IACjB,EAAQC,mBAAqB,IAEhB,IAAI,IAAS,GAKnB,QAAe,KAAW,WAAiB,gBAAiBC,ECsB5DC,eAAeC,EAAgBC,GACpC,MACMC,SADgBC,EAAAA,EAAAA,cAAc,wBACTC,KAAKC,KAAKC,OAAOC,KAItCC,SAHeL,EAAAA,EAAAA,cAClB,sBAAqBD,gBAESE,KAAKK,QAAQC,QAC3CC,GAASA,EAAKC,cAAcL,OAASN,IAExC,OAAOO,EAAkB,IAAMA,EAAkBK,MAAMN,KAGlDR,eAAee,EAAkBC,GAItC,aAHsBZ,EAAAA,EAAAA,cACnB,uBAAsBY,aAEVX,KAAKY,Q,qCCzDtBC,EAAAA,GAAAA,SAAc,CAAEC,OAAQ,cAAeC,IAAKC,IAC5CH,EAAAA,GAAAA,SAAc,CAAEC,OAAQ,UAAWC,IAAKE,IAQxC,MAAMC,EAASC,EAAAA,GAAAA,OAAkB,CAC/BC,KAAM,CACJC,cAAe,OAEjBC,QAAS,CACPC,OAAQ,GACRC,QAAS,GACTC,SAAU,GAEZC,WAAY,CACVF,QAAS,EACTG,WAAW,cACXC,SAAU,GAC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ACzBA,EAAIC,MAAMpK,KAAKqK,GACd,kBAACC,EAAA,EAAD,CAAWrE,IAAKoE,EAAKnF,IAAKmF,EAAKhN,kBAS/C,gCCheN,EAPwB,IAEpB,yBAAK+L,UAAY,qBAAoBtL,EAAAA,aACnC,kBAAC,EAAD,Q,iFCJFyM,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOvF,GAAI,whCAAyhC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,wDAAwD,MAAQ,GAAG,SAAW,wWAAwW,eAAiB,CAAC,myBAAmyB,WAAa,MAEr1EqF,EAAwBG,OAAS,CAChC,eAAkB,0DAClB,iBAAoB,4DACpB,SAAY,oDACZ,QAAW,oDAEZ,W,iFCVIH,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOvF,GAAI,wEAAyE,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iCAAiC,MAAQ,GAAG,SAAW,sBAAsB,eAAiB,CAAC,sCAAsC,WAAa,MAE/RqF,EAAwBG,OAAS,CAChC,UAAa,gDAEd,W","sources":["webpack://@pih/esm-pathology-app/./src/pathology.css?9d3a","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.css?a61d","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.resource.ts","webpack://@pih/esm-pathology-app/./src/Print-to-PDF/Document-Component.tsx","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.tsx","webpack://@pih/esm-pathology-app/./src/PathologySystem.tsx","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.css","webpack://@pih/esm-pathology-app/./src/pathology.css"],"sourcesContent":["\n import API from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./pathology.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./pathology.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./ReportComponent.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./ReportComponent.css\";\n export default content && content.locals ? content.locals : undefined;\n","import { openmrsFetch } from \"@openmrs/esm-framework\";\nimport cloneDeep from \"lodash-es/cloneDeep\";\n\n\nexport interface EncounterResult {\n family_name: string;\n given_name: string;\n middle_name: string;\n patientPhoneNumber: { value: string };\n patientHealthCenter: string;\n patientUuid: string;\n encounterUuid: string;\n encounterId: number;\n personId: number;\n encounterDatetime: Date;\n sampleStatusObs: string;\n referralStatusObs: string;\n sampleDropoffObs: string;\n resultsEncounterId: string;\n resultsEncounterUuid: string;\n resultsEncounter: [];\n approvedBy: string;\n approvalObsUuid: string;\n pathologicDiagnosisObs: string;\n}\nexport interface Patient {\n uuid: string;\n}\nexport interface Concept {\n uuid: string;\n name: string;\n display: string;\n}\n\nexport interface Obs {\n patientUuid: string;\n obsDateTime: string;\n sampleDropoffObsUuid: string;\n referralStatusObsUuid: string;\n sampleStatusObsUuid: string;\n location: string;\n encounterUuid: string;\n valueCodedName: string;\n voided: boolean;\n resultsEncounterUuid: string;\n}\n\n\nexport async function getUserLocation(healthCenterAttrTypeUUID) {\n const session = await openmrsFetch(`/ws/rest/v1/session`);\n const personUuid = session.data.user.person.uuid;\n const person = await openmrsFetch(\n `/ws/rest/v1/person/${personUuid}/attribute`\n );\n const hcPersonAttribute = person.data.results.filter(\n (attr) => attr.attributeType.uuid === healthCenterAttrTypeUUID\n );\n return hcPersonAttribute[0] && hcPersonAttribute.value.uuid;\n}\n\nexport async function getConceptAnswers(conceptUuid) {\n const concept = await openmrsFetch(\n `/ws/rest/v1/concept/${conceptUuid}?v=full`\n );\n return concept.data.answers;\n}\n\nexport async function getLocations() {\n const location = await openmrsFetch(`/ws/rest/v1/location`);\n\n return location.data.results;\n}\n\nexport async function getEncounters(\n healthCenterAttrTypeUUID: string,\n pathologyFullAllowedLocationUUID: string\n): Promise<Array<EncounterResult>> {\n const userLocationUUID = await getUserLocation(healthCenterAttrTypeUUID);\n\n let searchEncounter = null;\n if (\n userLocationUUID &&\n userLocationUUID != pathologyFullAllowedLocationUUID\n ) {\n searchEncounter = await openmrsFetch(\n `/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0?location=${userLocationUUID}`\n );\n } else {\n searchEncounter = await openmrsFetch(\n `/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0`\n );\n }\n\n const EncListClone = searchEncounter.data.dataSets[0].rows.map(async (encObject)=>{\n if(encObject.resultsEncounterUuid){\n const encIndex = searchEncounter.data.dataSets[0].rows.findIndex(\n (enc) => enc.encounterUuid == encObject.encounterUuid\n );\n const resultsEnc =await getEncounter(encObject.resultsEncounterUuid);\n encObject.resultsEncounter = resultsEnc;\n \n }\n return encObject; \n });\n \n return Promise.all(EncListClone);\n}\n\nexport async function postSampleDropoffObs(\n obsObject: Obs,\n sampleDropOffconceptUUID: string,\n healthCenterAttrTypeUUID: string,\n yesConceptName: string\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: sampleDropOffconceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: yesConceptName,\n voided: false,\n };\n\n const response = await openmrsFetch(\"/ws/rest/v1/obs\", {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n });\n return response;\n}\n\nexport async function voidSampleDropoff(sampleDropoffObsUuid: string) {\n const ObsObjectTocreate = {\n voided: true,\n };\n\n const response = await openmrsFetch(\n `/ws/rest/v1/obs/${sampleDropoffObsUuid}`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n }\n );\n\n return response;\n}\n\nexport async function postSampleStatusChangeObs(\n newStatusUuid: string,\n obs: Obs,\n sampleStatusConceptUUID: string,\n healthCenterAttrTypeUUID: string\n) {\n const postBody = {\n person: obs.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: sampleStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obs.encounterUuid,\n value: newStatusUuid,\n voided: false,\n };\n\n const response = await openmrsFetch(\"/ws/rest/v1/obs\", {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: postBody,\n });\n\n return response;\n}\n\nexport async function updateSampleStatusChangeObs(\n newStatus: null | { uuid: string; display: string },\n obsObject: Obs,\n sampleStatusConceptUUID: string,\n healthCenterAttrTypeUUID: string\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: sampleStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: newStatus.uuid,\n voided: newStatus ? false : true,\n };\n\n const response = await openmrsFetch(\n `/ws/rest/v1/obs/${obsObject.sampleStatusObsUuid}`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n }\n );\n\n return response;\n}\n\nexport async function postReferralStatusChangeObs(\n targetValueUuid: string,\n obsObject: Obs,\n referralStatusConceptUUID: string,\n healthCenterAttrTypeUUID: string\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: referralStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: targetValueUuid,\n voided: false,\n };\n\n const response = await openmrsFetch(\"/ws/rest/v1/obs\", {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n });\n\n return response;\n}\n\nexport async function updateReferralStatusChangeObs(\n targetValue,\n obsObject: Obs,\n referralStatusConceptUUID,\n healthCenterAttrTypeUUID\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: referralStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: targetValue.uuid,\n voided: targetValue ? false : true,\n };\n\n const response = await openmrsFetch(\n `/ws/rest/v1/obs/${obsObject.referralStatusObsUuid}`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n }\n );\n\n return response;\n}\n\n\n\nexport async function getUser(userUuid: string) {\n const user = await openmrsFetch(`/ws/rest/v1/user/${userUuid}`);\n\n return user.data;\n}\nexport async function getEncounter(encounterUuid) {\n const encResult = await openmrsFetch(`/ws/rest/v1/encounter/${encounterUuid}?v=full`);\n \n return encResult.data;\n}","import React from \"react\";\nimport { Document, Page, Text,Image, View, StyleSheet,Font } from \"@react-pdf/renderer\";\nimport ButaroLogo from '../images/ButaroHospitalLogo.gif';\nimport GeorgiaFontBold from '../Fonts/georgia/georgia-bold.ttf';\nimport GeorgiaFont from '../Fonts/georgia/Georgia.ttf';\n\n// import { Font } from '@react-pdf/renderer';\nFont.register({ family: 'GeorgiaBold', src: GeorgiaFontBold});\nFont.register({ family: 'Georgia', src: GeorgiaFont});\n\n// Font.register({ family: 'Georgia', src: '../Fonts/georgia/Georgia.ttf', fontStyle: 'normal', fontWeight: 'normal' });\n\n\n\n\n// Create styles\nconst styles = StyleSheet.create({\n page: {\n flexDirection: \"row\",\n },\n section: {\n margin: 10,\n padding: 20,\n flexGrow: 1,\n },\n textLabels: {\n padding: 7,\n fontFamily:\"GeorgiaBold\",\n fontSize: 16,\n fontWeight: 'bold',\n paddingBottom:30,\n },\n sentenceLabels: {\n paddingTop: 7,\n fontFamily:\"GeorgiaBold\",\n fontSize: 16,\n fontWeight: 'bold',\n paddingBottom:3,\n },\n textAnswers: {\n margin: 10,\n padding: 20,\n fontFamily:\"Georgia\",\n fontSize: 14,\n },\n sentenceAnswers: {\n marginBottom: 10,\n paddingBottom: 20,\n fontFamily:\"Georgia\",\n fontSize: 14,\n },\n logo: {\n width: 61,\n\n }\n});\n\n// Create Document Component\nconst MyDocument = (props) => (\n \n <Document title={`Pathology report \n ${props.encounterInfo.family_name} \n ${props.encounterInfo.given_name} \n ${props.encounterInfo.middle_name} `}\n >\n <Page size=\"A4\" style={styles.page}>\n \n <View style={styles.section}>\n <Image style={styles.logo} src={ButaroLogo}/>\n <Text style={{fontSize: 8}}>Butaro Hospital</Text>\n <Text style={{ position: \"absolute\",top: 0,left: 300,width: 300 }}>\n <Text style={styles.textAnswers}>\n Lab phone number:\n </Text>\n <Text>{\" \"}{\" \"}0784433618</Text>\n </Text>\n <Text style={{ position: \"absolute\",top: 15,left: 300,width: 300 }}>\n <Text style={styles.textAnswers}>\n Accession number:\n </Text> \n <Text >\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.AccessionNumberconceptUUID && obser.value)}\n </Text>\n </Text>\n <Text style={{ backgroundColor: \"#E4E4E4\",borderBottom:'1px', textAlign: 'center',fontWeight: 1500, marginBottom: 30,fontFamily:\"GeorgiaBold\" }}> \n Pathology Report \n </Text>\n <Text style={{ paddingBottom: 10 }} > \n <Text style={styles.textAnswers}>\n Patient Name:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.family_name} {\" \"} \n {props.encounterInfo.given_name} {\" \"} \n {props.encounterInfo.middle_name} \n </Text>\n \n </Text>\n <Text style={{ paddingBottom: 10, position: \"absolute\",top: 140,left: 335 }}>\n <Text style={styles.textAnswers}>\n Surgery Date:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.DateBiopsySpecimenTakenconceptUUID && \n new Date(obser.value)\n .toLocaleString([\"en-GB\",\"en-US\",\"en\",\"fr-RW\"],{day: 'numeric',month: 'numeric',year: 'numeric'})\n )}\n </Text>\n \n </Text>\n <Text style={{ paddingBottom: 10 }} > \n <Text style={styles.textAnswers}>\n Patient Birthday:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {\n new Date(props.encounterInfo.personBirthdate)\n .toLocaleString([\"en-GB\",\"en-US\",\"en\",\"fr-RW\"],{day: 'numeric',month: 'numeric',year: 'numeric'})\n }\n </Text>\n \n </Text>\n <Text style={{ paddingBottom: 10, position: \"absolute\",top: 168,left: 335,width: 200 }}> \n <Text style={styles.textAnswers}>\n Specimen Reception Date:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.SpecimenSubmissionDateconceptUUID && \n new Date(obser.value)\n .toLocaleString([\"en-GB\",\"en-US\",\"en\",\"fr-RW\"],{day: 'numeric',month: 'numeric',year: 'numeric'})\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10,borderBottom:'1px' }} > \n <Text style={styles.textAnswers}>\n Patient Gender:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.personGender}\n </Text>\n \n </Text>\n <Text style={{ paddingBottom: 10, position: \"absolute\",top: 200,left: 335,width: 250 }}> \n <Text style={styles.textAnswers}>\n Signout Date:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {\n new Date(props.encounterInfo.resultsEncounter.encounterDatetime)\n .toLocaleString([\"en-GB\",\"en-US\",\"en\",\"fr-RW\"],{day: 'numeric',month: 'numeric',year: 'numeric'})\n } \n </Text>\n </Text>\n \n <Text style={{ backgroundColor: \"#E4E4E4\",paddingBottom: 10 }}> \n <Text style={styles.textLabels}>\n Sending Physician:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.SendingPhysicianconceptUUID && obser.value)}\n </Text>\n </Text>\n <Text style={{ backgroundColor: \"#E4E4E4\",paddingBottom: 10 }}>\n <Text style={styles.textLabels}>\n Sending Facility: \n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.OtherBiopsyLocationconceptUUID && obser.value)}\n </Text>\n </Text>\n <Text style={{backgroundColor: \"#E4E4E4\",paddingBottom: 10 ,fontFamily:\"Georgia\"}}>Anatomical location:</Text>\n <Text style={{backgroundColor: \"#E4E4E4\", paddingBottom: 10,paddingLeft:10 }}> \n <Text style={styles.textLabels}>\n i.System:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.OrganSystemconceptUUID && (obser.value.name.display+ \", \"))}\n </Text>\n </Text>\n <Text style={{backgroundColor: \"#E4E4E4\", paddingBottom: 10,paddingLeft:10 }}>\n <Text style={styles.textLabels}>\n ii.Organ:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.OrganconceptUUID && (obser.value.name.display+ \", \"))} \n </Text>\n </Text>\n <Text style={{backgroundColor: \"#E4E4E4\", paddingBottom: 10,paddingLeft:10 }}>\n <Text style={styles.textLabels}>\n iii.Detail:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.SpecimenDetailconceptUUID && obser.value)}\n </Text>\n </Text>\n <Text style={{backgroundColor: \"#E4E4E4\", paddingBottom: 10 }}>\n <Text style={styles.textLabels}>\n Procedure type:\n </Text> \n <Text style={styles.textAnswers}>\n {\" \"}{\" \"}\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.OtherTestsOrProceduresconceptUUID && obser.value)}\n </Text>\n </Text>\n <Text style={[styles.sentenceLabels]}>\n Gross Description: \n </Text> \n <Text style={[styles.sentenceAnswers]}>\n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.GrossDescriptionconceptUUID && obser.value)}\n \n </Text>\n <Text style={styles.sentenceLabels}>\n Microscopic Examination:\n </Text> \n <Text style={styles.sentenceAnswers}>\n \n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.MacroscopicExaminationconceptUUID && obser.value)}\n\n </Text>\n <Text style={styles.sentenceLabels}>\n Conclusion:\n </Text> \n <Text style={styles.sentenceAnswers}>\n \n {props.encounterInfo.resultsEncounter.obs.map((obser) => obser.concept.uuid==props.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID && obser.value)}\n \n </Text>\n\n <Text style={{backgroundColor: \"#E4E4E4\", paddingBottom: 10 }}> \n <Text style={styles.textLabels}>\n Validated by pathologist:\n </Text> \n <Text style= {[styles.textAnswers, { fontWeight: 'bold' }]}>\n {\" \"}{\" \"}\n {props.encounterInfo.approvedBy}\n </Text>\n </Text>\n </View> \n </Page>\n </Document>\n);\n\nexport default MyDocument;\n\n","import React from \"react\";\nimport { useConfig } from \"@openmrs/esm-framework\";\nimport cloneDeep from \"lodash-es/cloneDeep\";\nimport DataTable, {\n Table,\n TableHead,\n TableRow,\n TableHeader,\n TableBody,\n TableCell,\n} from \"carbon-components-react/es/components/DataTable\";\nimport { PDFDownloadLink, PDFViewer } from \"@react-pdf/renderer\";\n\nimport styles from \"./ReportComponent.css\";\nimport {\n getUserLocation,\n getConceptAnswers,\n getLocations,\n getEncounters,\n postSampleDropoffObs,\n voidSampleDropoff,\n postSampleStatusChangeObs,\n updateSampleStatusChangeObs,\n postReferralStatusChangeObs,\n updateReferralStatusChangeObs,\n EncounterResult,\n // postApproval,\n // voidApprovalObs,\n getUser,\n Concept,\n getEncounter,\n} from \"./ReportComponent.resource\";\nimport MyDocument from \"../Print-to-PDF/Document-Component\";\nimport { Config } from \"../config-schema\";\n\nconst ReportComponent = () => {\n const config = useConfig() as Config;\n const [userLocation, setUserLocation] = React.useState();\n const [encountersList, setEncountersList] = React.useState<\n Array<EncounterResult>\n >([]);\n const [sendingHospital, setSendingHospital] = React.useState(\"\");\n const [listOfHospitals, setListOfHospitals] = React.useState([]);\n const [sampleStatusAnswers, setSampleStatusAnswers] = React.useState<\n Array<Concept>\n >([]);\n const [referralStatusAnswers, setReferralStatusAnswers] = React.useState<\n Array<Concept>\n >([]);\n const [sampleStatus, setSampleStatus] = React.useState(\"\");\n const [referralStatus, setReferralStatus] = React.useState(\"\");\n const [patientName, setPatientName] = React.useState(\"\");\n const headers = [\n {\n key: \"patientNames\",\n header: \"Patient name\",\n },\n {\n key: \"pathologyRequest\",\n header: \"pathology request\",\n },\n {\n key: \"sendingHospital\",\n header: \"Sending Hospital\",\n },\n {\n key: \"phoneNumber\",\n header: \"Phone number\",\n },\n {\n key: \"sampleStatus\",\n header: \"Sample status\",\n },\n {\n key: \"dateOfRequest\",\n header: \"Date of Request\",\n },\n {\n key: \"referralStatus\",\n header: \"Referral status\",\n },\n {\n key: \"sampleDropOff\",\n header: \"Sample drop off?\",\n },\n {\n key: \"pathologicDiagnosisObs\",\n header: \"Pathologic diagnosis\",\n },\n {\n key: \"resultsEncounter\",\n header: \"Results\",\n },\n {\n key: \"PDFReport\",\n header: \"Report\",\n },\n ];\n\n React.useEffect(() => {\n getUserLocation(config.healthCenterAttrTypeUUID).then(setUserLocation);\n getLocations().then(setListOfHospitals);\n getConceptAnswers(config.sampleStatusConceptUUID).then(\n setSampleStatusAnswers\n );\n getConceptAnswers(config.referralStatusConceptUUID).then(\n setReferralStatusAnswers\n );\n getEncounters(\n config.healthCenterAttrTypeUUID,\n config.pathologyFullAllowedLocationUUID\n ).then(\n setEncountersList\n );\n }, []);\n\n const filteredEncList = encountersList\n .filter(\n (encList) =>\n !sampleStatus ||\n encList.sampleStatusObs?.toLowerCase() == sampleStatus.toLowerCase()\n )\n .filter(\n (encList) =>\n !referralStatus ||\n encList.referralStatusObs?.toLowerCase() == referralStatus.toLowerCase()\n )\n .filter(\n (encList) =>\n !sendingHospital ||\n encList.patientHealthCenter?.toLowerCase() ==\n sendingHospital.toLowerCase()\n )\n .filter((encList) => {\n if (!patientName) {\n return true;\n } else {\n // Given a patient name filter input, break it up into tokens.\n // Filter to patients for which each token matches.\n // Matching is case-insensitive and matches the beginning of each name.\n const nameTokens = patientName.split(/\\s+/);\n const name = `${encList.family_name} ${encList.middle_name} ${encList.given_name}`;\n return nameTokens.every((token) =>\n new RegExp(\"\\\\b\" + token, \"i\").test(name)\n );\n }\n });\n\n const rows = filteredEncList.map((encounterInfo) => {\n return {\n // rows.push({\n // patientLink: <a href={`/openmrs/patientDashboard.form?patientId=${encounterInfo.personId}`} >Link</a>,\n id: encounterInfo.encounterId,\n patientNames: (\n <a\n data-testid=\"patientNames\"\n href={`/openmrs/patientDashboard.form?patientId=${encounterInfo.personId}`}\n >\n {encounterInfo.family_name}\n {\" \"}\n {encounterInfo.given_name}\n {\" \"}\n {encounterInfo.middle_name}\n </a>\n ),\n pathologyRequest: (\n <a\n href={`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${encounterInfo.encounterId}&mode=VIEW`}\n >\n {\" \"}\n Link{\" \"}\n </a>\n ),\n sendingHospital: encounterInfo.patientHealthCenter,\n phoneNumber: encounterInfo.patientPhoneNumber || \"\",\n sampleStatus: (\n <select\n onChange={(e) =>\n sampleStatusChange(\n {\n uuid: e.target.value,\n display: e.target.options[e.target.selectedIndex].text,\n },\n encounterInfo\n )\n }\n >\n <option value=\"\"></option>\n {sampleStatusAnswers.map((ans) => (\n <option\n data-testid=\"sampleStatus-option\"\n value={ans.uuid}\n key={ans.uuid}\n selected={\n encounterInfo.sampleStatusObs\n ? encounterInfo.sampleStatusObs === ans.display && true\n : false\n }\n >\n {ans.display}\n </option>\n ))}\n </select>\n ),\n dateOfRequest: new Date(encounterInfo.encounterDatetime)\n .toLocaleString([\"en-GB\",\"en-US\",\"en\",\"fr-RW\"],{day: 'numeric',month: 'numeric',year: 'numeric'}),\n referralStatus: (\n <select\n onChange={(e) =>\n referralStatusChange(\n {\n uuid: e.target.value,\n display: e.target.options[e.target.selectedIndex].text,\n },\n encounterInfo\n )\n }\n >\n <option data-testid=\"referralStatus-option\" value=\"\"></option>\n {referralStatusAnswers.map((ans) => (\n <option\n value={ans.uuid}\n key={ans.uuid}\n selected={\n encounterInfo.referralStatusObs &&\n encounterInfo.referralStatusObs === ans.display\n }\n >\n {ans.display}\n </option>\n ))}\n </select>\n ),\n sampleDropOff: (\n <input\n data-testid=\"sampleDropOff\"\n type=\"checkbox\"\n checked={Boolean(encounterInfo.sampleDropoffObs)}\n onChange={(e) => sampleDropOffChange(encounterInfo)}\n />\n ),\n pathologicDiagnosisObs: encounterInfo.pathologicDiagnosisObs,\n resultsEncounter: encounterInfo.resultsEncounterId ? (\n <a\n data-testid=\"resultsEncounter\"\n href={`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${encounterInfo.resultsEncounterId}&mode=VIEW`}\n >\n {\" \"}\n Results{\" \"}\n </a>\n ) : (\n (!userLocation ||\n userLocation === config.pathologyFullAllowedLocationUUID) && (\n <a\n href={`/openmrs/module/htmlformentry/htmlFormEntry.form?personId=${encounterInfo.personId}&patientId=${encounterInfo.personId}&returnUrl=&formId=${config.pathologyResultsFromID}&uuid=${encounterInfo.encounterUuid}`}\n >\n {\" \"}\n Fill in results{\" \"}\n </a>\n )\n ),\n PDFReport:\n encounterInfo.resultsEncounterId &&\n (\n encounterInfo.approvedBy &&\n <PDFDownloadLink document={<MyDocument encounterInfo={encounterInfo} config={config} />} fileName=\"Pathology Report\">\n {({loading}) => (loading ? 'loading...' : <button>Download</button>)}\n </PDFDownloadLink>\n \n \n \n )\n \n };\n });\n\n const sampleDropOffChange = (encounterInfo) => {\n const tempEncList = cloneDeep(encountersList);\n if (!encounterInfo.sampleDropoffObs) {\n postSampleDropoffObs(\n encounterInfo,\n config.sampleDropOffconceptUUID,\n config.healthCenterAttrTypeUUID,\n config.yesConceptUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleDropoffObs = config.yesConceptName;\n tempEncList[encIndex].sampleDropoffObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n }\n });\n } else {\n voidSampleDropoff(encounterInfo.sampleDropoffObsUuid).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleDropoffObs = \"\";\n tempEncList[encIndex].sampleDropoffObsUuid = \"\";\n\n setEncountersList(tempEncList);\n }\n });\n }\n };\n\n\n const sampleStatusChange = (\n newStatus: { uuid: string; display: string },\n encounterInfo\n ) => {\n const tempEncList = cloneDeep(encountersList);\n if (!encounterInfo.sampleStatusObs) {\n postSampleStatusChangeObs(\n newStatus.uuid,\n encounterInfo,\n config.sampleStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleStatusObs = newStatus.display;\n tempEncList[encIndex].sampleStatusObsUuid = response.data.uuid;\n\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n } else {\n updateSampleStatusChangeObs(\n newStatus,\n encounterInfo,\n config.sampleStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleStatusObs = newStatus.display;\n tempEncList[encIndex].sampleStatusObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n }\n };\n\n const referralStatusChange = (targetedElem, encounterInfo) => {\n const tempEncList = cloneDeep(encountersList);\n if (!encounterInfo.referralStatusObs) {\n postReferralStatusChangeObs(\n targetedElem.uuid,\n encounterInfo,\n config.referralStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].referralStatusObs = targetedElem.display;\n tempEncList[encIndex].referralStatusObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n } else {\n updateReferralStatusChangeObs(\n targetedElem,\n encounterInfo,\n config.referralStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].referralStatusObs = targetedElem.display;\n tempEncList[encIndex].referralStatusObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n }\n };\n \n\n return (\n <div>\n <div className={styles.filtersContainer}>\n <label htmlFor=\"sending-hospital\">Sending Hospital </label>\n <select\n id=\"sending-hospital\"\n className={styles.dropdown}\n value={sendingHospital}\n onChange={(e) => setSendingHospital(e.target.value)}\n >\n <option value=\"\"></option>\n {listOfHospitals.map((loc) =>\n userLocation &&\n userLocation !== config.pathologyFullAllowedLocationUUID ? (\n loc.uuid === userLocation ? (\n <option value={loc.display} key={loc.uuid}>\n {loc.display}\n </option>\n ) : null\n ) : (\n <option value={loc.display} key={loc.uuid}>\n {loc.display}\n </option>\n )\n )}\n </select>\n <label htmlFor=\"sample-status\">Sample Status </label>\n <select\n id=\"sample-status\"\n className={styles.dropdown}\n value={sampleStatus}\n onChange={(e) => setSampleStatus(e.target.value)}\n >\n <option value=\"\"></option>\n {sampleStatusAnswers.map((ans) => (\n <option value={ans.display} key={ans.uuid}>\n {ans.display}\n </option>\n ))}\n </select>\n <label htmlFor=\"referral-status\">Referral Status </label>\n <select\n id=\"referral-status\"\n className={styles.dropdown}\n value={referralStatus}\n onChange={(e) => setReferralStatus(e.target.value)}\n >\n <option value=\"\"></option>\n {referralStatusAnswers.map((ans) => (\n <option value={ans.display} key={ans.uuid}>\n {ans.display}\n </option>\n ))}\n </select>\n\n <label htmlFor=\"patient-name\">Patient Name </label>\n <input\n id=\"patient-name\"\n className={styles.textBox}\n type=\"text\"\n onChange={(e) => setPatientName(e.target.value)}\n />\n </div>\n {console.log( encountersList)}\n <div className={styles.tableContainer}>\n <DataTable rows={rows} headers={headers}>\n {({ rows, headers, getTableProps, getHeaderProps, getRowProps }) => (\n <Table {...getTableProps()}>\n <TableHead>\n <TableRow>\n {headers.map((header) => (\n <TableHeader {...getHeaderProps({ header })}>\n {header.header}\n </TableHeader>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {rows.map((row) => (\n <TableRow {...getRowProps({ row })}>\n {row.cells.map((cell) => (\n <TableCell key={cell.id}>{cell.value}</TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )}\n </DataTable>\n </div>\n <div>\n {/* <PDFViewer>\n <MyDocument />\n </PDFViewer> */}\n {/* <PDFDownloadLink document={<MyDocument />} fileName=\"Pathology Report\">\n {({loading}) => (loading ? 'loading...' : <button>Download</button>)}\n </PDFDownloadLink> */}\n \n </div>\n </div>\n );\n};\n\nexport default ReportComponent;\n","import React from \"react\";\nimport styles from \"./pathology.css\";\nimport ReportComponent from \"./pathology-report/ReportComponent\";\n\nconst PathologySystem = () => {\n return (\n <div className={`omrs-main-content ${styles.container}`}>\n <ReportComponent />\n </div>\n );\n};\nexport default PathologySystem;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".-esm-pathology__ReportComponent__tableContainer___uOmmk {\\n height: 500px;\\n overflow-x: auto;\\n margin: 0 1rem;\\n border: 2px solid lightgrey;\\n border-radius: 0.25rem;\\n}\\n\\n.-esm-pathology__ReportComponent__filtersContainer___avnpi {\\n border-radius: 0.25rem;\\n margin: 0 1rem;\\n padding-top: 4%;\\n}\\n\\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe {\\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___Lr3Fe:disabled {\\n opacity: 0.8;\\n background: lightgrey;\\n cursor: not-allowed;\\n}\\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe:focus {\\n border: 2px solid var(--omrs-color-interaction);\\n outline: 0;\\n}\\n.-esm-pathology__ReportComponent__textBox___-gvpP {\\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\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/pathology-report/ReportComponent.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,2BAA2B;EAC3B,sBAAsB;AACxB;;AAEA;EACE,sBAAsB;EACtB,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,YAAY;EACZ,qBAAqB;EACrB,mBAAmB;AACrB;AACA;EACE,+CAA+C;EAC/C,UAAU;AACZ;AACA;EACE,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd\",\"sourcesContent\":[\".tableContainer {\\n height: 500px;\\n overflow-x: auto;\\n margin: 0 1rem;\\n border: 2px solid lightgrey;\\n border-radius: 0.25rem;\\n}\\n\\n.filtersContainer {\\n border-radius: 0.25rem;\\n margin: 0 1rem;\\n padding-top: 4%;\\n}\\n\\n.dropdown {\\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.dropdown:disabled {\\n opacity: 0.8;\\n background: lightgrey;\\n cursor: not-allowed;\\n}\\n.dropdown:focus {\\n border: 2px solid var(--omrs-color-interaction);\\n outline: 0;\\n}\\n.textBox {\\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\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"tableContainer\": \"-esm-pathology__ReportComponent__tableContainer___uOmmk\",\n\t\"filtersContainer\": \"-esm-pathology__ReportComponent__filtersContainer___avnpi\",\n\t\"dropdown\": \"-esm-pathology__ReportComponent__dropdown___Lr3Fe\",\n\t\"textBox\": \"-esm-pathology__ReportComponent__textBox___-gvpP\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".-esm-pathology__pathology__container___ny2VS {\\n padding: 2em;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/pathology.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,YAAY;AACd\",\"sourcesContent\":[\".container {\\n padding: 2em;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": \"-esm-pathology__pathology__container___ny2VS\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","undefined","async","getUserLocation","healthCenterAttrTypeUUID","personUuid","openmrsFetch","data","user","person","uuid","hcPersonAttribute","results","filter","attr","attributeType","value","getConceptAnswers","conceptUuid","answers","Font","family","src","GeorgiaFontBold","GeorgiaFont","styles","StyleSheet","page","flexDirection","section","margin","padding","flexGrow","textLabels","fontFamily","fontSize","fontWeight","paddingBottom","sentenceLabels","paddingTop","textAnswers","sentenceAnswers","marginBottom","logo","width","props","title","encounterInfo","family_name","given_name","middle_name","size","style","ButaroLogo","position","top","left","resultsEncounter","obs","map","obser","concept","config","AccessionNumberconceptUUID","backgroundColor","borderBottom","textAlign","DateBiopsySpecimenTakenconceptUUID","Date","toLocaleString","day","month","year","personBirthdate","SpecimenSubmissionDateconceptUUID","personGender","encounterDatetime","SendingPhysicianconceptUUID","OtherBiopsyLocationconceptUUID","paddingLeft","OrganSystemconceptUUID","name","display","OrganconceptUUID","SpecimenDetailconceptUUID","OtherTestsOrProceduresconceptUUID","GrossDescriptionconceptUUID","MacroscopicExaminationconceptUUID","COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID","approvedBy","useConfig","userLocation","setUserLocation","React","encountersList","setEncountersList","sendingHospital","setSendingHospital","listOfHospitals","setListOfHospitals","sampleStatusAnswers","setSampleStatusAnswers","referralStatusAnswers","setReferralStatusAnswers","sampleStatus","setSampleStatus","referralStatus","setReferralStatus","patientName","setPatientName","then","getLocations","sampleStatusConceptUUID","referralStatusConceptUUID","pathologyFullAllowedLocationUUID","userLocationUUID","searchEncounter","EncListClone","dataSets","rows","encObject","resultsEncounterUuid","findIndex","enc","encounterUuid","resultsEnc","getEncounter","Promise","all","getEncounters","encList","sampleStatusObs","toLowerCase","referralStatusObs","patientHealthCenter","nameTokens","split","every","token","RegExp","test","id","encounterId","patientNames","href","personId","pathologyRequest","phoneNumber","patientPhoneNumber","onChange","e","sampleStatusChange","target","selectedIndex","text","ans","key","selected","dateOfRequest","referralStatusChange","sampleDropOff","type","checked","Boolean","sampleDropoffObs","sampleDropOffChange","pathologicDiagnosisObs","resultsEncounterId","pathologyResultsFromID","PDFReport","document","fileName","loading","tempEncList","cloneDeep","sampleDropoffObsUuid","method","headers","body","voided","voidSampleDropoff","response","ok","encIndex","obsObject","sampleDropOffconceptUUID","yesConceptName","ObsObjectTocreate","patientUuid","obsDatetime","toISOString","location","encounter","postSampleDropoffObs","yesConceptUUID","newStatus","sampleStatusObsUuid","updateSampleStatusChangeObs","newStatusUuid","postBody","postSampleStatusChangeObs","targetedElem","targetValue","referralStatusObsUuid","updateReferralStatusChangeObs","targetValueUuid","postReferralStatusChangeObs","className","htmlFor","loc","console","log","DataTable","header","getTableProps","getHeaderProps","getRowProps","Table","TableHead","TableRow","TableHeader","TableBody","row","cells","cell","TableCell","___CSS_LOADER_EXPORT___","push","module","locals"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"861.js","mappings":"uTAWIA,EAAU,GAEdA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKnB,QAAe,KAAW,WAAiB,gBAAiBM,E,0HCf/D,EAAU,GAEd,EAAQL,kBAAoB,IAC5B,EAAQC,cAAgB,IAElB,EAAQC,OAAS,SAAc,KAAM,QAE3C,EAAQC,OAAS,IACjB,EAAQC,mBAAqB,IAEhB,IAAI,IAAS,GAKnB,QAAe,KAAW,WAAiB,gBAAiBC,ECsB5DC,eAAeC,EAAgBC,GACpC,MACMC,SADgBC,EAAAA,EAAAA,cAAc,wBACTC,KAAKC,KAAKC,OAAOC,KAItCC,SAHeL,EAAAA,EAAAA,cAClB,sBAAqBD,gBAESE,KAAKK,QAAQC,QAC3CC,GAASA,EAAKC,cAAcL,OAASN,IAExC,OAAOO,EAAkB,IAAMA,EAAkB,GAAGK,MAAMN,KAGrDR,eAAee,EAAkBC,GAItC,aAHsBZ,EAAAA,EAAAA,cACnB,uBAAsBY,aAEVX,KAAKY,Q,qCClDtBC,EAAAA,GAAAA,SAAc,CAAEC,OAAQ,cAAeC,IAAKC,IAC5CH,EAAAA,GAAAA,SAAc,CAAEC,OAAQ,UAAWC,IAAKE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C,EAAD,Q,iFCJFwM,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOvF,GAAI,whCAAyhC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,wDAAwD,MAAQ,GAAG,SAAW,wWAAwW,eAAiB,CAAC,myBAAmyB,WAAa,MAEr1EqF,EAAwBG,OAAS,CAChC,eAAkB,0DAClB,iBAAoB,4DACpB,SAAY,oDACZ,QAAW,oDAEZ,W,iFCVIH,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOvF,GAAI,wEAAyE,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iCAAiC,MAAQ,GAAG,SAAW,sBAAsB,eAAiB,CAAC,sCAAsC,WAAa,MAE/RqF,EAAwBG,OAAS,CAChC,UAAa,gDAEd,W","sources":["webpack://@pih/esm-pathology-app/./src/pathology.css?9d3a","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.css?a61d","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.resource.ts","webpack://@pih/esm-pathology-app/./src/Print-to-PDF/Document-Component.tsx","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.tsx","webpack://@pih/esm-pathology-app/./src/PathologySystem.tsx","webpack://@pih/esm-pathology-app/./src/pathology-report/ReportComponent.css","webpack://@pih/esm-pathology-app/./src/pathology.css"],"sourcesContent":["\n import API from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./pathology.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./pathology.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./ReportComponent.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./ReportComponent.css\";\n export default content && content.locals ? content.locals : undefined;\n","import { openmrsFetch } from \"@openmrs/esm-framework\";\nimport cloneDeep from \"lodash-es/cloneDeep\";\n\n\nexport interface EncounterResult {\n family_name: string;\n given_name: string;\n middle_name: string;\n patientPhoneNumber: { value: string };\n patientHealthCenter: string;\n patientUuid: string;\n encounterUuid: string;\n encounterId: number;\n personId: number;\n encounterDatetime: Date;\n sampleStatusObs: string;\n referralStatusObs: string;\n sampleDropoffObs: string;\n resultsEncounterId: string;\n resultsEncounterUuid: string;\n resultsEncounter: [];\n approvedBy: string;\n approvalObsUuid: string;\n pathologicDiagnosisObs: string;\n}\nexport interface Patient {\n uuid: string;\n}\nexport interface Concept {\n uuid: string;\n name: string;\n display: string;\n}\n\nexport interface Obs {\n patientUuid: string;\n obsDateTime: string;\n sampleDropoffObsUuid: string;\n referralStatusObsUuid: string;\n sampleStatusObsUuid: string;\n location: string;\n encounterUuid: string;\n valueCodedName: string;\n voided: boolean;\n resultsEncounterUuid: string;\n}\n\n\nexport async function getUserLocation(healthCenterAttrTypeUUID) {\n const session = await openmrsFetch(`/ws/rest/v1/session`);\n const personUuid = session.data.user.person.uuid;\n const person = await openmrsFetch(\n `/ws/rest/v1/person/${personUuid}/attribute`\n );\n const hcPersonAttribute = person.data.results.filter(\n (attr) => attr.attributeType.uuid === healthCenterAttrTypeUUID\n );\n return hcPersonAttribute[0] && hcPersonAttribute[0].value.uuid;\n}\n\nexport async function getConceptAnswers(conceptUuid) {\n const concept = await openmrsFetch(\n `/ws/rest/v1/concept/${conceptUuid}?v=full`\n );\n return concept.data.answers;\n}\n\nexport async function getLocations() {\n const location = await openmrsFetch(`/ws/rest/v1/location`);\n\n return location.data.results;\n}\n\nexport async function getEncounters(\n healthCenterAttrTypeUUID: string,\n pathologyFullAllowedLocationUUID: string\n): Promise<Array<EncounterResult>> {\n const userLocationUUID = await getUserLocation(healthCenterAttrTypeUUID);\n\n let searchEncounter = null;\n if (\n userLocationUUID &&\n userLocationUUID != pathologyFullAllowedLocationUUID\n ) {\n searchEncounter = await openmrsFetch(\n `/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0?location=${userLocationUUID}`\n );\n } else {\n searchEncounter = await openmrsFetch(\n `/ws/rest/v1/reportingrest/reportdata/996cf192-ff54-11eb-a63a-080027ce9ca0`\n );\n }\n\n const EncListClone = searchEncounter.data.dataSets[0].rows.map(async (encObject)=>{\n if(encObject.resultsEncounterUuid){\n const encIndex = searchEncounter.data.dataSets[0].rows.findIndex(\n (enc) => enc.encounterUuid == encObject.encounterUuid\n );\n const resultsEnc =await getEncounter(encObject.resultsEncounterUuid);\n encObject.resultsEncounter = resultsEnc;\n \n }\n return encObject; \n });\n \n return Promise.all(EncListClone);\n}\n\nexport async function postSampleDropoffObs(\n obsObject: Obs,\n sampleDropOffconceptUUID: string,\n healthCenterAttrTypeUUID: string,\n yesConceptName: string\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: sampleDropOffconceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: yesConceptName,\n voided: false,\n };\n\n const response = await openmrsFetch(\"/ws/rest/v1/obs\", {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n });\n return response;\n}\n\nexport async function voidSampleDropoff(sampleDropoffObsUuid: string) {\n const ObsObjectTocreate = {\n voided: true,\n };\n\n const response = await openmrsFetch(\n `/ws/rest/v1/obs/${sampleDropoffObsUuid}`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n }\n );\n\n return response;\n}\n\nexport async function postSampleStatusChangeObs(\n newStatusUuid: string,\n obs: Obs,\n sampleStatusConceptUUID: string,\n healthCenterAttrTypeUUID: string\n) {\n const postBody = {\n person: obs.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: sampleStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obs.encounterUuid,\n value: newStatusUuid,\n voided: false,\n };\n\n const response = await openmrsFetch(\"/ws/rest/v1/obs\", {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: postBody,\n });\n\n return response;\n}\n\nexport async function updateSampleStatusChangeObs(\n newStatus: null | { uuid: string; display: string },\n obsObject: Obs,\n sampleStatusConceptUUID: string,\n healthCenterAttrTypeUUID: string\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: sampleStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: newStatus.uuid,\n voided: newStatus ? false : true,\n };\n\n const response = await openmrsFetch(\n `/ws/rest/v1/obs/${obsObject.sampleStatusObsUuid}`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n }\n );\n\n return response;\n}\n\nexport async function postReferralStatusChangeObs(\n targetValueUuid: string,\n obsObject: Obs,\n referralStatusConceptUUID: string,\n healthCenterAttrTypeUUID: string\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: referralStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: targetValueUuid,\n voided: false,\n };\n\n const response = await openmrsFetch(\"/ws/rest/v1/obs\", {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n });\n\n return response;\n}\n\nexport async function updateReferralStatusChangeObs(\n targetValue,\n obsObject: Obs,\n referralStatusConceptUUID,\n healthCenterAttrTypeUUID\n) {\n const ObsObjectTocreate = {\n person: obsObject.patientUuid,\n obsDatetime: new Date().toISOString(),\n concept: referralStatusConceptUUID,\n location: await getUserLocation(healthCenterAttrTypeUUID),\n encounter: obsObject.encounterUuid,\n value: targetValue.uuid,\n voided: targetValue ? false : true,\n };\n\n const response = await openmrsFetch(\n `/ws/rest/v1/obs/${obsObject.referralStatusObsUuid}`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: ObsObjectTocreate,\n }\n );\n\n return response;\n}\n\n\n\nexport async function getUser(userUuid: string) {\n const user = await openmrsFetch(`/ws/rest/v1/user/${userUuid}`);\n\n return user.data;\n}\nexport async function getEncounter(encounterUuid) {\n const encResult = await openmrsFetch(`/ws/rest/v1/encounter/${encounterUuid}?v=full`);\n \n return encResult.data;\n}","import React from \"react\";\nimport {\n Document,\n Page,\n Text,\n Image,\n View,\n StyleSheet,\n Font,\n} from \"@react-pdf/renderer\";\nimport ButaroLogo from \"../images/ButaroHospitalLogo.gif\";\nimport GeorgiaFontBold from \"../Fonts/georgia/georgia-bold.ttf\";\nimport GeorgiaFont from \"../Fonts/georgia/Georgia.ttf\";\n\nFont.register({ family: \"GeorgiaBold\", src: GeorgiaFontBold });\nFont.register({ family: \"Georgia\", src: GeorgiaFont });\n\n// Create styles\nconst styles = StyleSheet.create({\n page: {\n flexDirection: \"row\",\n },\n section: {\n margin: 10,\n padding: 20,\n flexGrow: 1,\n },\n textLabels: {\n padding: 7,\n fontFamily: \"GeorgiaBold\",\n fontSize: 16,\n fontWeight: \"bold\",\n paddingBottom: 30,\n },\n sentenceLabels: {\n paddingTop: 7,\n fontFamily: \"GeorgiaBold\",\n fontSize: 16,\n fontWeight: \"bold\",\n paddingBottom: 3,\n },\n textAnswers: {\n margin: 10,\n padding: 20,\n fontFamily: \"Georgia\",\n fontSize: 14,\n },\n sentenceAnswers: {\n marginBottom: 10,\n paddingBottom: 20,\n fontFamily: \"Georgia\",\n fontSize: 14,\n },\n logo: {\n width: 61,\n },\n});\n\n// Create Document Component\nconst MyDocument = (props) => (\n <Document\n title={`Pathology report \n ${props.encounterInfo.family_name} \n ${props.encounterInfo.given_name} \n ${props.encounterInfo.middle_name} `}\n >\n <Page size=\"A4\" style={styles.page}>\n <View style={styles.section}>\n <Image style={styles.logo} src={ButaroLogo} />\n <Text style={{ fontSize: 8 }}>Butaro Hospital</Text>\n <Text style={{ position: \"absolute\", top: 0, left: 300, width: 300 }}>\n <Text style={styles.textAnswers}>Lab phone number:</Text>\n <Text> 0784433618</Text>\n </Text>\n <Text style={{ position: \"absolute\", top: 15, left: 300, width: 300 }}>\n <Text style={styles.textAnswers}>Accession number:</Text>\n <Text>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid == props.config.AccessionNumberconceptUUID &&\n obser.value\n )}\n </Text>\n </Text>\n <Text\n style={{\n borderBottom: \"1px\",\n textAlign: \"center\",\n fontWeight: 1500,\n marginBottom: 30,\n fontFamily: \"GeorgiaBold\",\n }}\n >\n Pathology Report\n </Text>\n <Text style={{ paddingBottom: 10 }}>\n <Text style={styles.textAnswers}>Patient Name:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.family_name} {props.encounterInfo.given_name}{\" \"}\n {props.encounterInfo.middle_name}\n </Text>\n </Text>\n <Text\n style={{\n paddingBottom: 10,\n position: \"absolute\",\n top: 140,\n left: 335,\n }}\n >\n <Text style={styles.textAnswers}>Surgery Date:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid ==\n props.config.DateBiopsySpecimenTakenconceptUUID &&\n new Date(obser.value).toLocaleString(\n [\"en-GB\", \"en-US\", \"en\", \"fr-RW\"],\n { day: \"numeric\", month: \"numeric\", year: \"numeric\" }\n )\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10 }}>\n <Text style={styles.textAnswers}>Patient Birthdate:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {new Date(props.encounterInfo.personBirthdate).toLocaleString(\n [\"en-GB\", \"en-US\", \"en\", \"fr-RW\"],\n { day: \"numeric\", month: \"numeric\", year: \"numeric\" }\n )}\n </Text>\n </Text>\n <Text\n style={{\n paddingBottom: 10,\n position: \"absolute\",\n top: 168,\n left: 335,\n width: 200,\n }}\n >\n <Text style={styles.textAnswers}>Specimen Reception Date:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid ==\n props.config.SpecimenSubmissionDateconceptUUID &&\n new Date(obser.value).toLocaleString(\n [\"en-GB\", \"en-US\", \"en\", \"fr-RW\"],\n { day: \"numeric\", month: \"numeric\", year: \"numeric\" }\n )\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10, borderBottom: \"1px\" }}>\n <Text style={styles.textAnswers}>Patient Gender:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.personGender}\n </Text>\n </Text>\n <Text\n style={{\n paddingBottom: 10,\n position: \"absolute\",\n top: 200,\n left: 335,\n width: 250,\n }}\n >\n <Text style={styles.textAnswers}>Signout Date:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {new Date(\n props.encounterInfo.resultsEncounter.encounterDatetime\n ).toLocaleString([\"en-GB\", \"en-US\", \"en\", \"fr-RW\"], {\n day: \"numeric\",\n month: \"numeric\",\n year: \"numeric\",\n })}\n </Text>\n </Text>\n\n <Text style={{ paddingBottom: 10 }}>\n <Text style={styles.textLabels}>Sending Physician:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid ==\n props.config.SendingPhysicianconceptUUID && obser.value\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10 }}>\n <Text style={styles.textLabels}>Sending Facility:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid ==\n props.config.OtherBiopsyLocationconceptUUID && obser.value\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10, fontFamily: \"Georgia\" }}>\n Anatomical location:\n </Text>\n <Text style={{ paddingBottom: 10, paddingLeft: 10 }}>\n <Text style={styles.textLabels}>i.System:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid == props.config.OrganSystemconceptUUID &&\n obser.value.name.display + \", \"\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10, paddingLeft: 10 }}>\n <Text style={styles.textLabels}>ii.Organ:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid == props.config.OrganconceptUUID &&\n obser.value.name.display + \", \"\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10, paddingLeft: 10 }}>\n <Text style={styles.textLabels}>iii.Detail:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid == props.config.SpecimenDetailconceptUUID &&\n obser.value\n )}\n </Text>\n </Text>\n <Text style={{ paddingBottom: 10 }}>\n <Text style={styles.textLabels}>Procedure type:</Text>\n <Text style={styles.textAnswers}>\n {\" \"}\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid ==\n props.config.OtherTestsOrProceduresconceptUUID && obser.value\n )}\n </Text>\n </Text>\n <Text style={[styles.sentenceLabels]}>Gross Description:</Text>\n <Text style={[styles.sentenceAnswers]}>\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid == props.config.GrossDescriptionconceptUUID &&\n obser.value\n )}\n </Text>\n <Text style={styles.sentenceLabels}>Microscopic Examination:</Text>\n <Text style={styles.sentenceAnswers}>\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid ==\n props.config.MacroscopicExaminationconceptUUID && obser.value\n )}\n </Text>\n <Text style={styles.sentenceLabels}>Conclusion:</Text>\n <Text style={styles.sentenceAnswers}>\n {props.encounterInfo.resultsEncounter.obs.map(\n (obser) =>\n obser.concept.uuid ==\n props.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID &&\n obser.value\n )}\n </Text>\n\n <Text style={{ paddingBottom: 10 }}>\n <Text style={styles.textLabels}>Validated by pathologist:</Text>\n <Text style={[styles.textAnswers, { fontWeight: \"bold\" }]}>\n {\" \"}\n {props.encounterInfo.approvedBy}\n </Text>\n </Text>\n </View>\n </Page>\n </Document>\n);\n\nexport default MyDocument;\n","import React from \"react\";\nimport { useConfig } from \"@openmrs/esm-framework\";\nimport cloneDeep from \"lodash-es/cloneDeep\";\nimport DataTable, {\n Table,\n TableHead,\n TableRow,\n TableHeader,\n TableBody,\n TableCell,\n} from \"carbon-components-react/es/components/DataTable\";\nimport { PDFDownloadLink, PDFViewer } from \"@react-pdf/renderer\";\n\nimport styles from \"./ReportComponent.css\";\nimport {\n getUserLocation,\n getConceptAnswers,\n getLocations,\n getEncounters,\n postSampleDropoffObs,\n voidSampleDropoff,\n postSampleStatusChangeObs,\n updateSampleStatusChangeObs,\n postReferralStatusChangeObs,\n updateReferralStatusChangeObs,\n EncounterResult,\n getUser,\n Concept,\n getEncounter,\n} from \"./ReportComponent.resource\";\nimport MyDocument from \"../Print-to-PDF/Document-Component\";\nimport { Config } from \"../config-schema\";\n\nconst ReportComponent = () => {\n const config = useConfig() as Config;\n const [userLocation, setUserLocation] = React.useState();\n const [encountersList, setEncountersList] = React.useState<\n Array<EncounterResult>\n >([]);\n const [sendingHospital, setSendingHospital] = React.useState(\"\");\n const [listOfHospitals, setListOfHospitals] = React.useState([]);\n const [sampleStatusAnswers, setSampleStatusAnswers] = React.useState<\n Array<Concept>\n >([]);\n const [referralStatusAnswers, setReferralStatusAnswers] = React.useState<\n Array<Concept>\n >([]);\n const [sampleStatus, setSampleStatus] = React.useState(\"\");\n const [referralStatus, setReferralStatus] = React.useState(\"\");\n const [patientName, setPatientName] = React.useState(\"\");\n const headers = [\n {\n key: \"patientNames\",\n header: \"Patient name\",\n },\n {\n key: \"pathologyRequest\",\n header: \"pathology request\",\n },\n {\n key: \"sendingHospital\",\n header: \"Sending Hospital\",\n },\n {\n key: \"phoneNumber\",\n header: \"Phone number\",\n },\n {\n key: \"sampleStatus\",\n header: \"Sample status\",\n },\n {\n key: \"dateOfRequest\",\n header: \"Date of Request\",\n },\n {\n key: \"referralStatus\",\n header: \"Referral status\",\n },\n {\n key: \"sampleDropOff\",\n header: \"Sample drop off?\",\n },\n {\n key: \"pathologicDiagnosisObs\",\n header: \"Pathologic diagnosis\",\n },\n {\n key: \"resultsEncounter\",\n header: \"Results\",\n },\n {\n key: \"PDFReport\",\n header: \"Report\",\n },\n ];\n\n React.useEffect(() => {\n getUserLocation(config.healthCenterAttrTypeUUID).then(setUserLocation);\n getLocations().then(setListOfHospitals);\n getConceptAnswers(config.sampleStatusConceptUUID).then(\n setSampleStatusAnswers\n );\n getConceptAnswers(config.referralStatusConceptUUID).then(\n setReferralStatusAnswers\n );\n getEncounters(\n config.healthCenterAttrTypeUUID,\n config.pathologyFullAllowedLocationUUID\n ).then(setEncountersList);\n }, []);\n\n const filteredEncList = encountersList\n .filter(\n (encList) =>\n !sampleStatus ||\n encList.sampleStatusObs?.toLowerCase() == sampleStatus.toLowerCase()\n )\n .filter(\n (encList) =>\n !referralStatus ||\n encList.referralStatusObs?.toLowerCase() == referralStatus.toLowerCase()\n )\n .filter(\n (encList) =>\n !sendingHospital ||\n encList.patientHealthCenter?.toLowerCase() ==\n sendingHospital.toLowerCase()\n )\n .filter((encList) => {\n if (!patientName) {\n return true;\n } else {\n // Given a patient name filter input, break it up into tokens.\n // Filter to patients for which each token matches.\n // Matching is case-insensitive and matches the beginning of each name.\n const nameTokens = patientName.split(/\\s+/);\n const name = `${encList.family_name} ${encList.middle_name} ${encList.given_name}`;\n return nameTokens.every((token) =>\n new RegExp(\"\\\\b\" + token, \"i\").test(name)\n );\n }\n });\n\n const rows = filteredEncList.map((encounterInfo) => {\n return {\n id: encounterInfo.encounterId,\n patientNames: (\n <a\n data-testid=\"patientNames\"\n href={`/openmrs/patientDashboard.form?patientId=${encounterInfo.personId}`}\n >\n {encounterInfo.family_name}\n {\" \"}\n {encounterInfo.given_name}\n {\" \"}\n {encounterInfo.middle_name}\n </a>\n ),\n pathologyRequest: (\n <a\n href={`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${encounterInfo.encounterId}&mode=VIEW`}\n >\n {\" \"}\n Link{\" \"}\n </a>\n ),\n sendingHospital: encounterInfo.patientHealthCenter,\n phoneNumber: encounterInfo.patientPhoneNumber || \"\",\n sampleStatus: (\n <select\n onChange={(e) =>\n sampleStatusChange(\n {\n uuid: e.target.value,\n display: e.target.options[e.target.selectedIndex].text,\n },\n encounterInfo\n )\n }\n >\n <option value=\"\"></option>\n {sampleStatusAnswers.map((ans) => (\n <option\n data-testid=\"sampleStatus-option\"\n value={ans.uuid}\n key={ans.uuid}\n selected={\n encounterInfo.sampleStatusObs\n ? encounterInfo.sampleStatusObs === ans.display && true\n : false\n }\n >\n {ans.display}\n </option>\n ))}\n </select>\n ),\n dateOfRequest: new Date(encounterInfo.encounterDatetime).toLocaleString(\n [\"en-GB\", \"en-US\", \"en\", \"fr-RW\"],\n { day: \"numeric\", month: \"numeric\", year: \"numeric\" }\n ),\n referralStatus: (\n <select\n onChange={(e) =>\n referralStatusChange(\n {\n uuid: e.target.value,\n display: e.target.options[e.target.selectedIndex].text,\n },\n encounterInfo\n )\n }\n >\n <option data-testid=\"referralStatus-option\" value=\"\"></option>\n {referralStatusAnswers.map((ans) => (\n <option\n value={ans.uuid}\n key={ans.uuid}\n selected={\n encounterInfo.referralStatusObs &&\n encounterInfo.referralStatusObs === ans.display\n }\n >\n {ans.display}\n </option>\n ))}\n </select>\n ),\n sampleDropOff: (\n <input\n data-testid=\"sampleDropOff\"\n type=\"checkbox\"\n checked={Boolean(encounterInfo.sampleDropoffObs)}\n onChange={(e) => sampleDropOffChange(encounterInfo)}\n />\n ),\n pathologicDiagnosisObs: encounterInfo.pathologicDiagnosisObs,\n resultsEncounter: encounterInfo.resultsEncounterId ? (\n <a\n data-testid=\"resultsEncounter\"\n href={`/openmrs/module/htmlformentry/htmlFormEntry.form?encounterId=${encounterInfo.resultsEncounterId}&mode=VIEW`}\n >\n {\" \"}\n Results{\" \"}\n </a>\n ) : (\n (!userLocation ||\n userLocation === config.pathologyFullAllowedLocationUUID) && (\n <a\n href={`/openmrs/module/htmlformentry/htmlFormEntry.form?personId=${encounterInfo.personId}&patientId=${encounterInfo.personId}&returnUrl=&formId=${config.pathologyResultsFromID}&uuid=${encounterInfo.encounterUuid}`}\n >\n {\" \"}\n Fill in results{\" \"}\n </a>\n )\n ),\n PDFReport: encounterInfo.resultsEncounterId &&\n encounterInfo.approvedBy && (\n <PDFDownloadLink\n document={\n <MyDocument encounterInfo={encounterInfo} config={config} />\n }\n fileName=\"Pathology Report\"\n >\n {({ loading }) =>\n loading ? \"loading...\" : <button>Download</button>\n }\n </PDFDownloadLink>\n ),\n };\n });\n\n const sampleDropOffChange = (encounterInfo) => {\n const tempEncList = cloneDeep(encountersList);\n if (!encounterInfo.sampleDropoffObs) {\n postSampleDropoffObs(\n encounterInfo,\n config.sampleDropOffconceptUUID,\n config.healthCenterAttrTypeUUID,\n config.yesConceptUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleDropoffObs = config.yesConceptName;\n tempEncList[encIndex].sampleDropoffObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n }\n });\n } else {\n voidSampleDropoff(encounterInfo.sampleDropoffObsUuid).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleDropoffObs = \"\";\n tempEncList[encIndex].sampleDropoffObsUuid = \"\";\n setEncountersList(tempEncList);\n }\n });\n }\n };\n\n const sampleStatusChange = (\n newStatus: { uuid: string; display: string },\n encounterInfo\n ) => {\n const tempEncList = cloneDeep(encountersList);\n if (!encounterInfo.sampleStatusObs) {\n postSampleStatusChangeObs(\n newStatus.uuid,\n encounterInfo,\n config.sampleStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleStatusObs = newStatus.display;\n tempEncList[encIndex].sampleStatusObsUuid = response.data.uuid;\n\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n } else {\n updateSampleStatusChangeObs(\n newStatus,\n encounterInfo,\n config.sampleStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].sampleStatusObs = newStatus.display;\n tempEncList[encIndex].sampleStatusObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n }\n };\n\n const referralStatusChange = (targetedElem, encounterInfo) => {\n const tempEncList = cloneDeep(encountersList);\n if (!encounterInfo.referralStatusObs) {\n postReferralStatusChangeObs(\n targetedElem.uuid,\n encounterInfo,\n config.referralStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].referralStatusObs = targetedElem.display;\n tempEncList[encIndex].referralStatusObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n } else {\n updateReferralStatusChangeObs(\n targetedElem,\n encounterInfo,\n config.referralStatusConceptUUID,\n config.healthCenterAttrTypeUUID\n ).then((response) => {\n if (response.ok) {\n const encIndex = tempEncList.findIndex(\n (enc) => enc.encounterUuid == encounterInfo.encounterUuid\n );\n tempEncList[encIndex].referralStatusObs = targetedElem.display;\n tempEncList[encIndex].referralStatusObsUuid = response.data.uuid;\n setEncountersList(tempEncList);\n } else {\n setEncountersList(tempEncList);\n //Need error message\n }\n });\n }\n };\n\n return (\n <div>\n <div className={styles.filtersContainer}>\n <label htmlFor=\"sending-hospital\">Sending Hospital </label>\n <select\n id=\"sending-hospital\"\n className={styles.dropdown}\n value={sendingHospital}\n onChange={(e) => setSendingHospital(e.target.value)}\n >\n <option value=\"\"></option>\n {listOfHospitals.map((loc) =>\n userLocation &&\n userLocation !== config.pathologyFullAllowedLocationUUID ? (\n loc.uuid === userLocation ? (\n <option value={loc.display} key={loc.uuid}>\n {loc.display}\n </option>\n ) : null\n ) : (\n <option value={loc.display} key={loc.uuid}>\n {loc.display}\n </option>\n )\n )}\n </select>\n <label htmlFor=\"sample-status\">Sample Status </label>\n <select\n id=\"sample-status\"\n className={styles.dropdown}\n value={sampleStatus}\n onChange={(e) => setSampleStatus(e.target.value)}\n >\n <option value=\"\"></option>\n {sampleStatusAnswers.map((ans) => (\n <option value={ans.display} key={ans.uuid}>\n {ans.display}\n </option>\n ))}\n </select>\n <label htmlFor=\"referral-status\">Referral Status </label>\n <select\n id=\"referral-status\"\n className={styles.dropdown}\n value={referralStatus}\n onChange={(e) => setReferralStatus(e.target.value)}\n >\n <option value=\"\"></option>\n {referralStatusAnswers.map((ans) => (\n <option value={ans.display} key={ans.uuid}>\n {ans.display}\n </option>\n ))}\n </select>\n\n <label htmlFor=\"patient-name\">Patient Name </label>\n <input\n id=\"patient-name\"\n className={styles.textBox}\n type=\"text\"\n onChange={(e) => setPatientName(e.target.value)}\n />\n </div>\n {console.log(encountersList)}\n <div className={styles.tableContainer}>\n <DataTable rows={rows} headers={headers}>\n {({ rows, headers, getTableProps, getHeaderProps, getRowProps }) => (\n <Table {...getTableProps()}>\n <TableHead>\n <TableRow>\n {headers.map((header) => (\n <TableHeader {...getHeaderProps({ header })}>\n {header.header}\n </TableHeader>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {rows.map((row) => (\n <TableRow {...getRowProps({ row })}>\n {row.cells.map((cell) => (\n <TableCell key={cell.id}>{cell.value}</TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )}\n </DataTable>\n </div>\n <div></div>\n </div>\n );\n};\n\nexport default ReportComponent;\n","import React from \"react\";\nimport styles from \"./pathology.css\";\nimport ReportComponent from \"./pathology-report/ReportComponent\";\n\nconst PathologySystem = () => {\n return (\n <div className={`omrs-main-content ${styles.container}`}>\n <ReportComponent />\n </div>\n );\n};\nexport default PathologySystem;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".-esm-pathology__ReportComponent__tableContainer___uOmmk {\\n height: 500px;\\n overflow-x: auto;\\n margin: 0 1rem;\\n border: 2px solid lightgrey;\\n border-radius: 0.25rem;\\n}\\n\\n.-esm-pathology__ReportComponent__filtersContainer___avnpi {\\n border-radius: 0.25rem;\\n margin: 0 1rem;\\n padding-top: 4%;\\n}\\n\\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe {\\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___Lr3Fe:disabled {\\n opacity: 0.8;\\n background: lightgrey;\\n cursor: not-allowed;\\n}\\n.-esm-pathology__ReportComponent__dropdown___Lr3Fe:focus {\\n border: 2px solid var(--omrs-color-interaction);\\n outline: 0;\\n}\\n.-esm-pathology__ReportComponent__textBox___-gvpP {\\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\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/pathology-report/ReportComponent.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,2BAA2B;EAC3B,sBAAsB;AACxB;;AAEA;EACE,sBAAsB;EACtB,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,YAAY;EACZ,qBAAqB;EACrB,mBAAmB;AACrB;AACA;EACE,+CAA+C;EAC/C,UAAU;AACZ;AACA;EACE,uBAAuB;EACvB,uDAAuD;EACvD,4BAA4B;EAC5B,kBAAkB;EAClB,YAAY;AACd\",\"sourcesContent\":[\".tableContainer {\\n height: 500px;\\n overflow-x: auto;\\n margin: 0 1rem;\\n border: 2px solid lightgrey;\\n border-radius: 0.25rem;\\n}\\n\\n.filtersContainer {\\n border-radius: 0.25rem;\\n margin: 0 1rem;\\n padding-top: 4%;\\n}\\n\\n.dropdown {\\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.dropdown:disabled {\\n opacity: 0.8;\\n background: lightgrey;\\n cursor: not-allowed;\\n}\\n.dropdown:focus {\\n border: 2px solid var(--omrs-color-interaction);\\n outline: 0;\\n}\\n.textBox {\\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\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"tableContainer\": \"-esm-pathology__ReportComponent__tableContainer___uOmmk\",\n\t\"filtersContainer\": \"-esm-pathology__ReportComponent__filtersContainer___avnpi\",\n\t\"dropdown\": \"-esm-pathology__ReportComponent__dropdown___Lr3Fe\",\n\t\"textBox\": \"-esm-pathology__ReportComponent__textBox___-gvpP\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".-esm-pathology__pathology__container___ny2VS {\\n padding: 2em;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/pathology.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,YAAY;AACd\",\"sourcesContent\":[\".container {\\n padding: 2em;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": \"-esm-pathology__pathology__container___ny2VS\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","undefined","async","getUserLocation","healthCenterAttrTypeUUID","personUuid","openmrsFetch","data","user","person","uuid","hcPersonAttribute","results","filter","attr","attributeType","value","getConceptAnswers","conceptUuid","answers","Font","family","src","GeorgiaFontBold","GeorgiaFont","styles","StyleSheet","page","flexDirection","section","margin","padding","flexGrow","textLabels","fontFamily","fontSize","fontWeight","paddingBottom","sentenceLabels","paddingTop","textAnswers","sentenceAnswers","marginBottom","logo","width","props","title","encounterInfo","family_name","given_name","middle_name","size","style","ButaroLogo","position","top","left","resultsEncounter","obs","map","obser","concept","config","AccessionNumberconceptUUID","borderBottom","textAlign","DateBiopsySpecimenTakenconceptUUID","Date","toLocaleString","day","month","year","personBirthdate","SpecimenSubmissionDateconceptUUID","personGender","encounterDatetime","SendingPhysicianconceptUUID","OtherBiopsyLocationconceptUUID","paddingLeft","OrganSystemconceptUUID","name","display","OrganconceptUUID","SpecimenDetailconceptUUID","OtherTestsOrProceduresconceptUUID","GrossDescriptionconceptUUID","MacroscopicExaminationconceptUUID","COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID","approvedBy","useConfig","userLocation","setUserLocation","React","encountersList","setEncountersList","sendingHospital","setSendingHospital","listOfHospitals","setListOfHospitals","sampleStatusAnswers","setSampleStatusAnswers","referralStatusAnswers","setReferralStatusAnswers","sampleStatus","setSampleStatus","referralStatus","setReferralStatus","patientName","setPatientName","then","getLocations","sampleStatusConceptUUID","referralStatusConceptUUID","pathologyFullAllowedLocationUUID","userLocationUUID","searchEncounter","EncListClone","dataSets","rows","encObject","resultsEncounterUuid","findIndex","enc","encounterUuid","resultsEnc","getEncounter","Promise","all","getEncounters","encList","sampleStatusObs","toLowerCase","referralStatusObs","patientHealthCenter","nameTokens","split","every","token","RegExp","test","id","encounterId","patientNames","href","personId","pathologyRequest","phoneNumber","patientPhoneNumber","onChange","e","sampleStatusChange","target","selectedIndex","text","ans","key","selected","dateOfRequest","referralStatusChange","sampleDropOff","type","checked","Boolean","sampleDropoffObs","sampleDropOffChange","pathologicDiagnosisObs","resultsEncounterId","pathologyResultsFromID","PDFReport","document","fileName","loading","tempEncList","cloneDeep","sampleDropoffObsUuid","method","headers","body","voided","voidSampleDropoff","response","ok","encIndex","obsObject","sampleDropOffconceptUUID","yesConceptName","ObsObjectTocreate","patientUuid","obsDatetime","toISOString","location","encounter","postSampleDropoffObs","yesConceptUUID","newStatus","sampleStatusObsUuid","updateSampleStatusChangeObs","newStatusUuid","postBody","postSampleStatusChangeObs","targetedElem","targetValue","referralStatusObsUuid","updateReferralStatusChangeObs","targetValueUuid","postReferralStatusChangeObs","className","htmlFor","loc","console","log","DataTable","header","getTableProps","getHeaderProps","getRowProps","Table","TableHead","TableRow","TableHeader","TableBody","row","cells","cell","TableCell","___CSS_LOADER_EXPORT___","push","module","locals"],"sourceRoot":""}
|
|
@@ -154,9 +154,9 @@
|
|
|
154
154
|
"initial": false,
|
|
155
155
|
"entry": false,
|
|
156
156
|
"recorded": false,
|
|
157
|
-
"size":
|
|
157
|
+
"size": 251814,
|
|
158
158
|
"sizes": {
|
|
159
|
-
"javascript":
|
|
159
|
+
"javascript": 35536,
|
|
160
160
|
"asset": 216194,
|
|
161
161
|
"consume-shared": 84
|
|
162
162
|
},
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"861.js.map",
|
|
175
175
|
"a5fad24f075c978ac04b.ttf"
|
|
176
176
|
],
|
|
177
|
-
"hash": "
|
|
177
|
+
"hash": "11922baba8ffa5755745",
|
|
178
178
|
"childrenByOrder": {}
|
|
179
179
|
},
|
|
180
180
|
{
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pih/esm-pathology-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "A microfrontend pathology OpenMRS",
|
|
6
6
|
"browser": "dist/pih-esm-pathology-app.js",
|
|
7
7
|
"main": "src/index.ts",
|
|
8
8
|
"source": true,
|
|
9
9
|
"scripts": {
|
|
10
|
-
"start": "openmrs develop --backend http://
|
|
10
|
+
"start": "openmrs develop --backend http://imb.pih-emr.org:8096",
|
|
11
11
|
"serve": "webpack serve --mode development",
|
|
12
12
|
"build": "webpack --mode production",
|
|
13
13
|
"analyze": "webpack --mode=production --env.analyze=true",
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Font
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import {
|
|
3
|
+
Document,
|
|
4
|
+
Page,
|
|
5
|
+
Text,
|
|
6
|
+
Image,
|
|
7
|
+
View,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
Font,
|
|
10
|
+
} from "@react-pdf/renderer";
|
|
11
|
+
import ButaroLogo from "../images/ButaroHospitalLogo.gif";
|
|
12
|
+
import GeorgiaFontBold from "../Fonts/georgia/georgia-bold.ttf";
|
|
13
|
+
import GeorgiaFont from "../Fonts/georgia/Georgia.ttf";
|
|
14
14
|
|
|
15
|
+
Font.register({ family: "GeorgiaBold", src: GeorgiaFontBold });
|
|
16
|
+
Font.register({ family: "Georgia", src: GeorgiaFont });
|
|
15
17
|
|
|
16
18
|
// Create styles
|
|
17
19
|
const styles = StyleSheet.create({
|
|
@@ -25,232 +27,270 @@ const styles = StyleSheet.create({
|
|
|
25
27
|
},
|
|
26
28
|
textLabels: {
|
|
27
29
|
padding: 7,
|
|
28
|
-
fontFamily:"GeorgiaBold",
|
|
30
|
+
fontFamily: "GeorgiaBold",
|
|
29
31
|
fontSize: 16,
|
|
30
|
-
fontWeight:
|
|
31
|
-
paddingBottom:30,
|
|
32
|
+
fontWeight: "bold",
|
|
33
|
+
paddingBottom: 30,
|
|
32
34
|
},
|
|
33
35
|
sentenceLabels: {
|
|
34
36
|
paddingTop: 7,
|
|
35
|
-
fontFamily:"GeorgiaBold",
|
|
37
|
+
fontFamily: "GeorgiaBold",
|
|
36
38
|
fontSize: 16,
|
|
37
|
-
fontWeight:
|
|
38
|
-
paddingBottom:3,
|
|
39
|
+
fontWeight: "bold",
|
|
40
|
+
paddingBottom: 3,
|
|
39
41
|
},
|
|
40
42
|
textAnswers: {
|
|
41
43
|
margin: 10,
|
|
42
44
|
padding: 20,
|
|
43
|
-
fontFamily:"Georgia",
|
|
45
|
+
fontFamily: "Georgia",
|
|
44
46
|
fontSize: 14,
|
|
45
47
|
},
|
|
46
48
|
sentenceAnswers: {
|
|
47
49
|
marginBottom: 10,
|
|
48
50
|
paddingBottom: 20,
|
|
49
|
-
fontFamily:"Georgia",
|
|
51
|
+
fontFamily: "Georgia",
|
|
50
52
|
fontSize: 14,
|
|
51
53
|
},
|
|
52
54
|
logo: {
|
|
53
55
|
width: 61,
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
+
},
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
// Create Document Component
|
|
59
60
|
const MyDocument = (props) => (
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
<Document
|
|
62
|
+
title={`Pathology report
|
|
62
63
|
${props.encounterInfo.family_name}
|
|
63
64
|
${props.encounterInfo.given_name}
|
|
64
65
|
${props.encounterInfo.middle_name} `}
|
|
65
66
|
>
|
|
66
67
|
<Page size="A4" style={styles.page}>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
<Text style={{
|
|
71
|
-
|
|
72
|
-
<Text
|
|
73
|
-
Lab phone number:
|
|
74
|
-
</Text>
|
|
75
|
-
<Text>{" "}{" "}0784433618</Text>
|
|
68
|
+
<View style={styles.section}>
|
|
69
|
+
<Image style={styles.logo} src={ButaroLogo} />
|
|
70
|
+
<Text style={{ fontSize: 8 }}>Butaro Hospital</Text>
|
|
71
|
+
<Text style={{ position: "absolute", top: 0, left: 300, width: 300 }}>
|
|
72
|
+
<Text style={styles.textAnswers}>Lab phone number:</Text>
|
|
73
|
+
<Text> 0784433618</Text>
|
|
76
74
|
</Text>
|
|
77
|
-
<Text style={{ position: "absolute",top: 15,left: 300,width: 300 }}>
|
|
78
|
-
<Text style={styles.textAnswers}>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
<Text style={{ position: "absolute", top: 15, left: 300, width: 300 }}>
|
|
76
|
+
<Text style={styles.textAnswers}>Accession number:</Text>
|
|
77
|
+
<Text>
|
|
78
|
+
{" "}
|
|
79
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
80
|
+
(obser) =>
|
|
81
|
+
obser.concept.uuid == props.config.AccessionNumberconceptUUID &&
|
|
82
|
+
obser.value
|
|
83
|
+
)}
|
|
84
84
|
</Text>
|
|
85
85
|
</Text>
|
|
86
|
-
<Text
|
|
87
|
-
|
|
86
|
+
<Text
|
|
87
|
+
style={{
|
|
88
|
+
borderBottom: "1px",
|
|
89
|
+
textAlign: "center",
|
|
90
|
+
fontWeight: 1500,
|
|
91
|
+
marginBottom: 30,
|
|
92
|
+
fontFamily: "GeorgiaBold",
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
Pathology Report
|
|
88
96
|
</Text>
|
|
89
|
-
<Text style={{ paddingBottom: 10 }}
|
|
90
|
-
<Text style={styles.textAnswers}>
|
|
91
|
-
Patient Name:
|
|
92
|
-
</Text>
|
|
97
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
98
|
+
<Text style={styles.textAnswers}>Patient Name:</Text>
|
|
93
99
|
<Text style={styles.textAnswers}>
|
|
94
|
-
|
|
95
|
-
{props.encounterInfo.family_name} {" "}
|
|
96
|
-
{props.encounterInfo.
|
|
97
|
-
{props.encounterInfo.middle_name}
|
|
100
|
+
{" "}
|
|
101
|
+
{props.encounterInfo.family_name} {props.encounterInfo.given_name}{" "}
|
|
102
|
+
{props.encounterInfo.middle_name}
|
|
98
103
|
</Text>
|
|
99
|
-
|
|
100
104
|
</Text>
|
|
101
|
-
<Text
|
|
105
|
+
<Text
|
|
106
|
+
style={{
|
|
107
|
+
paddingBottom: 10,
|
|
108
|
+
position: "absolute",
|
|
109
|
+
top: 140,
|
|
110
|
+
left: 335,
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<Text style={styles.textAnswers}>Surgery Date:</Text>
|
|
102
114
|
<Text style={styles.textAnswers}>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
{" "}
|
|
116
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
117
|
+
(obser) =>
|
|
118
|
+
obser.concept.uuid ==
|
|
119
|
+
props.config.DateBiopsySpecimenTakenconceptUUID &&
|
|
120
|
+
new Date(obser.value).toLocaleString(
|
|
121
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
122
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
123
|
+
)
|
|
124
|
+
)}
|
|
111
125
|
</Text>
|
|
112
|
-
|
|
113
126
|
</Text>
|
|
114
|
-
<Text style={{ paddingBottom: 10 }}
|
|
127
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
128
|
+
<Text style={styles.textAnswers}>Patient Birthdate:</Text>
|
|
115
129
|
<Text style={styles.textAnswers}>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
new Date(props.encounterInfo.personBirthdate)
|
|
122
|
-
.toLocaleString(["en-GB","en-US","en","fr-RW"],{day: 'numeric',month: 'numeric',year: 'numeric'})
|
|
123
|
-
}
|
|
130
|
+
{" "}
|
|
131
|
+
{new Date(props.encounterInfo.personBirthdate).toLocaleString(
|
|
132
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
133
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
134
|
+
)}
|
|
124
135
|
</Text>
|
|
125
|
-
|
|
126
136
|
</Text>
|
|
127
|
-
<Text
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
<Text
|
|
138
|
+
style={{
|
|
139
|
+
paddingBottom: 10,
|
|
140
|
+
position: "absolute",
|
|
141
|
+
top: 168,
|
|
142
|
+
left: 335,
|
|
143
|
+
width: 200,
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
<Text style={styles.textAnswers}>Specimen Reception Date:</Text>
|
|
131
147
|
<Text style={styles.textAnswers}>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
148
|
+
{" "}
|
|
149
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
150
|
+
(obser) =>
|
|
151
|
+
obser.concept.uuid ==
|
|
152
|
+
props.config.SpecimenSubmissionDateconceptUUID &&
|
|
153
|
+
new Date(obser.value).toLocaleString(
|
|
154
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
155
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
156
|
+
)
|
|
157
|
+
)}
|
|
137
158
|
</Text>
|
|
138
159
|
</Text>
|
|
139
|
-
<Text style={{ paddingBottom: 10,borderBottom:
|
|
160
|
+
<Text style={{ paddingBottom: 10, borderBottom: "1px" }}>
|
|
161
|
+
<Text style={styles.textAnswers}>Patient Gender:</Text>
|
|
140
162
|
<Text style={styles.textAnswers}>
|
|
141
|
-
|
|
142
|
-
</Text>
|
|
143
|
-
<Text style={styles.textAnswers}>
|
|
144
|
-
{" "}{" "}
|
|
163
|
+
{" "}
|
|
145
164
|
{props.encounterInfo.personGender}
|
|
146
165
|
</Text>
|
|
147
|
-
|
|
148
166
|
</Text>
|
|
149
|
-
<Text
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
167
|
+
<Text
|
|
168
|
+
style={{
|
|
169
|
+
paddingBottom: 10,
|
|
170
|
+
position: "absolute",
|
|
171
|
+
top: 200,
|
|
172
|
+
left: 335,
|
|
173
|
+
width: 250,
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<Text style={styles.textAnswers}>Signout Date:</Text>
|
|
153
177
|
<Text style={styles.textAnswers}>
|
|
154
|
-
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
178
|
+
{" "}
|
|
179
|
+
{new Date(
|
|
180
|
+
props.encounterInfo.resultsEncounter.encounterDatetime
|
|
181
|
+
).toLocaleString(["en-GB", "en-US", "en", "fr-RW"], {
|
|
182
|
+
day: "numeric",
|
|
183
|
+
month: "numeric",
|
|
184
|
+
year: "numeric",
|
|
185
|
+
})}
|
|
159
186
|
</Text>
|
|
160
187
|
</Text>
|
|
161
|
-
|
|
162
|
-
<Text style={{
|
|
163
|
-
<Text style={styles.textLabels}>
|
|
164
|
-
Sending Physician:
|
|
165
|
-
</Text>
|
|
188
|
+
|
|
189
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
190
|
+
<Text style={styles.textLabels}>Sending Physician:</Text>
|
|
166
191
|
<Text style={styles.textAnswers}>
|
|
167
|
-
|
|
168
|
-
|
|
192
|
+
{" "}
|
|
193
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
194
|
+
(obser) =>
|
|
195
|
+
obser.concept.uuid ==
|
|
196
|
+
props.config.SendingPhysicianconceptUUID && obser.value
|
|
197
|
+
)}
|
|
169
198
|
</Text>
|
|
170
199
|
</Text>
|
|
171
|
-
<Text style={{
|
|
172
|
-
<Text style={styles.textLabels}>
|
|
173
|
-
Sending Facility:
|
|
174
|
-
</Text>
|
|
200
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
201
|
+
<Text style={styles.textLabels}>Sending Facility:</Text>
|
|
175
202
|
<Text style={styles.textAnswers}>
|
|
176
|
-
|
|
177
|
-
|
|
203
|
+
{" "}
|
|
204
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
205
|
+
(obser) =>
|
|
206
|
+
obser.concept.uuid ==
|
|
207
|
+
props.config.OtherBiopsyLocationconceptUUID && obser.value
|
|
208
|
+
)}
|
|
178
209
|
</Text>
|
|
179
210
|
</Text>
|
|
180
|
-
<Text style={{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
211
|
+
<Text style={{ paddingBottom: 10, fontFamily: "Georgia" }}>
|
|
212
|
+
Anatomical location:
|
|
213
|
+
</Text>
|
|
214
|
+
<Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
|
|
215
|
+
<Text style={styles.textLabels}>i.System:</Text>
|
|
185
216
|
<Text style={styles.textAnswers}>
|
|
186
|
-
|
|
187
|
-
|
|
217
|
+
{" "}
|
|
218
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
219
|
+
(obser) =>
|
|
220
|
+
obser.concept.uuid == props.config.OrganSystemconceptUUID &&
|
|
221
|
+
obser.value.name.display + ", "
|
|
222
|
+
)}
|
|
188
223
|
</Text>
|
|
189
224
|
</Text>
|
|
190
|
-
<Text style={{
|
|
191
|
-
<Text style={styles.textLabels}>
|
|
192
|
-
ii.Organ:
|
|
193
|
-
</Text>
|
|
225
|
+
<Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
|
|
226
|
+
<Text style={styles.textLabels}>ii.Organ:</Text>
|
|
194
227
|
<Text style={styles.textAnswers}>
|
|
195
|
-
|
|
196
|
-
|
|
228
|
+
{" "}
|
|
229
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
230
|
+
(obser) =>
|
|
231
|
+
obser.concept.uuid == props.config.OrganconceptUUID &&
|
|
232
|
+
obser.value.name.display + ", "
|
|
233
|
+
)}
|
|
197
234
|
</Text>
|
|
198
235
|
</Text>
|
|
199
|
-
<Text style={{
|
|
200
|
-
<Text style={styles.textLabels}>
|
|
201
|
-
iii.Detail:
|
|
202
|
-
</Text>
|
|
236
|
+
<Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
|
|
237
|
+
<Text style={styles.textLabels}>iii.Detail:</Text>
|
|
203
238
|
<Text style={styles.textAnswers}>
|
|
204
|
-
|
|
205
|
-
|
|
239
|
+
{" "}
|
|
240
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
241
|
+
(obser) =>
|
|
242
|
+
obser.concept.uuid == props.config.SpecimenDetailconceptUUID &&
|
|
243
|
+
obser.value
|
|
244
|
+
)}
|
|
206
245
|
</Text>
|
|
207
246
|
</Text>
|
|
208
|
-
<Text style={{
|
|
209
|
-
<Text style={styles.textLabels}>
|
|
210
|
-
Procedure type:
|
|
211
|
-
</Text>
|
|
247
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
248
|
+
<Text style={styles.textLabels}>Procedure type:</Text>
|
|
212
249
|
<Text style={styles.textAnswers}>
|
|
213
|
-
|
|
214
|
-
|
|
250
|
+
{" "}
|
|
251
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
252
|
+
(obser) =>
|
|
253
|
+
obser.concept.uuid ==
|
|
254
|
+
props.config.OtherTestsOrProceduresconceptUUID && obser.value
|
|
255
|
+
)}
|
|
215
256
|
</Text>
|
|
216
257
|
</Text>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
258
|
+
<Text style={[styles.sentenceLabels]}>Gross Description:</Text>
|
|
259
|
+
<Text style={[styles.sentenceAnswers]}>
|
|
260
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
261
|
+
(obser) =>
|
|
262
|
+
obser.concept.uuid == props.config.GrossDescriptionconceptUUID &&
|
|
263
|
+
obser.value
|
|
264
|
+
)}
|
|
265
|
+
</Text>
|
|
266
|
+
<Text style={styles.sentenceLabels}>Microscopic Examination:</Text>
|
|
267
|
+
<Text style={styles.sentenceAnswers}>
|
|
268
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
269
|
+
(obser) =>
|
|
270
|
+
obser.concept.uuid ==
|
|
271
|
+
props.config.MacroscopicExaminationconceptUUID && obser.value
|
|
272
|
+
)}
|
|
273
|
+
</Text>
|
|
274
|
+
<Text style={styles.sentenceLabels}>Conclusion:</Text>
|
|
275
|
+
<Text style={styles.sentenceAnswers}>
|
|
276
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
277
|
+
(obser) =>
|
|
278
|
+
obser.concept.uuid ==
|
|
279
|
+
props.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID &&
|
|
280
|
+
obser.value
|
|
281
|
+
)}
|
|
282
|
+
</Text>
|
|
240
283
|
|
|
241
|
-
|
|
242
|
-
<Text style={styles.textLabels}>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
<Text style= {[styles.textAnswers, { fontWeight: 'bold' }]}>
|
|
246
|
-
{" "}{" "}
|
|
284
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
285
|
+
<Text style={styles.textLabels}>Validated by pathologist:</Text>
|
|
286
|
+
<Text style={[styles.textAnswers, { fontWeight: "bold" }]}>
|
|
287
|
+
{" "}
|
|
247
288
|
{props.encounterInfo.approvedBy}
|
|
248
289
|
</Text>
|
|
249
290
|
</Text>
|
|
250
|
-
</View>
|
|
291
|
+
</View>
|
|
251
292
|
</Page>
|
|
252
293
|
</Document>
|
|
253
294
|
);
|
|
254
295
|
|
|
255
296
|
export default MyDocument;
|
|
256
|
-
|
|
@@ -55,7 +55,7 @@ export async function getUserLocation(healthCenterAttrTypeUUID) {
|
|
|
55
55
|
const hcPersonAttribute = person.data.results.filter(
|
|
56
56
|
(attr) => attr.attributeType.uuid === healthCenterAttrTypeUUID
|
|
57
57
|
);
|
|
58
|
-
return hcPersonAttribute[0] && hcPersonAttribute.value.uuid;
|
|
58
|
+
return hcPersonAttribute[0] && hcPersonAttribute[0].value.uuid;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export async function getConceptAnswers(conceptUuid) {
|
|
@@ -24,8 +24,6 @@ import {
|
|
|
24
24
|
postReferralStatusChangeObs,
|
|
25
25
|
updateReferralStatusChangeObs,
|
|
26
26
|
EncounterResult,
|
|
27
|
-
// postApproval,
|
|
28
|
-
// voidApprovalObs,
|
|
29
27
|
getUser,
|
|
30
28
|
Concept,
|
|
31
29
|
getEncounter,
|
|
@@ -109,9 +107,7 @@ const ReportComponent = () => {
|
|
|
109
107
|
getEncounters(
|
|
110
108
|
config.healthCenterAttrTypeUUID,
|
|
111
109
|
config.pathologyFullAllowedLocationUUID
|
|
112
|
-
).then(
|
|
113
|
-
setEncountersList
|
|
114
|
-
);
|
|
110
|
+
).then(setEncountersList);
|
|
115
111
|
}, []);
|
|
116
112
|
|
|
117
113
|
const filteredEncList = encountersList
|
|
@@ -148,8 +144,6 @@ const ReportComponent = () => {
|
|
|
148
144
|
|
|
149
145
|
const rows = filteredEncList.map((encounterInfo) => {
|
|
150
146
|
return {
|
|
151
|
-
// rows.push({
|
|
152
|
-
// patientLink: <a href={`/openmrs/patientDashboard.form?patientId=${encounterInfo.personId}`} >Link</a>,
|
|
153
147
|
id: encounterInfo.encounterId,
|
|
154
148
|
patientNames: (
|
|
155
149
|
<a
|
|
@@ -202,8 +196,10 @@ const ReportComponent = () => {
|
|
|
202
196
|
))}
|
|
203
197
|
</select>
|
|
204
198
|
),
|
|
205
|
-
dateOfRequest: new Date(encounterInfo.encounterDatetime)
|
|
206
|
-
|
|
199
|
+
dateOfRequest: new Date(encounterInfo.encounterDatetime).toLocaleString(
|
|
200
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
201
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
202
|
+
),
|
|
207
203
|
referralStatus: (
|
|
208
204
|
<select
|
|
209
205
|
onChange={(e) =>
|
|
@@ -259,18 +255,19 @@ const ReportComponent = () => {
|
|
|
259
255
|
</a>
|
|
260
256
|
)
|
|
261
257
|
),
|
|
262
|
-
PDFReport:
|
|
263
|
-
encounterInfo.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
258
|
+
PDFReport: encounterInfo.resultsEncounterId &&
|
|
259
|
+
encounterInfo.approvedBy && (
|
|
260
|
+
<PDFDownloadLink
|
|
261
|
+
document={
|
|
262
|
+
<MyDocument encounterInfo={encounterInfo} config={config} />
|
|
263
|
+
}
|
|
264
|
+
fileName="Pathology Report"
|
|
265
|
+
>
|
|
266
|
+
{({ loading }) =>
|
|
267
|
+
loading ? "loading..." : <button>Download</button>
|
|
268
|
+
}
|
|
269
|
+
</PDFDownloadLink>
|
|
270
|
+
),
|
|
274
271
|
};
|
|
275
272
|
});
|
|
276
273
|
|
|
@@ -300,14 +297,12 @@ const ReportComponent = () => {
|
|
|
300
297
|
);
|
|
301
298
|
tempEncList[encIndex].sampleDropoffObs = "";
|
|
302
299
|
tempEncList[encIndex].sampleDropoffObsUuid = "";
|
|
303
|
-
|
|
304
300
|
setEncountersList(tempEncList);
|
|
305
301
|
}
|
|
306
302
|
});
|
|
307
303
|
}
|
|
308
304
|
};
|
|
309
305
|
|
|
310
|
-
|
|
311
306
|
const sampleStatusChange = (
|
|
312
307
|
newStatus: { uuid: string; display: string },
|
|
313
308
|
encounterInfo
|
|
@@ -397,7 +392,6 @@ const ReportComponent = () => {
|
|
|
397
392
|
});
|
|
398
393
|
}
|
|
399
394
|
};
|
|
400
|
-
|
|
401
395
|
|
|
402
396
|
return (
|
|
403
397
|
<div>
|
|
@@ -462,7 +456,7 @@ const ReportComponent = () => {
|
|
|
462
456
|
onChange={(e) => setPatientName(e.target.value)}
|
|
463
457
|
/>
|
|
464
458
|
</div>
|
|
465
|
-
{console.log(
|
|
459
|
+
{console.log(encountersList)}
|
|
466
460
|
<div className={styles.tableContainer}>
|
|
467
461
|
<DataTable rows={rows} headers={headers}>
|
|
468
462
|
{({ rows, headers, getTableProps, getHeaderProps, getRowProps }) => (
|
|
@@ -489,15 +483,7 @@ const ReportComponent = () => {
|
|
|
489
483
|
)}
|
|
490
484
|
</DataTable>
|
|
491
485
|
</div>
|
|
492
|
-
<div>
|
|
493
|
-
{/* <PDFViewer>
|
|
494
|
-
<MyDocument />
|
|
495
|
-
</PDFViewer> */}
|
|
496
|
-
{/* <PDFDownloadLink document={<MyDocument />} fileName="Pathology Report">
|
|
497
|
-
{({loading}) => (loading ? 'loading...' : <button>Download</button>)}
|
|
498
|
-
</PDFDownloadLink> */}
|
|
499
|
-
|
|
500
|
-
</div>
|
|
486
|
+
<div></div>
|
|
501
487
|
</div>
|
|
502
488
|
);
|
|
503
489
|
};
|