Skip to content

Conversation

@Dtphelan1
Copy link
Contributor

Summary

Supports ingestion of CSV's with either totally blank rows of data or rows with nothing by empty-values; in both cases those rows will be ignored.

New behavior

Now the CSVFileModule can ingest files with rows that meet the above criteria.

Code changes

Some new tests

Testing guidance

Make sure the tool still works.

Copy link
Contributor

@dmendelowitz dmendelowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Just had one small comment


const INVALID_MRN = 'INVALID MRN';
const csvFileModule = new CSVFileModule(path.join(__dirname, './fixtures/example-csv.csv'));
const csvFileModuleWithBOMs = new CSVFileModule(path.join(__dirname, './fixtures/example-csv-bom.csv'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can delete example-csv-bom.csv now, right? It's not used anywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are still using it, just encapsulated it within the test that uses it instead of leaving it up at the top

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if I'm missing something obvious but I don't see the file used anywhere in the tests. The BOM test uses example-csv-empty-values.csv, is that intentional? I think that file has a BOM so it is an accurate test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not intentional. Definitely a typo. Fixing now.

@jafeltra
Copy link
Contributor

jafeltra commented Dec 9, 2021

I'm not officially reviewing this PR, but when I was looking through the code yesterday and when Dylan M mentioned the bom nightmares, I remembered there are two other places we probably need these option as well. There's the CSVURLModule and the function in appUtils that uses it for the patient ids CSV. I think we want this in both of those places as well, right?

@dmendelowitz
Copy link
Contributor

I'm not officially reviewing this PR, but when I was looking through the code yesterday and when Dylan M mentioned the bom nightmares, I remembered there are two other places we probably need these option as well. There's the CSVURLModule and the function in appUtils that uses it for the patient ids CSV. I think we want this in both of those places as well, right?

I wonder if it would be worth it to write a wrapper function that just calls parse() with the right settings and use that in all three places just so we never have to worry about this again?

@jafeltra
Copy link
Contributor

jafeltra commented Dec 9, 2021

I wonder if it would be worth it to write a wrapper function that just calls parse() with the right settings and use that in all three places just so we never have to worry about this again?

Ah that's a good point. I feel like that could definitely be worthwhile.

@dmendelowitz dmendelowitz merged commit 0bd315d into develop Dec 10, 2021
@dmendelowitz dmendelowitz deleted the support-blank-lines branch December 10, 2021 16:04
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.

4 participants