Search code examples
ioshealthkithl7-fhir

How to get a healthcare organization from a Clinical Health Record instance?


I'm developing an app that works with Clinical Health Records. The idea is to fetch FHIR resources and process them in a certain way. Although getting the FHIR data is easy, I cannot find out what account or organization the record belongs to.

Neither HKClinicalRecord nor HKFHIRResource classes have methods or fields that might lead to account or healthcare organization.

At the same time, the standard Apple Health application does know the account for each record. It even allows to open it and see the patient's data (see screenshots). Apple's app can filter records by their organizations. That exactly what I'm looking for in my app. Can anybody give me a clue about how to get that information in my code?

The screenshots:


Solution

  • Look at HKClinicalRecord.sourceRevision.source, it tells you where the FHIR data is from. It is an HKSource instance that has a name.