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

Subject Namespace #1058

Open
simonFuturePerfect opened this issue Feb 15, 2023 · 5 comments
Open

Subject Namespace #1058

simonFuturePerfect opened this issue Feb 15, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@simonFuturePerfect
Copy link

simonFuturePerfect commented Feb 15, 2023

Environment information

EHRBASE_VERSION: 0.22.0-SNAPSHOT
Java Runtime version: Open JDK 11.0.16
OS Version: Debian GNU/Linux 9
Archie version: 2.0.1
PostgreSQL version:11 (Azure PostgreSQL)

Steps to reproduce

curl -X 'PUT'
'https://anapplication.azurewebsites.net/ehrbase/rest/openehr/v1/ehr/f56175ac-0e72-4b7b-9088-233652444371'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"_type": "EHR_STATUS",

"name": {
"_type": "DV_TEXT",
"value": "EHR Status"
},
"subject": {
"_type": "PARTY_SELF",
"external_ref": {
"_type": "PARTY_REF",
"type": "PERSON",
"id": {
"_type": "GENERIC_ID",
"value": "9044258125",
"scheme": "id_scheme"
},
"namespace": "https://fhir.nhs.uk.Id/nhs-number"
}
},
"is_queryable": true,
"is_modifiable": true,
"archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1"
}'

Actual result

Error Status Code 400 Bad Request
{
"error": "Bad Request",
"message": "Subject's namespace format invalid"
}

Expected result

200 EHrId Created

Further information

I think the RegEx in
ValidationServiceImp needs to include the '.' character so it should be
private static final Pattern NAMESPACE_PATTERN = Pattern.compile("[a-zA-Z][a-zA-Z0-9-_:/&+?.]*");

I'm happy to create a unit test that emulates the openEHR subject namespace requirements, if it helps.

@vidi42
Copy link
Contributor

vidi42 commented Feb 20, 2023

Hey @simonFuturePerfect

We are getting a lot of issue requests and for that, we set up some issue types which guide you through detailing an issue and help us with all the information needed so we can prioritize it.

You can read more about how to contribute in our Contributing page.

Please use one of the provided templates to detail the issue.

@vidi42 vidi42 added the feedback Feedback from the creator of the issue is required label Feb 20, 2023
@simonFuturePerfect

This comment was marked as duplicate.

@vidi42 vidi42 added bug Something isn't working and removed feedback Feedback from the creator of the issue is required labels Feb 22, 2023
@vladislavploaia
Copy link
Contributor

vladislavploaia commented Feb 24, 2023

Hello @simonFuturePerfect,
Regex expression in specifications, is the following:
[a-zA-Z][a-zA-Z0-9_.:/&?=+-]* - https://specifications.openehr.org/releases/BASE/latest/base_types.html#_object_ref_class
Your expression is the following:
[a-zA-Z][a-zA-Z0-9-_:/&+?.]*

Question: What is the expected one? I would go with what I see in the specifications (both cases can find the full URL https://fhir.nhs.uk.id/nhs-number in namespace, including dot).

Please let me know, so I can report bug for that, because currently, I see this regex [a-zA-Z][a-zA-Z0-9-_:/&+?]* in ValidationServiceImp.java and that one is not able to see the dot.
Old ticket was closed for unclear reasons (the same error): #399

CC: @vidi42 , @birgerhaarbrandt, @stefanspiska, @HolgerReiseVSys

@vladislavploaia vladislavploaia added the feedback Feedback from the creator of the issue is required label Feb 24, 2023
@simonFuturePerfect
Copy link
Author

I agree with you @vladislavploaia go with the one that is in the specification. I just added the '.' to the RegExpression in ValidationServiceImp.java. Thanks for the help.

@vladislavploaia vladislavploaia removed the feedback Feedback from the creator of the issue is required label Feb 24, 2023
@vladislavploaia
Copy link
Contributor

@simonFuturePerfect,
Defect ticket reported in our internal Jira: https://jira.vitagroup.ag/browse/CDR-754
Once I get any updates, I will let you know.
Thank you!
CC: @vidi42 , @stefanspiska

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants