-
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
Improve mapping between XDS XON and FHIR Organization #166
base: master
Are you sure you want to change the base?
Improve mapping between XDS XON and FHIR Organization #166
Conversation
56b9226
to
217b4d7
Compare
@unixoid can you please review? |
result.addIdentifier().setSystem(system).setValue(id); | ||
} else { | ||
final var identifier = result.addIdentifier().setValue(id); | ||
if (id.startsWith("urn:oid:") || id.startsWith("urn:uuid:")) { |
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.
can it be simplified to if (id.startsWith("urn:"))
?
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.
Indeed!
@@ -141,4 +141,12 @@ public static Processor retrievedDocumentSetToHttResponse() { | |||
}; | |||
} | |||
*/ | |||
|
|||
public static boolean isUnprefixedOid(final String oid) { | |||
return oid != null && oid.matches("\\d+(\\.\\d+)+"); |
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.
here and in isUprefixedUuid
: probably it would make sense to introduce static constants in order to avoid pattern recompilation on each call. For example,
private static final Pattern OID_PATTERN = Pattern.compile("\\d+(\\.\\d+)+");
public static boolean isUnprefixedOid(final String oid) {
return (oid != null) && OID_PATTERN.matcher(oid).matches();
}
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.
Sure!
} | ||
return result; | ||
} | ||
if (identifier.hasSystem()) { |
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.
proposal: change line 1011 to if ((identifier != null) && identifier.hasValue()) {
, change line 1021 to simply } else {
.
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.
Done!
217b4d7
to
7aa87aa
Compare
Fixes #165