Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type AdministeredMedicationTableData = {
dose?: string;
route?: string;
therapeuticResponse?: string;
text?: string;
};

/**
Expand Down Expand Up @@ -47,6 +48,10 @@ export const AdministeredMedication = ({
columnName: "Therapeutic Response Observation",
className: "bg-gray-5 minw-15",
},
{
columnName: "Text",
className: "bg-gray-5 minw-15",
},
];

return (
Expand All @@ -58,6 +63,7 @@ export const AdministeredMedication = ({
<td>{entry?.dose ?? noData}</td>
<td>{entry?.route ?? noData}</td>
<td>{entry?.therapeuticResponse ?? noData}</td>
<td>{entry?.text ?? noData}</td>
</tr>
))}
</BaseTable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Bundle,
CareTeamParticipant,
Device,
Dosage,
Element,
Location,
Medication,
Expand All @@ -13,7 +12,6 @@ import {
Organization,
Period,
Practitioner,
Quantity,
Reference,
ServiceRequest,
} from "fhir/r4";
Expand Down Expand Up @@ -219,6 +217,7 @@ const evaluateAdministeredMedication = (
dose: doseValue,
route: formatCodeableConcept(medicationAdministration?.dosage?.route),
therapeuticResponse: therapeuticResponseText,
text: medicationAdministration?.dosage?.text,
};
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe("AdminMedTable", () => {
dose: "325 mg",
route: "Intravenous",
therapeuticResponse: "Improved condition",
text: "Take with food",
},
{
name: "aleve tablet",
Expand All @@ -36,10 +37,11 @@ describe("AdminMedTable", () => {
expect(screen.getByText("09/29/2022")).toBeVisible();
expect(screen.getByText("Intravenous")).toBeVisible();
expect(screen.getByText("Improved condition")).toBeVisible();
expect(screen.getByText("Take with food")).toBeVisible();

expect(screen.getByText("aleve tablet")).toBeVisible();
expect(screen.getByText("250 mg")).toBeVisible();
expect(screen.getByText("09/29/2022 4:53 AM")).toBeVisible();
expect(screen.getAllByText("No data")).toBeArrayOfSize(2);
expect(screen.getAllByText("No data")).toBeArrayOfSize(3);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { render, screen } from "@testing-library/react";
import { Bundle } from "fhir/r4";
import { axe } from "jest-axe";

import BundleAdmissionMedications from "@/../../../test-data/fhir/BundleAdmissionMedications.json";
import BundleCareTeam from "@/../../../test-data/fhir/BundleCareTeam.json";
import BundleWithMiscNotes from "@/../../../test-data/fhir/BundleMiscNotes.json";
import * as _BundleWithPatient from "@/../../../test-data/fhir/BundlePatient.json";
Expand Down Expand Up @@ -128,6 +129,21 @@ describe("Snapshot test for eCR Document", () => {
});
});

describe("Evaluate Administered Medications", () => {
it("should include dosage text when present", () => {
const actual = evaluateClinicalData(
BundleAdmissionMedications as unknown as Bundle,
);
const adminMedsItem = actual.treatmentData.availableData.find(
(d) => d.title === "Administered Medications",
);
render(adminMedsItem!.value as React.JSX.Element);
expect(
screen.getByText("Take with water once daily"),
).toBeInTheDocument();
});
});

describe("Evaluate Care Team Table", () => {
it("should evaluate care team table results", () => {
const actual: React.JSX.Element = returnCareTeamTable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,12 @@ Result: 2 m
>
Therapeutic Response Observation
</th>
<th
class="table-header bg-gray-5 minw-15"
scope="col"
>
Text
</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -1061,6 +1067,13 @@ Result: 2 m
No data
</span>
</td>
<td>
<span
class="text-italic text-base"
>
No data
</span>
</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion containers/fhir-converter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build

# Download FHIR-Converter

RUN git clone https://github.com/CDCgov/dibbs-FHIR-Converter.git --branch 8.0.4 --depth 1 /App
RUN git clone https://github.com/CDCgov/dibbs-FHIR-Converter.git --branch laura-victor/1345-dosage-text --depth 1 /App

WORKDIR /App

Expand Down
3 changes: 2 additions & 1 deletion test-data/fhir/BundleAdmissionMedications.json
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,8 @@
"rateQuantity": {
"value": 12,
"unit": "h"
}
},
"text": "Take with water once daily"
},
"extension": [
{
Expand Down
Loading