-
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
Add mpsii comments mapping refactor #1477
Add mpsii comments mapping refactor #1477
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
@@ -28,43 +28,63 @@ public void transform(HealthData<?> resource, Map<String, Object> args) { | |||
var codingMap = getMapFromArgs(args); | |||
|
|||
var bundle = (Bundle) resource.getUnderlyingData(); | |||
var msh41Identifier = extractMsh41Identifier(bundle); |
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.
Consider adding a null check for bundle
in extractMsh41Identifier
method to prevent potential NullPointerExceptions. This is important as the method assumes bundle
is not null. [important]
observation.getCode().getCoding().add(0, mappedCoding); | ||
} | ||
|
||
private String validateField(String field, String fieldName) { |
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.
Refactor the validateField
method to handle different types of validation based on the field type or requirements. This could improve the flexibility and reusability of the validation logic. [medium]
|
||
private String validateField(String field, String fieldName) { | ||
if (field == null || field.isBlank()) { | ||
throw new IllegalArgumentException("missing or empty required field " + fieldName); |
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.
Consider using a more specific exception than IllegalArgumentException
for different validation failures in validateField
, such as MissingFieldException
or InvalidFieldException
, to provide clearer error information. [important]
PR Code Suggestions ✨Explore these optional code suggestions:
|
#Refactoring of original PR (Add mpsii comments mapping refactor)
Describe what changed in this PR at a high level.