1

Using Synthea i have generated 10 patient information. I have an azure account where i have setup "Azure API for FHIR" service. i did all the setup and tried pushing a sample patient (as mentioned in the official docs). i am able to retrieve the patient information by patient id as well.

However, the generated resource from Synthea are not just one resource type.. It has many entries like Patient, Organization, Claim etc.. everything bundled under one resource - bundle

Something like this.. but having more than 100 resource types for a patient. Its good that, it covers entire journey of the patient.

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [
   .....
   {
    ....
   "resourceType": "patient"
    ....
    },
   {
    ....
   "resourceType": "organization"
    ....
    },
]
}

Using post man i tried to insert this bundle with api below

https://XXXXXX.azurehealthcareapis.com/Bundle/

i was able to insert multiple bundles.. However, when i query the patients using the following api

https://XXXXXX.azurehealthcareapis.com/Patient/

All the patient information are not getting retrieved.

Here are my questions.

  1. Inserting bundle by bundle - Is that the right approach.. or
  2. Insert resource by resource .. Patient, Organization , Patient , Organization... But this looks meaningless. Because, if i need to find entire journey of a patient how would i be mapping it
  3. Is There any way i can convert this each bundle as CSV files.. i would like to extract information and run a machine learning model on it.
srinath
  • 2,748
  • 6
  • 35
  • 56

1 Answers1

3

When you need to process bundles at the FHIR endpoint, you need to POST it to the root / of the FHIR server. This is all described in https://www.hl7.org/fhir/http.html#transaction.

That said, the managed Azure API for FHIR only supports "batch" bundles at the moment. Bundle type transaction is not currently supported on Azure API for FHIR.

Both batch and transaction are supported on the OSS FHIR Server for Azure (https://github.com/Microsoft/fhir-server) when deployed with the SQL server persistence provider.

If you want to convert the transaction bundle that Synthea produces to a batch bundle, then you could take a look at something like this: https://github.com/hansenms/FhirTransactionToBatch

MichaelHansen
  • 656
  • 3
  • 7
  • okies.. i will change the type from transaction to batch and try inserting the data. when you say '/' is it 'https://XXXXXX.azurehealthcareapis.com/' ? And how should i get the details out of it as csv.. am using pandas for machine learning model. – srinath Apr 18 '20 at 03:27
  • i have purchased cosmos-db as well. is there a way to connect this fhir-server with cosmos-db or pull the data into datalake and process it with ML model? – srinath Apr 18 '20 at 03:28
  • Yes, by / , I mean the root of the FHIR server. I am not sure what you mean by how to get the details out in csv, if you are looking to convert FHIR to csv, then you need to process the JSON and flatten it out according to your needs. That is not built into the FHIR service. To get data into Cosmos or any other system, again, you will need to do some processing. $export is supported on the service, maybe that will help. – MichaelHansen Apr 18 '20 at 04:48