Comments (25)
Hi @ppc001, could you please share more context of your question? Does the converter work fail to get the OBX segment or the NTE segments? BTW, could you please share the raw liquid template you created instead of the snapshot?
from fhir-converter.
from fhir-converter.
from fhir-converter.
from fhir-converter.
Got it. The current behavior of get_related_segment_list
returns a series of consecutive segments following a specific segment. When we obtain the OBX segments which follow OBR segment with this filter, as they are not consecutive (each OBX is followed by several NTE segments), the filter only returns the first OBX segment.
Currently, the segment filters in converter lack the context of grouping and have limited functions. We will investigate more about how to support it in future.
As a workaround for this special case, we can use get_segment_lists
to get the OBX segments instead. After that, we can get the NTE segments with get_related_segment_list
, as they are consecutive.
{% assign obxSegmentLists = hl7v2Data | get_segment_lists: 'OBX' -%}
{% for obxSegment in obxSegmentLists.OBX -%}
{% assign nteSegmentLists = hl7v2Data | get_related_segment_list: obxSegment, 'NTE' -%}
{% for nteSegment in nteSegmentLists.NTE -%}
{% if nteSegment.1.Value == 1 -%}
{% assign comments = nteSegment.3.Value -%}
{% else %}
{% assign comments = comments | append: "^" -%}
{% assign comments = comments | append: nteSegment.3.Value -%}
{% endif %}
{% endfor -%}
...
from fhir-converter.
I've noticed that after OBX, the function will search for an NTE segment(s) until it gets to one rather than only looking at the next line. As you can see below, there are multiple lines between OBX and NTE but it still gets converted and added as a comment.
.
I have also attached a correct scenario for reference.
Optimally, we would want the function to only look at one line after the OBX line. If the next few consecutive lines are NTE then they should be added as a comment and appended to each other but if it is anything other than NTE there should not be a comment at all.
The liquid code surrounding this issue is the same one you recommended which I have reattached and the ORU_R01.hl7 is still a valid file to reference.
from fhir-converter.
Hey @yankunhuang-pku,
Wanted to check-in on the progress of this issue.
from fhir-converter.
We are implementing a new filter to solve this problem. I'll let you know if it's ready.
from fhir-converter.
good afternoon,
checking on progress
from fhir-converter.
We plan to release it this week or next week if nothing goes wrong.
from fhir-converter.
great to hear! do you have a more precise timeline at this time?
from fhir-converter.
We released a filter called split_data_by_segments
for now. I think you can try using this filter to remove the confusing segments to solve this problem.
from fhir-converter.
Closing per Yankun's solution above. Please re-open if you have additional questions, thanks!
from fhir-converter.
Thank you for creating the changes and releasing the filter @yankunhuang-pku.
I have been trying to use the filter to fix my current issue but I am not succeeding. I have attached two sample HL7v2 files that I am using to test the filter, bkr_998302 and bkr_998330_2.
For bkr_998302, the intended result would be to have the NTE segments(notes/comments) of line 23-32 in the sample data file to follow OBX |9| (Observation) from line 22 as seen in MSFT_2 below
Currently, with the most recent version of the FHIR converter, the NTE segments follow every single OBX instances from line 14 through 22 plus an additional instance in the ServiceRequest resource group. (line 12).
We added the filter at the obrSegment level as you can see in MSFT_4 below on line 453. This deleted all nteSegments under Observations and only kept the nteSegments in the ServiceRequest resource group as seen in MSFT_3 below
For bkr_998330_2, the intended result is for the NTE segments to populate the correct Observation resources and for all the Observations to get converted.
With the most recent converter update, we have noticed that the notes/comments are populating the correct Observation resources as seen in MSFT_5 below. However, the following OBX and NTE segments (lines 14-42) end up getting lost and not converted. I believe this issue also stems from the NTE filtering that ends up ignoring OBXsegments that follow NTE segments.
please advise on how we can achieve our intended results and move forward. Please let me know if further documentation would be necessary or helpful.
from fhir-converter.
Are these tests based on the VS Code extension? At present, we can only use the command line tool in this project to try the new filter, which has not been released on the VS Code side.
Could you test these cases with the command line tool first?
from fhir-converter.
We tried testing the split_data_by_segments filter from the command line and got the following error
C:\tmp\Microsoft.Health.Fhir.Liquid.Converter.Tool>.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe convert -d C:\Users\ppc001\source\repos\fhir_liquidtemplates -r ORU_R01 -i c:\tmp\fhir_input -o c:\tmp\fhir_output
Processing c:\tmp\fhir_input\bkr_998302.hl7
Process failed: Error happened when rendering templates: Error - Filter 'split_data_by_segments' does not have a default value for 'segmentIdSeparators' and no value was supplied
Here is the code snippet that was called.
{% assign obxSegmentLists = hl7v2Data | split_data_by_segments 'OBX|NTE' -%}
Not sure if we did something wrong there
from fhir-converter.
Are these tests based on the VS Code extension? At present, we can only use the command line tool in this project to try the new filter, which has not been released on the VS Code side.
Could you test these cases with the command line tool first?
Do you have a timeline for the VS Code release?
In future updates, will the VS Code release always be delayed? How long is that delay?
thank you
from fhir-converter.
We tried testing the split_data_by_segments filter from the command line and got the following error
C:\tmp\Microsoft.Health.Fhir.Liquid.Converter.Tool>.\Microsoft.Health.Fhir.Liquid.Converter.Tool.exe convert -d C:\Users\ppc001\source\repos\fhir_liquidtemplates -r ORU_R01 -i c:\tmp\fhir_input -o c:\tmp\fhir_output Processing c:\tmp\fhir_input\bkr_998302.hl7 Process failed: Error happened when rendering templates: Error - Filter 'split_data_by_segments' does not have a default value for 'segmentIdSeparators' and no value was supplied
Here is the code snippet that was called.
{% assign obxSegmentLists = hl7v2Data | split_data_by_segments 'OBX|NTE' -%}
Not sure if we did something wrong there
This case may be because you wrote it wrong. Missing symbol :
after split_data_by_segments
from fhir-converter.
Are these tests based on the VS Code extension? At present, we can only use the command line tool in this project to try the new filter, which has not been released on the VS Code side.
Could you test these cases with the command line tool first?Do you have a timeline for the VS Code release? In future updates, will the VS Code release always be delayed? How long is that delay? thank you
Yes, it will be released later than this tool. The specific delay time depends on other work.
from fhir-converter.
from fhir-converter.
we have tested with command line and we are seeing the same issues. I have attached the input sample data files and some images detailing what we are seeing and what we wish to see. I have also attached what current outputs we currently see.
thank you for your assistance.
please re-open this issue thread
sample_data_outputs.zip
from fhir-converter.
@ppc001 @ydequin21 I think it may be the error of your template logic. Here I can provide some usage for your reference. You can try to write your template logic like this sample. Please note that you should use command line tool instead of VS Code extension.
If you have other questions, please provide the templates corresponding to your input data and outputs.
from fhir-converter.
@yankunhuang-pku, thank you for looking into our previous issues.
We originally thought the issue above pertaining to bkr_998330 had to do with the new filter but the issue persists without the filter when using the most recent FHIR Converter template and resources.
I have included the ORU_R01.liquid template. it is your current most updated version without custom changes. The input(bkr_998330 input) has NTE under OBR, OBX |1|, and OBX |2|. In our JSON output we clearly see the note under Service Request(OBR) and one Observation (OBX |1|) but there is not another Observation (OBX |2|) so we lose the entire observation with all the notes that followed it.
I have also reattached the expected output for a clearer perspective on what the issue is.
Moving on with our project we are not using the latest upgrade because of these code-breaking issues.
Please look into this issue.
sample_data_outputs.zip
from fhir-converter.
The reason for this problem is that the templates are still old and the behavior is the same as before if you haven't modified the templates. We have not replaced the old filter get_related_segment_list
with the new filter split_data_by_segments
in the current templates.
@ginalee-dotcom This seems to be a template problem. Could you help to refine the templates? I think we can not use get_related_segment_list: obrsegment, 'OBX'
, but split the data based on the segments OBR
and OBX
by using the new filter split_data_by_segments
.
from fhir-converter.
Closing this as we have the filter split_data_by_segments
as a solution. Will be refining the templates to use this filter.
from fhir-converter.
Related Issues (20)
- How-To Deploy Via Visual Studio Code
- Format as data time rejecting valid format
- How do I build the code? HOT 1
- provide official nuget package HOT 1
- Microsoft.Azure.ContainerRegistry library is obsolete. HOT 1
- Cannot Push Image from Linux Operating System
- Microsoft.Health.Common and Microsoft.Health.Logging packages are removed HOT 8
- Hl7v2 RDE feed conversion failing.
- OBX -5 where OBX-2 is SN allows for a comparator value of = and <>; however FHIR does not HOT 4
- Encounter.class display for U is misspelled
- How to use FHIR-Converter? HOT 1
- Hl7v2 templates - [Quantity/Timing] Explicit Time Interval subfield correct format. HOT 4
- No agent field in Provenance for ADT_A01 => R4 HOT 1
- Converting FHIR to HL7 HOT 2
- Issue with using custom templates to convert data in JSON format to FHIR bundle using $convert-data from ADF HOT 2
- External contributions HOT 1
- Add support to authenticate with Storage without using `DefaultAzureCredential` HOT 1
- Provide documentation for the expected structure of a template container HOT 1
- FHIR converter Service - CCD to FHIR conversion - getting response message like Input data size: 182743B exceeds limit: 102400B. HOT 2
- CLI for mac m2 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fhir-converter.