Skip to content

Commit

Permalink
fixed runtime error on postevent dashboard (#140)
Browse files Browse the repository at this point in the history
Problem
- would get runtime error when trying to filter hospital transports and deprture_dest is null

Solution
- added a check to see if departure_dest is null and if so, return false

Ticket:
N/A

Documentation:
N/A

Tests
- tested on local machine and no longer get runtime error
  • Loading branch information
critch646 authored Mar 25, 2024
1 parent b812227 commit 4deffe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/web/utils/postfestivalDashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ export function calculateTransportLosListData(
patientEncounters: PatientEncounterRow[]
): LengthOfStayTransportItem[] {
const hospitalTransports = patientEncounters.filter((encounter) =>
encounter.departure_dest.toLowerCase().includes("hospital")
encounter.departure_dest?.toLowerCase().includes("hospital")
);

// Helper function to combine date and time in UTC
Expand Down

0 comments on commit 4deffe5

Please sign in to comment.