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

Adds support for specifying onset and cure date in Encounter Symptoms #7874

Merged
merged 23 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d0c1acb
update types and required utilities
rithviknishad May 21, 2024
2e50b03
Implements necessary reusable components for composing the Symptoms B…
rithviknishad May 21, 2024
2e6724b
Migrate in Consultation Form
rithviknishad May 21, 2024
1e8fd41
Migrate in daily rounds form
rithviknishad May 21, 2024
f21c35c
improve reusability
rithviknishad May 21, 2024
c240aec
patch types, remove unused references, switch to new choices
rithviknishad May 21, 2024
d7f454f
rename consultation symptom to encounter symptom
rithviknishad May 21, 2024
7b9c1c6
Show symptoms in consultation dashboard
rithviknishad May 21, 2024
4d8585f
add loading state
rithviknishad May 21, 2024
6caa08a
update sorting
rithviknishad May 21, 2024
f7e0d26
add loading state
rithviknishad May 21, 2024
110af95
fixes during QA
rithviknishad May 21, 2024
e8c15cb
Merge branch 'develop' into symptoms-v2
rithviknishad May 22, 2024
06b4e79
fix responsiveness of symptoms card
rithviknishad May 22, 2024
dc1a618
update button design
rithviknishad May 22, 2024
3c8c022
Make symptoms builder entries responsive
rithviknishad May 22, 2024
a287195
make add symptom block responsive
rithviknishad May 22, 2024
ad7c3ba
correct separator for for last element
rithviknishad May 22, 2024
5d4f004
Merge branch 'develop' into symptoms-v2
rithviknishad May 22, 2024
2bbb6c0
Merge branch 'develop' into symptoms-v2
rithviknishad May 22, 2024
9bb273e
Merge branch 'develop' into symptoms-v2
rithviknishad May 28, 2024
177a880
remove unused imports
rithviknishad May 28, 2024
1ba42ae
Merge branch 'develop' into symptoms-v2
khavinshankar May 28, 2024
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
36 changes: 0 additions & 36 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,42 +318,6 @@ export const REVIEW_AT_CHOICES: Array<OptionsType> = [
{ id: 30 * 24 * 60, text: "1 month" },
];

export const SYMPTOM_CHOICES = [
{ id: 1, text: "ASYMPTOMATIC", isSingleSelect: true },
{ id: 2, text: "FEVER" },
{ id: 3, text: "SORE THROAT" },
{ id: 4, text: "COUGH" },
{ id: 5, text: "BREATHLESSNESS" },
{ id: 6, text: "MYALGIA" },
{ id: 7, text: "ABDOMINAL DISCOMFORT" },
{ id: 8, text: "VOMITING" },
{ id: 11, text: "SPUTUM" },
{ id: 12, text: "NAUSEA" },
{ id: 13, text: "CHEST PAIN" },
{ id: 14, text: "HEMOPTYSIS" },
{ id: 15, text: "NASAL DISCHARGE" },
{ id: 16, text: "BODY ACHE" },
{ id: 17, text: "DIARRHOEA" },
{ id: 18, text: "PAIN" },
{ id: 19, text: "PEDAL EDEMA" },
{ id: 20, text: "WOUND" },
{ id: 21, text: "CONSTIPATION" },
{ id: 22, text: "HEAD ACHE" },
{ id: 23, text: "BLEEDING" },
{ id: 24, text: "DIZZINESS" },
{ id: 25, text: "CHILLS" },
{ id: 26, text: "GENERAL WEAKNESS" },
{ id: 27, text: "IRRITABILITY" },
{ id: 28, text: "CONFUSION" },
{ id: 29, text: "ABDOMINAL PAIN" },
{ id: 30, text: "JOINT PAIN" },
{ id: 31, text: "REDNESS OF EYES" },
{ id: 32, text: "ANOREXIA" },
{ id: 33, text: "NEW LOSS OF TASTE" },
{ id: 34, text: "NEW LOSS OF SMELL" },
{ id: 9, text: "OTHERS" },
];

export const DISCHARGE_REASONS = [
{ id: 1, text: "Recovered" },
{ id: 2, text: "Referred" },
Expand Down
85 changes: 0 additions & 85 deletions src/Components/Common/SymptomsSelect.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/Components/Diagnosis/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import routes from "../../Redux/api";
import request from "../../Utils/request/request";
import { ICD11DiagnosisModel } from "./types";

// TODO: cache ICD11 responses and hit the cache if present instead of making an API call.

export const getDiagnosisById = async (id: ICD11DiagnosisModel["id"]) => {
return (await request(routes.getICD11Diagnosis, { pathParams: { id } })).data;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BedModel } from "../models";
import HL7PatientVitalsMonitor from "../../VitalsMonitor/HL7PatientVitalsMonitor";
import VentilatorPatientVitalsMonitor from "../../VitalsMonitor/VentilatorPatientVitalsMonitor";
import useVitalsAspectRatioConfig from "../../VitalsMonitor/useVitalsAspectRatioConfig";
import { DISCHARGE_REASONS, SYMPTOM_CHOICES } from "../../../Common/constants";
import { DISCHARGE_REASONS } from "../../../Common/constants";
import PrescriptionsTable from "../../Medicine/PrescriptionsTable";
import Chip from "../../../CAREUI/display/Chip";
import {
Expand All @@ -23,6 +23,7 @@ import { getVitalsMonitorSocketUrl } from "../../VitalsMonitor/utils";
import useQuery from "../../../Utils/request/useQuery";
import routes from "../../../Redux/api";
import CareIcon from "../../../CAREUI/icons/CareIcon";
import EncounterSymptomsCard from "../../Symptoms/SymptomsCard";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

Expand Down Expand Up @@ -363,91 +364,10 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
)}
</div>
)}
{props.consultationData.symptoms_text && (
<div className="overflow-hidden rounded-lg bg-white shadow">
<div className="px-4 py-5 sm:p-6">
<h3 className="mb-4 text-lg font-semibold leading-relaxed text-gray-900">
Symptoms
</h3>
<div className="">
<div className="text-sm font-semibold uppercase">
Last Daily Update
</div>
{props.consultationData.last_daily_round
?.additional_symptoms && (
<>
<div className="my-4 flex flex-wrap items-center gap-2">
{props.consultationData.last_daily_round?.additional_symptoms.map(
(symptom: any, index: number) => (
<Chip
key={index}
text={
SYMPTOM_CHOICES.find(
(choice) => choice.id === symptom,
)?.text ?? "Err. Unknown"
}
size="small"
/>
),
)}
</div>
{props.consultationData.last_daily_round
?.other_symptoms && (
<div className="capitalize">
<div className="text-xs font-semibold">
Other Symptoms:
</div>
{
props.consultationData.last_daily_round
?.other_symptoms
}
</div>
)}
<span className="text-xs font-semibold leading-relaxed text-gray-800">
from{" "}
{formatDate(
props.consultationData.last_daily_round.taken_at,
)}
</span>
</>
)}
<hr className="my-4 border border-gray-300" />
<div className="text-sm font-semibold uppercase">
Consultation Update
</div>
<div className="my-4 flex flex-wrap items-center gap-2">
{props.consultationData.symptoms?.map(
(symptom, index) => (
<Chip
key={index}
text={
SYMPTOM_CHOICES.find(
(choice) => choice.id === symptom,
)?.text ?? "Err. Unknown"
}
size="small"
/>
),
)}
</div>
{props.consultationData.other_symptoms && (
<div className="capitalize">
<div className="text-xs font-semibold">
Other Symptoms:
</div>
{props.consultationData.other_symptoms}
</div>
)}
<span className="text-xs font-semibold leading-relaxed text-gray-800">
from{" "}
{props.consultationData.symptoms_onset_date
? formatDate(props.consultationData.symptoms_onset_date)
: "--/--/----"}
</span>
</div>
</div>
</div>
)}

<div className="rounded-lg bg-white px-4 py-5 shadow sm:p-6 md:col-span-2">
<EncounterSymptomsCard />
</div>

{props.consultationData.history_of_present_illness && (
<div className="overflow-hidden rounded-lg bg-white shadow">
Expand Down
25 changes: 10 additions & 15 deletions src/Components/Facility/ConsultationDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
CONSULTATION_TABS,
GENDER_TYPES,
SYMPTOM_CHOICES,
} from "../../../Common/constants";
import { CONSULTATION_TABS, GENDER_TYPES } from "../../../Common/constants";
import { ConsultationModel } from "../models";
import {
getConsultation,
Expand Down Expand Up @@ -44,7 +40,6 @@ import { CameraFeedPermittedUserTypes } from "../../../Utils/permissions";

const Loading = lazy(() => import("../../Common/Loading"));
const PageTitle = lazy(() => import("../../Common/PageTitle"));
const symptomChoices = [...SYMPTOM_CHOICES];

export interface ConsultationTabProps {
consultationId: string;
Expand Down Expand Up @@ -114,15 +109,15 @@ export const ConsultationDetails = (props: any) => {
...res.data,
symptoms_text: "",
};
if (res.data.symptoms?.length) {
const symptoms = res.data.symptoms
.filter((symptom: number) => symptom !== 9)
.map((symptom: number) => {
const option = symptomChoices.find((i) => i.id === symptom);
return option ? option.text.toLowerCase() : symptom;
});
data.symptoms_text = symptoms.join(", ");
}
// if (res.data.symptoms?.length) {
// const symptoms = res.data.symptoms
// .filter((symptom: number) => symptom !== 9)
// .map((symptom: number) => {
// const option = symptomChoices.find((i) => i.id === symptom);
// return option ? option.text.toLowerCase() : symptom;
// });
// data.symptoms_text = symptoms.join(", ");
// }
if (facilityId != data.facility || patientId != data.patient) {
navigate(
`/facility/${data.facility}/patient/${data.patient}/consultation/${data?.id}`,
Expand Down
Loading
Loading