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

Pipes in checkbox entry #503

Open
wibeasley opened this issue Jul 15, 2023 · 1 comment
Open

Pipes in checkbox entry #503

wibeasley opened this issue Jul 15, 2023 · 1 comment

Comments

@wibeasley
Copy link
Member

@BlairCooper, if you're itching for a regex challenge (similar to #500, #501, #502)... what can you do if the entry contains pipes?

I think I'm ok documenting that users shouldn't use pipes and expect this to work correctly. But if you're up for it, I'm curious if any solution exists.

image

From data dictionary:

"1, American Indian/Alaska Native | -2, Asian | 3, Native Hawaiian |or| Other Pacific Islander | 4, Black or African American | 5, White | 66, Unknown / Not Reported"
@nutterb
Copy link
Contributor

nutterb commented Oct 14, 2023

I'm certain that this is impossible. Deconstructing the problem:

REDCap identifies codes and labels on the algorithm [code] [first comma] [label] [line break]

There's no restriction on [label] preventing the user from including commas or or pipes.

Unfortunately, when the API pushes out the definitions, it replaces the line break with a pipe. So there is no dedicated character for delimiting one code-label pairing from another. Quite literally, what we receive from the API is fundamentally different than what REDCap is parsing on its side.

So the combination of 1) replacing the line break with the pipe, and 2) allowing both pipes and commas in the label makes it impossible to generalize a solution that can properly parse labels that include a pipe.

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

No branches or pull requests

2 participants