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

General Feedback - Community Question: Track Informatics Assay(s) in a FHIR Schema #50

Open
teslajoy opened this issue Sep 17, 2024 · 4 comments
Assignees

Comments

@teslajoy
Copy link

teslajoy commented Sep 17, 2024

How can we track informatics assays within a FHIR schema to ensure they are findable and searchable (using REST API - search parameters of a resource), while maintaining strong associations (tightest links) with core FHIR resources such as Specimen, DocumentReference, Patient, and Observations?

Over the years the informatics community has been capable of efficiently generating large-scale reproducible results associated with specimen(s) of interest using informatics workflow languages such as Nextflow or WDL. By utilizing these workflows in a cloud environment, we can systematically organize analyses results and outcomes according to predefined business rules, leading to streamlined data management and enhanced accessibility.

To organize and translate the data into FHIR, there are two FHIR resources DiagnosticReport and Task that provide provenance to track the assays associated with specimen(s) of interest. However there are Pro's and Con's with each.

Although the naming conventions appears clinical, DiagnosticReport seems to have search parameters with tightest links to core FHIR resources such as Specimen, Patient, Observations, and most importantly DocumentReference's associated with assays that a Task FHIR resource lacks. However, its media field lacks a subfield to define the usage of the DocumentReference ex. input/intermediate/output.

Relevant Link:

github issue : Task vs DiagnosticReport

diagnosticReport

Suggested Improvements:

  • It would be beneficial to include a subfield in DiagnosticReport.media, such as DiagnosticReport.media.use, to specify the type of "grouping" or the intended usage of the DocumentReference (input/intermediate/output).

  • It would be beneficial to include a timestamp of type String, allowing us to define anonymized times in research, such as the index date of XYZ (unit: days). This applies to many FHIR resources including DiagnosticReport.

@JamedFV JamedFV self-assigned this Sep 26, 2024
@bwalsh
Copy link

bwalsh commented Jan 7, 2025

See #75

@bwalsh
Copy link

bwalsh commented Jan 7, 2025

Alternatives using "stock" FHIR resources.
Unfortunately, what works in R4 and R6 is problematic for R5.

image

@bwalsh
Copy link

bwalsh commented Jan 7, 2025

Potential solutions A, B Extension Based
image

Potential solutions C No Extension needed, Search Parameter
image

Make Task input and output references searchable

See https://cloud.google.com/healthcare-api/docs/how-tos/fhir-custom-search

Delete the SearchParameters

# if they already exist
curl -X DELETE \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     $FHIR_BASE'/fhir/SearchParameter?url=http://example.org/fhir/SearchParameter/task-input-reference'

curl -X DELETE \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     $FHIR_BASE'/fhir/SearchParameter?url=http://example.org/fhir/SearchParameter/task-output-reference'

Create the SearchParameters

curl -X POST \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/fhir+json" \
     -d '{
  "resourceType": "SearchParameter",
  "id": "task-input-reference",
  "url": "http://example.org/fhir/SearchParameter/task-input-reference",
  "name": "input",
  "status": "active",
  "description": "Search for Task.input.value that is a Reference",
  "code": "input",
  "base": [
    "Task"
  ],
  "type": "reference",
  "expression": "Task.input.value",
  "target": [
    "Resource"
  ]
}' \
      $FHIR_BASE'/fhir/SearchParameter'

curl -X POST \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/fhir+json" \
     -d '{
  "resourceType": "SearchParameter",
  "id": "task-output-reference",
  "url": "http://example.org/fhir/SearchParameter/task-output-reference",
  "name": "output",
  "status": "active",
  "description": "Search for Task.output.value that is a Reference",
  "code": "output",
  "base": [
    "Task"
  ],
  "type": "reference",
  "expression": "Task.output.value",
  "target": [
    "Resource"
  ]
}' \
      $FHIR_BASE'/fhir/SearchParameter'

See the SearchParameters

curl -X GET \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      $FHIR_BASE'/fhir/SearchParameter'

Re-configure the search (google fhir)

curl -X POST \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    --data "{
        \"canonicalUrls\": [\"http://example.org/fhir/SearchParameter/task-output-reference\",\"http://example.org/fhir/SearchParameter/task-input-reference\"],
    }" \
    $FHIR_BASE":configureSearch"

Re-configure the search (HAPI)

 $FHIR_BASE":$reindex"

Create a Task with Specimen input and DocumentReference output

curl -X POST \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    --data '{
  "resourceType": "Task",
  "status": "draft",
  "intent": "order",
  "input": [
    {
      "type": {"text": "input_specimen"},
      "valueReference": {"reference": "Specimen/4212b378-c69b-5df0-ab79-8f42f62bac5e"}
    }
  ],
  "output": [
    {
      "type": {"text": "output_file"},
      "valueReference": {"reference": "DocumentReference/ccac2a79-31e1-565b-9e92-653f3f9c9524"}
    }
  ]    
}' \
      $FHIR_BASE'/fhir/Task'

Search for the Assay(Task) with Specimen input

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    $FHIR_BASE'/fhir/Task?input=Specimen/4212b378-c69b-5df0-ab79-8f42f62bac5e'

Find the Specimen and associated Assay (Task)

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    $FHIR_BASE'/fhir/Specimen?_id=4212b378-c69b-5df0-ab79-8f42f62bac5e&_revinclude:recurse=Task:input'

Search for the task with DocumentReference output

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    $FHIR_BASE'/fhir/Task?output=DocumentReference/ccac2a79-31e1-565b-9e92-653f3f9c9524'

Find the DocumentReference and associated Assay (Task)

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    $FHIR_BASE'/fhir/DocumentReference?_id=ccac2a79-31e1-565b-9e92-653f3f9c9524&_revinclude:recurse=Task:output'

@bwalsh
Copy link

bwalsh commented Jan 7, 2025

@teslajoy @RobertJCarroll @JamedFV Consolidated comments on Assay here.

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

3 participants