Search code examples
hl7-fhir

How to get multiple patients $everything from synthea (syntheticmass.mitre.org) in single request?


Does Synthea (syntheticmass.mitre.org) support the ability to get multiple Patent?$everything resources in a single request?

I've tried some permutations of the the following but I'm not able to get it to return multiple patients in the same request.

Requests (POST)

https://syntheticmass.mitre.org/v1/fhir/$export?apikey=API_KEY_GOES_HERE

https://syntheticmass.mitre.org/v1/fhir?apikey=API_KEY_GOES_HERE

https://syntheticmass.mitre.org/v1/fhir/Bundle?apikey=API_KEY_GOES_HERE

https://syntheticmass.mitre.org/v1/fhir/Bundle/$export?apikey=API_KEY_GOES_HERE

Requests Body

{
  "resourceType": "Bundle",
  "id": "bundle-request-simplesummary",
  "type": "batch",
  "entry": [
    {
      "request": {
        "method": "GET",
        "url": "/Patient/6f7acde5-db81-4361-82cf-886893a3280c?apikey=<API_KEY_GOES_HERE>"
      }
    },
    {
      "request": {
        "method": "GET",
        "url": "/Patient/6f7acde5-db81-4361-82cf-886893a3280c?apikey=<API_KEY_GOES_HERE>"
      }
    }
  ]
}

Response (resource not found)

{
    "resourceType": "OperationOutcome",
    "text": {
        "status": "generated",
        "div": "<div><h1>Operation Outcome</h1><table border='1'><tr><td style='font-weight: bold;'>error</td><td>[]</td><td><pre>The requested resource was not found on this server.</pre></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
    },
    "issue": [
        {
            "severity": "error",
            "code": "not-found",
            "details": "The requested resource was not found on this server."
        }
    ]
}

Response (cannot create resource on server)

{
  "issue": [
    {
      "code": "security",
      "details": {
        "text": "permission_denied"
      },
      "diagnostics": "Permission healthcare.fhirResources.create denied on resource projects/synthea/locations/us-central1/datasets/201902/fhirStores/synthetic-mass (or it may be malformed or not exist)",
      "severity": "error"
    }
  ],
  "resourceType": "OperationOutcome"
}

Solution

  • SyntheticMass does not support bulk data export.

    If you want all the data, download the data from the downloads section: https://synthea.mitre.org/downloads

    Source: I am responsible for the system.