- {t("no_observations")}
+
+
+ {observations.map((item: Observation) => (
+
+
+
+
+ {formatDateTime(item.effective_datetime)}
+
+
+ {item.main_code.display || item.main_code.code}
+
+ {item.value.value_quantity && (
+
+ {item.value.value_quantity.value}{" "}
+ {item.value.value_quantity.code.display}
-
-
-
-
className="grid gap-4">
- {(item) => (
-
-
-
-
- {formatDateTime(item.effective_datetime)}
-
-
- {item.main_code.display || item.main_code.code}
-
- {item.value.value_quantity && (
-
- {item.value.value_quantity.value}{" "}
- {item.value.value_quantity.code.display}
-
- )}
- {item.value.value && (
-
{item.value.value}
- )}
- {item.note && (
-
- {item.note}
-
- )}
-
-
)}
-
-
-
-
+ {item.value.value && (
+
{item.value.value}
+ )}
+ {item.note && (
+
+ {item.note}
+
+ )}
+
+
+ ))}
+ {hasNextPage && (
+
+
+ {isFetchingNextPage ? t("loading_more") : t("load_more")}
-
- )}
-
+ )}
+
+
);
}
diff --git a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx
index b82b37aaca5..11f9ea4529b 100644
--- a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx
+++ b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx
@@ -149,7 +149,9 @@ export default function QuestionnaireResponsesList({ encounter }: Props) {
route={routes.getQuestionnaireResponses}
pathParams={{
patientId: encounter.patient.id,
- encounterId: encounter.id,
+ }}
+ query={{
+ encounter: encounter.id,
}}
>
{() => (
@@ -264,6 +266,7 @@ export default function QuestionnaireResponsesList({ encounter }: Props) {
type={type}
id={response.id}
patientId={encounter.patient.id}
+ encounterId={encounter.id}
/>
);
},
diff --git a/src/components/Facility/ConsultationDetails/StructuredResponseView.tsx b/src/components/Facility/ConsultationDetails/StructuredResponseView.tsx
index ba4e3ba2e98..9d6b06ae2b8 100644
--- a/src/components/Facility/ConsultationDetails/StructuredResponseView.tsx
+++ b/src/components/Facility/ConsultationDetails/StructuredResponseView.tsx
@@ -16,9 +16,15 @@ interface Props {
type: string;
id: string;
patientId: string;
+ encounterId: string;
}
-export function StructuredResponseView({ type, id, patientId }: Props) {
+export function StructuredResponseView({
+ type,
+ id,
+ patientId,
+ encounterId,
+}: Props) {
const getRouteAndParams = () => {
const params: Record
= { patientId };
switch (type) {
@@ -26,19 +32,20 @@ export function StructuredResponseView({ type, id, patientId }: Props) {
return {
route: symptomApi.retrieveSymptom,
pathParams: { ...params, symptomId: id },
+ queryParams: { encounter: encounterId },
};
case "diagnosis":
return {
route: diagnosisApi.retrieveDiagnosis,
pathParams: { ...params, diagnosisId: id },
+ queryParams: { encounter: encounterId },
};
case "allergy_intolerance":
return {
route: allergyApi.retrieveAllergy,
pathParams: { ...params, allergyId: id },
+ queryParams: { encounter: encounterId },
};
- default:
- return null;
}
};
@@ -47,7 +54,8 @@ export function StructuredResponseView({ type, id, patientId }: Props) {
const { data, isLoading, error } = useQuery({
queryKey: [type, id],
queryFn: query(routeConfig?.route as any, {
- pathParams: routeConfig?.pathParams || { patientId },
+ pathParams: routeConfig?.pathParams,
+ queryParams: routeConfig?.queryParams,
}),
enabled: !!id && !!routeConfig,
});
diff --git a/src/pages/Encounters/tabs/EncounterPlotsTab.tsx b/src/pages/Encounters/tabs/EncounterPlotsTab.tsx
index c0857b2d000..cc9c6d57689 100644
--- a/src/pages/Encounters/tabs/EncounterPlotsTab.tsx
+++ b/src/pages/Encounters/tabs/EncounterPlotsTab.tsx
@@ -55,6 +55,7 @@ export const EncounterPlotsTab = (props: EncounterTabProps) => {
diff --git a/src/pages/Encounters/tabs/EncounterUpdatesTab.tsx b/src/pages/Encounters/tabs/EncounterUpdatesTab.tsx
index f8eab9f6743..fb49046d1cb 100644
--- a/src/pages/Encounters/tabs/EncounterUpdatesTab.tsx
+++ b/src/pages/Encounters/tabs/EncounterUpdatesTab.tsx
@@ -5,372 +5,35 @@ import { SymptomsList } from "@/components/Patient/symptoms/list";
import { EncounterTabProps } from "@/pages/Encounters/EncounterShow";
-export const EncounterUpdatesTab = (props: EncounterTabProps) => {
+export const EncounterUpdatesTab = ({
+ encounter,
+ patient,
+}: EncounterTabProps) => {
return (
-
-
-
-
-
+
+ {/* Main Content Area */}
+
+ {/* Left Column - Symptoms, Diagnoses, and Questionnaire Responses */}
+
+ {/* Symptoms Section */}
+
+
-
-
-
-
-
-
-
- {/*