### Push Output Example - FHIR Converter Tool - Text Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Shows an example of the output displayed after successfully pushing a template collection. It includes information about uploaded layers, the final image reference, and the crucial image digest. ```Text Uploading 4085e9f97630 layer2.tar.gz Uploading 4157f847ecb1 layer1.tar.gz Pushed testacr.azurecr.io/templatetest:default Digest: sha256:412ea84f1bb1a9d98345efb7b427ba89616ec29ac332d543eff9a2161ca12a58 ``` -------------------------------- ### Push Example - FHIR Converter Tool - Command Line Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Provides an example command demonstrating how to push templates from a local folder ('myInputFolder') to a specified Azure Container Registry image ('testacr.azurecr.io/templatetest:default'). ```Command Line >.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe push testacr.azurecr.io/templatetest:default myInputFolder ``` -------------------------------- ### Pull Example - FHIR Converter Tool - Command Line Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Provides an example command demonstrating how to pull templates from a specific image digest ('sha256:412ea84f1bb1a9d98345efb7b427ba89616ec29ac332d543eff9a2161ca12a58') of an image ('testacr.azurecr.io/templatetest') into a local folder ('myOutputFolder'). ```Command Line >.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe pull testacr.azurecr.io/templatetest@sha256:412ea84f1bb1a9d98345efb7b427ba89616ec29ac332d543eff9a2161ca12a58 myOutputFolder ``` -------------------------------- ### Get FHIR Converter Swagger Document Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md Provides the HTTP GET request format to retrieve the OpenAPI (Swagger) documentation for a specific API version of the FHIR converter service. ```HTTP GET https:////swagger.yaml ``` -------------------------------- ### Another FHIR to HL7v2 Conversion Output Example (JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md This snippet provides another example of the FHIR converter service output format, illustrating the structure of the JSON response containing the converted HL7v2 message. ```JSON { "result": "FHS|^~\\&|TestSystem|\nBHS|^~\\&|TestSystem|\nMSH|^~\\&|TestSystem||TransformationAgent||123||ORU^R01|1|T|2.5|\nPID|||12345|\nOBR||6323|15074-8^Glucose[Moles/volume]inBlood^LN||||||||||||||||||||||F|\nOBX|||||6.3|mmol/l|3.1-6.2|H|\nMSH|^~\\&|TestSystem||TransformationAgent||123||ORU^R01|1|T|2.5|\nPID|||12345|\nOBR||6324|11111-1^Another test^LN||||||||||||||||||||||F|\nOBX|||||8|mmol/l|3.1-6.2|H|\nBTS|1|\nFTS|1|\n" } ``` -------------------------------- ### Applying now Filter (Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Illustrates how to use the `now` filter to get the current time in various formats, demonstrating the default output and custom format strings. ```Liquid {{ "" | now }} -> 2022-03-22T06:50:25.071Z // an example time {{ "" | now: 'dddd, dd MMMM yyyy HH:mm:ss' }} -> Tuesday, 22 March 2022 06:52:15 {{ "" | now: 'd' }} -> 3/22/2022 ``` -------------------------------- ### Example FHIR to HL7v2 Conversion Output (JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md This snippet shows an example of the output returned by the FHIR converter service. It is a JSON object containing the converted HL7v2 data string in the 'result' field. ```JSON { "result": "FHS|^~\\&|TestSystem|\nBHS|^~\\&|TestSystem|\nMSH|^~\\&|TestSystem||TransformationAgent||123||ORU^R01|1|T|2.5|\nPID|||12345|\nOBR||6323|15074-8^Glucose[Moles/volume]inBlood^LN||||||||||||||||||||||F|\nOBX|||||6.3|mmol/l|3.1-6.2|H|\nMSH|^~\\&|TestSystem||TransformationAgent||123||ORU^R01|1|T|2.5|\nPID|||12345|\nOBR||6324|11111-1^Another test^LN||||||||||||||||||||||F|\nOBX|||||8|mmol/l|3.1-6.2|H|\nBTS|1|\nFTS|1|\n" } ``` -------------------------------- ### FHIR to HL7v2 Transformation Example (JSON/Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/customize-templates.md Provides a sample Liquid template embedded within the HL7v2 JSON structure. This template demonstrates iterating over FHIR Observation resources in a Bundle and populating various HL7v2 segments (FHS, BHS, MSH, PID, OBR, OBX, BTS, FTS) using Liquid syntax for loops, conditionals, and accessing FHIR data. ```json { "messageDefinition": [ { "FHS": { "2": "^~\\&", "3": "TestSystem" } }, { "BHS": { "2": "^~\\&", "3": "TestSystem" } }, {% for entry in msg.entry %} {% if entry.resource.resourceType == "Observation" %} {% assign patient_reference = msg | to_json_string | get_object: "$.entry[?(@resource.resourceType == 'Patient')].resource" %} { "MSH": { "2": "^~\\&", "3": "TestSystem", "4": "", "5": "TransformationAgent", "6": "", "7": "123", "8": "", "9": "ORU^R01", "10": "1", "11": "T", "12": "2.5" } }, { "PID": { "3": {{ patient_reference | evaluate: "$.identifier[0].value" }} } }, { "OBR": { "2": "{{entry.resource.identifier[0].value}}", "3": "{{entry.resource.code.coding[0].code}}^{{entry.resource.code.coding[0].display}}^LN", {% if entry.resource.status == "final" %} "25": "F" {% endif %} } }, { "OBX": { "5": "{{entry.resource.valueQuantity.value}}", "6": "{{entry.resource.valueQuantity.unit}}", "7": "{{entry.resource.referenceRange[0].low.value}}-{{entry.resource.referenceRange[0].high.value}}", "8": "{{entry.resource.interpretation[0].coding[0].code}}" } }, {% endif %} {% endfor %} { "BTS": { "1": "1" } }, { "FTS": { "1": "1" } }] } ``` -------------------------------- ### Sample Health Check Response Body Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md An example of the JSON response returned by the health check endpoint, detailing the overall service status and the status of individual components like the template store. ```JSON { "overallStatus": "Healthy", "details": [ { "name": "TemplateStoreHealthCheck", "status": "Healthy", "description": "Sucessfully connected to blob template store.", "data": {} } ] } ``` -------------------------------- ### Get Character at Index Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Shows how to use the `char_at` filter to get the character at a specific zero-based index within a string. ```Liquid {{ 'foo' \| char_at: 0 }} ``` -------------------------------- ### Sample Health Check Response Body (JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/enable-template-store-integration.md Example JSON response body from the template store health check endpoint, indicating the status of the connection to the blob template store. ```JSON { "overallStatus": "Healthy", "details": [ { "name": "TemplateStoreHealthCheck", "status": "Healthy", "description": "Successfully connected to blob template store.", "data": {} } ] } ``` -------------------------------- ### Applying format_as_date_time Filter (Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Shows examples of using the `format_as_date_time` filter to convert HL7v2/C-CDA datetime strings to FHIR format, including handling time zones ('preserve', 'utc'). ```Liquid {{ "20110103143428-0800" | format_as_date_time }} -> 2011-01-03T14:34:28-08:00 {{ "20110103143428-0800" | format_as_date_time: 'preserve' }} -> 2011-01-03T14:34:28-08:00 {{ "20110103143428-0800" | format_as_date_time: 'utc' }} -> 2011-01-03T22:34:28Z ``` -------------------------------- ### Login to ACR using Docker CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Authenticate to an Azure Container Registry using the Docker CLI with a username and password. This method requires Docker to be installed. ```Docker docker login -u -p ``` -------------------------------- ### Get First C-CDA Sections by Template ID Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Demonstrates the `get_first_ccda_sections_by_template_id` filter, used to retrieve the first instance of C-CDA sections identified by a specific template ID. ```Liquid {% assign firstSections = msg \| get_first_ccda_sections_by_template_id: '2.16.840.1.113883.10.20.22.2.5.1' -%} ``` -------------------------------- ### Get Sign of Number Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Demonstrates the `sign` filter, which returns 1 for positive numbers, -1 for negative numbers, and 0 for zero. ```Liquid {{ -5 \| sign }} ``` -------------------------------- ### Check FHIR Converter Service Health Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md Shows the HTTP GET request format to query the health status of the FHIR converter service, indicating its availability and configuration status. ```HTTP GET https:///health/check ``` -------------------------------- ### Verify Template Store Health Check Endpoint (HTTP) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/enable-template-store-integration.md Use this GET endpoint to check if the FHIR converter service is correctly configured to access the custom template store in the Storage Account. ```HTTP GET https:///health/check ``` -------------------------------- ### Get HL7v2 Segment Lists Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Shows the syntax for the `get_segment_lists` filter, which extracts all instances of the specified HL7 v2 segments from the message and returns them as a list. ```Liquid {% assign result = hl7v2Data \| get_segment_lists: 'segment1\|segment2\|...' -%} ``` -------------------------------- ### Defining FHIR Converter Application Log Error Format (Text) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/troubleshoot.md This text snippet describes the format used for error messages in the FHIR Converter application logs. It includes details about the HTTP status, top-level error code and message, and detailed inner error information including exception details. This format provides more granular debugging information than the API response body. ```text Failed conversion request with HTTP Status {HTTP status}; TOP-LEVEL-ERROR: {error code} - {top-level error message}.; INNER ERROR: Code: {inner error code}, Message: {inner error message}, Exception: {the exception that causes the Inner Error}; InnerException: {the inner exception of the Inner Error} - Code: {error code of the inner exception}, Message: {inner exception message}. ``` -------------------------------- ### Get C-CDA Section Lists Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Shows the syntax for the `get_ccda_section_lists` filter, which returns a list of all instances for the given C-CDA sections. Section names are processed by replacing non-alphanumeric characters with underscores. ```Liquid {% assign sections = msg \| get_ccda_section_lists: 'Problems' -%} ``` -------------------------------- ### Get First HL7v2 Segments Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Demonstrates how to use the `get_first_segments` filter to retrieve the first instance of specified HL7 v2 segments from the input data. The filter takes a pipe-separated string of segment names. ```Liquid {% assign result = hl7v2Data \| get_first_segments: 'segment1\|segment2\|...' -%} ``` -------------------------------- ### Applying add_seconds Filter (Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Provides examples of using the `add_seconds` filter to add or subtract seconds from a FHIR datetime string, showing different time zone handling options ('utc', 'preserve'). ```Liquid {{ "1970-01-01T00:01:00.000+10:00" | add_seconds: -60, 'utc' }} -> 1969-12-31T14:00:00.000Z {{ "1970-01-01T00:01:00Z" | add_seconds: 60.1230 }} -> 1970-01-01T00:02:00.123Z {{ "1970-01-01T00:01:00+14:00" | add_seconds: 60, 'preserve' }} -> 1970-01-01T00:01:01+14:00 ``` -------------------------------- ### Login to Azure and ACR using Azure CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Authenticate with Azure AD using the Azure CLI and then log in to a specific Azure Container Registry. This method requires the Azure CLI to be installed and configured. ```Azure CLI az login az acr login --name ``` -------------------------------- ### HL7v2 Message JSON Structure Example Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/customize-templates.md Illustrates the basic JSON structure used to represent an HL7v2 message. It shows the 'messageDefinition' array containing segment objects (MSH, PID, PV1) with placeholder 'fieldNumber' keys. ```json { "messageDefinition": [ { "MSH": { "fieldNumber": "data resolution code" }, "PID": { "fieldNumber": "data resolution code", "fieldNumber": "data resolution code", "fieldNumber": "data resolution code" }, "PV1": { "fieldNumber": "data resolution code" } } ] } ``` -------------------------------- ### Get First C-CDA Sections Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Illustrates using the `get_first_ccda_sections` filter to retrieve the first instance of specified C-CDA sections from the message. Section names have non-alphanumeric characters replaced by underscores. ```Liquid {% assign firstSections = msg \| get_first_ccda_sections: 'Problems' -%} ``` -------------------------------- ### Get Access Token using Azure CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/enable-authentication.md Execute this command in Azure CLI to retrieve an access token for a specified resource application. Replace with the Application ID URI of your FHIR converter resource application. ```Azure CLI az account get-access-token --resource= ``` -------------------------------- ### Convert STU3 ChargeItemPerformer to R4 using mergeDiff (Liquid/JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Example of a Liquid sub-template intended for use with batch_render in the ChargeItem conversion. It demonstrates how to convert a participant entry (representing a performer) from STU3 to R4 using the mergeDiff tag, specifically renaming the 'role' field to 'function'. ```Liquid {% mergeDiff msg -%} { "function" : {{msg.role | to_json_string | default : '""'}}, "role" : "" } {% endmergeDiff -%} ``` -------------------------------- ### Add or Update Item using mergeDiff (Liquid/JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Example demonstrating how to add a new key-value pair or update an existing one in the input JSON data using the mergeDiff tag. The JSON inside the tag specifies the changes to be merged. ```Liquid {% mergeDiff msg -%} { "added": "value" } {% endmergeDiff %} ``` -------------------------------- ### Get Parent HL7v2 Segment Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Provides the syntax for the `get_parent_segment` filter, used to locate the first parent segment of a specified type relative to a child segment at a given message index. ```Liquid {% assign result = hl7v2Data \| get_parent_segment: 'childSegmentName', 3, 'parentSegmentName' -%} ``` -------------------------------- ### Defining FHIR Converter API Error Response Body Structure (JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/troubleshoot.md This JSON snippet defines the standard structure for error response bodies returned by the FHIR Converter API. It includes top-level error details and an optional inner error object for more specific information. The `code` property matches the `x-ms-error-code` header. ```json { "error": { "code": "", "message": "", "innerError": { "code": "", "message": "" } } } ``` -------------------------------- ### Split HL7v2 Data by Segments Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Demonstrates the `split_data_by_segments` filter, which divides an HL7 v2 message into a list of messages using specified segments as separators. The separators are included at the start of each new message. ```Liquid {% assign result = hl7v2Data \| split_data_by_segments: 'segment1\|segment2\|...' -%} ``` -------------------------------- ### Remove Item using mergeDiff (Liquid/JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Example demonstrating how to remove a key from the input JSON data using the mergeDiff tag. Setting the value to an empty string within the diff JSON indicates that the corresponding key should be removed. ```Liquid {% mergeDiff msg -%} { "removed": "" } {% endmergeDiff %} ``` -------------------------------- ### Convert STU3 ChargeItem to R4 using mergeDiff (Liquid/JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Example of a Liquid template for converting a FHIR ChargeItem resource from STU3 to R4 using the mergeDiff tag. It demonstrates renaming fields ('definition' to 'definitionUri', 'participant' to 'performer') and utilizing other Liquid filters and tags like to_json_string, default, to_array, and batch_render for complex transformations. ```Liquid {% mergeDiff msg -%} { "definitionUri" : {{msg.definition | to_json_string | default : '""'}}, "performer" : [ {{ msg.participant | to_array | batch_render: 'ChargeItem/ChargeItemPerformer', 'msg' }} ], "participant" : "", "definition" : "" } {% endmergeDiff -%} ``` -------------------------------- ### Get Related HL7v2 Segment List Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Illustrates using the `get_related_segment_list` filter to find a collection of child segments related to a given parent segment. It requires the parent segment object and the name of the child segment. ```Liquid {% assign result = hl7v2Data \| get_related_segment_list: parentSegment, 'childSegmentName' -%} ``` -------------------------------- ### Using get_related_segment_list Filter in Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/HL7v2-ImportantPoints.md This Liquid snippet illustrates the use of the `get_related_segment_list` filter in the FHIR converter's mapping. It aims to retrieve 'NTE' segments related to a starting 'schSegment' within the HL7v2 data. The accompanying text points out an unexpected behavior where the filter might return unrelated segments if the expected related segments are not positioned as anticipated in the message structure. ```Liquid {% assign nteSegmentLists = hl7v2Data | get_related_segment_list: schSegment, 'NTE' -%} ``` -------------------------------- ### Remove Choice Type Item using mergeDiff (Liquid/JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Example showing how to remove a choice type element (like value[x]) from the input JSON data using the mergeDiff tag. The [x] syntax simplifies targeting choice type fields in the diff JSON. ```Liquid {% mergeDiff msg -%} { "value[x]" : "" } {% endmergeDiff %} ``` -------------------------------- ### Cloning Repository and Navigating Directory (PowerShell) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md Clones the FHIR Converter GitHub repository and navigates into the Bicep deployment folder, preparing the local environment for executing deployment scripts. ```PowerShell git clone https://github.com/microsoft/FHIR-Converter.git cd docs/deploy ``` -------------------------------- ### Configure FHIR Converter Template Store Integration (Bicep) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/configuration-settings.md Sample Bicep command using az deployment sub create to deploy the FHIR converter service with template store integration enabled. Requires location, deployment name, template file, and parameters for template store settings (enabled, storage account name, container name). ```Bicep az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep --parameters templateStoreIntegrationEnabled=true templateStorageAccountName="" templateStorageAccountContainerName="" ``` -------------------------------- ### Push Command Syntax - FHIR Converter Tool - Command Line Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Defines the command line syntax for pushing a template collection to an OCI image registry. It requires an image reference and the input template folder path, with an optional flag to force building a new base layer. ```Command Line push InputTemplateFolder [ -n | --NewBaseLayer] ``` -------------------------------- ### Deploy FHIR Converter to Azure Container App using Bicep (Azure CLI) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/configuration-settings.md Deploys the FHIR converter service to an Azure Container App using an Azure CLI command with a Bicep template. Allows customization of container app name, replica count, CPU, and memory limits. ```Shell az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep --parameters containerAppName="" minReplicas="" maxReplicas="" cpuLimit="" memoryLimit="memory_unit" -Container_name>" ``` -------------------------------- ### Configure FHIR Converter Template Store Integration (PowerShell) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/configuration-settings.md Sample PowerShell command using the FhirConverter-SingleAzureDeploy.ps1 script to deploy the FHIR converter service with template store integration enabled. Requires parameters for template store settings (enabled, storage account name, container name). ```PowerShell ./FhirConverter-SingleAzureDeploy.ps1 -templateStoreIntegrationEnabled $true -templateStorageAccountName "" -templateStorageAccountContainerName "" ``` -------------------------------- ### Configure FHIR Converter Authentication (Bicep) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/configuration-settings.md Sample Bicep command using az deployment sub create to deploy the FHIR converter service with authentication enabled. Requires location, deployment name, template file, and parameters for security settings (enabled, audiences, authority). ```Bicep az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep --parameters securityEnabled=true securityAuthenticationAudiences="['','','']" securityAuthenticationAuthority="" ``` -------------------------------- ### Run PowerShell Deployment Script Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md Executes the PowerShell script to deploy the FHIR Converter service using default settings. The script handles the underlying Azure resource provisioning via Bicep templates and Azure CLI. ```PowerShell ./FhirConverter-SingleAzureDeploy.ps1 ``` -------------------------------- ### Deploy Bicep Template via Azure CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md Deploys the FHIR Converter using the single Bicep template via Azure CLI, using default parameter values. Requires specifying the Azure location and a deployment name. ```bash az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep ``` -------------------------------- ### FHIR Converter API Request URL Format Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md Shows the general structure for making requests to the FHIR converter service, including the required `api-version` query parameter. ```HTTP https:///?api-version= ``` -------------------------------- ### Logging into Azure CLI (PowerShell) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md Logs into your Azure account using the Azure CLI. This is a prerequisite for deploying resources to Azure. ```PowerShell az login ``` -------------------------------- ### Deploy FHIR Converter Container App to Existing Environment - Azure CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md This Azure CLI command deploys the FHIR Converter Container App to a pre-existing Azure Container Apps environment using the specified Bicep template. It requires parameters for the resource group, location, app name, environment name, and container image tag. ```azurecli az deployment group create --resource-group --template-file Deploy-FhirConverterService.bicep --parameters location= appName= envName= imageTag= ``` -------------------------------- ### Pull Command Syntax - FHIR Converter Tool - Command Line Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Defines the command line syntax for pulling a template collection from an OCI image registry. It requires an image reference (by tag or digest) and the output folder path, with an optional flag to force override the output folder. ```Command Line pull [ -f | --ForceOverride] ``` -------------------------------- ### Run PowerShell Deployment Script with Custom Parameters Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md Executes the PowerShell script to deploy the FHIR Converter service, allowing customization of parameters like the container app name via script arguments. ```PowerShell ./FhirConverter-SingleAzureDeploy.ps1 -containerAppName "" ``` -------------------------------- ### Deploy Bicep Template with Custom Parameters via Azure CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md Deploys the FHIR Converter using the single Bicep template via Azure CLI, allowing customization of parameter values like the container app name. Requires specifying location, deployment name, and custom parameters. ```bash az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep --parameters containerAppName="" ``` -------------------------------- ### Deploy FHIR Converter with Storage Account Network Isolation (PowerShell) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/storage-account-network-isolation.md Deploys the FHIR Converter using a PowerShell script, enabling template store integration and Storage Account network isolation with default Virtual Network settings. ```PowerShell ./FhirConverter-SingleAzureDeploy.ps1 -templateStoreIntegrationEnabled $true -storageAccountNetworkIsolationEnabled $true ``` -------------------------------- ### Deploy FHIR Converter to Azure Container App using PowerShell Script Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/configuration-settings.md Executes a PowerShell script (`FhirConverter-SingleAzureDeploy.ps1`) to deploy the FHIR converter service to an Azure Container App. Configures the container app name, minimum/maximum replicas, CPU limit, and memory limit via script parameters. ```PowerShell ./FhirConverter-SingleAzureDeploy.ps1 -containerAppName "" -minReplicas "" -maxReplicas "" -cpuLimit "" -memoryLimit "" ``` -------------------------------- ### Deploy FHIR Converter with Storage Account Network Isolation (Bicep) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/storage-account-network-isolation.md Deploys the FHIR Converter using a Bicep template via Azure CLI, enabling template store integration and Storage Account network isolation with default Virtual Network settings. ```Azure CLI az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep --parameters templateStoreIntegrationEnabled=true storageAccountNetworkIsolationEnabled=true ``` -------------------------------- ### Sample Response Body from convertToFhir API (FHIR R4 Bundle) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md This JSON object shows a sample response body returned by the convertToFhir API. It contains the converted data within the 'result' property, formatted as a FHIR R4 Bundle resource. The bundle includes metadata like resourceType, type, timestamp, identifier, and an array of 'entry' objects containing the converted FHIR resources. ```json { "result": { "resourceType": "Bundle", "type": "batch", "timestamp": "2020-05-08T13:10:15Z", "identifier": { "value": "517" }, "id": "7dcb7d92-7a75-3d65-42f9-0f790afac4db", "entry": [ { "fullUrl": "urn:uuid:aa521dd9-b613-0210-a661-82ce17e38fb3", "resource": { "resourceType": "MessageHeader", "id": "aa521dd9-b613-0210-a661-82ce17e38fb3", "source": { "name": "SIMHOSP", "_endpoint": { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason", "valueCode": "unknown" } ] } } } } ] } } ``` -------------------------------- ### Deploy FHIR Converter with Custom VNet and Storage Account Network Isolation (Bicep) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/storage-account-network-isolation.md Deploys the FHIR Converter using a Bicep template via Azure CLI, enabling template store integration and network isolation while specifying custom Virtual Network and subnet names and address prefixes. ```Azure CLI az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep --parameters templateStoreIntegrationEnabled=true storageAccountNetworkIsolationEnabled=true vnetName="" vnetAddressPrefixes="['','','']" subnetName="" subnetAddressPrefix="" ``` -------------------------------- ### Setting Azure Subscription (PowerShell) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/deployment-options.md Selects the specific Azure subscription to be used for deployment. This step is necessary if your account has access to multiple subscriptions. ```PowerShell az account set --subscription ``` -------------------------------- ### Sample POST Request Body for convertToFhir API (HL7v2) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md This JSON object represents a sample request body for the convertToFhir API endpoint. It specifies the input data format as 'Hl7v2', the root template name 'ADT_A01' for conversion, and provides the HL7v2 message content as a string. ```json { "InputDataFormat": "Hl7v2", "RootTemplateName": "ADT_A01", "InputDataString": "MSH|^~\\&|SIMHOSP|SFAC|RAPP|RFAC|20200508131015||ADT^A01|517|T|2.3|||AL||44|ASCII\nEVN|A01|20200508131015|||C005^Whittingham^Sylvia^^^Dr^^^DRNBR^PRSNL^^^ORGDR|\nPID|1|3735064194^^^SIMULATOR MRN^MRN|3735064194^^^SIMULATOR MRN^MRN~2021051528^^^NHSNBR^NHSNMBR||" } ``` -------------------------------- ### View Template Store Storage Account Configuration JSON Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/enable-template-store-integration.md This JSON snippet illustrates the structure of the configuration settings required to specify the Azure Storage Account blob container URL for hosting custom Liquid templates within the FHIR converter service. ```JSON { "TemplateHosting": { "StorageAccountConfiguration": { "ContainerUrl": "" } } } ``` -------------------------------- ### Grant Execute Permission for Oras on macOS Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Add execute permission to the Oras executable file on macOS using the chmod command, which is necessary before running the tool. ```Shell chmod +x oras-osx ``` -------------------------------- ### Gzip Compress String Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Demonstrates the `gzip` filter, used to compress a string using the Gzip algorithm. ```Liquid {{ uncompressedData \| gzip }} ``` -------------------------------- ### Including Encounter Diagnosis Condition Reference Snippet (Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/SnippetConcept.md Shows how to use the `include` tag to incorporate a Reference snippet that creates a link between an Encounter and a Condition resource. It passes the Encounter ID (`pv1Id`) and the Condition reference (`fullDg1Id`) as parameters. ```Liquid {% include 'Reference/Encounter/Diagnosis_Condition' with ID: pv1Id, REF: fullDg1Id -%} ``` -------------------------------- ### Deploy FHIR Converter with Custom VNet and Storage Account Network Isolation (PowerShell) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/storage-account-network-isolation.md Deploys the FHIR Converter using a PowerShell script, enabling template store integration and network isolation while specifying custom Virtual Network and subnet names and address prefixes. ```PowerShell ./FhirConverter-SingleAzureDeploy.ps1 -templateStoreIntegrationEnabled $true -storageAccountNetworkIsolationEnabled $true -vnetName "" -vnetAddressPrefixes @('','','') -subnetName "" -subnetAddressPrefix "" ``` -------------------------------- ### Including XPN Data Type Snippet (Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/SnippetConcept.md Shows how to use the `include` tag to incorporate a predefined Data Type snippet for the XPN data type. It passes the value from the HL7 v2 PID.5 segment field as input to the snippet. ```Liquid {% include 'DataType/XPN' with XPN: PID.5 -%} ``` -------------------------------- ### Authentication Settings Configuration (JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/enable-authentication.md This JSON snippet shows the structure for configuring security and authentication settings for the FHIR converter service. It includes options to enable security and specify the token audience and authority. ```JSON { "ConvertService" : { "Security": { "Enabled": true, "Authentication": { "Audience": "", "Authority": "" } } } } ``` -------------------------------- ### Querying Traces for a Specific Container App in Log Analytics (KQL) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/monitoring.md This KQL query filters AppTraces logs generated within the last 3 hours to show only traces associated with a specific Container App instance, identified by its cloud_RoleInstance. ```KQL // in the case of multiple Container Apps deployed to the same Container Apps Environment, get traces associated with one specific Container App AppTraces | where TimeGenerated > ago(3hours) | where cloud_RoleInstance contains // may also replace with a specific Revision name, found in the "Revisions and Replicas" blade of the Container App ``` -------------------------------- ### Sample Request Body for convertToHl7v2 API Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md This JSON object represents the required body for a POST request to the convertToHl7v2 endpoint. It specifies the input data format as FHIR, the root template name for conversion, and the FHIR data itself as a string. ```json { "InputDataFormat": "Fhir", "RootTemplateName": "Fhir/BundleToHL7v2", "InputDataString": "{\"resourceType\":\"Bundle\",\"id\":\"bundle-response-medsallergies\",\"type\":\"batch-response\",\"entry\":[{\"resource\":{\"resourceType\":\"Patient\",\"id\":\"example\",\"meta\":{\"versionId\":\"1\",\"lastUpdated\":\"2018-11-12T03:35:20.715Z\"},\"identifier\":[{\"use\":\"usual\",\"type\":{\"coding\":[{\"system\":\"http://terminology.hl7.org/CodeSystem/v2-0203\",\"code\":\"MR\"}]},\"system\":\"urn:oid:1.2.36.146.595.217.0.1\",\"value\":\"12345\",\"period\":{\"start\":\"2001-05-06\"},\"assigner\":{\"display\":\"AcmeHealthcare\"}}],\"active\":true,\"name\":[{\"use\":\"official\",\"family\":\"Chalmers\",\"given\":[\"Peter\",\"James\"]},{\"use\":\"usual\",\"given\":[\"Jim\"]},{\"use\":\"maiden\",\"family\":\"Windsor\",\"given\":[\"Peter\",\"James\"],\"period\":{\"end\":\"2002\"}}],\"telecom\":[{\"use\":\"home\"},{\"system\":\"phone\",\"value\":\"(03)55556473\",\"use\":\"work\",\"rank\":1},{\"system\":\"phone\",\"value\":\"(03)34105613\",\"use\":\"mobile\",\"rank\":2},{\"system\":\"phone\",\"value\":\"(03)55558834\",\"use\":\"old\",\"period\":{\"end\":\"2014\"}}],\"gender\":\"male\",\"birthDate\":\"1974-12-25\",\"_birthDate\":{\"extension\":[{\"url\":\"http://hl7.org/fhir/StructureDefinition/patient-birthTime\",\"valueDateTime\":\"1974-12-25T14:35:45-05:00\"}]},\"deceasedBoolean\":false,\"address\":[{\"use\":\"home\",\"type\":\"both\",\"text\":\"534ErewhonStPeasantVille,Rainbow,Vic3999\",\"line\":[\"534ErewhonSt\"],\"city\":\"PleasantVille\",\"district\":\"Rainbow\",\"state\":\"Vic\",\"postalCode\":\"3999\",\"period\":{\"start\":\"1974-12-25\"}}],\"contact\":[{\"relationship\":[{\"coding\":[{\"system\":\"http://terminology.hl7.org/CodeSystem/v2-0131\",\"code\":\"N\"}]}],\"name\":{\"family\":\"duMarché\",\"_family\":{\"extension\":[{\"url\":\"http://hl7.org/fhir/StructureDefinition/humanname-own-prefix\",\"valueString\":\"VV\"}]},\"given\":[\"Bénédicte\"]},\"telecom\":[{\"system\":\"phone\",\"value\":\"+33(237)998327\"}],\"address\":{\"use\":\"home\",\"type\":\"both\",\"line\":[\"534ErewhonSt\"],\"city\":\"PleasantVille\",\"district\":\"Rainbow\",\"state\":\"Vic\",\"postalCode\":\"3999\",\"period\":{\"start\":\"1974-12-25\"}},\"gender\":\"female\",\"period\":{\"start\":\"2012\"}}],\"managingOrganization\":{\"reference\":\"Organization/1\"}}},{\"resource\":{\"resourceType\":\"Observation\",\"id\":\"f001\",\"identifier\":[{\"use\":\"official\",\"system\":\"http://www.bmc.nl/zorgportal/identifiers/observations\",\"value\":\"6323\"}],\"status\":\"final\",\"code\":{\"coding\":[{\"system\":\"http://loinc.org\",\"code\":\"15074-8\",\"display\":\"Glucose[Moles/volume]inBlood\"}]},\"subject\":{\"reference\":\"Patient/f001\" ``` -------------------------------- ### Power Calculation Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Illustrates using the `pow` filter to calculate the result of a base number raised to an exponent. ```Liquid {{ 3 \| pow: 3 }} ``` -------------------------------- ### Querying Request Counts in Log Analytics (KQL) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/monitoring.md This KQL query summarizes the total, successful, and failed request counts from the AppMetrics table within the last hour, grouping the results by the metric name. ```KQL // get the number of total requests, successful requests, and failed requests AppMetrics | where TimeGenerated > ago(1hour) | where Name == "RequestCount" or Name == "RequestSucceeded" or Name == "RequestFailed" | summarize Count = count() by Name ``` -------------------------------- ### Match String with Regex Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Demonstrates the `match` filter, which applies a regular expression to a string and returns an array of matches. ```Liquid {% assign m = code \| match: '[0123456789.]+' -%} ``` -------------------------------- ### Mapping HL7v2 Code to FHIR using CodeSystem JSON (Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/SnippetConcept.md Illustrates using the `get_property` filter in a Liquid template to look up a value from a CodeSystem JSON file. It takes the value from HL7 v2 PID.8, uses the 'CodeSystem/Gender' mapping, and extracts the 'code' property for the FHIR gender field. ```Liquid "gender":"{{ PID.8.Value | get_property: 'CodeSystem/Gender', 'code' }}", ``` -------------------------------- ### Querying Specific Step Latency Across Requests in Log Analytics (KQL) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/monitoring.md This KQL query retrieves the latency for a specified conversion step across multiple requests within the last 3 hours from the AppTraces table, projecting the timestamp, metric name, latency, and operation ID. ```KQL // get the latency of one of the convert operation steps (latency_metric_name options are "InputDeserializationDuration", "TemplateRetrievalDuration", "TemplateRenderDuration", and "PostProcessDuration") for multiple requests AppTraces | where TimeGenerated > ago(3hours) | where Properties contains | project TimeGenerated, Metric = tostring(Properties.Metric), Latency = tostring(Properties.Duration), OperationId ``` -------------------------------- ### Login to Azure CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/enable-authentication.md Use this command to authenticate with your Azure account via the Azure Command-Line Interface. This is a prerequisite for executing subsequent Azure CLI commands. ```Azure CLI az account ``` -------------------------------- ### Querying Failed Request Counts by Exception Type in Log Analytics (KQL) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/monitoring.md This KQL query counts failed requests categorized as 'ClientError' from the AppMetrics table within the last 6 hours, summarizing the count by the specific exception type. ```KQL // get the total number of failed requests by exception type, where the error is a client error AppMetrics | where TimeGenerated > ago(6hour) | where tostring(Properties.ErrorCategory) == "ClientError" | summarize Count = count() by ExceptionType = tostring(Properties.Name) ``` -------------------------------- ### Querying Convert Operation Step Latency in Log Analytics (KQL) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/monitoring.md This KQL query extracts the latency for each step of the convert operation for a given request from the AppTraces table, filtering for entries containing 'Metric' and 'Duration' properties. ```KQL // get the latency of each step of the convert operation for a given request AppTraces | where OperationId == "" | where Properties contains "Metric" and Properties contains "Duration" | project OperationId, Metric = tostring(Properties.Metric), Latency = tostring(Properties.Duration) ``` -------------------------------- ### Querying Request Details in Log Analytics (KQL) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/monitoring.md This KQL query retrieves basic details for requests within the last 12 hours from the AppRequests table, including the timestamp, name, result code, and operation ID. ```KQL // get the operation_id and result of each request AppRequests | where TimeGenerated > ago(12hours) | project TimeGenerated, Name, ResultCode, OperationId ``` -------------------------------- ### Login to ACR using Oras CLI Source: https://github.com/microsoft/fhir-converter/blob/main/docs/TemplateManagementCLI.md Authenticate to an Azure Container Registry using the Oras executable tool with a username and password. This method requires the Oras tool to be available. ```Shell login -u -p ``` -------------------------------- ### FHIR Encounter Resource Structure with Reference (JSON) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/SnippetConcept.md Provides a JSON structure for a FHIR Encounter resource snippet. It demonstrates how a reference to another resource, like a Condition, is included within the `diagnosis` array using the `reference` field, typically populated by template variables like `{{ REF }}`. ```JSON { "resource":{ "resourceType": "Encounter", "id":"{{ ID }}", "diagnosis": [ { "condition": { "reference":"{{ REF }}", }, }, ], }, } ``` -------------------------------- ### Disable FHIR Converter Application Insights (Bicep) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/configuration-settings.md Sample Bicep command using az deployment sub create to deploy the FHIR converter service with Application Insights disabled. Requires location, deployment name, template file, and the parameter to disable Application Insights. ```Bicep az deployment sub create --location --name --template-file FhirConverter-SingleAzureDeploy.bicep --parameters applicationInsightsEnabled=false ``` -------------------------------- ### Querying Failed Request Error Details in Log Analytics (KQL) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/monitoring.md This KQL query filters the AppTraces table to find trace logs associated with a specific operation ID that contain the message 'Convert operation failed', useful for debugging errors. ```KQL // get the error details of a failed request AppTraces | where OperationId == "" | where Message contains "Convert operation failed" ``` -------------------------------- ### Base64 Encode String Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Demonstrates the `base64_encode` filter, used to encode a string into its Base64 representation. ```Liquid {{ decodedData \| base64_encode }} ``` -------------------------------- ### Including RelatedPerson Resource Snippet (Liquid) Source: https://github.com/microsoft/fhir-converter/blob/main/docs/SnippetConcept.md Illustrates using the `include` tag to incorporate a Resource snippet for creating a RelatedPerson FHIR resource. It passes the NK1 segment data and a generated ID as parameters to the snippet. ```Liquid {% include 'Resource/RelatedPerson' with NK1: nk1Segment, ID: nk1Id -%} ``` -------------------------------- ### Closing Braces - C# Source: https://github.com/microsoft/fhir-converter/blob/main/docs/how-to-guides/use-convert-web-apis.md This snippet contains only closing braces, typically used to end code blocks, scopes, or definitions in C#. ```C# } } ``` -------------------------------- ### Gunzip Base64 String Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Illustrates using the `gunzip_base64_string` filter to decompress a Gzip-compressed string that is also Base64 encoded. ```Liquid {{ compressedData \| gunzip_base64_string }} ``` -------------------------------- ### Generate AllergyIntolerance ID using Liquid Template Source: https://github.com/microsoft/fhir-converter/blob/main/docs/concepts/resource-id-generation.md This Liquid template snippet demonstrates how to use the 'evaluate' tag to generate a Resource ID for an AllergyIntolerance. It calls the 'ID/AllergyIntolerance' template, passing the 'AL1' segment data and a 'baseId' (typically a patient ID) as inputs to the template for ID computation. ```liquid {% evaluate allergyIntoleranceId using 'ID/AllergyIntolerance' AL1: al1Segment, baseId: patientId -%} ``` -------------------------------- ### Divide Numbers Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Shows the syntax for the `divide` filter, which divides the first number by the second number and returns the result as a double. ```Liquid {{ 5 \| divide: 2 }} ``` -------------------------------- ### Base64 Decode String Liquid Source: https://github.com/microsoft/fhir-converter/blob/main/docs/Filters-and-Tags.md Illustrates using the `base64_decode` filter to decode a Base64 encoded string back into its original form. ```Liquid {{ encodedData \| base64_decode }} ```