GithubHelp home page GithubHelp logo

microsoft / fhir-converter Goto Github PK

View Code? Open in Web Editor NEW
382.0 47.0 167.0 103.54 MB

Conversion utility to translate legacy data formats into FHIR

License: MIT License

ANTLR 0.02% Liquid 84.86% C# 15.12%
hl7v2 fhir converter fhir-converter

fhir-converter's Introduction

FHIR Converter

FHIR converter is an open source project that enables conversion of health data from legacy formats to and from FHIR. The FHIR converter uses the Liquid template language and the .NET runtime.

The FHIR converter supports the following conversions: HL7v2 to FHIR, C-CDA to FHIR, JSON to FHIR, FHIR STU3 to R4, and FHIR to HL7v2 (Preview).

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. See Templates & Authoring for specifics.

What's New?

The latest iteration of the Preview FHIR converter makes some significant changes over previous versions.

Some of the changes include:

  • Containerized API
  • Support Azure Storage for customer templates.
  • Removal of Azure Container repository dependency for custom templates.
  • Support for FHIR to HL7v2 conversion.

All the documentation for the new preview FHIR converter API can be found in the How to Guides folder.

Architecture

The FHIR converter API preview provides REST based APIs to perform conversion requests.

The FHIR converter APIs are offered as a container artifact in Microsoft Container Registry. This image can be downloaded and run as a web service on a container hosting platform in your Azure tenant; that clients can target for conversion requests.

Convert setup

Templates & Authoring

The FHIR converter API comes with several pre-built templates you can use as reference as to create your own.

Conversion Notes
HL7v2 to FHIR 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
C-CDA to FHIR
JSON to FHIR
FHIR STU3 to R4 Differences between STU3 & R4
FHIR to HL7v2 (Preview)

Concepts

In addition to the example templates provided there are several important concepts to review and consider when creating your own templates, including:

To use your custom templates, the FHIR converter API offers robust support for storing and retrieving your templates from Azure storage. For more information see: Template Store Integration.

Deployment

You can deploy the FHIR converter API using the instructions found here. The default deployment will deploy the FHIR Conventer API container hosted on Azure Container Apps.

API

The conversion APIs process the provided input data of the specified format and use the specified Liquid template (default or custom) and return the converted result as per the transformations in the template.

Convert API summary

Complete details on the FHIR converter APIs and examples can be found here.

Troubleshooting

Some key concepts to consider:

  • Processing time is related to both the input message size, template, and logic contained in the template. If your template is taking a long time to execute make sure you don't have any unnecessary loops.
  • The output of the template is expected to be JSON when the target is FHIR.
  • When converting data to FHIR, post processing is performed. If you are seeing unexpected results, double check the post processing logic.
  • If you want a deeper understanding on how data is converted, look at the functional tests found here

Detailed troubleshooting options for your deployed FHIR converter API can be found here.

Previous Versions

Detailed documentation of prior Converter release is covered in the table below.

Version Summary
5.x Liquid Liquid engine release covers:
1. HL7v2, CCDA, and JSON to FHIR transformations.
2. Command Line utility.
3. VS Code authoring extension.
4. FHIR Service $convert integration.
5. ACR template storage.
3.x Handlebars Previous handlebars base solution. No longer supported. See full comparision here.

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 bkaney avatar boyawu10 avatar caitlinv39 avatar deepak-ms avatar dependabot[bot] avatar dustinburson avatar evachen96 avatar ewoutkramer avatar feordin avatar ginalee-dotcom avatar hongyh13 avatar irenepjoseph avatar joedrowan avatar lta-thinking avatar microsoftopensource avatar moiradillon12 avatar moria97 avatar ms-teli avatar pallar-ms avatar qiwjin avatar quanwanxx avatar ranvijaykumar avatar shashanknarang27 avatar shaundonn avatar shaundonn2 avatar sowu880 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  avatar

fhir-converter's Issues

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();

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

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"
}
]
}
]
}
}

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
:

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.

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

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

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": "[ < 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||

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.

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.

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.

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.

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

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

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 }}

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

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)

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

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"

[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)?

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

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

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

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.

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.

metadata error

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

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

OUL Messages

Hi,

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

Thanks,
Hanuma

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.

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

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.

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?

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

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

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."

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

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}}
]
}

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.

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

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.

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.

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

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

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.