Section class - Text member
dheasley
#1 Posted : Friday, July 12, 2013 11:12:00 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/11/2013(UTC)
Posts: 6
Points: 21
Location: charlotte, NC US

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I'm trying to create a CCD and when creating the text portion of the section portion I writing the following for example:

var s = new Section();
s.TemplateId = new List<II> { new II("2.16.840.1.113883.10.20.1.13")) };
s.Code = new CE<string>("48764-5", "2.16.840.1.113883.6.1");
s.Title = new ST("Summary of Purpose");
s.Text = new ED("<table border='1' width='100%'><thead><tr><th>Payer Name</th><th>Group Number</th><th>Policy Number</th><th>Status</th></tr></thead><tbody><tr><td>Bcbs No Carolina</td><td>1111111</td><td>111111111</td><td>Active</td></tr></tbody></table>");


The actual output that it produces is:

<text representation="TXT" mediaType="text/plain">&lt;table border='1' width='100%'&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Payer Name&lt;/th&gt;&lt;th&gt;Group Number&lt;/th&gt;&lt;th&gt;Policy Number&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Bcbs No Carolina&lt;/td&gt;&lt;td&gt;118245&lt;/td&gt;&lt;td&gt;Zeb903419438&lt;/td&gt;&lt;td&gt;Active&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</text>


2 questions.
1. when i validate against http://xreg2.nist.gov/cd...idation/validation.html I receive the following messages. I can't seem to figure out how to remove those 2 attribute(representation and mediaType)
cvc-complex-type.3.2.2: Attribute 'representation' is not allowed to appear in element 'text'.
cvc-complex-type.3.1: Value 'text/plain' of attribute 'mediaType' of element 'text' is not valid with respect to the corresponding attribute use. Attribute 'mediaType' has a fixed value of 'text/x-hl7-text+xml'.
2. As you can see in the above text element my < and > that I'm passing in to the Text property are getting encoded and output xml produces &lt; and &gt;
Do you know how I can resolve this.

Thanks




<component>
<structuredBody>
<component>
<section>
<text>
justin.fyfe1
#2 Posted : Friday, July 12, 2013 11:22:32 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)
Hello,

When you construct the formatter you should use the ClinicalDocumentDatatypeFormatter instead of the DatatypeFormatter, as this puts the data-types output into CDA mode. Though, looking at this it is placing the representation= on the wire (I will take a look at this).

You can also have mixed mode XML by constructing the CDA text like this:

Code:
ED text = "<b>This is a test</b>";
text.MediaType = "text/xml";
text.Representation = EncapsulatedDataRepresentation.XML;


You can also load into a XmlDocument for easier manipulation:

Code:
XmlDocument html = new XmlDocument();
html.AppendChild(html.CreateElement("b", "http://www.w3.org/1999/xhtml"));
html.DocumentElement.InnerText = "This is a test";
ED text = new ED();
text.XmlData = html.DocumentElement;
text.MediaType = "text/xml";
text.Representation = EncapsulatedDataRepresentation.XML;


Result:

Code:
<text representation="TXT" mediaType="text/xml"><b xmlns="http://www.w3.org/1999/xhtml">This is a test</b></text>


There may be a bug where "representation" is output where it isn't supposed to be. I will take a look.

Cheers
-Justin
justin.fyfe1
#3 Posted : Friday, July 12, 2013 11:59:57 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)
As a follow-up, you have found a bug in the R1 formatter. I have corrected the issue and will post an update as soon as the build/tests are complete (about an hour).

Cheers
-Justin
dheasley
#4 Posted : Friday, July 12, 2013 12:12:19 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/11/2013(UTC)
Posts: 6
Points: 21
Location: charlotte, NC US

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
So the fix will remove representation and mediaType from the output of the text element to comply with the following validation error messages?


cvc-complex-type.3.2.2: Attribute 'representation' is not allowed to appear in element 'text'.
cvc-complex-type.3.1: Value 'text/xml' of attribute 'mediaType' of element 'text' is not valid with respect to the corresponding attribute use. Attribute 'mediaType' has a fixed value of 'text/x-hl7-text+xml'.

Really appreciate the quick response.
justin.fyfe1
#5 Posted : Friday, July 12, 2013 12:14:54 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)
The patch will remove the representation="TXT" issue (the first of the validation errors), in order to be compliant you'll have to set an appropriate media type like:

Code:

ED text = new ED();
text.MediaType = "text/x-hl7-text+xml";


Should be the appropriate code to get rid of the second validation error.

Cheers
-Justin
dheasley
#6 Posted : Friday, July 12, 2013 1:43:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/11/2013(UTC)
Posts: 6
Points: 21
Location: charlotte, NC US

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Do I pull the new code down from SVN. if so can you give me the path to the snv trunk They current code I'm working off of is from the everest-sdk-1.2.2.exe.

I couldn't get the svn to compile for me.
justin.fyfe1
#7 Posted : Friday, July 12, 2013 2:07:33 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)
Hello,

The 1.2 maintenance branch is located at https://fisheye.marc-hi.ca/svn/Everest/branches/1.2 (which is where I generate 1.2.x installation packages). We usually build off api.sln (this was created way before Everest even had a name ;)) rather than Everest.sln it contains everything (unit tests, etc.).

I have posted 1.2.3 which contains the necessary patches (http://te.marc-hi.ca/release.aspx?project=af66d54ed41e4ac18b44d0d3ca6cabf0) .

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.192 seconds.