-
Notifications
You must be signed in to change notification settings - Fork 24
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 term binding validation for IANA_media-type terminology #625
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #625 +/- ##
============================================
+ Coverage 71.94% 71.96% +0.01%
- Complexity 7066 7071 +5
============================================
Files 671 671
Lines 23034 23056 +22
Branches 3740 3745 +5
============================================
+ Hits 16572 16592 +20
Misses 4717 4717
- Partials 1745 1747 +2 ☔ View full report in Codecov by Sentry. |
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.
At first glance it looks good, but I still need to test this. I already have one comment.
@@ -19,8 +19,10 @@ | |||
|
|||
public class OpenEHRTerminologyAccess implements TerminologyAccess { | |||
|
|||
static volatile OpenEHRTerminologyAccess instance; | |||
private static final Pattern openEHRTermIdPattern = Pattern.compile("http://openehr.org/id/(?<id>[0-9]+)"); | |||
private static final Pattern IANATermIdPattern = Pattern.compile("https://www.w3.org/ns/iana/media-types/(?<type>[A-Za-z]+)/(?<subtype>[A-Za-z]+)#Resource"); |
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.
This regex is a bit too restrictive. Media types can also contain numbers and other special characters, see https://github.com/openEHR/archie/blob/master/openehr-terminology/src/main/resources/openEHR_RM/openehr_external_terminologies.xml#L525
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.
Nice work!
Remarks:
OpenEHRTerminologyAccess
to retrieve media typeIANA_media-types
term bindings for at codes./code_string
to terminology path instead of only for/defining_code
paths (e.g./media_type
also needs this)