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

org.hl7.fhir.r4.model.codesystems package missing in R5 #1496

Open
Athou opened this issue Nov 24, 2023 · 4 comments
Open

org.hl7.fhir.r4.model.codesystems package missing in R5 #1496

Athou opened this issue Nov 24, 2023 · 4 comments

Comments

@Athou
Copy link

Athou commented Nov 24, 2023

Hello!

We're currently exposing FHIR R4 resources using the FHIR facade model described here https://hapifhir.io/hapi-fhir/docs/server_plain/server_types.html#plain-server-facade

Our code makes use of the classes in the org.hl7.fhir.r4.model.codesystems package. We're using the enums to create CodeableConcepts in order to avoid hardcoding system ids, display texts and values e.g.

Condition condition = new Condition();
ConditionClinical status = Items.isActive(item) ? ConditionClinical.ACTIVE : ConditionClinical.INACTIVE;
condition.setClinicalStatus(new CodeableConcept(new Coding(status.getSystem(), status.toCode(), status.getDisplay())));

We're currently in the process of migrating to R5 but it seems the package org.hl7.fhir.r5.model.codesystems does not exist with R5.
Do those enums still exist somewhere else? If they don't, what is the recommended way of creating CodeableConcepts?

Thanks!

@grahamegrieve
Copy link
Collaborator

Interesting. I did not generate the r5 code systems because no one ever reported any issues with the r4 code systems, and I figured no one was using them.

@Athou
Copy link
Author

Athou commented Nov 27, 2023

😄

Would you be willing to generate the code systems for r5?

Would it even be possible to add a toCoding() method on those enums that would simply call the Coding(String theSystem, String theCode, String theDisplay) constructor, in order to ease creation of CodeableConcepts?
It would look something like this:

condition.setClinicalStatus(new CodeableConcept(ConditionClinical.ACTIVE.toCoding()));

@alaingodet
Copy link

Sorry to jump in this post but I think it would be useful to keep these enums based on the code systems, as suggested by Athou. If there was no issue with them it's probably because it was working just fine.

@cmark
Copy link
Contributor

cmark commented Apr 25, 2024

I just bumped into this issue when generating subsumption outcomes in an R5 $subsumes endpoint 😅 and the four possible outcome literals are non-existent in the R5 package (nor in the R4B).
I think these CodeSystem definitions need their own R4B and R5 representations just to be consistent with the other package or some other alternative will be needed so that when someone is using a newer FHIR version they have the enumerations at his/her disposal. I assume when R6 gets released as the new Normative release, these enumerations will be in that package.

My workaround for now is to use the R4 lib which is okay but requires another maven dependency just for a few enum classes.

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

No branches or pull requests

4 participants