Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid JSON generated (Exception) - CcdaDataParser does not escape incoming double quote character #421

Open
jgriesemer-ndsc opened this issue Aug 8, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jgriesemer-ndsc
Copy link

jgriesemer-ndsc commented Aug 8, 2022

Conversion fails and throws a PostprocessException because CcdaDataParser.cs does not escape double quote characters inside of XText nodes from the incoming xml document.

Example problematic xml:

<value xsi:type="ST">
* Adjustment of the mA and/or kV according to patient size (this  
       includes techniques or standardized protocols for targeted exams  
       where dose is matched to indication / reason for exam; i.e.  
       extremities or head ) * Use of iterative reconstruction technique"
</value>

Using Ccda Processor with DischargeSummary template. I've added a step to the parser locally to replace " -> \" and the fix works.

@marcocrasso
Copy link

marcocrasso commented Aug 29, 2022

Similar problem with: &quot; and Microsoft.Health.Fhir.Liquid.Converter.Tool 5.0.4.3.

<value code="&quot;text&quot;" displayName="&quot;text&quot;">
    <originalText>
        <reference value="text"/>
    </originalText>
</value>

Output:

Process failed: Invalid JSON generated: line 845:18 no viable alternative at input: ...

Preprocessing also works for me.

@irenepjoseph irenepjoseph added the bug Something isn't working label Oct 5, 2022
@sowu880
Copy link
Contributor

sowu880 commented Oct 27, 2022

Hi,
you can use string filter: 'escape' in CCDA templates which will return string with special chars escaped.
e.g.
"div":"\<div>{{ component.section.title.displayName| escape }}\</div>",

Thanks.

@evachen96
Copy link
Collaborator

@jgriesemer-ndsc were you able to try out the escape string filter? Did that help with the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants