Skip to content

Commit

Permalink
bug fixes, merge branch 'develop' of https://github.com/uwcirg/cosri-…
Browse files Browse the repository at this point in the history
…pain-management-summary into feature/lib-upgrades
  • Loading branch information
Amy Chen authored and Amy Chen committed Dec 17, 2024
2 parents fcd034d + 2874f62 commit 9c0fe33
Show file tree
Hide file tree
Showing 21 changed files with 328 additions and 132 deletions.
2 changes: 1 addition & 1 deletion public/assets/data/patientEducationReferences.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"link": {
"title": "Naloxone Information Sheet",
"className": "education",
"url": "{process.env.PUBLIC_URL}/assets/files/NaloxoneInformationSheet.pdf",
"url": "/assets/files/NaloxoneInformationSheet.pdf",
"type": "PDF",
"size": "142 KB"
}
Expand Down
19 changes: 10 additions & 9 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta charset="utf-8" />
<!-- Use Internet Explorer Edge Standards mode -->
<meta http-equiv="x-ua-compatible" content="IE=edge" >
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico">
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<title>Washington Opioid Clinical Assessment</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
Expand Down
1 change: 1 addition & 0 deletions src/components/CopyButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default class CopyButton extends Component {
"button",
"button-primary",
"button-secondary",
"pagination"
];
return !exclusionClasses.some((classname) =>
node.classList?.contains(classname)
Expand Down
29 changes: 18 additions & 11 deletions src/components/Disclaimer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,24 @@ export default class Disclaimer extends Component {
[show/hide]
</button>
<div className="content">
COSRI incorporates the Clinical Pain Management Summary application,
released as open-source software by CDS Connect project at the
Agency for Healthcare Research and Quality (AHRQ). We have extended
ARHQ's work to provide enhanced security, improved decision support,
integration with state Prescription Drug Monitoring Program
databases, standalone operation, and other features. For a
description of our open source release, contact{" "}
<a href="mailto:[email protected]">[email protected]</a>. Support for the
development of COSRI was provided by the Washington State Department
of Health and the Washington State Health Care Authority through the
CMS Support Act.
<div className="content">
COSRI incorporates the Clinical Pain Management Summary
application, released as open-source software by CDS Connect
project at the Agency for Healthcare Research and Quality (AHRQ).
We have extended ARHQ's work to provide enhanced security,
improved decision support, integration with state Prescription
Drug Monitoring Program databases, standalone operation, and other
features. For a description of our open source release, contact{" "}
<a href="mailto:[email protected]">[email protected]</a>. Support for
the development of COSRI was provided by the Washington State
Department of Health and the Washington State Health Care
Authority through the CMS Support Act. Additional COSRI
implementation and evaluation funding provided by the Centers for
Disease Control and Prevention (CDC) and the Assistant Secretary
for Technology Policy (ASTP) through contract #
GS-35F-0034W/75P00122F80168, awarded to Security Risk Solutions,
Inc.
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/InfoModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class InfoModal extends Component {
{
Header: () => <span className="col-header">Name</span>,
accessor: "name",
minWidth: 225,
minWidth: "45%",
disableSortBy: true,
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/components/Landing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import executeElm from "../../utils/executeELM";
import * as landingUtils from "./utility";
import { datishFormat } from "../../helpers/formatit";
import {
addMatomoTracking,
getEnvSystemType,
getEPICPatientIdFromSource,
getPatientNameFromSource,
Expand Down Expand Up @@ -98,6 +99,8 @@ export default class Landing extends Component {
});
return;
}
// add PIWIK tracking
addMatomoTracking();
writeToLog("application loaded", "info", this.getPatientLogParams());
//set FHIR results
let result = {};
Expand Down
7 changes: 7 additions & 0 deletions src/components/Report/components/ScoringSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ export default class ScoringSummary extends Component {
<CopyButton
buttonTitle="Click to copy scoring summary table"
elementToCopy={this.tableRef.current}
options={{
// workaround for table getting cut off when copying due to overflow
style: {
paddingBottom: "48px",
}
}}

></CopyButton>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Report/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class Report extends Component {
const flagObj = this.getSectionFlags(section);
if (isEmptyArray(flagObj)) return null;
return (
<div className="flags-container">
<div className="flags-container rows">
{flagObj.map((o, index) => {
return (
<div
Expand Down
3 changes: 2 additions & 1 deletion src/components/Summary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Version from "../elements/Version";
import {
getErrorMessageString,
isEmptyArray,
isNumber,
isReportEnabled,
} from "../helpers/utility";
import { getScoringData } from "./Report/utility";
Expand Down Expand Up @@ -361,7 +362,7 @@ export default class Summary extends Component {
...formatterArguments
);
}
return value
return value || isNumber(value)
? value
: headerKey.default
? headerKey.default
Expand Down
63 changes: 50 additions & 13 deletions src/components/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { useFlexLayout, useTable, useSortBy, usePagination } from "react-table";
import AscendingSortImg from "../icons/icon-sort-up.png";
import DescenidngSortImg from "../icons/icon-sort-down.png";

export default function Table({ tableKey, columns, data, tableParams, tableClass }) {
export default function Table({
tableKey,
columns,
data,
tableParams,
tableClass,
}) {
const params = tableParams ? tableParams : {};
// Use the state and functions returned from useTable to build your UI
const {
Expand Down Expand Up @@ -138,21 +144,20 @@ export default function Table({ tableKey, columns, data, tableParams, tableClass
key={`row_${tableKey}_${headerIndex}`}
>
{headerGroup.headers.map((column, colIndex) => {
const headerProps = column.getHeaderProps(column.getSortByToggleProps());
const cellMinSize = column.minWidth ? column.minWidth: "auto";
const cellSize = column.size
? `${column.size}`
: "160px";
const headerProps = column.getHeaderProps(
column.getSortByToggleProps()
);
const cellMinSize = column.minWidth ? column.minWidth : "auto";
const cellSize = column.size ? `${column.size}` : "160px";
return (
<th
{...headerProps}
style={{
...headerProps.style,
flex: `${cellSize} 0 auto`,
width: cellSize,
minWidth: cellMinSize
minWidth: cellMinSize,
}}

key={`th_${tableKey}_${colIndex}`}
>
<div
Expand Down Expand Up @@ -202,7 +207,9 @@ export default function Table({ tableKey, columns, data, tableParams, tableClass
<tr {...row.getRowProps()} key={`tr_${tableKey}_${i}`}>
{row.cells.map((cell, cellIndex) => {
const cellProps = cell.getCellProps();
const cellMinSize = cell.column.minWidth ? cell.column.minWidth: "auto";
const cellMinSize = cell.column.minWidth
? cell.column.minWidth
: "auto";
const cellSize = cell.column.size
? `${cell.column.size}`
: "160px";
Expand All @@ -217,7 +224,7 @@ export default function Table({ tableKey, columns, data, tableParams, tableClass
...cellProps.style,
flex: `${cellSize} 0 auto`,
width: cellSize,
minWidth: cellMinSize
minWidth: cellMinSize,
}}
>
{cell.render("Cell")}
Expand All @@ -228,11 +235,41 @@ export default function Table({ tableKey, columns, data, tableParams, tableClass
);
})}
{emptyRows > 0 && (
<tr className="no-hover">
<td
<tr
className="no-hover"
style={{ display: "flex", flex: "1 0 auto" }}
>
{/* <td
colSpan={columns.length}
style={{ height: 33 * emptyRows }}
></td>
></td> */}
{page[0].cells.map((cell, cellIndex) => {
const cellProps = cell.getCellProps();
const cellMinSize = cell.column.minWidth
? cell.column.minWidth
: "auto";
const cellSize = cell.column.size
? `${cell.column.size}`
: "160px";
return (
<td
{...cellProps}
className={
cell.column.className ? cell.column.className : ""
}
key={`td_${tableKey}_filler_${cellIndex}`}
style={{
...cellProps.style,
flex: `${cellSize} 0 auto`,
width: cellSize,
minWidth: cellMinSize,
height: 26 * emptyRows,
}}
>
&nbsp;
</td>
);
})}
</tr>
)}
</tbody>
Expand Down
13 changes: 10 additions & 3 deletions src/config/report_config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const reportConfig = [
{
id: "CIRG-PainTracker-GE",
key: GE_DATA_KEY,
useDefaultELMLib: true
},
],
//status: "inactive",
Expand Down Expand Up @@ -380,6 +381,7 @@ const reportConfig = [
{
id: "CIRG-PainTracker-TRT",
key: TRT_DATA_KEY,
useDefaultELMLib: true
},
],
icon: (props) => (
Expand All @@ -403,10 +405,12 @@ const reportConfig = [
Name: {
key : "Name",
sortable: true,
size: "100%",
minWidth: "35%"
},
"Ordering Department": "Location",
"Ordering Department": {
key : "Location",
minWidth: "22%"
},
"CPT Code": "CPT_CODE",
},
}}
Expand Down Expand Up @@ -434,7 +438,10 @@ const reportConfig = [
size: "100%",
minWidth: "35%"
},
"Ordering Department": "Location",
"Ordering Department": {
key : "Location",
minWidth: "22%"
},
"CPT Code": "CPT_CODE",
},
}}
Expand Down
46 changes: 33 additions & 13 deletions src/config/summary_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,6 @@
},
"tables": [
{
"defaultSorted": {
"id": "Dispensed",
"desc": true
},
"headers": {
"Drug Description": {
"key": "Name",
Expand Down Expand Up @@ -288,7 +284,7 @@
"formatter": "datishFormat",
"sorter": "dateCompare",
"sortable": true,
"size": "120px"
"size": "140px"
},
"Dispensed": {
"key": "DispensedDate",
Expand Down Expand Up @@ -393,10 +389,34 @@
},
{
"flag": {
"ifOneOrMore": {
"table": "MedicationRequestsForNaloxoneConsideration",
"source": "RiskConsiderations"
}
"ifAnd": [
{
"ifEqualTo": {
"header": "Class",
"targetValue": "opioid"
}
},
{
"ifGreaterThanOrEqualTo": {
"header": "MME",
"targetValue": 50
}
},
{
"ifEqualTo": {
"header": "isActive",
"type": "boolean",
"targetValue": true
}
},
{
"ifEqualTo": {
"header": "isBup",
"type": "boolean",
"targetValue": false
}
}
]
},
"flagText": "Current MME 50 or more, consider prescribing Naloxone",
"flagClass": "info"
Expand Down Expand Up @@ -883,7 +903,7 @@
"Drug Description": {
"key": "Name",
"sortable": true,
"minWidth": "180px"
"minWidth": "220px"
},
"Quantity": {
"key": "Quantity",
Expand Down Expand Up @@ -979,7 +999,7 @@
"Drug Description": {
"key": "Name",
"sortable": true,
"minWidth": "180px"
"minWidth": "220px"
},
"Quantity": {
"key": "Quantity",
Expand Down Expand Up @@ -1074,7 +1094,7 @@
"Drug Description": {
"key": "Name",
"sortable": true,
"minWidth": "180px"
"minWidth": "220px"
},
"Quantity": {
"key": "Quantity",
Expand Down Expand Up @@ -1337,7 +1357,7 @@
"headers": {
"Name": {
"key": "Name",
"minWidth": "150px"
"minWidth": "50%"
},
"Date": {
"key": "Date",
Expand Down
Loading

0 comments on commit 9c0fe33

Please sign in to comment.