Loosen required fields for Patient CSV and mark missing required fields #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes it so that
familyName,givenName, andgenderare not required fields in CSVs. Because they are still required in the mCODE Cancer Patient profile, they are marked withdataAbsentReasonextensions with a code'unknown'.New behavior
If
familyName,givenName, orgenderis not provided in the patient information CSV, no errors/warnings are logged and no data extracted. Further, if they are missing, the template will add adataAbsentReasonfornameandgenderin the patient resource because they have a1..*cardinality in mCODE. I thought about adding a warning or debug message to say those fields are recommended, but decided against it. If anyone likes the idea of that message, I can definitely be convinced to add it back.If
nameorgenderis not provided but configuration says to mask it, it will get adataAbsentReasonfor'masked'instead. I thought this made sense because we'd want to mask any data we had, including the extension saying that we had no data (when I type it out, it sounds more confusing than I thought).None of the other fields in the patient CSV are affected by this PR because they are not required in the profiled Patient resource, and if values are not provided in the CSV, we already do not include them in the extracted resource. Any field that we say to mask but was never in the resource is not masked, which I believe is still correct.
Code changes
CSVPatientExtractorto only throw if themrnis missingdataAbsentReasonextensions if applicable tonameandgenderTesting guidance
gender,name,mrn, and any other non-required,0..*property.