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

fhir:link missing from MedicationStatement.subject #121

Open
dbooth-boston opened this issue Jun 21, 2023 · 9 comments · May be fixed by hapifhir/org.hl7.fhir.core#1858
Open

fhir:link missing from MedicationStatement.subject #121

dbooth-boston opened this issue Jun 21, 2023 · 9 comments · May be fixed by hapifhir/org.hl7.fhir.core#1858
Assignees
Labels
help wanted Turtle FHIR specification Turtle examples

Comments

@dbooth-boston
Copy link
Contributor

dbooth-boston commented Jun 21, 2023

Turtle filename
This R4 example has a fhir:link inside the fhir:MedicationStatement.subject:
https://hl7.org/fhir/R4B/medicationstatementexample1.ttl.html

But it is missing in the R5 example. Look for fhir:subject in this example:
https://build.fhir.org/medicationstatementexample1.ttl.html

FHIR Resource
https://build.fhir.org/medicationstatement.html#af

ShEx shape
https://build.fhir.org/medicationstatement.shex.html

Description
The turtle probably should have the fhir:link or something equivalent, but we should discuss.

This issue is related to #120

@dbooth-boston dbooth-boston added the Turtle FHIR specification Turtle examples label Jun 21, 2023
@dbooth-boston
Copy link
Contributor Author

I just checked, and this is not fixed by HL7/kindling#148

@dbooth-boston
Copy link
Contributor Author

@balhoff

@balhoff
Copy link
Contributor

balhoff commented Oct 24, 2024

@dbooth-boston can you assign to me?

@dbooth-boston
Copy link
Contributor Author

@tmprd Do you think this is a change needed in Kindling?

@balhoff
Copy link
Contributor

balhoff commented Dec 11, 2024

I think this may be the same issue causing the root node in the R5 examples to be a blank node, when it had an IRI in R4.

E.g. <http://hl7.org/fhir/MedicationStatement/example001> vs. [] in the linked pages above.

This code checks if base has a value:

  protected String getReferenceURI(String ref) {
    if (ref != null && (ref.startsWith("http://") || ref.startsWith("https://")))
      return "<" + ref + ">";
    else if (base != null && ref != null && ref.contains("/"))
      return "<" + Utilities.appendForwardSlash(base) + ref + ">";
    else
      return null;
    }

I think the calling code needs to provide a value for base. Not sure why it was in R4 but isn't now.

@balhoff
Copy link
Contributor

balhoff commented Dec 11, 2024

I verified my idea above by hardcoding a base string. It fixes both the resource IRI and the fhir:link output. So we need to change the calling code. I see this is called in @tmprd's changes here, with a null value:

https://github.com/HL7/kindling/pull/148/files#diff-0b45ecac1a10eb5075600a7cb0da87b7531c1c2795f7d2519db5a50e1d440a42R4506

This must be called somewhere else as well, since R5 generation has been happening. I don't know enough about the full build.

@balhoff
Copy link
Contributor

balhoff commented Dec 12, 2024

Discussed in WG meeting, if base is null, in the code default to base http://hl7.org/fhir/ to match the R4 examples.

As a larger project, we think it would be nice if the example IRIs were dereferenced in a cleaner way, e.g. for something like <http://hl7.org/fhir/MedicationStatement/example001>, return a resource rather than redirect to https://hl7.org/fhir/medicationstatementexample1.ttl. (@ericprud)

@balhoff
Copy link
Contributor

balhoff commented Dec 12, 2024

I opened a pull request for the above change: hapifhir/org.hl7.fhir.core#1858

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Turtle FHIR specification Turtle examples
Projects
None yet
3 participants