Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Patient Filter for Review Missed #7328

Merged
merged 20 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"autoprefixer": "^10.4.14",
"cypress": "^13.5.0",
"cypress-localstorage-commands": "^2.2.3",
"dotenv": "^16.4.5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this added? Context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't know why using env variables wasn't working in vite.config.mts, when I used "import 'dotenv/config'", it worked. That's the reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was onw of the reasons why I was unable to connect to the local care backend.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using direnv in this repository to load environment variables as configured here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also connect to your local backend using:

CARE_API=https://127.0.0.1:8000/ bun run dev

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, after removing dotenv, when I am using process.env.CARE_API, in vite.config.mts, its not working, but working when I am explicitly mentioning https://127.0.0.1:9000/.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CARE_API=127.0.0.1:9000 bun run dev I added the above line in my .env, but unable to connect to the local backend which is running at http://localhost:9000.

You shouldn't add that to the .env
Instead use that to run in the terminal directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if that's the thing, will try to do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I have pushed some changes, could you please review them and suggest if any modification is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also all the tests are now passing successfully.

"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-standard": "^17.1.0",
Expand Down
2 changes: 2 additions & 0 deletions src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export const PatientManager = () => {
diagnoses_provisional: qParams.diagnoses_provisional || undefined,
diagnoses_unconfirmed: qParams.diagnoses_unconfirmed || undefined,
diagnoses_differential: qParams.diagnoses_differential || undefined,
review_missed: qParams.review_missed || undefined,
};

useEffect(() => {
Expand Down Expand Up @@ -917,6 +918,7 @@ export const PatientManager = () => {
kasp(),
badge("COWIN ID", "covin_id"),
badge("Is Antenatal", "is_antenatal"),
badge("Review Missed", "review_missed"),
badge(
"Is Medico-Legal Case",
"last_consultation_medico_legal_case"
Expand Down
15 changes: 15 additions & 0 deletions src/Components/Patient/PatientFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default function PatientFilter(props: any) {
diagnoses_provisional: filter.diagnoses_provisional || null,
diagnoses_unconfirmed: filter.diagnoses_unconfirmed || null,
diagnoses_differential: filter.diagnoses_differential || null,
review_missed: filter.review_missed || null,
});

useQuery(routes.getAnyFacility, {
Expand Down Expand Up @@ -203,6 +204,7 @@ export default function PatientFilter(props: any) {
diagnoses_provisional,
diagnoses_unconfirmed,
diagnoses_differential,
review_missed,
} = filterState;
const data = {
district: district || "",
Expand Down Expand Up @@ -270,6 +272,7 @@ export default function PatientFilter(props: any) {
diagnoses_provisional: diagnoses_provisional || "",
diagnoses_unconfirmed: diagnoses_unconfirmed || "",
diagnoses_differential: diagnoses_differential || "",
review_missed: review_missed || "",
};
onChange(data);
};
Expand Down Expand Up @@ -437,6 +440,18 @@ export default function PatientFilter(props: any) {
}
/>
</div>
<div className="w-full flex-none">
<FieldLabel className="text-sm">Review Missed</FieldLabel>
<SelectMenuV2
placeholder="Show all"
options={["true", "false"]}
optionLabel={(o) => (o === "true" ? "Yes" : "No")}
value={filterState.review_missed}
onChange={(v) =>
setFilterState({ ...filterState, review_missed: v })
}
/>
</div>
<div className="w-full flex-none">
<FieldLabel className="text-sm">Is Medico-Legal Case</FieldLabel>
<SelectMenuV2
Expand Down
1 change: 1 addition & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { VitePWA } from "vite-plugin-pwa";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import 'dotenv/config';

const cdnUrls =
process.env.CARE_CDN_URL ??
Expand Down
Loading