Skip to content

Commit

Permalink
fix(mappers): remove dash to dot replacement for encounter dates sear…
Browse files Browse the repository at this point in the history
…ch param
  • Loading branch information
pl-buiquang committed Oct 9, 2024
1 parent f8717a1 commit 5ae8714
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ export const buildEncounterDateFilter = (
if (includeNullDates && encounterDateExists) {
const dateFilter = `(${getDateFilters(
encounterDate,
criterionDateFilterName.replace('-', '.')
)}) or not (${criterionDateFilterName.replace('-', '.')} eq "*")`
criterionDateFilterName
)}) or not (${criterionDateFilterName} eq "*")`

return filtersBuilders(FILTER_PARAM_NAME, dateFilter)
} else if (encounterDateExists) {
Expand Down Expand Up @@ -303,10 +303,10 @@ export const unbuildEncounterDatesFilters = (
criterion: SelectedCriteriaTypesWithAdvancedInputs | EncounterDataType,
value: string | null
) => {
if (value?.includes(EncounterParamsKeys.START_DATE.replace('-', '.'))) {
if (value?.includes(EncounterParamsKeys.START_DATE)) {
criterion.encounterStartDate = unbuildEncounterDateFilters(value)
criterion.includeEncounterStartDateNull = true
} else if (value?.includes(EncounterParamsKeys.END_DATE.replace('-', '.'))) {
} else if (value?.includes(EncounterParamsKeys.END_DATE)) {
criterion.encounterEndDate = unbuildEncounterDateFilters(value)
criterion.includeEncounterEndDateNull = true
}
Expand Down

0 comments on commit 5ae8714

Please sign in to comment.