Gravitate-Health / fhir-connector

FHIR connector example
Apache License 2.0
0 stars 2 forks source link

Generate provenance for any retrieved resources #17

Closed gmej closed 5 months ago

gmej commented 6 months ago

I have implemented the creation of Provenance for retrieved resources. You can see some examples at https://gravitate-health.lst.tfo.upm.es/epi/api/fhir/Provenance. I wouldn't close this issue yet as I would like to confirm that the provenance is being correctly generated.

gmej commented 6 months ago

Here there's an example of a generated provenance. The source is this in this example: SOURCE and the generated resource in our server is this one RESOURCE


{
  "resourceType": "Provenance",
  "id": "6048",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2024-05-14T14:28:59.485+00:00",
    "source": "#044ac57a-bde7-92"
  },
  "target": [
    {
      "reference": "Bundle/bundlepackageleaflet-en-444c9ba43fa8be9df56ba30d3dc13ea7"
    }
  ],
  "recorded": "2024-05-14T14:28:59.373158+00:00",
  "activity": {
    "coding": [
      {
        "system": "https://gravitate-health.lst.tfo.upm.es/epi/api/fhir",
        "code": "access",
        "display": "Access/View Record Lifecycle Event"
      }
    ]
  },
  "agent": [
    {
      "type": {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
            "code": "author",
            "display": "Author"
          }
        ],
        "text": "Author"
      },
      "onBehalfOf": {
        "reference": "Organization/1"
      }
    }
  ],
  "entity": [
    {
      "role": "source",
      "what": {
        "reference": "https://sandbox.hl7europe.eu/gravitate-health/fhir/Bundle/bundlepackageleaflet-en-444c9ba43fa8be9df56ba30d3dc13ea7"
      }
    }
  ]
}
gmej commented 5 months ago

Done in https://github.com/Gravitate-Health/fhir-connector/commit/bf63fe6dbd65540e9e3d96cf54d8c0d71843dd5a