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

Add ability for NACCulator to process date and rater header info on individual forms #122

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

s-emerson
Copy link
Contributor

This change adds logic to NACCulator's builder.py files that checks each individual form for date and rater information before it checks the main header form. This allows centers to specify which doctor filled out a form, and if they were filled on different days. If a center has not added these fields to their project, then NACCulator's functionality has not changed other than a few bug fixes.

Small fixes include:
The C2T form for telephone followup packets is now optional. The program will no longer assume the C2T is present.
The LBD event detection is improved (it will search for more variations of the B1L form's fieldname).
"NOGDS" in form B6 has been added to set_to_zero_if_blank to account for the TFP forms.

Why was this change made? Including an issue number is sufficient. Otherwise, briefly explain the benefit of the change.

This change was made to address Elijah Rockers' request to add custom form header functionality to NACCulator. This pull request uses the same builder.py logic as in #118 and I made sure to fix the same typo that Eli found in the uds3 fvp forms.py file.
My code differs by adding a few other bug fixes and leaving the forms.py files otherwise unchanged, so that the unit tests still pass.

Verification

  1. Collect a data export from your center's REDCap project.
  2. From the command-line, run:
    redcap2nacc -ivp -lbdsv <input_data.csv >output_data.txt
    (or a command with a similar flag; I am using lbd short version to demonstrate the improved event detection)
  3. The output should look like: Regular NACCulator output, without any KeyErrors involved. If your center has custom form header info, then each individual form should have that custom date and rater info in the header of each line.
  4. If you pass some bad value, the output should look like: Regular NACCulator error messages, with no false positives.
  • Verify the thing does this: Handles custom form header info, and correctly processes TFP v3.2 data.
  • Verify the thing does not do that: Skips forms that are required, nor includes optional forms that are empty.

Affirmations

All of these should have a check by them. Any exception requires an explanation.

  • I matched the style of the existing code.
  • I added and updated any relevant documentation (inline, README, CHANGELOG, and such).
  • I used Python's type hinting.
  • I ran the automated tests and ensured they ALL passed.
  • I ran the linter and ensured my changes have not introduced ANY warnings or errors.
  • I have made an effort to minimize code changes and have not included any cruft (preference files, *.pyc files, old comments, print-debugging, unused variables).
  • I have made an effort maintain a clear commit history (haven't merged other branches or rebased improperly).
  • I have written the code myself or have given credit where credit is due.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant