-
Notifications
You must be signed in to change notification settings - Fork 9
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
Transformation Engine To Use Map<String,Object> As Args #1362
Transformation Engine To Use Map<String,Object> As Args #1362
Conversation
...cdc/trustedintermediary/etor/ruleengine/transformation/custom/RemoveObservationRequests.java
Outdated
Show resolved
Hide resolved
if (alternateId != null) { | ||
updateAlternateCodingId(allCodings, alternateId); | ||
} | ||
}); | ||
} | ||
|
||
// Returns null if it is not a String | ||
private String castToString(Object obj) { | ||
return obj instanceof String ? (String) obj : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, do we want this to skip or pass an empty string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we control the values passed in args, I think it's safe to assume they will be there and have the correct type. If that's not the case, we need to know so we can fix it, so it's better to let it fail
RemoveObservationRequests has invalid args
…pplicationNamespaceTest
…ceivingApplicationNamespace
…eivingApplicationNamespaceTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments. It's actually just one comment but in multiple places. Otherwise looks good to me
...cdc/trustedintermediary/etor/ruleengine/transformation/custom/RemoveObservationRequests.java
Outdated
Show resolved
Hide resolved
...dintermediary/etor/ruleengine/transformation/custom/UpdateReceivingApplicationNamespace.java
Outdated
Show resolved
Hide resolved
...rustedintermediary/etor/ruleengine/transformation/custom/UpdateSendingFacilityNamespace.java
Outdated
Show resolved
Hide resolved
if (alternateId != null) { | ||
updateAlternateCodingId(allCodings, alternateId); | ||
} | ||
}); | ||
} | ||
|
||
// Returns null if it is not a String | ||
private String castToString(Object obj) { | ||
return obj instanceof String ? (String) obj : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we control the values passed in args, I think it's safe to assume they will be there and have the correct type. If that's not the case, we need to know so we can fix it, so it's better to let it fail
> When message has a mappable local observation code in OBX-3.4/5/6, should add the mapped code to OBX-3.1/2/3 > When message has an unmapped local observation code in OBX-3.4/5/6, no mapping should occur and a warning should be logged > added createBundleWithObservation helper method > added createCoding helper method
added createBundleWithMultipleCodings helper method refactored When message has a mappable local observation code in OBX-3.4/5/6 and other content in OBX3-1/2/3, no mapping should occur unit test
refactored When message has a LOINC code, no mapping should occur unit test
added createBundleWithNoSystem helper method refactored When no coding system, no mapping should occur
added createBundleWithNoExtension helper method refactored When no coding extension, no mapping should occur unit test
added createBundleWithNoIdentifier helper method refactored When no observation identifier, the observation does not change unit test
Since local code to LOINC or PLT code PR was merged, I had to refactor that transformation class (MapLocalObservationCodes) and it's test cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one suggestion, otherwise looks good!
...stedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifier.java
Outdated
Show resolved
Hide resolved
…p-object-args' into feature/transformation-engine/map-object-args
Quality Gate passedIssues Measures |
* changes: Map<String,String> args -> Map<String,Object> args CustomFhirTransformation uses Map<String,Objcet> in signature HappyPathCustomTransformationMockClass uses Map<String,Object> TransformationRule expects a Map<String,Object> * unit test: RemoveObservationRequests has invalid args * rename test case * args.get('name') not a string test case for UpdateSendingFacilityNamespaceTest * added casting of Object to test cases in UpdateSendingFacilityNamespaceTest * unit test when args.get('name') is not a string, for UpdateReceivingApplicationNamespaceTest * added (Object) casting to test case in UpdateReceivingApplicationNamespaceTest * null check for RemoveObservationrequests * NoExceptionThrown when args.get('universalServiceIdentifier') is not a string * null check for receiving application and args.get('name') in UpdateReceivingApplicationNamespace * edited unit test: receiving application not in bundle, from UpdateReceivingApplicationNamespaceTest * Map<String, String> -> Map<String, Object> for MapLocalObservationCodes * refactored unit tests: > When message has a mappable local observation code in OBX-3.4/5/6, should add the mapped code to OBX-3.1/2/3 > When message has an unmapped local observation code in OBX-3.4/5/6, no mapping should occur and a warning should be logged > added createBundleWithObservation helper method > added createCoding helper method * refactored MapLocalObservationcodesTest: added createBundleWithMultipleCodings helper method refactored When message has a mappable local observation code in OBX-3.4/5/6 and other content in OBX3-1/2/3, no mapping should occur unit test * refactored MapLocalObservationcodesTest: refactored When message has a LOINC code, no mapping should occur unit test * refactored MapLocalObservationCodesTest: added createBundleWithNoSystem helper method refactored When no coding system, no mapping should occur * refactored MapLocalObservationCodesTest: added createBundleWithNoExtension helper method refactored When no coding extension, no mapping should occur unit test * refactored MapLocalObservationCodesTest: added createBundleWithNoIdentifier helper method refactored When no observation identifier, the observation does not change unit test * deleted unused helper method * deleted comment * remove null check when casthing to string * remove casting method
Complex Map As Args For Transformation Engine
This PR adds the logic for the trasnformation engine to use a Map<String,Object> intead of a Map<String,String> allowing for more flexibility when passing parameters when using the transformation_definitions.json file.
Issue
#1366
Checklist
Note: You may remove items that are not applicable