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

Update PID 3.4 #1095

Closed
wants to merge 13 commits into from
Closed

Update PID 3.4 #1095

wants to merge 13 commits into from

Conversation

jorg3lopez
Copy link
Contributor

@jorg3lopez jorg3lopez commented May 15, 2024

Transformation: Update PID 3.4

PR is still work in progress.

Issue

#1024

Checklist

  • I have added tests to cover my changes
  • I have added logging where useful (with appropriate log level)
  • I have added JavaDocs where required
  • I have updated the documentation accordingly

}

try {
Bundle bundle = (Bundle) resource.getUnderlyingResource();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would be the only check that would trigger an exception as the HapiHelper::updatePatientIdentifierValue does not throw any exceptions. So, I will add the ability to throw exceptions if the bundle is missing the patient resource or the organization/id can't be found.

}
}

def "handle empty bundle gracefully"() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test will change once exceptions are thrown

noExceptionThrown()
}

def "should not perform updates if no organizations are present in the bundle"() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same with this unit test, it will change once exceptions are thrown

noExceptionThrown()
}

def "should handle patients without assigners"() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same. It will change once exceptions are thrown

org -> {
boolean matches =
("Organization/" + org.getId()).equals(assigner.getReference());
LOGGER.logInfo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried using LOGGER.logDebug() here but it was not working

Copy link


try {
Bundle bundle = (Bundle) resource.getUnderlyingResource();
String newValue = args.get("newValue");
Copy link
Contributor

Choose a reason for hiding this comment

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

There should not be a new value for this transformation. This is the description as it's in the spreadsheet: "Strip content from Patient Identifier (PID-3). Remove PID-3.4 and PID-3.5"

Copy link
Contributor Author

@jorg3lopez jorg3lopez May 15, 2024

Choose a reason for hiding this comment

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

the value can be: newValue = " "

* updated.
* @param newValue the new value to which the identifier type code should be set.
*/
public static void updateOrganizationIdentifierValue(Bundle bundle, String newValue) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I will end up moving this logic into the transform method of the transformation class. This will only leave helper methods in the HapiHelper class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will use FHIR path for checking, if it exists, then I will proceed to update the value

@jorg3lopez
Copy link
Contributor Author

Closed as #1069 is working on this.

@jorg3lopez jorg3lopez closed this May 16, 2024
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.

2 participants