+
+
{t("consulting_doctor")}
:
{formatName(encounter.created_by)}
+
{encounter.external_identifier && (
-
+
{t("external_id")}
:
@@ -169,8 +277,9 @@ export default function TreatmentSummary({
)}
+
{encounter.hospitalization?.discharge_disposition && (
-
+
{t("discharge_disposition")}
@@ -184,51 +293,172 @@ export default function TreatmentSummary({
)}
-
{/* Medical Information */}
{/* Allergies */}
-
+
+ {allergies?.count ? (
+ ({
+ allergen: allergy.code.display,
+ status: t(allergy.clinical_status),
+ criticality: t(allergy.criticality),
+ verification: t(allergy.verification_status),
+ notes: allergy.note,
+ logged_by: formatName(allergy.created_by),
+ }))}
+ />
+ ) : (
+
+ )}
+
{/* Symptoms */}
-
+
+
+ {symptoms?.count ? (
+ ({
+ symptom: symptom.code.display,
+ severity: t(symptom.severity),
+ status: t(symptom.clinical_status),
+ verification: t(symptom.verification_status),
+ notes: symptom.note,
+ logged_by: formatName(symptom.created_by),
+ }))}
+ />
+ ) : (
+
+ )}
+
{/* Diagnoses */}
-
+
+ {diagnoses?.count ? (
+ ({
+ diagnosis: diagnosis.code.display,
+ status: t(diagnosis.clinical_status),
+ verification: t(diagnosis.verification_status),
+ onset: diagnosis.onset?.onset_datetime
+ ? new Date(
+ diagnosis.onset.onset_datetime,
+ ).toLocaleDateString()
+ : undefined,
+ notes: diagnosis.note,
+ logged_by: formatName(diagnosis.created_by),
+ }))}
+ />
+ ) : (
+
+ )}
+
{/* Medications */}
-
-
- {t("medications")}
-
-
-
-
+
+ {medications?.results.length ? (
+ {
+ const instruction = medication.dosage_instruction[0];
+ const frequency = getFrequencyDisplay(instruction?.timing);
+ const dosage = formatDosage(instruction);
+ const duration =
+ instruction?.timing?.repeat?.bounds_duration;
+ const remarks = formatSig(instruction);
+ const notes = medication.note;
+ return {
+ medicine: medication.medication?.display,
+ status: t(medication.status),
+ dosage: dosage,
+ frequency: instruction?.as_needed_boolean
+ ? `${t("as_needed_prn")} (${instruction?.as_needed_for?.display ?? "-"})`
+ : (frequency?.meaning ?? "-") +
+ (instruction?.additional_instruction?.[0]?.display
+ ? `, ${instruction.additional_instruction[0].display}`
+ : ""),
+ duration: duration
+ ? `${duration.value} ${duration.unit}`
+ : "-",
+ instructions: `${remarks || "-"}${notes ? ` (${t("note")}: ${notes})` : ""}`,
+ };
+ })}
+ />
+ ) : (
+
+ )}
+
- {/* Medication Statements */}
-
+ {/* Medication Statements */}
+
+ {medicationStatement?.results.length ? (
+ ({
+ medication:
+ medication.medication.display ??
+ medication.medication.code,
+ dosage: medication.dosage_text,
+ status: medication.status,
+ medication_taken_between: [
+ medication.effective_period?.start,
+ medication.effective_period?.end,
+ ]
+ .map((date) => formatDateTime(date))
+ .join(" - "),
+ reason: medication.reason,
+ notes: medication.note,
+ logged_by: formatName(medication.created_by),
+ }))}
+ />
+ ) : (
+
+ )}
+
+
{/* Questionnaire Responses Section */}
diff --git a/src/components/Patient/allergy/list.tsx b/src/components/Patient/allergy/list.tsx
index 62695fe02e8..4e4fe877a90 100644
--- a/src/components/Patient/allergy/list.tsx
+++ b/src/components/Patient/allergy/list.tsx
@@ -50,7 +50,7 @@ interface AllergyListProps {
patientId: string;
encounterId?: string;
className?: string;
- isPrintPreview?: boolean;
+
encounterStatus?: Encounter["status"];
}
@@ -72,10 +72,9 @@ export function AllergyList({
patientId,
encounterId,
className,
- isPrintPreview = false,
encounterStatus,
}: AllergyListProps) {
- const [showEnteredInError, setShowEnteredInError] = useState(isPrintPreview);
+ const [showEnteredInError, setShowEnteredInError] = useState(false);
const { data: allergies, isLoading } = useQuery({
queryKey: ["allergies", patientId, encounterId, encounterStatus],
@@ -178,28 +177,22 @@ export function AllergyList({
{allergy.note && (
- {isPrintPreview ? (
-
- {allergy.note}
-
- ) : (
-
-
-
-
-
-
- {allergy.note}
-
-
-
- )}
+
+
+
+
+
+
+ {allergy.note}
+
+
+
)}
@@ -223,7 +216,6 @@ export function AllergyList({
patientId={patientId}
encounterId={encounterId}
className={className}
- isPrintPreview={isPrintPreview}
>
@@ -295,24 +287,16 @@ const AllergyListLayout = ({
encounterId,
children,
className,
- isPrintPreview = false,
}: {
facilityId?: string;
patientId: string;
encounterId?: string;
children: ReactNode;
className?: string;
- isPrintPreview?: boolean;
}) => {
return (
-
+
{t("allergies")}
{facilityId && encounterId && (
)}
-
- {children}
-
+ {children}
);
};
diff --git a/src/components/Patient/diagnosis/DiagnosisTable.tsx b/src/components/Patient/diagnosis/DiagnosisTable.tsx
index ac9d93cc878..b80e0b6062a 100644
--- a/src/components/Patient/diagnosis/DiagnosisTable.tsx
+++ b/src/components/Patient/diagnosis/DiagnosisTable.tsx
@@ -26,13 +26,9 @@ import {
interface DiagnosisTableProps {
diagnoses: Diagnosis[];
- isPrintPreview?: boolean;
}
-export function DiagnosisTable({
- diagnoses,
- isPrintPreview = false,
-}: DiagnosisTableProps) {
+export function DiagnosisTable({ diagnoses }: DiagnosisTableProps) {
return (
@@ -100,26 +96,22 @@ export function DiagnosisTable({
{diagnosis.note ? (
- {isPrintPreview ? (
-
{diagnosis.note}
- ) : (
-
-
-
-
-
-
- {diagnosis.note}
-
-
-
- )}
+
+
+
+
+
+
+ {diagnosis.note}
+
+
+
) : (
"-"
@@ -132,6 +124,7 @@ export function DiagnosisTable({
className="w-4 h-4"
imageUrl={diagnosis.created_by.profile_picture_url}
/>
+
{diagnosis.created_by.username}
diff --git a/src/components/Patient/diagnosis/list.tsx b/src/components/Patient/diagnosis/list.tsx
index 4695f5900f9..cb682456b02 100644
--- a/src/components/Patient/diagnosis/list.tsx
+++ b/src/components/Patient/diagnosis/list.tsx
@@ -21,7 +21,6 @@ interface DiagnosisListProps {
encounterId?: string;
facilityId?: string;
className?: string;
- isPrintPreview?: boolean;
}
export function DiagnosisList({
@@ -29,9 +28,8 @@ export function DiagnosisList({
encounterId,
facilityId,
className,
- isPrintPreview = false,
}: DiagnosisListProps) {
- const [showEnteredInError, setShowEnteredInError] = useState(isPrintPreview);
+ const [showEnteredInError, setShowEnteredInError] = useState(false);
const { data: diagnoses, isLoading } = useQuery({
queryKey: ["diagnosis", patientId, encounterId],
@@ -47,6 +45,7 @@ export function DiagnosisList({
facilityId={facilityId}
patientId={patientId}
encounterId={encounterId}
+ className={className}
>
@@ -71,6 +70,7 @@ export function DiagnosisList({
facilityId={facilityId}
patientId={patientId}
encounterId={encounterId}
+ className={className}
>
{t("no_diagnoses_recorded")}
@@ -85,38 +85,39 @@ export function DiagnosisList({
patientId={patientId}
encounterId={encounterId}
className={className}
- isPrintPreview={isPrintPreview}
>
- diagnosis.verification_status !== "entered_in_error",
- ),
- ...(showEnteredInError
- ? filteredDiagnoses.filter(
- (diagnosis) =>
- diagnosis.verification_status === "entered_in_error",
- )
- : []),
- ]}
- isPrintPreview={isPrintPreview}
- />
+ <>
+
+ diagnosis.verification_status !== "entered_in_error",
+ ),
+ ...(showEnteredInError
+ ? filteredDiagnoses.filter(
+ (diagnosis) =>
+ diagnosis.verification_status === "entered_in_error",
+ )
+ : []),
+ ]}
+ />
- {hasEnteredInErrorRecords && !showEnteredInError && (
- <>
-
-
-
-
- >
- )}
+ {hasEnteredInErrorRecords && !showEnteredInError && (
+ <>
+
+
+
+
+ >
+ )}
+ >
);
}
@@ -127,22 +128,17 @@ const DiagnosisListLayout = ({
encounterId,
children,
className,
- isPrintPreview = false,
}: {
facilityId?: string;
patientId: string;
encounterId?: string;
children: ReactNode;
className?: string;
- isPrintPreview?: boolean;
}) => {
return (
-
+
{t("diagnoses")}
{facilityId && encounterId && (
@@ -155,14 +151,7 @@ const DiagnosisListLayout = ({
)}
-
- {children}
-
+ {children}
);
};
diff --git a/src/components/Patient/symptoms/SymptomTable.tsx b/src/components/Patient/symptoms/SymptomTable.tsx
index 8b9dd9cb973..759342338cb 100644
--- a/src/components/Patient/symptoms/SymptomTable.tsx
+++ b/src/components/Patient/symptoms/SymptomTable.tsx
@@ -27,13 +27,9 @@ import {
interface SymptomTableProps {
symptoms: Symptom[];
- isPrintPreview?: boolean;
}
-export function SymptomTable({
- symptoms,
- isPrintPreview = false,
-}: SymptomTableProps) {
+export function SymptomTable({ symptoms }: SymptomTableProps) {
return (
@@ -110,26 +106,22 @@ export function SymptomTable({
{symptom.note ? (
- {isPrintPreview ? (
-
{symptom.note}
- ) : (
-
-
-
-
-
-
- {symptom.note}
-
-
-
- )}
+
+
+
+
+
+
+ {symptom.note}
+
+
+
) : (
"-"
@@ -142,6 +134,7 @@ export function SymptomTable({
className="w-4 h-4"
imageUrl={symptom.created_by.profile_picture_url}
/>
+
{symptom.created_by.username}
diff --git a/src/components/Patient/symptoms/list.tsx b/src/components/Patient/symptoms/list.tsx
index 0f4b558d6a9..891154584f1 100644
--- a/src/components/Patient/symptoms/list.tsx
+++ b/src/components/Patient/symptoms/list.tsx
@@ -21,7 +21,6 @@ interface SymptomsListProps {
encounterId?: string;
facilityId?: string;
className?: string;
- isPrintPreview?: boolean;
}
export function SymptomsList({
@@ -29,9 +28,8 @@ export function SymptomsList({
encounterId,
facilityId,
className,
- isPrintPreview = false,
}: SymptomsListProps) {
- const [showEnteredInError, setShowEnteredInError] = useState(isPrintPreview);
+ const [showEnteredInError, setShowEnteredInError] = useState(false);
const { data: symptoms, isLoading } = useQuery({
queryKey: ["symptoms", patientId, encounterId],
@@ -84,7 +82,6 @@ export function SymptomsList({
patientId={patientId}
encounterId={encounterId}
className={className}
- isPrintPreview={isPrintPreview}
>
{hasEnteredInErrorRecords && !showEnteredInError && (
@@ -125,24 +121,16 @@ const SymptomListLayout = ({
encounterId,
children,
className,
- isPrintPreview = false,
}: {
facilityId?: string;
patientId: string;
encounterId?: string;
children: ReactNode;
className?: string;
- isPrintPreview?: boolean;
}) => {
return (
-
+
{t("symptoms")}
{facilityId && encounterId && (
)}
-
- {children}
-
+ {children}
);
};