<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ajit Sonawane on Medium]]></title>
        <description><![CDATA[Stories by Ajit Sonawane on Medium]]></description>
        <link>https://medium.com/@ajitsonawane?source=rss-e382f97e71c9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dublUJuH2D8qLGcG</url>
            <title>Stories by Ajit Sonawane on Medium</title>
            <link>https://medium.com/@ajitsonawane?source=rss-e382f97e71c9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 22:41:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ajitsonawane/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Handle Custom Data and Resources in GCP FHIR Stores]]></title>
            <link>https://medium.com/google-cloud/handle-custom-data-and-resources-in-gcp-fhir-stores-cab9b911a42e?source=rss-e382f97e71c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cab9b911a42e</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[fhir]]></category>
            <category><![CDATA[healthcare-api]]></category>
            <category><![CDATA[hl7]]></category>
            <dc:creator><![CDATA[Ajit Sonawane]]></dc:creator>
            <pubDate>Thu, 18 May 2023 11:00:19 GMT</pubDate>
            <atom:updated>2023-05-18T15:36:05.300Z</atom:updated>
            <content:encoded><![CDATA[<h3>Business Scenario</h3><p>FHIR stores are a valuable tool for healthcare organizations that are looking to improve the interoperability, scalability, security, and usability of their data.</p><p>However, the harmonization process of moving data from a siloed environment to a FHIR store can have challenges. For some data fields, customers may not have relevant FHIR attribute to map the source data field or there can be additional custom data including things like demographics, social determinants of health which needs to be harmonized and stored to FHIR store in the patient’s longitudinal record for downstream usage.</p><p>So, let’s understand how we can resolve this issue using GCP’s Healthcare Api and add this unmapped/custom/additional data to the FHIR store. We will also see how we can search these fields in Bigquery tables and FHIR stores. Since FHIR stores don’t allow search on custom fields, we will need some additional configurations to enable search on these custom fields.</p><p><strong>Important :<em> </em></strong>Custom fields in FHIR resources are not recommended for interoperability but you can store and use them for your downstream analytical applications.</p><h3>What do we need</h3><p>There are two possible approaches to store custom/unmapped data in a FHIR store,</p><ol><li>Usage of FHIR extensions</li><li>Custom FHIR resource</li></ol><p>In this blog we will use the FHIR extension to address them. Extensions are a powerful tool that can be used to add custom data to FHIR resources.</p><p>Here are some additional details about each approach:</p><h4>1. Usage of FHIR extensions:</h4><blockquote>Consider a scenario where you have information about a patient including name, address, contact details, personal identifiers along with details like hair-color, patient-citizenship. This information you will need to harmonize and map to the FHIR attributes. So we need a mapping exercise where you will map source data to the FHIR resource and its attributes. During the mapping exercise, You will find that there is no attribute in patient resource to map fields hair-color and patient-citizenship. You want these both fields to be stored with other attributes in the patient FHIR resource.</blockquote><p>So to store these additional data in the FHIR resource we can use the resource’s extensions. You can first look up listed extensions that have already been listed for the FHIR resources defined in association with the core specification. If you still couldn’t find mapping from the listed extensions, You can add any custom fields that you need on this resource.</p><p>The following example shows a Patient resource with two extensions, hair-color and patient-citizenship, on the root element. In the following example, resourceType, active, gender, extension are FHIR attributes defined in HL7 FHIR specifications.</p><pre>{<br>  &quot;resourceType&quot;:&quot;Patient&quot;,<br>  &quot;active&quot;:true,<br>  &quot;gender&quot;:&quot;male&quot;,<br>  &quot;extension&quot;:[<br>            {<br>              &quot;url&quot;: &quot;http://example.com/fhir/StructureDefinition/hair-colour&quot;,<br>              &quot;valueString&quot;: &quot;brown&quot;<br>            },<br>            {<br>              &quot;url&quot;:&quot;http://example.com/fhir/StructureDefinition/patient-citizenship&quot;,<br>              &quot;valueCodeableConcept&quot; :<br>                  { &quot;coding&quot; :<br>                                [<br>                                      {<br>                                      &quot;system&quot; : &quot;urn:iso:std:iso:3166&quot;,<br>                                      &quot;code&quot;: &quot;US&quot;<br>                                      }<br>                                ]<br>                  }<br>            }<br>      ]<br>}</pre><p>FHIR attribute <strong><em>extension</em></strong> is a list/array containing multiple extensions. Each extension must have a url and value[x] fields. Url identifies the meaning of the extension and you can define extension using using the Url value and StructureDefinition resource. The value[x] field has an actual name of “value” and then the TitleCased name of one of these defined data types e.g. if value is string then field name will be valueString if value is date then valueDate.</p><h4>2. Custom FHIR resource</h4><blockquote>Now, consider a scenario where you have multiple data fields from the healthcare domain which can relate to each other and are not relevant to any existing FHIR resources. Also, these data fields can represent a separate building block of FHIR. For example, the dataset consists of information regarding consent: surgical consent or information disclosure consent, diet specification for the patient, practitioner referring specialists ,invoice and financial transactions. In such a scenario, you may want to create a new FHIR resource itself.</blockquote><p>Though, technically it is possible to create a new FHIR resource in general, it is not recommended by HL7 FHIR specification due to several interoperability issues with this approach. GCP Healthcare API also does not support creation of custom FHIR resources.</p><p>As per HL7 FHIR specification, Basic resource is used for handling concepts not yet defined in FHIR, narrative-only resources that don’t map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. So for this use-case, FHIR resource ‘Basic’ can be used as a resourceType and custom/additional data fields stored as extensions to this resource. To define and identify the type of the data stored in you can use code attribute of Basic resource or add specific ‘type’ field in the extensions.</p><p>As mentioned earlier, usage of custom resource type is discouraged in FHIR but by using Basic resourceType we can store custom data safely in FHIR stores.</p><p>Here is an example of a custom resource type called referral. This resource is not yet a part of the FHIR standard, but it is used to describe a situation where one healthcare provider (the referring practitioner) requests that another healthcare provider (the receiving practitioner) provide care to a patient.</p><pre>{<br>  &quot;resourceType&quot;: &quot;Basic&quot;,<br>  &quot;extension&quot;: [<br>    {<br>      &quot;url&quot;: &quot;http://example.org/do-not-use/fhir-extensions/referral#requestingPractitioner&quot;,<br>      &quot;valueReference&quot;: {<br>        &quot;reference&quot;: &quot;Practitioner/f201&quot;,<br>        &quot;display&quot;: &quot;Dokter Bronsig&quot;<br>      }<br>    },<br>    {<br>      &quot;url&quot;: &quot;http://example.org/do-not-use/fhir-extensions/referral#notes&quot;,<br>      &quot;valueString&quot;: &quot;The patient had fever peaks over the last couple of days. He is worried about these peaks.&quot;<br>    },<br>    {<br>      &quot;url&quot;: &quot;http://example.org/do-not-use/fhir-extensions/referral#fulfillingEncounter&quot;,<br>      &quot;valueReference&quot;: {<br>        &quot;reference&quot;: &quot;Encounter/f201&quot;<br>      }<br>    },<br>    {<br>      &quot;url&quot;: &quot;http://example.org/do-not-use/fhir-extensions/referral#referredForService&quot;,<br>      &quot;valueCodeableConcept&quot;: {<br>        &quot;coding&quot;: [<br>          {<br>            &quot;system&quot;: &quot;http://snomed.info/sct&quot;,<br>            &quot;code&quot;: &quot;11429006&quot;,<br>            &quot;display&quot;: &quot;Consultation&quot;<br>          }<br>        ]<br>      }<br>    }<br>  ],<br>  &quot;identifier&quot;: [<br>    {<br>      &quot;system&quot;: &quot;http://goodhealth.org/basic/identifiers&quot;,<br>      &quot;value&quot;: &quot;19283746&quot;<br>    }<br>  ],<br>  &quot;code&quot;: {<br>    &quot;coding&quot;: [<br>      {<br>        &quot;system&quot;: &quot;http://terminology.hl7.org/CodeSystem/basic-resource-type&quot;,<br>        &quot;code&quot;: &quot;referral&quot;<br>      }<br>    ]<br>  },<br>  &quot;subject&quot;: {<br>    &quot;reference&quot;: &quot;Patient/f201&quot;,<br>    &quot;display&quot;: &quot;Roel&quot;<br>  },<br>  &quot;created&quot;: &quot;2013-05-14&quot;,<br>  &quot;author&quot;: {<br>    &quot;reference&quot;: &quot;Practitioner/example&quot;<br>  }<br>}</pre><h3>Defining an extension with a StructureDefinition</h3><p>For the purposes of interoperability, The name and meaning of an extension can be defined with a StructureDefinition resource that can be published or distributed to enable consumers of the data to interpret it. This is optional when using extensions in the Cloud Healthcare API.</p><p>The identity of this definition is indicated by the canonical url in the ‘url’ field of extensions. For any data that is exchanged between organizations, it is recommended to use a URL that data consumers can follow to obtain the StructureDefinition. The Cloud Healthcare API does not validate this URL or attempt to resolve it.</p><p>We will see more details on StructureDefinition in upcoming blogs.</p><h3>Enable search on custom fields</h3><p>By combining core fields and custom fields, you can create a comprehensive dataset that can be used to gain insights into patient care and improve the quality of care. This dataset can be used for analytical purposes, dashboards, and reports.</p><p>By default, FHIR resources support search on fields that are defined by the FHIR specifications, with some exceptions (FHIR capability statement or FHIR conformance statement). Therefore, to use custom fields or extensions for search queries or any analytical purpose, they must be searchable. This can be done by creating one or more custom search parameters and configuring the FHIR store to support them in queries through the search method.</p><p>Custom search parameters are useful for searching extensions or data that is not specified by FHIR.</p><h3>Detailed Approach to solve the business need</h3><p>Let’s understand how we can store custom fields in FHIR extensions using GCP healthcare APIs and Bigquery and how we can create a custom searchParameter to enable search on these custom fields.</p><p>Following is an example of Patient FHIR resources with custom field mothersMaidenName :</p><pre>{<br>    &quot;name&quot;: [<br>        {<br>            &quot;use&quot;: &quot;official&quot;,<br>            &quot;family&quot;: &quot;Smith&quot;,<br>            &quot;given&quot;: [<br>                &quot;Darcy&quot;<br>            ]<br>        }<br>    ],<br>    &quot;gender&quot;: &quot;female&quot;,<br>    &quot;birthDate&quot;: &quot;1970-01-01&quot;,<br>    &quot;resourceType&quot;: &quot;Patient&quot;,<br>    &quot;extension&quot;: [<br>        {<br>            &quot;url&quot;: &quot;http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName&quot;,<br>            &quot;valueString&quot;: &quot;Marca&quot;<br>        }<br>    ]<br>}</pre><p>a. Ingest sample Patient resource with custom field to GCP FHIR store using GCP cloud healthcare API</p><pre>curl -X POST \ <br>-H &quot;Authorization: Bearer $(gcloud auth application-default print-access-token)&quot; \<br>-H &quot;Content-Type: application/json; charset=utf-8&quot; \ <br>--data &#39;{ &quot;name&quot;: [ { &quot;use&quot;: &quot;official&quot;, &quot;family&quot;: &quot;Smith&quot;, &quot;given&quot;: [ &quot;Darcy&quot; ] } ], &quot;gender&quot;: &quot;female&quot;, &quot;birthDate&quot;: &quot;1970-01-01&quot;, &quot;resourceType&quot;: &quot;Patient&quot;, &quot;extension&quot;: [ { &quot;url&quot;: &quot;http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName&quot;, &quot;valueString&quot;: &quot;Marca&quot; } ] }&#39; \ <br>&quot;https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient&quot;</pre><p>b. Now Let’s create a searchParameter payload to enable search on a custom field patient-mothersMaidenName</p><pre>{<br>    &quot;resourceType&quot;: &quot;SearchParameter&quot;,<br>    &quot;url&quot;: &quot;http://example.com/SearchParameter/patient-mothersMaidenName&quot;,<br>    &quot;base&quot;: [&quot;Patient&quot;],<br>    &quot;code&quot;: &quot;mothers-maiden-name&quot;,<br>    &quot;name&quot;: &quot;mothers-maiden-name&quot;,<br>    &quot;type&quot;: &quot;string&quot;,<br>    &quot;expression&quot;: &quot;Patient.extension(&#39;&#39;http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName&#39;&#39;).value.as(String)&quot;,<br>    &quot;status&quot;: &quot;active&quot;,<br>    &quot;description&quot;: &quot;search on mother&#39;s maiden name&quot;<br>}</pre><p>The above section shows an example of SearchParameter resource fields that are relevant to custom searches. Check more information about fields in the searchParameter resource <a href="http://hl7.org/fhir/searchparameter.html">here</a>.</p><p>c. Ingest above specified SearchParameter resource to GCP FHIR store using GCP cloud healthcare API</p><pre>curl -X POST \ <br>-H &quot;Authorization: Bearer $(gcloud auth application-default print-access-token)&quot; \ <br>-H &quot;Content-Type: application/json; charset=utf-8&quot; \ <br>--data &quot;{ \&quot;resourceType\&quot;: \&quot;SearchParameter\&quot;, \&quot;url\&quot;: \&quot;http://example.com/SearchParameter/patient-mothersMaidenName\&quot;, \&quot;base\&quot;: [\&quot;Patient\&quot;], \&quot;code\&quot;: \&quot;mothers-maiden-name\&quot;, \&quot;name\&quot;: \&quot;mothers-maiden-name\&quot;, \&quot;type\&quot;: \&quot;string\&quot;, \&quot;expression\&quot;: \&quot;Patient.extension(&#39;http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName&#39;).value.as(String)\&quot;, \&quot;status\&quot;: \&quot;active\&quot;, \&quot;description\&quot;: \&quot;search on mother&#39;s maiden name\&quot; }&quot; \ <br>&quot;https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/SearchParameter&quot;</pre><p>d. Enable ingested searchParameter resource using configureSearch method</p><pre>curl -X POST \ <br>-H &quot;Authorization: Bearer $(gcloud auth application-default print-access-token)&quot; \ <br>-H &quot;Content-Type: application/json; charset=utf-8&quot; \ <br>--data &quot;{ \&quot;canonicalUrls\&quot;: [\&quot;http://example.com/SearchParameter/patient-mothersMaidenName\&quot;], }&quot; \ <br>&quot;https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:configureSearch&quot;</pre><p>e. Let’s search using the recently configured custom search parameter on extension</p><pre>curl -X GET \ <br>-H &quot;Authorization: Bearer $(gcloud auth application-default print-access-token)&quot; \ <br>&quot;https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?mothers-maiden-name:exact=Marca&quot;</pre><h3>Search and analyze FHIR resources using Bigquery</h3><p>The above mentioned approach explained a way to search through FHIR stores. But if you want to search using SQL queries, Google Cloud provides option <a href="https://cloud.google.com/healthcare-api/docs/how-tos/fhir-export-bigquery">exporting your data from the FHIR API to BigQuery</a>.</p><p>BigQuery is a serverless, scalable data warehouse that lets you analyze large quantities of data retrospectively or prospectively. Additionally, BigQuery conforms to <a href="https://wikipedia.org/wiki/SQL:2011">ANSI:2011 SQL</a>, which makes data accessible to data scientists and business analysts through tools that they typically use, such as Tableau, Looker, or <a href="https://cloud.google.com/vertex-ai/docs/workbench/introduction">Vertex AI Workbench</a>.</p><p>Following is the sample SQL query to search on the extension <em>patient-mothersMaidenName</em> from Bigquery using SQL.</p><pre>SELECT id, code.code  FROM `&lt;bigquery_dataset&gt;.fhir.Basic`, UNNEST(patient_mothersMaidenName) as patient_mothername, UNNEST(code.coding) as code<br>where patient_mothername.value.string = &quot;Marca&quot;<br>LIMIT 1000;</pre><h3>Conclusion</h3><p>In conclusion, custom data fields can be added to existing FHIR resources using extensions. Creating custom resources is not recommended, but you can use the <strong><em>Basic</em></strong> resourceType instead and add data fields as extensions to the Basic resource. Extensions can be defined using StructureDefinition for interoperability purposes. Search on extensions in FHIR stores can be enabled by configuring the search parameter using the GCP Healthcare API. Using the GCP Healthcare API’s export FHIR to BigQuery feature, you can make SQL queries to a comprehensive dataset that combines core and custom FHIR data fields in the FHIR resources.</p><blockquote>In the next blog, we will learn more about StructureDefinition and FHIR profiles.</blockquote><h3>References</h3><p>FHIR extensibility: <a href="https://www.hl7.org/fhir/extensibility.html">https://www.hl7.org/fhir/extensibility.html</a></p><p>Basic FHIR resource: <a href="https://www.hl7.org/fhir/basic.html">https://www.hl7.org/fhir/basic.html</a></p><p>Enable custom search in FHIR: <a href="https://cloud.google.com/healthcare-api/docs/how-tos/fhir-custom-search">https://cloud.google.com/healthcare-api/docs/how-tos/fhir-custom-search</a></p><p>Export FHIR data to Bigquery: <a href="https://cloud.google.com/healthcare-api/docs/how-tos/fhir-export-bigquery">https://cloud.google.com/healthcare-api/docs/how-tos/fhir-export-bigquery</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cab9b911a42e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/handle-custom-data-and-resources-in-gcp-fhir-stores-cab9b911a42e">Handle Custom Data and Resources in GCP FHIR Stores</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>