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

Engagement/jessica/15405 cleanup deidentification enrichment #15821

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9c06530
Removing AOEs and updating condition filter to include RSV
JessicaWNava Aug 20, 2024
1dad44f
Merging changes
JessicaWNava Aug 20, 2024
d9a10fe
Merge branch 'master' of https://github.com/CDCgov/prime-reportstream
JessicaWNava Aug 22, 2024
2152c10
Merge branch 'master' of https://github.com/CDCgov/prime-reportstream
JessicaWNava Aug 28, 2024
f72074c
Merge branch 'master' of https://github.com/CDCgov/prime-reportstream
JessicaWNava Aug 29, 2024
e6cebab
Merge branch 'master' of https://github.com/CDCgov/prime-reportstream
JessicaWNava Sep 4, 2024
aee1237
Merge branch 'master' of https://github.com/CDCgov/prime-reportstream
JessicaWNava Sep 4, 2024
d4bc0ea
Merge branch 'master' of https://github.com/CDCgov/prime-reportstream
JessicaWNava Sep 6, 2024
c10e62b
Merge branch 'master' of https://github.com/CDCgov/prime-reportstream
JessicaWNava Sep 9, 2024
b0478d6
Changed where the files used and produced by the remove pii test live…
JessicaWNava Sep 9, 2024
43bff6c
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 10, 2024
6534406
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 10, 2024
4949079
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 10, 2024
77b4e2a
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 10, 2024
b4f6257
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 10, 2024
5bad6a5
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 10, 2024
0bbed2f
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 10, 2024
fc98086
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 11, 2024
67c789d
Merge branch 'master' into engagement/jessica/15405-cleanup-deidentif…
JessicaWNava Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions prime-router/src/main/kotlin/cli/tests/RemovePIITest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import org.hl7.fhir.r4.model.ServiceRequest
import org.hl7.fhir.r4.model.Specimen
import java.io.File
import java.nio.file.Paths
import kotlin.io.path.Path
import kotlin.io.path.deleteIfExists

class RemovePIITest : CoolTest() {
/**
Expand All @@ -41,9 +43,10 @@ class RemovePIITest : CoolTest() {
*/
override suspend fun run(environment: Environment, options: CoolTestOptions): Boolean {
ugly("Starting remove PII test")
val inputFilePath = Paths.get("").toAbsolutePath().toString() + "/src/main/kotlin/cli/tests/fakePII.fhir"
val inputFilePath = Paths.get("").toAbsolutePath().toString() +
"/src/main/resources/clitests/compare-test-files/fakePII.fhir"
val outputFilePath = Paths.get("").toAbsolutePath().toString() +
"/src/main/kotlin/cli/tests/piiRemoved.fhir"
"/src/main/resources/clitests/compare-test-files/piiRemoved.fhir"

PIIRemovalCommands().test(
"-i $inputFilePath -o $outputFilePath"
Expand All @@ -56,40 +59,48 @@ class RemovePIITest : CoolTest() {

if (!testIdsRemoved(inputBundle, outputContent)) {
ugly("Not all IDs removed. Test failed.")
Path(outputFilePath).deleteIfExists()
return false
}

if (!testPatientPIIRemoved(inputBundle, outputBundle)) {
ugly("Not all patient PII removed. Test failed.")
Path(outputFilePath).deleteIfExists()
return false
}

if (!testOrganizationPIIRemoved(inputBundle, outputBundle)) {
ugly("Not all organization PII removed. Test failed.")
Path(outputFilePath).deleteIfExists()
return false
}

if (!testPractitionerPIIRemoved(inputBundle, outputBundle)) {
ugly("Not all practitioner PII removed. Test failed.")
Path(outputFilePath).deleteIfExists()
return false
}

if (!testServiceRequestPIIRemoved(inputBundle, outputBundle)) {
ugly("Not all service request PII removed. Test failed.")
Path(outputFilePath).deleteIfExists()
return false
}

if (!testObservationPIIRemoved(inputBundle, outputBundle)) {
ugly("Not all observation PII removed. Test failed.")
Path(outputFilePath).deleteIfExists()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This implementation is risky because for new use cases you need to remember to have this line

return false
}

if (!testSpecimenPIIRemoved(inputBundle, outputBundle)) {
ugly("Not all specimen PII removed. Test failed.")
Path(outputFilePath).deleteIfExists()
return false
}

ugly("PII removal test passed")
Path(outputFilePath).deleteIfExists()
return true
}

Expand Down
Loading