HTML encoding of text fields by the XML formatter
fieranmason@gmail.com
#1 Posted : Tuesday, October 1, 2013 11:09:35 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/8/2013(UTC)
Posts: 22
Points: 66
Location: University of Victoria

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Hello Everest,

We have been looking for a way to force the XML ITS1 formatter to html encode the content of the text fields of the CDA document. We haven't found anything that supports this and we are wondering if it is A) missing or B) could be implemented.

Thank you
Fieran
justin.fyfe1
#2 Posted : Tuesday, October 1, 2013 11:32:16 AM(UTC)

Rank: Administration

Medals: Mobile Tech Grasshopper: Mobile Tech GrasshopperHealth Informatics MVP

Groups: Registered, Administrators
Joined: 7/22/2010(UTC)
Posts: 96
Points: 297
Man
Location: Hamilton, ON

Thanks: 2 times
Was thanked: 17 time(s) in 17 post(s)
Hi Fieran,

I'm not sure if I understand what you're asking to do. Could you provide a sample (xml) of what you're attempting to represent vs. what is actually being produced? That way I can provide some guidance on how it might be implemented :)

Cheers
-Justin
fieranmason@gmail.com
#3 Posted : Tuesday, October 1, 2013 12:49:34 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/8/2013(UTC)
Posts: 22
Points: 66
Location: University of Victoria

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Hi Justin,

Suppose you wanted to provide the following title for a document "<My Document &". This would would likely fail to parse once the document was created on account of the leading open angle brace confusing the parser by subsuming the next open tag. Text values anywhere in the clinical document which contain characters which need to be encoded are likely to cause this problem.

Hopefully this is more clear. If not we can of course provide a more complete example. The short version is that any string value I assign to a component of the clinical document should be encoded.

Returning to the example so as to satisfy your request -

What I would like to appear in the document

<title>&lt;MyDocument &amp;</title>

What actually appears in the document

<title><MyDocument &</title>

Thanks
Fieran
justin.fyfe1
#4 Posted : Tuesday, October 1, 2013 1:01:40 PM(UTC)

Rank: Administration

Medals: Mobile Tech Grasshopper: Mobile Tech GrasshopperHealth Informatics MVP

Groups: Registered, Administrators
Joined: 7/22/2010(UTC)
Posts: 96
Points: 297
Man
Location: Hamilton, ON

Thanks: 2 times
Was thanked: 17 time(s) in 17 post(s)
Hi Fieran,

Thanks for the clarification. When I try this using code I get the expected behavior:

Code:

cda.Title = "<this is my title&";


Yields:

Code:

<title language="en-US">&lt;this is my title&amp;</title>


In the ED data type this should be automatically handled if you assign a string, ie:

Code:

doc.Code = new CE<string>();
doc.Code.OriginalText = "<this is my title&";


Yields:

Code:

<code>
    <originalText representation="TXT" mediaType="text/plain" language="en-US">&lt;this is my title&amp;</originalText>
</code>


However if you instruct the ED to represent itself as raw XML (ie. representation = XML) then you'll get the behavior you identify as the formatter will treat the Data property as just XML (it expects it to be well formed).

Hope that helps
-Justin
1 user thanked justin.fyfe1 for this useful post.
fieranmason@gmail.com on 10/1/2013(UTC)
fieranmason@gmail.com
#5 Posted : Tuesday, October 1, 2013 2:20:48 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/8/2013(UTC)
Posts: 22
Points: 66
Location: University of Victoria

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Thank you Justin
We were using a media type of text/x-hl7-text+xml. We will make the necessary changes.

Fieran
justin.fyfe1
#6 Posted : Tuesday, October 1, 2013 2:23:42 PM(UTC)

Rank: Administration

Medals: Mobile Tech Grasshopper: Mobile Tech GrasshopperHealth Informatics MVP

Groups: Registered, Administrators
Joined: 7/22/2010(UTC)
Posts: 96
Points: 297
Man
Location: Hamilton, ON

Thanks: 2 times
Was thanked: 17 time(s) in 17 post(s)
Hi Fieran,

The best way to do structured text is to load/construct the structure in a DOM, XElement or with an XmlWriter and output to a byte array and then represent that as XML (as XElement and DOM will escape the strings for you).

Cheers
-Justin
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

SoClean Theme By Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.113 seconds.