diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..bf25654b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "dibbs-query-connector", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/query-connector/src/app/CustomQuery.ts b/query-connector/src/app/CustomQuery.ts index 3f72897b..44fa0c10 100644 --- a/query-connector/src/app/CustomQuery.ts +++ b/query-connector/src/app/CustomQuery.ts @@ -75,7 +75,7 @@ export class CustomQuery { : ""; this.medicationRequestQuery = rxnormFilter !== "" - ? `/MedicationRequest?subject=${patientId}&code=${rxnormFilter}&_include=MedicationRequest:medication&_include=MedicationRequest:intended-performer` + ? `/MedicationRequest?subject=${patientId}&code=${rxnormFilter}&_include=MedicationRequest:medication&_revinclude=MedicationAdministration:request` : ""; this.socialHistoryQuery = `/Observation?subject=${patientId}&category=social-history`; this.encounterQuery = diff --git a/query-connector/src/app/query/components/SelectQuery.tsx b/query-connector/src/app/query/SelectQuery.tsx similarity index 82% rename from query-connector/src/app/query/components/SelectQuery.tsx rename to query-connector/src/app/query/SelectQuery.tsx index 34e5e858..38bbbdf5 100644 --- a/query-connector/src/app/query/components/SelectQuery.tsx +++ b/query-connector/src/app/query/SelectQuery.tsx @@ -1,16 +1,16 @@ "use client"; import React, { useEffect, useState } from "react"; -import { FHIR_SERVERS, USE_CASES, ValueSetItem } from "../../constants"; -import CustomizeQuery from "./CustomizeQuery"; -import SelectSavedQuery from "./selectQuery/SelectSavedQuery"; +import { FHIR_SERVERS, USE_CASES, ValueSetItem } from "../constants"; +import CustomizeQuery from "./components/CustomizeQuery"; +import SelectSavedQuery from "./components/selectQuery/SelectSavedQuery"; import { QueryResponse } from "@/app/query-service"; import { Patient } from "fhir/r4"; import { fetchQueryResponse, fetchUseCaseValueSets, -} from "./selectQuery/queryHooks"; -import LoadingView from "./LoadingView"; +} from "./components/selectQuery/queryHooks"; +import LoadingView from "./components/LoadingView"; interface SelectQueryProps { goForward: () => void; @@ -23,6 +23,8 @@ interface SelectQueryProps { fhirServer: FHIR_SERVERS; setFhirServer: React.Dispatch>; setLoading: (isLoading: boolean) => void; + showCustomizeQuery: boolean; + setShowCustomizeQuery: (showCustomizeQuery: boolean) => void; } /** @@ -30,11 +32,14 @@ interface SelectQueryProps { * @param root0.goBack - Callback to return to previous page * @param root0.goForward - Callback to go to the next page * @param root0.selectedQuery - query we chose for further customization + * @param root0.showCustomizeQuery - toggle to navigate to show customize query * @param root0.setSelectedQuery - callback function to update the selected query * @param root0.patientForQuery - patient to apply a particular query for * @param root0.resultsQueryResponse - Response of selected query * @param root0.setResultsQueryResponse - Callback function to update selected * query + * @param root0.setShowCustomizeQuery - state function to update location of + * show customize query * @param root0.fhirServer - the FHIR server that we're running the query against * @param root0.setFhirServer - callback function to update the FHIR server * @returns - The selectQuery component. @@ -44,13 +49,14 @@ const SelectQuery: React.FC = ({ patientForQuery, resultsQueryResponse, fhirServer, + showCustomizeQuery, goForward, goBack, setSelectedQuery, setResultsQueryResponse, setFhirServer, + setShowCustomizeQuery, }) => { - const [showCustomizeQuery, setShowCustomizedQuery] = useState(false); const [queryValueSets, setQueryValueSets] = useState( [] as ValueSetItem[], ); @@ -92,7 +98,7 @@ const SelectQuery: React.FC = ({ const displayLoading = loadingResultResponse || loadingQueryValueSets; return ( - <> +
{displayLoading && } {showCustomizeQuery ? ( @@ -101,7 +107,7 @@ const SelectQuery: React.FC = ({ queryType={selectedQuery} queryValuesets={queryValueSets} setQueryValuesets={setQueryValueSets} - goBack={() => setShowCustomizedQuery(false)} + goBack={() => setShowCustomizeQuery(false)} > ) : ( = ({ loadingQueryValueSets={loadingQueryValueSets} goBack={goBack} setSelectedQuery={setSelectedQuery} - setShowCustomizedQuery={setShowCustomizedQuery} + setShowCustomizedQuery={setShowCustomizeQuery} handleSubmit={onSubmit} setFhirServer={setFhirServer} > )} - +
); }; diff --git a/query-connector/src/app/query/components/CustomizeQuery.tsx b/query-connector/src/app/query/components/CustomizeQuery.tsx index c1dc1950..0987709e 100644 --- a/query-connector/src/app/query/components/CustomizeQuery.tsx +++ b/query-connector/src/app/query/components/CustomizeQuery.tsx @@ -138,7 +138,7 @@ const CustomizeQuery: React.FC = ({ goBack(); showRedirectConfirmation({ heading: QUERY_CUSTOMIZATION_CONFIRMATION_HEADER, - body: QUERY_CUSTOMIZATION_CONFIRMATION_BODY, + body: "", headingLevel: "h4", }); }; @@ -163,16 +163,14 @@ const CustomizeQuery: React.FC = ({ -

- Customize query -

-
+

Customize query

+

Query: {demoQueryValToLabelMap[queryType]} -

-
+ +

{countLabs} labs found, {countMedications} medications found,{" "} {countConditions} conditions found. -

+ = ({ export default CustomizeQuery; export const QUERY_CUSTOMIZATION_CONFIRMATION_HEADER = "Query Customization Successful!"; -export const QUERY_CUSTOMIZATION_CONFIRMATION_BODY = - "You've successfully customized your query. Once you're done adding patient details, submit your completed query to get results"; diff --git a/query-connector/src/app/query/components/LoadingView.tsx b/query-connector/src/app/query/components/LoadingView.tsx index 4a7d5375..4fbd685a 100644 --- a/query-connector/src/app/query/components/LoadingView.tsx +++ b/query-connector/src/app/query/components/LoadingView.tsx @@ -17,7 +17,7 @@ const LoadingView: React.FC = ({ loading }) => { return (
-

Loading...

+
Loading...
); } else { diff --git a/query-connector/src/app/query/components/ResultsView.tsx b/query-connector/src/app/query/components/ResultsView.tsx index d0a8b15c..518e3172 100644 --- a/query-connector/src/app/query/components/ResultsView.tsx +++ b/query-connector/src/app/query/components/ResultsView.tsx @@ -4,7 +4,7 @@ import ResultsViewSideNav, { } from "./resultsView/ResultsViewSideNav"; import React, { useEffect } from "react"; import ResultsViewTable from "./resultsView/ResultsViewTable"; -import styles from "../page.module.css"; +import styles from "./resultsView/resultsView.module.scss"; import ConditionsTable from "./resultsView/tableComponents/ConditionsTable"; import Demographics from "./resultsView/tableComponents/Demographics"; import DiagnosticReportTable from "./resultsView/tableComponents/DiagnosticReportTable"; @@ -63,28 +63,24 @@ const ResultsView: React.FC = ({ return ( <> -
-
- goBack()} label={RETURN_LABEL["results"]} /> - -
-
-
-

- {PAGE_TITLES["results"]} -

-

- Query:{" "} - - {demoQueryValToLabelMap[selectedQuery]} - -

+
+ goBack()} label={RETURN_LABEL["results"]} /> +
+

+ {PAGE_TITLES["results"]} +

+

+ Query: + + {demoQueryValToLabelMap[selectedQuery]} + +

diff --git a/query-connector/src/app/query/components/searchForm/SearchForm.tsx b/query-connector/src/app/query/components/SearchForm.tsx similarity index 91% rename from query-connector/src/app/query/components/searchForm/SearchForm.tsx rename to query-connector/src/app/query/components/SearchForm.tsx index a3521c0e..337e0bfa 100644 --- a/query-connector/src/app/query/components/searchForm/SearchForm.tsx +++ b/query-connector/src/app/query/components/SearchForm.tsx @@ -15,7 +15,7 @@ import { } from "@/app/constants"; import { UseCaseQueryResponse, UseCaseQuery } from "@/app/query-service"; import { fhirServers } from "@/app/fhir-servers"; -import styles from "./searchForm.module.css"; +import styles from "./searchForm/searchForm.module.scss"; import { FormatPhoneAsDigits } from "@/app/format-service"; import { PAGE_TITLES } from "@/app/query/stepIndicator/StepIndicator"; @@ -108,18 +108,16 @@ const SearchForm: React.FC = ({ return ( <> -
-

- {PAGE_TITLES["search"]} -

-

+ +

{PAGE_TITLES["search"]}

+

Enter patient information below to search for a patient. We will query the connected network to find matching records.{" "}

{