♊️ GemiNews 🗞️
(dev)
🏡
📰 Articles
🏷️ Tags
🧠 Queries
📈 Graphs
☁️ Stats
💁🏻 Assistant
💬
🎙️
Demo 1: Embeddings + Recommendation
Demo 2: Bella RAGa
Demo 3: NewRetriever
Demo 4: Assistant function calling
Editing article
Title
Summary
Content
<h3>Business Scenario</h3><p>Healthcare Data Engine(HDE) is a popular GCP based solution to help Healthcare stakeholders transition to FHIR (Fast Healthcare Interoperability Resources). HDE provides pipelines which helps convert non FHIR data to FHIR and reconciles them to form a single Longitudinal Patient Record, which then makes deriving insights from patient data easy and quick.</p><p>One of the core components of HDE is the Data Mapping Language known as Whistle. This Open Source Data Mapping language is used for converting complex, nested data from one schema to another. For Example, from HL7 to FHIR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*ODs0XPOT-aUALiRqchds9Q.png" /></figure><p>This article talks about how to use Whistle to write sample mappings for HL7 data. Run the mapping code locally and then test the resultant converted FHIR format data against a FHIR store.</p><h3><strong>What do we need</strong></h3><p>We will test the Whistle Mappings to convert sample HL7 data to FHIR. We will be leveraging APIs provided by GCP Healthcare API to ingest some sample HL7 messages to a HL7 store provided by GCP Healthcare API. We will use the schematized variant of this HL7 message from HL7 store and run Whistle mapping code to convert it to FHIR on our local machines. We will then test this converted FHIR data by ingesting it into GCP Healthcare API FHIR store</p><h3>Steps</h3><p><strong>Step 1</strong> — Enable GCP Cloud Healthcare API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*4QU0vG0lwQMn5RSS-yC2Fw.png" /></figure><p><strong>Step 2</strong> — Follow documentation in <a href="https://github.com/GoogleCloudPlatform/healthcare-data-harmonization">git repo — Healthcare Data Harmonization</a> to set up Whistle Engine on our local machines. This would need us to install below softwares on our local machines, as we will be using ‘<strong>gradle</strong>’ to run our Whistle engine application.</p><ul><li><a href="https://git-scm.com/">Git</a></li><li><a href="https://www.azul.com/downloads/?version=java-11-lts&package=jdk#zulu">JDK 11.x</a></li><li><a href="https://gradle.org/next-steps/?version=7.6&format=bin">Gradle 7.x</a></li></ul><p><strong>Step 3 </strong>— Create a <a href="https://cloud.google.com/healthcare-api/docs/datasets#create-dataset">Healthcare API Dataset</a> and <a href="https://cloud.google.com/healthcare-api/docs/how-tos/hl7v2#creating_an_hl7v2_store">HL7 store</a> and <a href="https://cloud.google.com/healthcare-api/docs/how-tos/fhir#creating_a_fhir_store">Fhir store</a> inside that dataset. We will use these resources for our testing.</p><p>Once created we should see an output like below, where ‘<strong>datastore</strong>’ is our Healthcare API Dataset, ‘<strong>hl7v2store</strong>’ is the HL7 store and ‘<strong>fhirstore</strong>’ is the FHIR store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*FfLztPEw6stASDDU3c6C3w.png" /></figure><p><strong>Step 4</strong> — Let us <a href="https://cloud.google.com/healthcare-api/docs/how-tos/hl7v2-messages#ingesting_hl7v2_messages">ingest a sample HL7 message</a> into our HL7 store. Save the below sample message in a file named ‘<strong>sample-hl7-msg.hl7</strong>’.</p><pre>MSH|^~\&|FROM_APP|FROM_FACILITY|TO_APP|TO_FACILITY|20170703223000||ADT^A01|20170703223000|P|2.5|<br>EVN|A01|20210713083617|<br>PID|1||21004033^^^^MRN||SULIE^BRAN||19941208|M|||444 MAIN ST^^MOUNTAIN SPRINGS^CO^80444||1111111144|2222222244|<br>PV1||I|H44 RM4^1^^HIGHWAY 44 CLINIC||||5144^MARRIE QUINIE|||||||||Y||||||||||||||||||||||||||||20170703223000|</pre><p>The default segment separator in HL7v2 is a carriage return (\r). Most text editors use newline (\n) characters as segment separators. So we will use the below command to replace any \n with \r.</p><pre>sed -z 's/\n/\r/g' sample-hl7-msg.hl7 > sample-hl7-msg-fixed.hl7</pre><p>HL7 store expects input messages to be in base64 encoded string format. So let us use the below command to encode the sample HL7 message.</p><pre>openssl base64 -A -in ./sample-hl7-msg-fixed.hl7 -out ./sample-hl7-msg-base64.txt</pre><p>Copy the encoded string from ‘<strong>sample-hl7-msg-base64.txt</strong>’ in the below format and save it in a file named ‘<strong>hl7v2-sample.json’</strong>.</p><pre>{<br> "message": {<br> "data": "<base64-encoded-string>"<br> }<br>}</pre><p>We will run the below CURL command in a terminal to ingest this message to an HL7 store.</p><pre>curl -X POST \<br> -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \<br> -H "Content-Type: application/json; charset=utf-8" \<br> --data-binary @hl7v2-sample.json \<br> "https://healthcare.googleapis.com/v1/projects/<gcp-project-name>/locations/<location>/datasets/<dataset-name>/hl7V2Stores/<hl7store-name>/messages:ingest"</pre><p>Once the command is successful, we will get a ‘<strong>message.name</strong>’ field in the response as shown below.</p><pre>{<br> "hl7Ack": "<base64-encoded-string>",<br> "message": {<br> "name": "<gcp-project-name>/locations/<location>/datasets/<dataset-name>/hl7V2Stores/<hl7store-name>/messages/<MESSAGE_ID>",<br> }<br>}</pre><p>Using the ‘<strong>message.name</strong>’ field we will next fetch the schematized message into an output json file. This file will act as an input for our whistle mappings.</p><pre>curl -X GET \<br> -H "Authorization: Bearer "$(gcloud auth print-access-token) \<br> -H "Content-Type: application/json; charset=utf-8" \<br> "https://healthcare.googleapis.com/v1/projects/<project-name>/locations/<location>/datasets/<dataset-name>/hl7V2Stores/<hl7store-name>/messages/<message-name>" \<br> | jq '.schematizedData.data | fromjson' > <output-filename.json></pre><p><strong>Step 5</strong> — Let us open any IDE or terminal. We will run below gradle command to trigger mapping, in the directory where github repo was cloned.</p><pre>gradle :runtime:run -q --args="-m $HOME/wstl_codelab/codelab.wstl -i $HOME/wstl_cod<br>elab/<output-filename.json>" > converted-fhir.json</pre><blockquote>Explanation of the above <strong>gradle</strong> command:</blockquote><blockquote><strong>gradle</strong>: This invokes the Gradle build automation tool.<br><strong>:runtime:run</strong>: This tells Gradle to execute the run task to start the Whistle application.<br><strong>-q</strong>: This flag tells Gradle to run in “quiet” mode, suppressing most of the output except for errors.<br> <strong>— args</strong>: This introduces arguments that will be passed to the run task (and ultimately to the application it starts).<br><strong>-m $HOME/wstl_codelab/codelab.wstl</strong>: This argument specifies the path to a whistle file that the application will use for data mapping.<br><strong>-i $HOME/wstl_codelab/<output-filename.json></strong>: This argument points to a JSON file containing input data for the Whistle mapping.</blockquote><p><strong>Sample Patient Whistle Mapping:</strong></p><blockquote>This code is just for demo purposes and does not represent the actual FHIR structure. It maps Patient fields like ‘<strong>identifier</strong>’, ‘<strong>name</strong>’ and ‘<strong>address</strong>’ from the PID segment in our input file. These mappings are structured into functions like ‘<strong>Build_Identifier</strong>’, ‘<strong>Build_Name</strong>’ and ‘<strong>Build_Address</strong>’ for better readability.</blockquote><pre>PID_Patient($root.ADT_A01.PID)<br><br>def PID_Patient(PID){<br> identifier[]: Build_Identifier(PID.3[])<br> name[]: Build_Name(PID.5[])<br> address[]: Build_Address(PID.11[])<br> active: true<br> resourceType: "Patient"<br>}<br><br>def Build_Identifier(CX) {<br> value: CX.1<br>}<br><br>def Build_Name(XPN) {<br> family: XPN.1.1<br> given[]: XPN.2<br> given[]: XPN.3<br>}<br><br>def Build_Address(XAD) {<br> line[]: XAD.2<br> city: XAD.3<br> state: XAD.4<br> postalCode: XAD.5<br>}</pre><p><strong>Step 6</strong> — Once we have the mapped output, we can check if all the fields were converted as per our requirements. Once confirmed, we can try and load this to a FHIR store using the below command.</p><pre>curl -X POST \<br> -H "Authorization: Bearer $(gcloud auth print-access-token)" \<br> -H "Content-Type: application/fhir+json" \<br> -d @converted-fhir.json \<br> "https://healthcare.googleapis.com/v1/projects/<project-name>/locations/<location>/datasets/<dataset-name>/fhirStores/<fhirstore-name>/fhir/Patient"</pre><p>Post successful completion of the above command, we should be able to see the record in our FHIR store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGeHlfu01LH9IC1oCEeN7Q.png" /></figure><h3>Conclusion</h3><p>By following the steps outlined above, we explored a method to validate the HL7 to FHIR conversion workflow utilizing the Open Source Whistle Data Mapping repository. This approach can be readily adapted to validate data conversion workflows involving any other data format to FHIR. This technique proves useful for conducting quick tests, proofs of concept (POCs), or pilot projects for healthcare data conversion to FHIR. Engaging with this process offers a deeper understanding of the capabilities of the powerful Whistle Data Mapping Language.</p><h3>Reference Links</h3><p><a href="https://github.com/GoogleCloudPlatform/healthcare-data-harmonization">Whistle github repo</a></p><p><a href="https://cloud.google.com/healthcare-api/docs">Cloud Healthcare API documentation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd62c8613a92" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/fhir-whistle-data-mappings-validation-cd62c8613a92">FHIR Whistle Data Mappings Validation</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>
Author
Link
Published date
Image url
Feed url
Guid
Hidden blurb
--- !ruby/object:Feedjira::Parser::RSSEntry title: FHIR Whistle Data Mappings Validation published: 2024-04-16 00:06:38.000000000 Z categories: - healthcare-data-engine - fhir-mapping - whistle-data-mapping - google-cloud-platform - data url: https://medium.com/google-cloud/fhir-whistle-data-mappings-validation-cd62c8613a92?source=rss----e52cf94d98af---4 entry_id: !ruby/object:Feedjira::Parser::GloballyUniqueIdentifier is_perma_link: 'false' guid: https://medium.com/p/cd62c8613a92 carlessian_info: news_filer_version: 2 newspaper: Google Cloud - Medium macro_region: Blogs content: '<h3>Business Scenario</h3><p>Healthcare Data Engine(HDE) is a popular GCP based solution to help Healthcare stakeholders transition to FHIR (Fast Healthcare Interoperability Resources). HDE provides pipelines which helps convert non FHIR data to FHIR and reconciles them to form a single Longitudinal Patient Record, which then makes deriving insights from patient data easy and quick.</p><p>One of the core components of HDE is the Data Mapping Language known as Whistle. This Open Source Data Mapping language is used for converting complex, nested data from one schema to another. For Example, from HL7 to FHIR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*ODs0XPOT-aUALiRqchds9Q.png" /></figure><p>This article talks about how to use Whistle to write sample mappings for HL7 data. Run the mapping code locally and then test the resultant converted FHIR format data against a FHIR store.</p><h3><strong>What do we need</strong></h3><p>We will test the Whistle Mappings to convert sample HL7 data to FHIR. We will be leveraging APIs provided by GCP Healthcare API to ingest some sample HL7 messages to a HL7 store provided by GCP Healthcare API. We will use the schematized variant of this HL7 message from HL7 store and run Whistle mapping code to convert it to FHIR on our local machines. We will then test this converted FHIR data by ingesting it into GCP Healthcare API FHIR store</p><h3>Steps</h3><p><strong>Step 1</strong> — Enable GCP Cloud Healthcare API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*4QU0vG0lwQMn5RSS-yC2Fw.png" /></figure><p><strong>Step 2</strong> — Follow documentation in <a href="https://github.com/GoogleCloudPlatform/healthcare-data-harmonization">git repo — Healthcare Data Harmonization</a> to set up Whistle Engine on our local machines. This would need us to install below softwares on our local machines, as we will be using ‘<strong>gradle</strong>’ to run our Whistle engine application.</p><ul><li><a href="https://git-scm.com/">Git</a></li><li><a href="https://www.azul.com/downloads/?version=java-11-lts&package=jdk#zulu">JDK 11.x</a></li><li><a href="https://gradle.org/next-steps/?version=7.6&format=bin">Gradle 7.x</a></li></ul><p><strong>Step 3 </strong>— Create a <a href="https://cloud.google.com/healthcare-api/docs/datasets#create-dataset">Healthcare API Dataset</a> and <a href="https://cloud.google.com/healthcare-api/docs/how-tos/hl7v2#creating_an_hl7v2_store">HL7 store</a> and <a href="https://cloud.google.com/healthcare-api/docs/how-tos/fhir#creating_a_fhir_store">Fhir store</a> inside that dataset. We will use these resources for our testing.</p><p>Once created we should see an output like below, where ‘<strong>datastore</strong>’ is our Healthcare API Dataset, ‘<strong>hl7v2store</strong>’ is the HL7 store and ‘<strong>fhirstore</strong>’ is the FHIR store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*FfLztPEw6stASDDU3c6C3w.png" /></figure><p><strong>Step 4</strong> — Let us <a href="https://cloud.google.com/healthcare-api/docs/how-tos/hl7v2-messages#ingesting_hl7v2_messages">ingest a sample HL7 message</a> into our HL7 store. Save the below sample message in a file named ‘<strong>sample-hl7-msg.hl7</strong>’.</p><pre>MSH|^~\&|FROM_APP|FROM_FACILITY|TO_APP|TO_FACILITY|20170703223000||ADT^A01|20170703223000|P|2.5|<br>EVN|A01|20210713083617|<br>PID|1||21004033^^^^MRN||SULIE^BRAN||19941208|M|||444 MAIN ST^^MOUNTAIN SPRINGS^CO^80444||1111111144|2222222244|<br>PV1||I|H44 RM4^1^^HIGHWAY 44 CLINIC||||5144^MARRIE QUINIE|||||||||Y||||||||||||||||||||||||||||20170703223000|</pre><p>The default segment separator in HL7v2 is a carriage return (\r). Most text editors use newline (\n) characters as segment separators. So we will use the below command to replace any \n with \r.</p><pre>sed -z 's/\n/\r/g' sample-hl7-msg.hl7 > sample-hl7-msg-fixed.hl7</pre><p>HL7 store expects input messages to be in base64 encoded string format. So let us use the below command to encode the sample HL7 message.</p><pre>openssl base64 -A -in ./sample-hl7-msg-fixed.hl7 -out ./sample-hl7-msg-base64.txt</pre><p>Copy the encoded string from ‘<strong>sample-hl7-msg-base64.txt</strong>’ in the below format and save it in a file named ‘<strong>hl7v2-sample.json’</strong>.</p><pre>{<br> "message": {<br> "data": "<base64-encoded-string>"<br> }<br>}</pre><p>We will run the below CURL command in a terminal to ingest this message to an HL7 store.</p><pre>curl -X POST \<br> -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \<br> -H "Content-Type: application/json; charset=utf-8" \<br> --data-binary @hl7v2-sample.json \<br> "https://healthcare.googleapis.com/v1/projects/<gcp-project-name>/locations/<location>/datasets/<dataset-name>/hl7V2Stores/<hl7store-name>/messages:ingest"</pre><p>Once the command is successful, we will get a ‘<strong>message.name</strong>’ field in the response as shown below.</p><pre>{<br> "hl7Ack": "<base64-encoded-string>",<br> "message": {<br> "name": "<gcp-project-name>/locations/<location>/datasets/<dataset-name>/hl7V2Stores/<hl7store-name>/messages/<MESSAGE_ID>",<br> }<br>}</pre><p>Using the ‘<strong>message.name</strong>’ field we will next fetch the schematized message into an output json file. This file will act as an input for our whistle mappings.</p><pre>curl -X GET \<br> -H "Authorization: Bearer "$(gcloud auth print-access-token) \<br> -H "Content-Type: application/json; charset=utf-8" \<br> "https://healthcare.googleapis.com/v1/projects/<project-name>/locations/<location>/datasets/<dataset-name>/hl7V2Stores/<hl7store-name>/messages/<message-name>" \<br> | jq '.schematizedData.data | fromjson' > <output-filename.json></pre><p><strong>Step 5</strong> — Let us open any IDE or terminal. We will run below gradle command to trigger mapping, in the directory where github repo was cloned.</p><pre>gradle :runtime:run -q --args="-m $HOME/wstl_codelab/codelab.wstl -i $HOME/wstl_cod<br>elab/<output-filename.json>" > converted-fhir.json</pre><blockquote>Explanation of the above <strong>gradle</strong> command:</blockquote><blockquote><strong>gradle</strong>: This invokes the Gradle build automation tool.<br><strong>:runtime:run</strong>: This tells Gradle to execute the run task to start the Whistle application.<br><strong>-q</strong>: This flag tells Gradle to run in “quiet” mode, suppressing most of the output except for errors.<br> <strong>— args</strong>: This introduces arguments that will be passed to the run task (and ultimately to the application it starts).<br><strong>-m $HOME/wstl_codelab/codelab.wstl</strong>: This argument specifies the path to a whistle file that the application will use for data mapping.<br><strong>-i $HOME/wstl_codelab/<output-filename.json></strong>: This argument points to a JSON file containing input data for the Whistle mapping.</blockquote><p><strong>Sample Patient Whistle Mapping:</strong></p><blockquote>This code is just for demo purposes and does not represent the actual FHIR structure. It maps Patient fields like ‘<strong>identifier</strong>’, ‘<strong>name</strong>’ and ‘<strong>address</strong>’ from the PID segment in our input file. These mappings are structured into functions like ‘<strong>Build_Identifier</strong>’, ‘<strong>Build_Name</strong>’ and ‘<strong>Build_Address</strong>’ for better readability.</blockquote><pre>PID_Patient($root.ADT_A01.PID)<br><br>def PID_Patient(PID){<br> identifier[]: Build_Identifier(PID.3[])<br> name[]: Build_Name(PID.5[])<br> address[]: Build_Address(PID.11[])<br> active: true<br> resourceType: "Patient"<br>}<br><br>def Build_Identifier(CX) {<br> value: CX.1<br>}<br><br>def Build_Name(XPN) {<br> family: XPN.1.1<br> given[]: XPN.2<br> given[]: XPN.3<br>}<br><br>def Build_Address(XAD) {<br> line[]: XAD.2<br> city: XAD.3<br> state: XAD.4<br> postalCode: XAD.5<br>}</pre><p><strong>Step 6</strong> — Once we have the mapped output, we can check if all the fields were converted as per our requirements. Once confirmed, we can try and load this to a FHIR store using the below command.</p><pre>curl -X POST \<br> -H "Authorization: Bearer $(gcloud auth print-access-token)" \<br> -H "Content-Type: application/fhir+json" \<br> -d @converted-fhir.json \<br> "https://healthcare.googleapis.com/v1/projects/<project-name>/locations/<location>/datasets/<dataset-name>/fhirStores/<fhirstore-name>/fhir/Patient"</pre><p>Post successful completion of the above command, we should be able to see the record in our FHIR store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGeHlfu01LH9IC1oCEeN7Q.png" /></figure><h3>Conclusion</h3><p>By following the steps outlined above, we explored a method to validate the HL7 to FHIR conversion workflow utilizing the Open Source Whistle Data Mapping repository. This approach can be readily adapted to validate data conversion workflows involving any other data format to FHIR. This technique proves useful for conducting quick tests, proofs of concept (POCs), or pilot projects for healthcare data conversion to FHIR. Engaging with this process offers a deeper understanding of the capabilities of the powerful Whistle Data Mapping Language.</p><h3>Reference Links</h3><p><a href="https://github.com/GoogleCloudPlatform/healthcare-data-harmonization">Whistle github repo</a></p><p><a href="https://cloud.google.com/healthcare-api/docs">Cloud Healthcare API documentation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd62c8613a92" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/fhir-whistle-data-mappings-validation-cd62c8613a92">FHIR Whistle Data Mappings Validation</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>' rss_fields: - title - published - categories - url - entry_id - content - author author: Ashwinshetty
Language
Active
Ricc internal notes
Imported via /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/import-feedjira.rb on 2024-04-16 21:08:48 +0200. Content is EMPTY here. Entried: title,published,categories,url,entry_id,content,author. TODO add Newspaper: filename = /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/../../../crawler/out/feedjira/Blogs/Google Cloud - Medium/2024-04-16-FHIR_Whistle_Data_Mappings_Validation-v2.yaml
Ricc source
Show this article
Back to articles