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

Removed hacks for loading investigations in Consultation Form, updated type definitions #8416

Merged
Merged
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
4 changes: 1 addition & 3 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
cause_of_death: data?.discharge_notes || "",
death_datetime: data?.death_datetime || "",
death_confirmed_doctor: data?.death_confirmed_doctor || "",
InvestigationAdvice: Array.isArray(data.investigation)
? data.investigation
: [],
InvestigationAdvice: data.investigation ?? [],
diagnoses: data.diagnoses?.sort(
(a: ConsultationDiagnosis, b: ConsultationDiagnosis) =>
ConditionVerificationStatuses.indexOf(a.verification_status) -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const LogUpdateCardAttribute = <T extends keyof DailyRoundsModel>({
<div className="flex flex-col items-center gap-2 md:flex-row">
<AttributeLabel attributeKey={attributeKey} />
<span className="text-sm font-semibold text-secondary-700">
{t(attributeValue)}
{t(attributeValue as string)}
</span>
</div>
);
Expand Down
3 changes: 0 additions & 3 deletions src/Components/Facility/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { RouteToFacility } from "../Common/RouteToFacilitySelect";
import { InvestigationType } from "../Common/prescription-builder/InvestigationBuilder";
import { ProcedureType } from "../Common/prescription-builder/ProcedureBuilder";
import { ConsultationDiagnosis, CreateDiagnosis } from "../Diagnosis/types";
import { NormalPrescription, PRNPrescription } from "../Medicine/models";
import {
AssignedToObjectModel,
DailyRoundsModel,
Expand Down Expand Up @@ -132,8 +131,6 @@ export interface ConsultationModel {
created_date?: string;
discharge_date?: string;
new_discharge_reason?: (typeof DISCHARGE_REASONS)[number]["id"];
discharge_prescription?: NormalPrescription;
discharge_prn_prescription?: PRNPrescription;
discharge_notes?: string;
examination_details?: string;
history_of_present_illness?: string;
Expand Down
10 changes: 3 additions & 7 deletions src/Components/Patient/DailyRoundListDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ export const DailyRoundListDetails = (props: any) => {

const { loading: isLoading } = useQuery(routes.getDailyReport, {
pathParams: { consultationId, id },
onResponse: ({ res, data }) => {
if (res && data) {
const tdata: DailyRoundsModel = {
...data,
medication_given: data.medication_given ?? [],
};
setDailyRoundListDetails(tdata);
onResponse: ({ data }) => {
if (data) {
setDailyRoundListDetails(data);
}
},
});
Expand Down
1 change: 0 additions & 1 deletion src/Components/Patient/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ export interface DailyRoundsModel {
physical_examination_info?: string;
other_details?: string;
consultation?: number;
medication_given?: Array<any>;
action?: string;
review_interval?: number;
id?: string;
Expand Down
Loading