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

422 Unprocessable Entity - null_flavour: Attribute has 0 occurrences, but must be 1..1 where a valid entry is given. #1027

Open
biermapa opened this issue Jan 5, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@biermapa
Copy link

biermapa commented Jan 5, 2023

Environment information

    <ehrbase_version>0.24.0-SNAPSHOT</ehrbase_version>
    <openehr_sdk_version>1.24.0-SNAPSHOT</openehr_sdk_version>
    <archie_version>2.0.1</archie_version>
    <jvm_version>Eclipse Adoptium 17.0.5+8</jvm_version>
    <os_version>Linux amd64 5.10.16.3-microsoft-standard-WSL2</os_version>
    <postgres_version>PostgreSQL 13.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit</postgres_version>

Steps to reproduce

The attached zip contains an postman collection with the opt and two composition (one self-constructed the other one is an example composition created via the ehrbase REST API). Everything was executed on a clean default docker-compose installation.

422_Unprocessable_Entity.postman_collection.zip

Actual result

Both composition return following:

{
    "error": "Unprocessable Entity",
    "message": "/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1 and name/value='Befund']/data[at0001]/events[at0002]/data[at0003]/items[openEHR-EHR-CLUSTER.laboratory_test_panel.v0 and name/value='Kultur']/items[openEHR-EHR-CLUSTER.laboratory_test_analyte.v1 and name/value='Pro Erreger']/items[openEHR-EHR-CLUSTER.erregerdetails.v1]/items[at0035]/null_flavour: Attribute has 0 occurrences, but must be 1..1"
}

The "items[at0035]/null_flavour" must not be 1..1 if an valid element is given. In this case a valid DV_QUANTITY.

Expected result

Ehrbase should create the valid composition.

@biermapa biermapa added the bug Something isn't working label Jan 5, 2023
@vladislavploaia
Copy link
Contributor

Hello @biermapa ,
Thank you for this ticket.
I was trying to reproduce it and got the same result as in another issue reported by you:
#1033
Please check my comments below and provide valid OPT or Composition.
image
Thank you in advance!

CC: @vidi42 , @HolgerReiseVSys

@vladislavploaia vladislavploaia added the feedback Feedback from the creator of the issue is required label Jan 16, 2023
@biermapa
Copy link
Author

biermapa commented Jan 18, 2023

Hello @vladislavploaia,

I think I added the wrong template version to the collection.
Here is the new one.

422_Unprocessable_Entity.postman_collection.zip

If you remove at0035 from the composition the composition will be created, but that can't be the solution.

@vladislavploaia
Copy link
Contributor

Hello @biermapa,
I analyzed your OPT content.
I removed this section from OPT content (null_flavour) - See below the removed section marked with red:
image
Compositions content remained the same.
Was able to commit both compositions from Postman collection.
Here is the updated OPT content:
updated_opt.txt

Please check and let me know if it is working for you. Thanks!
CC: @vidi42 , @HolgerReiseVSys

@vladislavploaia vladislavploaia removed the bug Something isn't working label Jan 19, 2023
@HolgerReiseVSys
Copy link
Contributor

It seems that there is an issue when the options for null_flavour are constrained.
For some reason in the openEHR-EHR-CLUSTER.erregerdetails.v1 archetype each available option is explicitly listed.
It appears that while parsing the template, at some point the constraint causes the null_flavour to be required, which leads to subsequent errors.

@biermapa
Copy link
Author

@vladislavploaia
This works.
Still the question remains, why the template won't be accepted the way it is. It should be possible to constrain the null_flavour. Altough I think that in this case it didn't happen on purpose.

The link to the given archetype: https://ckm.highmed.org/ckm/archetypes/1246.145.322/adl

@vladislavploaia vladislavploaia added bug Something isn't working and removed feedback Feedback from the creator of the issue is required labels Jan 30, 2023
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