Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen committed Jul 1, 2024
2 parents d889d46 + 02dce21 commit b2bb29c
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 98 deletions.
4 changes: 2 additions & 2 deletions patientsearch/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ def resource_bundle(resource_type):
token = validate_auth()
# Check for the store's configurations
active_patient_flag = current_app.config.get("ACTIVE_PATIENT_FLAG")
params = dict(deepcopy(request.args)) # Necessary on ImmutableMultiDict
params = dict(deepcopy(request.args))

# Override if the search is specifically for inactive objects
if request.args.get("inactive_search") in {"true", "1"}:
del params["inactive_search"]
elif active_patient_flag:
elif active_patient_flag and resource_type == "Patient":
params["active"] = "true"

try:
Expand Down
34 changes: 27 additions & 7 deletions patientsearch/src/js/constants/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import ClearIcon from "@material-ui/icons/Clear";
import Delete from "@material-ui/icons/Delete";
import Edit from "@material-ui/icons/Edit";
import FirstPage from "@material-ui/icons/FirstPage";
import ArrowDownIcon from '@material-ui/icons/ArrowDropUp';
import ArrowUpIcon from '@material-ui/icons/ArrowDropDown';
import ArrowDownIcon from "@material-ui/icons/ArrowDropUp";
import ArrowUpIcon from "@material-ui/icons/ArrowDropDown";
import LastPage from "@material-ui/icons/LastPage";
import Search from "@material-ui/icons/Search";
import RowData from "../models/RowData";
Expand All @@ -33,7 +33,12 @@ export const tableIcons = {
<ChevronLeft {...props} ref={ref} />
)),
SortArrow: forwardRef((props, ref) => (
<div style={{display: "flex", flexDirection:"column"}} {...props} ref={ref} color="primary">
<div
style={{ display: "flex", flexDirection: "column" }}
{...props}
ref={ref}
color="primary"
>
<ArrowDownIcon size="small" className="down"></ArrowDownIcon>
<ArrowUpIcon size="small" className="up"></ArrowUpIcon>
</div>
Expand Down Expand Up @@ -70,9 +75,14 @@ export const defaultPagination = {
nextPageURL: "",
prevPageURL: "",
};
export const defaultSearchableFields = [
"first_name",
"last_name",
"birth_date",
];
export const defaultFilters = (() => {
const defaultData = RowData.create();
return defaultData.getData();
return defaultData.getFilters();
})();
export const fieldNameMaps = {
first_name: "given",
Expand Down Expand Up @@ -123,10 +133,20 @@ export const defaultMenuItems = [
),
},
];
export const PDMP_SYSTEM_IDENTIFIER = "https://github.com/uwcirg/script-fhir-facade";
export const NON_PDMP_RESULT_MESSAGE = "<div>The patient was not found in the PMP. This could be due to:</div><ul><li>No previous controlled substance medications dispensed</li><li>Incorrect spelling of name or incorrect date of birth.</li></ul><div>Please double check name spelling and date of birth.</div>";
export const PDMP_SYSTEM_ERROR_MESSAGE = "<p>COSRI is unable to return PMP information. This may be due to PMP system being down or a problem with the COSRI connection to PMP.</p>";
export const PDMP_SYSTEM_IDENTIFIER =
"https://github.com/uwcirg/script-fhir-facade";
export const NON_PDMP_RESULT_MESSAGE =
"<div>The patient was not found in the PMP. This could be due to:</div><ul><li>No previous controlled substance medications dispensed</li><li>Incorrect spelling of name or incorrect date of birth.</li></ul><div>Please double check name spelling and date of birth.</div>";
export const PDMP_SYSTEM_ERROR_MESSAGE =
"<p>COSRI is unable to return PMP information. This may be due to PMP system being down or a problem with the COSRI connection to PMP.</p>";
export const noCacheParam = { cache: "no-cache" };
export const searchHeaderParams = {
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
...noCacheParam,
};
export const LAUNCH_BUTTON_LABEL = "VIEW";
export const CREATE_BUTTON_LABEL = "CREATE";
export const MORE_MENU_KEY = "MORE_MENU";
Expand Down
Loading

0 comments on commit b2bb29c

Please sign in to comment.