-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Individual filters seem to work well provided that there is a file in the backend for that filter. There are three files in the backend for three filters:
dpdash/server/constants/vars.js
Lines 6 to 10 in 2c57420
| export const INCLUSION_EXCLUSION_CRITERIA_FORM = | |
| 'form_inclusionexclusion_criteria_review' | |
| export const SOCIODEMOGRAPHICS_FORM = 'form_sociodemographics' | |
| // form_filters_status has all of the filters for participants | |
| export const FILTERS_FORM = 'form_filters' |
Sex At Brith: chrdemo_sexassigned
Cohort: chrcrit_part
Recruitment Status: recruitment_status
dpdash/server/services/FiltersService/index.js
Lines 46 to 50 in 2c57420
| const CHRCRIT_KEY = 'chrcrit_part' | |
| const DAY_DATA_KEY = 'dayData' | |
| const SEX_AT_BIRTH_FILTER_KEY = 'sex_at_birth' | |
| const SEX_AT_BIRTH_DOCUMENT_KEY = 'chrdemo_sexassigned' | |
| const RECRUITMENT_STATUS_KEY = 'recruitment_status' |
The CSV file values are mapped in MongoDB as:
dpdash/server/services/FiltersService/index.js
Lines 7 to 16 in 6736dec
| export const FILTER_TO_MONGO_VALUE_MAP = { | |
| HC: 2, | |
| CHR: 1, | |
| Missing: null, | |
| Recruited: 'recruited', | |
| 'Not recruited': 'not recruited', | |
| Excluded: 0, | |
| Male: 1, | |
| Female: 2, | |
| } |
But the filter counts deviate from expectation when there is no file for a subject. Apparently, DPdash logic expects to find a file for every subject. That subject is included in Missing category of the filters if the variable of that filter is null. But as of 10/17/2026, @dheshanm does not generate the above form_inclusionexclusion_criteria_review, form_sociodemographics files for all subjects. These two files are generated for the subjects that have this REDCap form appropriately filled out.
For filters to meet our expectation, Dheshan and I talked about two strategies:
-
Change this two files to one file
form_filters:
dpdash/server/constants/vars.js
Lines 6 to 8 in 2c57420
export const INCLUSION_EXCLUSION_CRITERIA_FORM = 'form_inclusionexclusion_criteria_review' export const SOCIODEMOGRAPHICS_FORM = 'form_sociodemographics' And include the
chrdemo_sexassigned,chrcrit_partvariables inform_filtersfile. Sinceform_filtersis generated for all subjects, this can resolve the issue. -
Do not modify the code but generate
form_inclusionexclusion_criteria_review,form_sociodemographicswith mostlynullvalues, particularly forchrdemo_sexassigned,chrcrit_part. This will fit DPdash count algorithm.