sara-chronister / syndrome-definition-evaluation

R code for evaluation of NSSP BioSense ESSENCE syndrome definition results using ESSENCE APIs.
13 stars 5 forks source link

Dev2024 Branch: Detect_Element() Field Inconsistencies #25

Open DOH-TJB0303 opened 4 months ago

DOH-TJB0303 commented 4 months ago

Bug

If a user turns important fields in the SelectFields tab of DefinitionInformation.xlsx to off WHEN they are core fields with which definitions are applied to (see DefinitionInformation tab Fields column) -- THEN detect_elements() will have errors as SelectFields prevents those fields from being pulled in the API.

Possible Solutions (basic to more advanced)

  1. Documentation on SelectFields tab --> make sure to keep core fields (used for definition application) toggled as on. Burden of work placed on the user correctly operating the tool.

  2. Do basic assumptions with underlying SelectFields. Specifically, always pull the most common fields used by definitions and remove the user's ability to include/exclude these fields. Possible options: ChiefComplaintUpdates, DischargeDiagnosis, CCDD, CCDDParsed.

  3. We could try doing trycatch() erroring that will warn a user (with an informative message) about their mistake --> so they can fix it!

  4. Allow users to continue selecting key fields to include/exclude SelectFields --> override their selections if they accidentally leave out key fields mentioned in DefinitionInformation Fields

I like number 3 as the approach may not be too hard to implement, and it easily/quickly guides the user to fix the problem in DefinitionInformation.xlsx without requiring a bunch of weird coding rules which may fail.

DOH-TJB0303 commented 4 months ago

Preferred Approach:

  1. Warning ("You did not select fields within SelectField tab that are required for your evaluated definitions to run) & Implement simple fixes. Example --> detect the information within DefinitionInformation$Fields, clean the variable names (if there are misspellings), and automatically include those variables within the API Pull (even if they are not selected in SelectField).

  2. Bad misspellings --> throw an error --> direct users to fix the spelling of DefinitionInfomration$Fields and correctly specify the fields they want to pull in the SelectField tab.