Relationship between Encounter/DiagnosticReport an...
# support
d
Hi all, Sorry if this is more of a FHIR issue than a Medplum one, but since we are using Medplum as a base for our project I figured I'd give it a shot and ask here if someone has faced something similar. We're trying to find a way to relate an Encounter and a DiagnosticReport to a ResearchStudy. I have a few questions: - From the [FHIR documentation](https://build.fhir.org/researchstudy-definitions.html#ResearchStudy.result) it seems that the ResearchStudy itself could reference a list of DiagnosticReports as a "result", but I can't seem to find any reference to that in the [Medplum documentation](https://www.medplum.com/docs/api/fhir/resources/researchstudy?section=schema). Do you know if this is implemented? - We are even more interested to know if the other way around is possible - a DiagnosticReport referencing a ResearchStudy. I couldn't find any specific field for that in the docs, and I believe we'd have to use the "basedOn" field. But that doesn't allow a reference to a ResearchStudy directly. So we'd have to reference a CarePlan, which in turn references a PlanDefinition which is, then, referenced by the ResearchStudy. Do you know if there's any easier way to accomplish that? - Related to the question above, if there's no easier way: I can see how to reference the PlanDefinition from the CarePlan on the [FHIR docs (using instantiatesCanonical)](https://build.fhir.org/careplan-definitions.html#CarePlan.instantiatesCanonical), but I also couldn't find this relationship in the [Medplum docs](https://www.medplum.com/docs/api/fhir/resources/careplan?section=schema). Do you know if this is possible at all? Thank you all for your time and attention! -# Pinging @ya51n. so he can follow this as well
n
Medplum user and not a FHIR expert but it seems you're looking at the "CI build" (latest) of the FHIR documentation. Medplum as well as the large majority of implementations use [R4](https://hl7.org/fhir/R4/researchstudy.html). In this case, it appears the
result
key you mentioned isn't part of the R4 ResearchStudy.
d
Hey @nathan-watkins , thanks for taking the time to answer! That makes sense, and it might be the case for the "result" key, yes. Any idea for the other questions, though? (@rahul1 and @reshma , sorry, I'll tag you here just in case you have some input on this as well)
r
@nathan-watkins is correct. R4 is the rolled out version here in the US and is going to be in the near future as well
n
Extremely unqualified to say what the most correct way to accomplish that but at first glance there appears to be a way to traverse it through something like DiagnosticReport.encounter (DiagnosticReport -> Encounter) Encounter.subject:Patient (Encounter -> Patient) ResearchSubject.individual (ResearchSubject -> Patient) ResearchSubject.study (ResearchSubject -> ResearchStudy) A probably hacky option would be to leverage meta.tag in a way that can point to the ResearchStudy
r
Hi @de_pretto ! These are great questions. The root cause of the discrepancy you've encounted is that the "FHIR docs" you've linked are from th working draft of FHIR version R6 (https://build.fhir.org) Medplum currently supports FHIR R4 only, which is the industry standard
Looking at the FHIR R4 docs, it seems like those fields had unforutunately not yet been added https://hl7.org/fhir/R4/researchstudy.html
d
Hi @rahul1 ! Apologies for the delay in responding, I got the messages and forgot to reply. Just wanted to thank you and @nathan-watkins for the help and tips. Also, I just saw that the Medplum docs now include the "result" field for the ResearchStudy. Thank you for that as well!
2 Views