Giter Club home page Giter Club logo

fhir-converter's Introduction

FHIR Converter

FHIR Converter is an open source project that enables conversion of health data from legacy formats to FHIR.

The first version of the FHIR Converter released to open source on Mar 6th, 2020. It used Handlebars template language and Javascript runtime. A new converter engine was released on Nov 13, 2020 that uses Liquid templating language and .Net runtime.

Currently, Microsoft supports two types of converter engines, Handlebars engine and Liquid engine, along with templates and filters. We strongly recommend using the Liquid converter for a better alignment with Azure Healthcare APIs, Azure Health Data Services, FHIR Server for Azure, and Microsoft Logic Apps.

The following table shows the differences between two converter engines:

Handlebars engine Liquid engine
Template language Handlebars Liquid
Template authoring tool Self-hosted web-app VS Code extension
Supported conversions 1. HL7v2 to FHIR
2. C-CDA to FHIR
1. HL7v2 to FHIR
2. C-CDA to FHIR
3. JSON to FHIR
4. FHIR STU3 to FHIR R4 (new!)
Available as 1. Self-deployed web service
(on-prem or on Azure)
1. Command line tool
2. $convert-data operation in FHIR Server for Azure (OSS)
3. $convert-data operation in both Azure Health Data Services and Azure API for FHIR

⚠ Rest of this document is about the Liquid converter. For the Handlebars converter, please refer to the Handlebars branch.

Currently, FHIR Converter supports four types of conversions, HL7v2 to FHIR, C-CDA to FHIR, JSON to FHIR and FHIR STU3 to R4. The converter uses templates that define mappings between these different data formats. The templates are written in Liquid templating language and make use of custom filters.

The converter comes with a few ready-to-use templates. If needed, you can create a new template, or modify existing templates to meet your specific conversion requirements. The provided templates are based off of HL7 v2.8. Other versions may require you to make modifications to these templates on your own.

FHIR Converter with DotLiquid engine transforms the input data into FHIR bundles that are persisted to a FHIR server. The converter is integrated into both Azure Health Data Services and Azure API for FHIR, as well as in the open-source FHIR Server as a [$convert-data] #using-convert-data-in-fhir-server) operation. It is also available as a command line tool.

NOTE: FHIR STU3 to R4 conversion is only available in the open-source FHIR Server as a $convert-data operation. It is also available as a command line tool.

Using $convert-data in FHIR server

The $convert-data operation is integrated into Azure Health Data Services, Azure API for FHIR and FHIR server to run as part of the service. After enabling $convert-data in your server, you can make API calls in the form of <<your FHIR server URL>>/$convert-data to the server to convert your data into FHIR. In the API call request body, you would include parameters such as inputData, inputDataType, templateCollectionReference, and rootTemplate, to specify the message and the type of message you are converting.

For more information on configuring and using $convert-data operation on your server, please refer to these documentation:

Using Command line tool

Supported parameters

The command line tool is another way of converting data, as well as managing templates. The tool converts a folder containing input messages (HL7v2, C-CDA, JSON or FHIR STU3) into FHIR R4 resources. It accepts the following parameters in the command line:

Option Name Optionality Default Description
-d TemplateDirectory Required Root directory of templates.
-r RootTemplate Required Name of root template.

HL7v2 to FHIR (57 templates): "ADT_A01", "ADT_A02", "ADT_A03", "ADT_A04", "ADT_A05", "ADT_A06". "ADT_A07", "ADT_A08", "ADT_A09", "ADT_A10", "ADT_A11", "ADT_A13", "ADT_A14", "ADT_A15", "ADT_A16", "ADT_A25", "ADT_A26", "ADT_A27", "ADT_A28", "ADT_A29", "ADT_A31", "ADT_A40", "ADT_A41", "ADT_A45", "ADT_A47", "ADT_A60", "BAR_P01", "BAR_P02", "BAR_B12", "DFT_P03", "DFT_P11", "MDM_T01", "MDM_T02", "MDM_T05", "MDM_T06", "MDM_T09", "MDM_T10", "OMG_O19" "OML_O21", "ORM_O01", "ORU_R01", "OUL_R22", "OUL_R23", "OUL_R24", "RDE_O11", "RDE_O25", "RDS_O13", "REF_I12", "REF_I14", "SIU_S12", "SIU_S13", "SIU_S14", "SIU_S15", "SIU_S16", "SIU_S17", "SIU_S26", "VXU_V04"

C-CDA to FHIR (9 templates): "CCD", "ConsultationNote", "DischargeSummary", "HistoryandPhysical", "OperativeNote", "ProcedureNote", "ProgressNote", "ReferralNote", "TransferSummary"

JSON to FHIR: "Stu3ChargeItem", "ExamplePatient"
(These JSON templates are sample templates for use, not default templates that adhere to any pre-defined JSON message types. JSON does not have any standardized message types, unlike HL7v2 messages or C-CDA documents. Therefore, instead of "default" templates we provide you with some sample templates that you can use as a starting guide for you to modify and customize.)

FHIR STU3 to R4: Name of the root template that is the same as the STU3 resource name e.g., "Patient", "Observation", "Organization". Some of the STU3 resources are renamed or removed from R4. Please refer to Resource differences and constraints for STU3 to R4.
-c InputDataContent Optional Input data content. Specify OutputDataFile to get the results.
-n InputDataFile Optional Input data file. Specify OutputDataFile to get the results.
-f OutputDataFile Optional Output data file.
-i InputDataFolder Optional Input data folder. Specify OutputDataFolder to get the results.
-o OutputDataFolder Optional Output data folder.
-t IsTraceInfo Optional Provide trace information in the output if "-t" is set. This parameter is only supported in HL7v2 to FHIR conversion.
--version Version Optional Display version information.
--help Help Optional Display usage information of this tool.

Command line example

First, build the executable file, Microsoft.Health.Fhir.Liquid.Converter.Tool.exe, in your local directory. Have the input data, as well as the conversion templates, saved in separate folders.

Converting data inside folders

You can run the built .exe file in your terminal by running the following command line and specifying the directories:

>.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe convert -d myTemplateDirectory -r myRootTemplate -i myInputDataFolder -o myOutputDataFolder

For example, you can run a command like below to convert all C-CDA sample documents inside the SampleData\Ccda folder using the default CCD template:

>.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe convert -d {path}\Templates\Ccda -r CCD -i {path}\SampleData\Ccda -o {path to your output folder}

After running the command line, there will be a series of "Processing..." lines being written in the terminal window. When the conversion is complete, you will see "Conversion completed!" message.

For example, if you were doing the C-CDA to FHIR conversion in a folder as in the command above, you will see something like this:

Conversion running on the terminal (screenshot)

Converting individual files

Instead of converting multiples messages and documents inside a folder, you can also convert single files using the parameters in the table above. For example, if you were to convert a C-CDA document into a FHIR resource using the CCD template:

>.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe convert -n {path}\SampleData\Ccda\CCD.ccda -d {path}\Templates\Ccda -f {path to your output json file} -r CCD

Using Templates

The command line tool supports managing different versions of templates from Azure Container Registry (ACR). You can customize templates and store them in your ACR if default templates are not sufficient for meeting conversion requirements. After ACR authentication, you can pull templates from ACR or push templates to ACR using our command line tool.

Note: Template version is aligned with the version of FHIR Converter.

Command line example

Example command to push a collection of templates to ACR image from a folder:

>.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe push testacr.azurecr.io/templatetest:default myInputFolder

Example usage of pulling an image of templates in a folder:

>.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe pull testacr.azurecr.io/templatetest@sha256:412ea84f1bb1a9d98345efb7b427ba89616ec29ac332d543eff9a2161ca12a58 myOutputFolder

For more details on how to push and pull template collections, please refer to the documentation on Template Management CLI tool.

To see the current version of templates we support, check out the complete list of templates.

There are other versions released by Microsoft that are stored in a public ACR healthplatformregistry.azurecr.io. You can directly pull templates from healthplatformregistry.azurecr.io/hl7v2defaulttemplates:<version> without ACR authentication.

HL7v2 to FHIR conversion templates

There are three documentations to note for HL7v2 to FHIR conversion. Please make sure to reference these as you use our HL7v2 default templates:

  • A complete list and explanation of each of the 57 HL7v2 to FHIR conversion templates: see here
  • Important points to note for HL7v2 to FHIR conversion: see here
  • Common FHIR Validator errors/warning you might run into, and their explanations: see here

Resource ID generation

The default templates provided with the Converter computes Resource IDs using the input data fields. In order to preserve the generated Resource IDs, the converter creates PUT requests, instead of POST requests in the generated bundles.

For HL7v2 to FHIR conversion, HL7v2 DotLiquid templates help generate FHIR resource IDs from HL7v2 messages. An ID generation template does three things: 1) extract identifiers from the input segment or field; 2) combine the identifers with resource type and base ID (optional) as hash seed; 3) compute hash as output ID.

For C-CDA to FHIR conversion, C-CDA DotLiquid templates generate FHIR resource IDs in two ways: 1) ID generation template helps generate Patient ID and Practitioner ID; 2) the resource IDs for other resources are generated from the resource object directly.

For JSON to FHIR conversion, there is no standardized JSON input message types unlike HL7v2 messages or C-CDA documents. Therefore, instead of default templates we provide you with some sample JSON DotLiquid templates that you can use as a starting guide for your custom JSON conversion templates. You can decide how to generate the resource IDs according to your own inputs, and use our sample templates as a reference.

For FHIR STU3 to R4 conversion, the Resource ID from STU3 resource is copied over to corresponding R4 resource.

The Converter introduces a concept of "base resource/base ID". Base resources are independent entities, like Patient, Organization, Device, etc, whose IDs are defined as base ID. Base IDs could be used to generate IDs for other resources that relate to them. It helps enrich the input for hash and thus reduce ID collision. For example, a Patient ID is used as part of hash input for an AllergyIntolerance ID, as this resource is closely related with a specific patient.

Below is an example where an AllergyIntolerance ID is generated, using ID/AllergyIntolerance template, AL1 segment and patient ID as its base ID. The syntax is {% evaluate [id] using [template] [variables] -%}.

{% evaluate allergyIntoleranceId using 'ID/AllergyIntolerance' AL1: al1Segment, baseId: patientId -%}

Resource validation and post-processing

The output of converter depends on the templates as well as the quality and richness of input messages. Therefore, it is important that you review and validate the Converter output before using those in production.

In general, you can use HL7 FHIR validator to validate a FHIR resource. You may be able to fix some of the conversion issues by appropriately changing the templates. For other issues, you may need to have a post-processing step in your pipeline.

In some cases, due to lack of field level data in the incoming messages, the Converter may produce resources without useful information or even without ID. You can use Hl7.Fhir.R4 .NET library to filter such resources in your pipeline. Here is the sample code for such purpose.

using Hl7.Fhir.Model;
using Hl7.Fhir.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;

public class PostProcessor
{
    private readonly FhirJsonParser _parser = new FhirJsonParser();

    public IEnumerable<Resource> FilterResources(IEnumerable<string> fhirResources)
    {
        return fhirResources
            .Select(fhirResource => _parser.Parse<Resource>(fhirResource))
            .Where(resource => !IsEmptyResource(resource))
            .Where(resource => !IsIdAbsentResource(resource));
    }

    public bool IsEmptyResource(Resource resource)
    {
        try
        {
            var fhirResource = resource.ToJObject();
            var properties = fhirResource.Properties().Select(property => property.Name);
            // an empty resource contains no properties other than "resourceType" and "id"
            return !properties
                .Where(property => !property.Equals("resourceType"))
                .Where(property => !property.Equals("id"))
                .Any();
        }
        catch (Exception e)
        {
            Console.Error.WriteLine(e.Message);
            // deal with the exception...
        }

        return false;
    }

    public bool IsIdAbsentResource(Resource resource)
    {
        try
        {
            return string.IsNullOrWhiteSpace(resource.Id);
        }
        catch (Exception e)
        {
            Console.Error.WriteLine(e.Message);
            // deal with the exception...
        }
        return false;
    }
}

Reference documentation

External resources

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit the CLA site.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

fhir-converter's People

Contributors

acmoretxj avatar boyawu10 avatar caitlinv39 avatar deepak-ms avatar dependabot[bot] avatar dustinburson avatar emluk avatar feordin avatar ginalee-dotcom avatar hongyh13 avatar jasonheld-msft avatar joedrowan avatar lta-thinking avatar microsoftopensource avatar moiradillon12 avatar moria97 avatar ms-teli avatar msftgits avatar pallar-ms avatar qiwjin avatar quanwanxx avatar ranvijaykumar avatar shabanlushaj avatar shashanknarang27 avatar shaundonn2 avatar sowu880 avatar umar-gh avatar wi-y avatar wsugarman avatar yankunhuang-pku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fhir-converter's Issues

Current converter template does not convert HL7 race/ethnicity data into FHIR

I have patient/ethnicity data from healthcare vendors in HL7. They are not converted by the template.

FHIR standard: https://www.hl7.org/fhir/v3/Race/cs.html and https://www.hl7.org/fhir/patient-profiles.html

My HL7 vendor test data have race as "WHITE" in the PID segment below.

MSH|^~&|J3rdsU1S/YU3pMoUwk/9ZQ==|CB99V96UUEJVQA7DK5G6APHVVG|Hospice Source||20210623103315||ADT^A01|20210623103315HEP00001905602|T|2.5||||||ASCII
EVN|A01|20210622144027|20210622144027|01||20210622144027
PID|1||19056|16364|JOHNSON^JAMES^||19450224|M||WHITE|1440 KNOTTS WAY^^EL PASO^MI^79910^^PATIENT'S HOME/RESIDENCE^^||(915)222-5566||English|WIDOW||HEP00000005602|456231920|||||||||||N

The challenge I have is where in the template can I add them so the FHIR API server would store the new data. Sometimes I cannot find the place in the template to add the data; sometimes if I could add them, they do not show up in the server.

explain use of uuid

Is your feature request related to a problem? Please describe.
I am using FHIR Converter successfully but would also like to create a separate application that need to create the same UUID/GUID as in the converter.
When I rung uuid v3 "XXXXXX" URL from the command line the results I get are not the same as the converter does through the API.
For example,
uuid v3 MTAwMDY1NzlNUg== URL produces 5bd1496a-f235-3d0f-ad43-685b7bab5a08
but the HL7 message produces: "fullUrl": "urn:uuid:64bac34e-e611-3549-848b-89416176aa0b",

Describe the solution you'd like
What should the correct call to uuid be to produce the same UUID

Describe alternatives you've considered
We've created a template that outputs the UUID as required but this could be a bit simpler.
From the code this is how the UUID is created. do you have any further details?
return uuidv3(''.concat(urlNamespace), uuidv3.URL);Additional context
Add any other context or screenshots about the feature request here.

Bug while processing German umlaut letters Ä, ä ,Ö, ö ,Ü, ü, ß in HL7v2 message

Hi,
I have came across a bug in FHIR converter tool while converting an HL7 v2 message containing German umlaut symbols Ä, ä ,Ö, ö ,Ü, ü, ß into FHIR resource.

Tool is removing above mentioned letters from the message string. In the below image we are getting Tübingen as the city in HL7 v2 message and while converting the segment data into fhir resource, ü is removed and output looks like Tbingen.
Please refer the below snapshots-
Note:-This is an anonymized message with fake patient name and address

Capture

Capture1

Thanks

Document sections with no template id throw exception in getFirstCdaSectionsByTemplateId helper

Describe the bug
Many of the sub-templates for CCDs use the getFirstCdaSectionsByTemplateId helper to find the section that they need to extract data from. If a document section lacks a template id, the helper throws an exception because the template id is null

To Reproduce
Steps to reproduce the behavior:

  1. Load a CCD document with a section that lacks a templateid
  2. Load the ccd.hbs template
  3. Error will appear "includes" is undefined

Expected behavior
Any sections with missing templateIds should be skipped

MLLP to Converter

I am not sure how I can point my mllp connector to the liquid version? Is this available, because I don't see where I can choose the different acr.
Thank you

Where can I map PV1 account status in FHIR?

I have the following HL7 PV1 segment field 41 as account status "CURRENT". Where can I map it in FHIR?

PV1|1|O|HOSPICE OF EDMOND, INC.^^^HEP&HOSPICE EDMOND^2^PATIENT'S HOME/RESIDENCE^^^GREEN|NEW ADMISSION|||1900038389^REEVES^BOB^^^^MD|^^^^^^|1538112198^G^LOUIS^^^^MD|||||||||HOSPICE|16364||||||||||||||||||||||CURRENT|||20210622000000

An assembly specified in the application dependencies manifest (Microsoft.Health.Fhir.Liquid.Converter.Tool.deps.json) was not found:

Hi Team,

While executing "Microsoft.Health.Fhir.Liquid.Converter.Tool.exe" with commandLineArgument in ElasticBeanStalk i am getting bellow error:
2021-11-02T13:37:44.000Z Error 0:(0) .NET Runtime - Description: A .NET Core application failed.
Application: Microsoft.Health.Fhir.Liquid.Converter.Tool.exe
Path: C:\inetpub\AspNetCoreWebApps\app\CCD2FHIR\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe
Message: Error:
An assembly specified in the application dependencies manifest (Microsoft.Health.Fhir.Liquid.Converter.Tool.deps.json) was not found:
package: 'Microsoft.Win32.SystemEvents', version: '4.7.0'
path: 'runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll'

Please help me for the same.

Thanks & Regards
Suprakash Maity

400 error when pushing converted bundle

Hi, I am using the $convert-data api call to convert the HL7 then make a call to post the bundle. When I try to push the bundle below my response says 400 error. It still posts but not sure what this error means? Can you explain , Thank you

bundle.txt

[handlebars] Deploy on-prem instructions missing a step

The instruction for deploy the handlebars engine are:

git clone https://github.com/microsoft/FHIR-Converter/
cd FHIR-Converter
npm install
npm start

Since the handlebars engine is now in a dedicated branch it's missing the instruction git checkout handlebars

Also is the plan to de-prioritized development and support for the handlebar engine(since introduction of Liquid Engine)?

Customizing Deployment to use separate Github Repo

Is your feature request related to a problem? Please describe.
when setting up a custom deployment of the FHIR Converter. We need to specify the Docker Registry - username and password.
Can you describe how to set those up?

Describe the solution you'd like
Instructions to connect to the Docker Registry repository

Describe alternatives you've considered
I have set up a pipeline both from Github Action and from Azure App Services the build works but the Docker image fails as it needs user/password.

Additional context

The template deployment 'Microsoft.Template-20200827113542' is not valid according to the validation procedure

Hello,

I am getting below error when trying to deploy the template.

Kindly help.

Thanks

{
"deploymentStatusCode": -1,
"stage": 6,
"expected": true,
"error": {
"message": "The template deployment 'Microsoft.Template-20200827113542' is not valid according to the validation procedure. . See inner errors for details."
},
"subscriptionId": "998bdx77-1gcb-4525-877b-c2f5142c29ec",
"resourceGroupName": "testpoc",
"resourceGroupLocation": "eastus",
"deploymentName": "Microsoft.Template-20200827113542",
"details": {
"code": "InvalidTemplateDeployment",
"message": "The template deployment 'Microsoft.Template-20200827113542' is not valid according to the validation procedure. The tracking id is 'bfg5e53f-cd78-4f59-xxe0-a75123bdf477'. See inner errors for details.",
"details": [
{
"code": "ValidationForResourceFailed",
"message": "Validation failed for a resource. Check 'Error.Details[0]' for more information.",
"details": [
{
"code": "LinuxWorkersNotAllowedInResourceGroup",
"message": "Linux workers are not available in resource group sbfhirsvc-poc. Use this link to learn more https://go.microsoft.com/fwlink/?linkid=831180"
}
]
}
]
}
}

valueQuantity.value is being returned as a string

I have the below ORU HL7 message. I am trying to convert it into an FHIR bundle using the API (handlebars version). I looked at the handlebars template for an observation resource and it looks correct. If there is a value, the template says to return the value. So, if there is a decimal value like 1.8 it should return 1.8. But, when I checked the response, it is returning "1.8"(string).

Any help that tells me where I should look more to troubleshoot it will be appreciated.

Excerpt from Observation Template

{{#if observationEntry.value.code}} "valueCodeableConcept":{{>DataType/CodeableConcept.hbs code=observationEntry.value}}, {{else if observationEntry.value.value}} "valueQuantity": { "value":{{observationEntry.value.value}}, "unit":"{{observationEntry.value.unit}}", }, {{else}} "valueString":"{{observationEntry.value._}}", {{/if}}

Response

{ "fullUrl": "urn:uuid:b868545e-087c-3860-b4bd-f03e98a344e2", "resource": { "resourceType": "Observation", "id": "b868545e-087c-3860-b4bd-f03e98a344e2", "code": { "coding": [ { "code": "tt-0002-17", "display": "Basophils", "system": "WinPath" } ] }, "valueQuantity": { "value": "0.18", "code": "x10*9/L" }, "status": "final", "effectiveDateTime": "2020-05-08T13:10:30.000Z", "component": [ { "code": { "coding": [ { "code": "tt-0002-17", "display": "Basophils", "system": "WinPath" } ] }, "valueQuantity": { "value": "0.18", "code": "x10*9/L" }, "referenceRange": [ { "text": "[ &lt; 0.21 ]" } ] } ], "subject": { "reference": "Patient/c49bc5d4-72a3-3cb4-9a27-5b4f65794e9d" } }, "request": { "method": "PUT", "url": "Observation/b868545e-087c-3860-b4bd-f03e98a344e2" } },

Sample HL7 Message

MSH|^~\&|SIMHOSP|SFAC|RAPP|RFAC|20200508131030||ORU^R01|557|T|2.5.1|||AL||44|ASCII PID|1|3265861866^^^SIMULATOR MRN^MRN|3265861866^^^SIMULATOR MRN^MRN~8898636334^^^NHSNBR^NHSNMBR||Lloyd^Kieran^Wilfred^^Mr^^CURRENT||19921001000000|M|||117 Kiss Place^^Croydon^^BB32 9BA^GBR^HOME||074 1156 4084^HOME|||||||||A^White - British^^^|||||||| PV1|1|I|OtherWard^MainRoom^Bed 195^Simulated Hospital^^BED^Main Building^4|28b|||C005^Whittingham^Sylvia^^^Dr^^^DRNBR^PRSNL^^^ORGDR|||CAR|||||||||13797039926095492417^^^^visitid||||||||||||||||||||||ARRIVED|||20200508131030|| ORC|RE|1975039636|4232299600||CM||||20200508131030 OBR|1|1975039636|4232299600|us-0002^COMPLETE BLOOD COUNT^WinPath^^||20200508131030|20200508131030|||||||20200508131030||||||||20200508131030|||F||1 OBX|1|NM|tt-0002-17^Basophils^WinPath^^||1.0|x10*9/L|[ < 0.21 ]||||F|||20200508131030|| OBX|2|NM|tt-0002-13^Monocytes^WinPath^^||0.38|x10*9/L|[ 0.2 - 1.0 ]||||F|||20200508131030|| OBX|3|NM|tt-0002-06^Platelet Count^WinPath^^||366.25|x10*9/L|[ 150 - 450 ]||||F|||20200508131030|| NTE|0||Sauce transportation warmth laparoscope bustle torso breakpoint inch cherry| OBX|4|NM|tt-0002-10^Lymphocytes per^WinPath^^||20|PERCENT|||||F|||20200508131030|| OBX|5|NM|tt-0002-15^Eosinophils^WinPath^^||0.21|x10*9/L|[ 0.04 - 0.40 ]||||F|||20200508131030|| NTE|0||Cracker roadway home| NTE|1||Ram margin meteor grade rock jute boot| OBX|6|NM|tt-0002-02^Red Cell Count^WinPath^^||4.44|x10*12/L|[ 4.2 - 6.0 ]||||F|||20200508131030|| NTE|0||Brook witch zipper kitchen bolt shorts bother volume guarantee| OBX|7|NM|tt-0002-11^Lymphocytes^WinPath^^||3.54|x10*9/L|[ 1.1 - 4.0 ]||||F|||20200508131030|| NTE|0||Metal coinsurance| OBX|8|NM|tt-0002-14^Eosinophils per^WinPath^^||20|PERCENT|||||F|||20200508131030|| OBX|9|NM|tt-0002-03^Haematocrit^WinPath^^||0.45||[ 0.38 - 0.52 ]||||F|||20200508131030|| OBX|10|NM|tt-0002-07^White Cell Count^WinPath^^||6.59|x10*9/L|[ 4.0 - 11.0 ]||||F|||20200508131030|| NTE|0||Cot zampone pantology disadvantage block sheet| OBX|11|NM|tt-0002-04^Mean Cell Volume^WinPath^^||81.54|fL|[ 80 - 98 ]||||F|||20200508131030|| OBX|12|NM|tt-0002-01^Haemoglobin^WinPath^^||163.75|g/L|[ 135 - 180 ]||||F|||20200508131030|| NTE|0||Landform university trouble go tonight pop terracotta| OBX|13|NM|tt-0002-09^Neutrophils^WinPath^^||2.40|x10*9/L|[ 2.0 - 7.5 ]||||F|||20200508131030|| NTE|0||Pike jasmine repeat| OBX|14|NM|tt-0002-12^Monocytes per^WinPath^^||20|PERCENT|||||F|||20200508131030|| NTE|0||Relish duck insect district orange thongs mud| OBX|15|NM|tt-0002-16^Basophils per^WinPath^^||20|PERCENT|||||F|||20200508131030|| OBX|16|NM|tt-0002-08^Neutrophils per^WinPath^^||20|PERCENT|||||F|||20200508131030|| NTE|0||Bridge sphere chateau| OBX|17|NM|tt-0002-05^Mean Cell Haemoglobin^WinPath^^||29.94|pg|[ 27 - 35 ]||||F|||20200508131030||

When trying to parse PID.11 segment, the e.g. the following PID has issue, as it consider

When trying to parse PID.11 segment, the e.g. the following PID has issue, as it consider
"20200819~21 WOOD CT" as one component, it should be repeated field.

21 WOOD CT^^HT^NY^11043^US^M^^Harris^^^2020081921 WOOD CT^^HT^NY^11043^US^H^^Harris^^^2020081921 WOOD CT^^HT^NY^11043^US^BA^^Harris^^^20200819

this shall be parsed into three addresses, but the convert only converted into one address in FHIR

  1. 21 WOOD CT^^HT^NY^11043^US^M^^Harris^^^20200819

  2. 21 WOOD CT^^HT^NY^11043^US^H^^Harris^^^20200819

  3. 21 WOOD CT^^HT^NY^11043^US^BA^^Harris^^^20200819

    "address": [
     {
       "line": [
         "21 WOOD CT"
       ],
       "city": "HT",
       "state": "NY",
       "postalCode": "11043",
       "country": "US",
       "type": "postal",
       "period": {
         "start": "20200819~21 WOOD CT",
         "end": "HT"
       }
     }
    

    ],

Look into the code, under Hl7v2DataParser, shall it first check the repetitions fields then "ParseComponent"?

                if (!string.IsNullOrEmpty(fieldValues[f]))
                {
                    var components = ParseComponents(fieldValues[f], encodingCharacters);
                    var field = new Hl7v2Field(fieldValues[f], components);
                    var repetitions = fieldValues[f].Split(encodingCharacters.RepetitionSeparator);
                    for (var r = 0; r < repetitions.Length; ++r)
                    {
                        var repetitionComponents = ParseComponents(repetitions[r], encodingCharacters);
                        var repetition = new Hl7v2Field(repetitions[r], repetitionComponents);
                        field.Repeats.Add(repetition);
                    }

                    fields.Add(field);
                }
                else
                {
                    fields.Add(null);
                }

Originally posted by @ddst0111 in #141

Mapping output in Liquid

I am noticing some items not being outputted in the starter template. Example: PV1.3 the location is not outputting the value in the bundle template after converting. I only see the location reference GUID being generated and not the actual value from HL7 (PREOD). I attached a screenshot. I see in the template it has PV1.3 am I missing something?

Thank you,
Brandon

image

Web UI and API return different json response

Describe the bug
The json response displayed in the Web UI contains a different bundle than the json response returned by the API for the same HL7v2 message. This can be confusing for users. The Web UI returns only the fhir bundle while the api returns the fhir bundle along with an invalidAccess object and an unusedSegments object.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Web UI
  2. Make sure HL7v2 is selected
  3. Select ADT_A01.hbs from the template drop down.
  4. Paste in an ADT message to convert in the top frame
  5. Notice the bottom right frame contains only the converted fhir bundle
  6. Send a POST request to /api/convert/hl7v2/ADT_A01.hbs with the same ADT message from step 4.
  7. Notice the json response contains elements named "unusedSegments", "invalidAccess", and "fhirResource". This is different from the output of step 5.

Expected behavior
The response from the Web UI and the api should match.

Screenshots
Input and output are attached.

Browser:
Chrome

Additional context

adt.txt
api_response.txt
webui_response.txt

CodeSystem/Langugage.liquid has all empty ifs

The contents of https://github.com/microsoft/FHIR-Converter/blob/main/data/Templates/Hl7v2/CodeSystem/_Language.liquid, start like this:

  {% if inCode == '' -%}
    "code" : "ar",
    "display" : "Arabic",
    "system" : "urn:ietf:bcp:47",
    {% elsif inCode == '' -%}
    "code" : "bn",
    "display" : "Bengali",
    "system" : "",
    {% elsif inCode == '' -%}
    "code" : "cs",
    "display" : "Czech",
    "system" : "",

It looks like there is issue in the generated code, since all comparison cases are against the empty string.

getFirstSegments producing error : {BadRequest: Unable to create result: helper "getSegmentLists" : TypeError: Cannot read property 'meta' of undefined}

I have HL7 message, I am trying to convert it into an FHIR using handlebars templates.

This is the HL7 msg :
MSH|^~&|AIN ADA||WIW||20210802103432||SIU^S14|245942910343210-0036||2.5.1
PID||738966|566329||Bugs^Bunny^^^1^||19600513|M|||
AIG|1|A|2828^Saal 05^^E/S5^Saal 05^|O|^2814|||202108020808|0||8400|||P|
AIG|2|A|3338^hama ali^212737^BEE^hama^ali|P|^10570|||202108020808|0||8400|||O|
AIG|3|A|47899^bou chnak^215070^PWP^bou^chnak|P|^10570|||202108020808|0||7200|||I|

I made this template which works fine :
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [

    {{#with (getFirstSegments msg.v2 'PID' )}}
    {
        "ID":"{{PID-2}}",
        "reasonReference":[
        {{#with (getSegmentLists ../msg.v2 'AIG')}}
        {{#each AIG as |AIGIns|}}
        {{#if (eq AIGIns-4 "P" )}}
            {
                "reference": "Procedure/{{generateUUID AIGIns-5-1}}",
            },
        {{/if}}
        {{/each}}
        {{/with}}
        ]
    }
   {{/with}}
]

}

the output is :
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"ID": "738966",
"reasonReference": [
{
"reference": "Procedure/c4f9c654-7490-3233-b90e-a7eb5088d6c5"
},
{
"reference": "Procedure/c4f9c654-7490-3233-b90e-a7eb5088d6c5"
}
]
}
]
}

Now, when I try to put the reasonReference code block in a separate file and call it like this :
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [

    {{#with (getFirstSegments msg.v2 'PID' )}}
    {{>Resources/Surgery.hbs}}
   {{/with}}
]

}
I get this error :
{BadRequest: Unable to create result: helper "getSegmentLists" : TypeError: Cannot read property 'meta' of undefined}

PS: Surgery.hbs contains exactely the same code :
{
"ID":"{{PID-2}}",
"reasonReference":[
{{#with (getSegmentLists ../msg.v2 'AIG')}}
{{#each AIG as |AIGIns|}}
{{#if (eq AIGIns-4 "P" )}}
{
"reference": "Procedure/{{generateUUID AIGIns-5-1}}",
},
{{/if}}
{{/each}}
{{/with}}
]
}

Error in Accessing HL7 v2 field information

Hi,
I have customized the ADT templates as per the version of HL7 v2, I could access the information from a field PV1-2 earlier and after few days I again run the templates but this time the information from PV1-2 is not accessible, then I used PV1-2-1 to access the same information in partial templates, and now this doesn't work any more, I have to use PV1-2-1-1 to access the same information.

It seems that this is happening after I configured for subcomponents for HL7 v2 in few fields but not sure.

Note:- PV1 segment is an example

Capture

Capture2

Swagger Doc incorrect for Convert functionality

Describe the bug
The swagger doc for the convert api has an incorrect url. The doc shows this:
/api/convert/{template}

The actual url is this:
/api/convert/hl7v2/{template}

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to converterurl/api-docs/#/
  2. Scroll to /api/convert/{template}
  3. Notice it is incorrect
  4. Attempt to send a post request with an hl7v2 message to that endpiont
  5. Notice http 502 error
  6. Send a post request to updated uri: /api/convert/hl7v2/{template}
  7. Notice http 200 success

Expected behavior
Swagger doc should accurately reflect api

Screenshots
Problem:
image

Does not match:
image

Browser:
n/a

Additional context
Recent update to the converter changed the URI from hl7 to hl7v2, and swagger documentation did not reflect this.

output stream reader is always empty in linux docker container for FHIR-convertor tool

I tried to run this tool from c# using Process and ProcessStartInfo, It is working fine in windows machine but in linux docker the outputStream is always empty and the json file is not getting created in the OutputDataFolder.
FYI:I have the FHIR-Convertor tool in the CCD2FHIR folder.

code:
ProcessStartInfo ProcessInfo;
Process Process;
ProcessInfo = new ProcessStartInfo(@"CCD2FHIR/Microsoft.Health.Fhir.Liquid.Converter.Tool.exe", @"convert -d CCD2FHIR/Template/Ccda -r CCD -i CCD2FHIR/Input -o CCD2FHIR/Output");
ProcessInfo.CreateNoWindow = false;
ProcessInfo.UseShellExecute = false;
ProcessInfo.RedirectStandardInput = true;
ProcessInfo.RedirectStandardOutput = true;
ProcessInfo.RedirectStandardError = true;
ProcessInfo.WindowStyle = ProcessWindowStyle.Hidden;
ProcessInfo.WorkingDirectory = Directory.GetCurrentDirectory();
Process = Process.Start(ProcessInfo);
StreamReader stdOut = Process.StandardOutput;
Process.WaitForExit(2 * 1000);
var outputStream = Process.StandardOutput.ReadToEnd();
var errorStream = Process.StandardError.ReadToEnd();
while (!stdOut.EndOfStream)
{
data += stdOut.ReadLine();
}
int exitCode = Process.ExitCode;
Process.Close();

Missing resourceTypes in output

I've deployed the Handlebars deployment to my Azure instance. I'm using CDA converter. I'm using ccd.hbs Template.
I have copied in my cda for synthetic patient Sofia Mateo. Even though the ccd template shows
{{>Sections/Allergies_and_Adverse_Reactions.hbs}}
it isn't creating an AllergyIntolerance resourceType in the resultant json. Or a Medication resourceType, or others. What I am getting is Composition, Patient, DocumentReference, and Organization.
Am I using the wrong template? Does it need to be customized to pull these resourceTypes? Is there an existing one that does pull all these?

Here is my cds
new 4.txt
:

Converter does not convert HL7 PV1 field 41 account status into FHIR data.

I have the following HL7 PV1 segment field 41 as account status "CURRENT". It is missed by the converter. Is there a workaround?

PV1|1|O|HOSPICE OF EDMOND, INC.^^^HEP&HOSPICE EDMOND^2^PATIENT'S HOME/RESIDENCE^^^GREEN|NEW ADMISSION|||1900038389^REEVES^BOB^^^^MD|^^^^^^|1538112198^G^LOUIS^^^^MD|||||||||HOSPICE|16364||||||||||||||||||||||CURRENT|||20210622000000

The challenge I have is where in the template can I add them so the FHIR API server would store the new data. Sometimes I cannot find the place in the template to add the data; sometimes if I could add them, they do not show up in the server.

Swagger header for `api/templates` PUT is incorrect

Describe the bug
The file parameter misses a type, and the name (body) parameter should have a schema.

To Reproduce

  1. Get the api-docs.json file
  2. Upload it to a validator (like swaggerhub.com)
  3. The validator highlights these errors

Additional context
I discovered this while trying to convert the swagger output to a C# server stub - using swaggerhub.com. The generator complained. After some research I found the swagger file generated by the converter API is incorrect.

I'll send a PR to fix it.

CCDA Conversion Failing

The CCDA Conversion process fails with the error "Process failed: The conversion from data type 'cda' to FHIR is not supported"

Changing the metadata.json under data/Templates/Ccda/ to 'ccda' fixes the process.

Liquid Engine VS Handlebars Engine

Since the team is moving toward implementing support for Liquid Engine, are still going to support Handlebars Engine?

Is the plan to retire Handlebars once Liquid is fully implemented? We are currently evaluating a FHIRv2/CDA to FHIR translation tool and this is a critical point for us.

Converter does not convert HL7 EVN message into FHIR.

My healthcare vendor would provide HL7 EVN message segment to indicate when an event such as A01 (admission), A03 (discharge), A08 (patient update), A04 (referral), and A11 (cancel admission). The event timestamp is generally different from the message header timestamp. So, I need to store the event timestamp as it occurred. Converter does not convert HL7 EVN message into FHIR. Is there a workaround available?

Here is a sample of the data. Note the EVN timestamp is different from message header timestamp. Without the EVN timestamp, I would miss the event by 1 day.

MSH|^~&|J3rdsU1S/YU3pMoUwk/9ZQ==|CB99V96UUEJVQA7DK5G6APHVVG|Hospice Source||20210615165034||ADT^A08|20210615165034HEP00001905502|T|2.5||||||ASCII
EVN|A08|20210614111226|20210614111226|01||20210614111226

The challenge I have is where in the template can I add them so the FHIR API server would store the new data. Sometimes I cannot find the place in the template to add the data; sometimes if I could add them, they do not show up in the server.

Where/how can I store EVN data?

My healthcare vendor would provide HL7 EVN message segment to indicate when an event such as A01 (admission), A03 (discharge), A08 (patient update), A04 (referral), and A11 (cancel admission). The event timestamp is generally different from the message header timestamp. So, I need to store the event timestamp as it occurred. Is there an FHIR entity to store EVN data?

Here is a sample of the data. Note the EVN timestamp is different from message header timestamp. Without the EVN timestamp, I would miss the event by 1 day.

MSH|^~&|J3rdsU1S/YU3pMoUwk/9ZQ==|CB99V96UUEJVQA7DK5G6APHVVG|Hospice Source||20210615165034||ADT^A08|20210615165034HEP00001905502|T|2.5||||||ASCII
EVN|A08|20210614111226|20210614111226|01||20210614111226

Working with GIt from deployed version

Is your feature request related to a problem? Please describe.
Hello, When working with templates and the UI there is a GIT option, that allows us to create, branches, etc. Can we get the URL of the GIT repository where this would be available?
As a user, it would be great to be able to work from the deployed git repository.

Describe the solution you'd like
As a user, it would be great to be able to work locally with my editor/file from the deployed git repository.

Describe alternatives you've considered
I've deployed locally and worked from there but would like to distribute and collaborate with team members.

Additional context

MSH is not mapping corectly in tool

Looks like the mapping is one field off. I map MSH-3 but see MSH-4 etc.. See screen shot of output. I think the tool is not counting the encoding character as the correct field.

image

image

Custom templates are getting deleted automatically.

I am using FHIR-Converter to convert HL7 Messages to FHIR resource in my project. The code is inside a container and is deployed into the Azure Cloud. I have also created a custom template according to my needs. But after using it for some time the template automatically gets deleted. Only the Pre built templates like 'ADT_A01' , 'ORU_O01' etc. remains. I have to create my template again and again . This is disrupting the flow of my project where I am using it. This has happened a couple of times in last three months. Also the repo on my local machine, where I initially tested my template is working absolutely fine. I never faced any issue in my local machine. If anyone knows about this issue please help me.

How to handle updates and other message types

When ADT is flowing inbound how do you match encounters. Example: A01 is sent that creates an encounter record in FHIR. An A03 is sent for the patient discharge. Does Azure know to update the correct encounter ID or does it create a new encounter ID record? If I were to search via FHIR for that patients encounters, would I see one response or two?

So far I created a another template for A03’s, but I see two encounters after sending the A03. How would this work for updates and other transaction types. I am assuming we would have to query the “lastupdated” value in resource to filter?
Thank you,
Brandon

trouble parsing an HL7 message with a repeating group

I am trying to parse an HL7 ORU^R01 message with a repeating group. The message has the following format:

MSH
PID
[{NTE}]
[{NK1}]
PV1
{
ORC
OBR
[{NTE}]
{
[
OBX
[{NTE}]
]
}
}

MSH|^&|BKR|NHCIEBC|||20210927003525|LABBACKGROUND|ORU^R01|38335214|P|2.3|||||||||PHLabReport-Ack^^2.16.840.1.114222.4.10.3^ISO||
PID|1||59999999^^^NOVANT^CI||JXXXXX^TXXXX^CXXXXXX||19010101|F||2|200 HAWTHORNE LANE^^CHARLOTTE^NC^28204^USA^P^^MECKLENBUR||(999)999-9999^PRN^PH^^1^999^9999999
^NET^Internet^[email protected]||ENGLISH|||999999999999|999999999|||Not Hispanic||||||||N|||20190617163909|1||PID|1||59999999^^^NOVANT^CI59999999^^^NOVANT^CI||JXXXXX^TXXXX^CXXXXXX^JXXXXX^TXXXX^CXXXXXX||19010101|F||2|200 HAWTHORNE LANE^^CHARLOTTE^NC^28204^USA^P^^MECKLENBUR||(999)999-9999^PRN^PH^^1^999^9999999^NET^Internet^[email protected]||ENGLISH|||999999999999|999999999|||Not Hispanic||||||||N|||20190617163909|1|
NTE|1|O|Signature - Acct: 99999999|
NTE|2|O|Allscripts - Gill Ortho, ChartID: 9999 EHR Mrn: 99999999|
NK1|1|ALMOND^CHRIS^^|Son|6225 SWIMMING DUCK RD^^CHARLOTTE^NC^28214^USA|(704)999-9999^^CP^^^704^9999999|||||||||||||||||||||||||||
NK1|2|BERRY^TAI^^|Daughter-in-|6225 SWIMMING DUCK RD^^CHARLOTTE^NC^28214^USA|(704)999-9999^^PH^^^704^9999999~(704)988-8888^^CP^^^704^9888888|||||||||||||||||||||||||||
PV1|1|OC|NHCIEBC^^^NHCIEBC^^^^^^^|||||9999999999^A^KETAN^B^^^^^^^^^NPI|||||||||||999999999999|Medicare Man||||||||||||||||||||||||20210923091309|20210923111059|||||8400112385
ORC|RE|936013155||21LCA-266S0345^Beaker|||^^^20210927^^R|935055050^56102788&Beaker|20210927003519|INFBLCRI^ACUTE INTERFACE^INCOMING^BEAKER LC RES^||8888888888^S^KIM^S^^^^^^^^^NPI|NHCIEBC^^^NHCIEBC^^^^^|(999)999-6500^^^^^999^9996500|20210927003519|||DKT2UA2490PL0^DKT2UA2490PL0^^100101001^LSC FAMILY MEDICINE||||||9 Queens^Ste 520^CHARLOTTE^NC^28204-3215^USA^C^^MECKLENBUR|||||||LAB304838^CULTURE, URINE^NH BEAKER EAP^^^^^^CULTURE, URINE
OBR|1|936013155||LAB3041225^URINE CULTURE RESULT^NH BEAKER EAP^^^^^^URINE CULTURE RESULT||20210927|20210923093255|||SES091^STARK^SHARON^E^|G||R30.0^Dysuria^ICD-10-CM^^^^^^Dysuria|20210923000000|Urine&Urine^^^Urine, Clean&Urine, Clean Catch|1376800698^STRICKLAND^KIMBERLY^S^^^^^^^^^NPI|(980)302-6500^^^^^980^3026500|||||20210927003500||Lab Only|F||^^^20210927^^R||935055050^56102788&Beaker|||&Acute Interface&Incoming&Beaker Lc Res&||||20210927||||||||||||||LAB304838^CULTURE, URINE^NH BEAKER EAP^^^^^^CULTURE, URINE
NTE|1|L|Performed at: 01 - LabCorp Burlington|
NTE|2|L|1447 York Court, Burlington, NC 272153361|
NTE|3|L|Lab Director: Sanjai Nagendra MD, Phone: 8007624344|
TQ1|1||||||||R
OBX|1|ST|10094^C URINE 1^NH BEAKER LRR^^^^^^C URINE 1||Klebsiella pneumoniae|||A|||F|||20210923093255|||||20210927003500||||NH LABCORP^D|SEE NOTES^^^^^^B||||||
NTE|1|L|Cefazolin <=4 ug/mL|
NTE|2|L|Cefazolin with an MIC <=16 predicts susceptibility to the oral agents|
NTE|3|L|cefaclor, cefdinir, cefpodoxime, cefprozil, cefuroxime, cephalexin,|
NTE|4|L|and loracarbef when used for therapy of uncomplicated urinary tract|
NTE|5|L|infections due to E. coli, Klebsiella pneumoniae, and Proteus|
NTE|6|L|mirabilis.|
NTE|7|L|50,000-100,000 colony forming units per mL|
OBX|2|ST|10098^C URINE SUS^NH BEAKER LRR^^^^^^C URINE SUS||Comment||||||F|||20210923093255|||||20210927003500||||NH LABCORP^D|SEE NOTES^^^^^^B||||||
NTE|1|L| ** S = Susceptible; I = Intermediate; R = Resistant **|
NTE|2|L| P = Positive; N = Negative|
NTE|3|L| MICS are expressed in micrograms per mL|
NTE|4|L| Antibiotic RSLT#1 RSLT#2 RSLT#3 RSLT#4|
NTE|5|L|Amoxicillin/Clavulanic Acid S|
NTE|6|L|Ampicillin R|
NTE|7|L|Cefepime S|
NTE|8|L|Ceftriaxone S|
NTE|9|L|Cefuroxime S|
NTE|10|L|Ciprofloxacin S|
NTE|11|L|Ertapenem S|
NTE|12|L|Gentamicin S|
NTE|13|L|Imipenem S|
NTE|14|L|Levofloxacin S|
NTE|15|L|Meropenem S|
NTE|16|L|Nitrofurantoin S|
NTE|17|L|Piperacillin/Tazobactam S|
NTE|18|L|Tetracycline S|
NTE|19|L|Tobramycin S|
NTE|20|L|Trimethoprim/Sulfa S|
SPM|1|||Urine^Urine^^^^^^^Urine||||Urine, Clean^Urine, Clean Catch^^^^^^^Urine, Clean Catch|||||||||20210923093255|20210923000000||||||

The messages has multiple OBX segments with multiple NTE segments following each OBX segment. The FHIR converter is only mapping the first OBX segment to an Observation resource. I need to map the NTE comments to the Observation.note.text FHIR attribute as well.

FYI: I am fairly new to the liquid markup language. Any help is greatly appreciate
ORU_R01_liquid_snippet
d.

OUL Messages

Hi,

Is there any plan of adding the template for OUL - Unsolicited Laboratory Observation Message (Event R21)? Please advise.

Thanks,
Hanuma

metadata error

When I try to follow the steps in VS code I get an error saying it cant find metadata?

format_as_date_time - time zone conversion

testing using the VS code extensions locally. format_as_date_time seems to convert to local time.

Is there a way to convert to the TZ specified in the string?

It seems to honor this value during conversion, but always returns the TZ in the result as my local TZ. Examples from my testing so far

UTC TZ conversion
{%- assign _date2Format="20200806133040+0000" -%}
{% assign _formatDate = _date2Format | format_as_date_time %}
"formatDate": "2020-08-06T09:30:40-04:00"

UTC +/-3 TZ conversion
{%- assign _date2Format="20200806133040+0300" -%}
"formatDate": "2020-08-06T06:30:40-04:00"

{%- assign _date2Format="20200806133040-0300" -%}
"formatDate": "2020-08-06T12:30:40-04:00"

Where can I store patient race/ethnicity data?

I have patient/ethnicity data from healthcare vendors in HL7. Where can I store/map it in FHIR?

FHIR standard: https://www.hl7.org/fhir/v3/Race/cs.html and https://www.hl7.org/fhir/patient-profiles.html

My HL7 vendor test data have race as "WHITE" in the PID segment below.

MSH|^~&|J3rdsU1S/YU3pMoUwk/9ZQ==|CB99V96UUEJVQA7DK5G6APHVVG|Hospice Source||20210623103315||ADT^A01|20210623103315HEP00001905602|T|2.5||||||ASCII
EVN|A01|20210622144027|20210622144027|01||20210622144027
PID|1||19056|16364|JOHNSON^JAMES^||19450224|M||WHITE|1440 KNOTTS WAY^^EL PASO^MI^79910^^PATIENT'S HOME/RESIDENCE^^||(915)222-5566||English|WIDOW||HEP00000005602|456231920|||||||||||N

Matching the correct MRN ID

How does the tool know its the correct patient during conversion? How does it know when I send one ADT that has MRN 123 vs a different patient that has the same MRN 123? can you explain your matching criteria

" set of templates help generate FHIR resource IDs from HL7 v2 messages. An ID generation template does 3 things: 1) extract identifiers from input segment or field; 2) combine the identifers with resource type and base ID (optional) as hash seed; 3) compute hash as output ID."

Only Patient resource is in bundle V2 converter

Describe the bug
I think PID fix broke the other resources. I only see the Patient resource in the FHIR bundle. I no longer see the encounter and procedure ones and others.

To Reproduce
Steps to reproduce the behavior:

  1. Go to FHIR Converter
  2. Load A01.hbs template and any ADT message
  3. Scroll down to FHIR bundle
  4. See only patient resource

Expected behavior
I expect to see many other FHIR resources in the bundle

Screenshots
image

PID-13 not repeatable

I am seeing the same issue for PID-13. Your example messages doesn't have repeating but in Epic they do. I am going to update using your change but just thought you should know.
removing image phi

Originally posted by @camila8 in #47 (comment)

Git menu will trigger commit call on every click

Describe the bug
When there are changes to commit, every single click on the Git dropdown menu will start a commit API call.

To Reproduce
Steps to reproduce the behavior:

  1. Make some changes to the handlebar templates
  2. Click on the "Git" menu
  3. Watch the developer console to see the app invoke /commit on every click on the menu

Expected behavior
Only invoke this call when the "Commit changes" item is called

The callback for the commit is attached to the menu, instead of the "Commit changes" item.

ID/_Practitioner does not support practitioners listed in PV1.

HL7 PV1 has the following practitioners listed and current ID/_Practitioner does not support their GUID calculation. I cannot use your current template to calculate their GUIDs.

PV1.7 Attending Doctor
PV1.8 Referring Doctor
PV1.9 Consulting Doctor
PV1.17 Admitting Doctor
PV1.52 Other Healthcare Provider

As a workaround, I am creating a new ID/_PractitionerPV1 with the content below to support my business need. Let me know if you want me to add this to my branch and my pull request.

{% capture identifiers -%}
{% if XCN.3 and XCN.7 -%}{{XCN.3.Value}},{{XCN.7.Value}}
{% elsif XCN.3 and XCN.8 -%}{{XCN.3.Value}},{{XCN.8.Value}}
{% elsif XCN.3 and XCN.9 -%}{{XCN.3.Value}},{{XCN.9.Value}}
{% elsif XCN.3 and XCN.17 -%}{{XCN.3.Value}},{{XCN.17.Value}}
{% elsif XCN.3 and XCN.52 -%}{{XCN.3.Value}},{{XCN.52.Value}}
{% endif -%}
{% endcapture -%}
{{ identifiers | generate_id_input: 'Practitioner', false | generate_uuid }}

Need a helper to set variable in templates

While customizing the templates as per our requirements, we often require to store some value and reuse it somewhere else , may be converting another segment into FHIR resource. Is there any feature or helper which can store value and can be reused?

NodeJs Version

Hi - I see that there is a constraint on the NodeJs version when using "engines": { "node": ">=10.10.0 <11.0" },. On 30th of last month(04/30/2021) was the end-of-life for any 10.x versions. So, is there any plan of upgrading the project to v14 or v12(LTS) so it can be safely used? Please advise.

Also, if there is a guide that already explains how the project can be upgraded, please point me towards it. Happy to answer any further questions.

image

I've added this in the discussion forum a few days back#237. But, now I think it should be called as a potential issue.
Thanks,
Hanuma

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.