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

Add term binding validation for IANA_media-type terminology #625

Merged
merged 7 commits into from
Sep 12, 2024

Conversation

mathijshudepohl
Copy link
Collaborator

@mathijshudepohl mathijshudepohl commented Aug 26, 2024

Remarks:

  • Add parsing for IANA terminology URI's to OpenEHRTerminologyAccess to retrieve media type
  • Add fetching of IANA_media-types term bindings for at codes.
  • FIX always add /code_string to terminology path instead of only for /defining_code paths (e.g. /media_type also needs this)

@mathijshudepohl mathijshudepohl self-assigned this Aug 26, 2024
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 71.96%. Comparing base (8df5c64) to head (c52183c).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...jectvalidator/PrimitiveObjectConstraintHelper.java 75.00% 1 Missing and 3 partials ⚠️
...p/archie/terminology/OpenEHRTerminologyAccess.java 75.00% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

@mathijshudepohl mathijshudepohl requested a review from J3173 August 26, 2024 12:41
@mathijshudepohl mathijshudepohl marked this pull request as ready for review August 26, 2024 12:41
Copy link
Collaborator

@J3173 J3173 left a 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");
Copy link
Collaborator

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

Copy link
Collaborator

@J3173 J3173 left a comment

Choose a reason for hiding this comment

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

Nice work!

@mathijshudepohl mathijshudepohl merged commit 1f79bd0 into master Sep 12, 2024
4 checks passed
@mathijshudepohl mathijshudepohl deleted the iana_media_types_validation branch September 12, 2024 08:58
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