User Tools

Site Tools


text_formatting_in_odm_-_is_it_possible

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

text_formatting_in_odm_-_is_it_possible [2015/03/29 16:54]
manager created
text_formatting_in_odm_-_is_it_possible [2015/03/29 17:23] (current)
manager
Line 1: Line 1:
 I was recently asked whether it is possible to add text formatting information in ODM. The person who asked me wanted to have underlining and bold support on question texts in the CRFs. Something like: I was recently asked whether it is possible to add text formatting information in ODM. The person who asked me wanted to have underlining and bold support on question texts in the CRFs. Something like:
-"Is your __quick__ //brown// fox jumping over the __lazy__ dog?"+"Is your __quick__ //​brown// ​**fox** jumping over the __lazy__ ​**dog**?"
  
 Now, CDISC ODM does not suppport text formatting out of the box, as it is an exchange and archival format, and was not meant for text formatting. However, as ODM is very often the source for automated CRF creation, the question makes sense. Now, CDISC ODM does not suppport text formatting out of the box, as it is an exchange and archival format, and was not meant for text formatting. However, as ODM is very often the source for automated CRF creation, the question makes sense.
  
-Also, we see that other standards in the medical world, like HL7-v3 and HL7-FHIR, do have partial ​support for text formatting, so it is surely we need to think about for a next version of CDISC ODM.+Also, we see that other standards in the medical ​informatics ​world, like HL7-v3 and HL7-FHIR, do have simple ​support for text formatting, so it is surely we need to think about for a next version of CDISC ODM.
  
 The first way you can add text formatting information is by using a vendor extension. This time, this is not so straightforward,​ as usually the text you will want to format is in a "​TranslatedText"​ element, which is of type "​simpleType"​ in the XML-Schema, so that you cannot add child elements to it ("​simpleType"​ means "text content only"​). The first way you can add text formatting information is by using a vendor extension. This time, this is not so straightforward,​ as usually the text you will want to format is in a "​TranslatedText"​ element, which is of type "​simpleType"​ in the XML-Schema, so that you cannot add child elements to it ("​simpleType"​ means "text content only"​).
  
-But you could for exampledo something like:+But you could for example do something like:
  
-<​Question>​+  ​<​Question>​
     <​TranslatedText xml:​lang="​en">​Is your quick brown fox jumping over the lazy dog?</​TranslatedText>​     <​TranslatedText xml:​lang="​en">​Is your quick brown fox jumping over the lazy dog?</​TranslatedText>​
-    <​my:​FormattedTranslatedText xml:​lang="​en">​Is your <b>​quick</​b> <​i>​brown</​i>​ jumping over the <b>​lazy</​b>​ dog?</​my:​FormattedTranslatedText>​ +    <​my:​FormattedTranslatedText xml:​lang="​en">​Is your <ul>​quick</​ul> <​i>​brown</​i> <​b>​fox</​b> jumping over the <ul>​lazy</​ul> <b>dog</b>?</​my:​FormattedTranslatedText>​ 
-</​Question>​+  </​Question>​ 
 +   
 +where the "​my"​ prefix is the prefix you have chosen for the prefix namespace of your vendor extension. 
 +   
 +Of course you will need to take care that the semantic contents of "​TranslatedText"​ and "​FormattedTranslatedText"​ are identical, as the ODM standard requires you that your ODM file still has all normal ODM information when you remove the vendor extension: "//​Removing all vendor extensions from an extended ODM file must result in a meaningful and accurate standard ODM file//"​. 
 + 
 +So, you can agree with the receiver of the ODM document that when there is a "​my:​FormattedTranslatedText"​ element for the target language, its text is taken for the question on the CRF, and the contents are being interpreted as having to be formatted (as XHTML in this case). If there is no "​my:​FormattedTranslatedText"​ the receiver should take the contents of the "​TranslatedText"​ element, and use that without any formatting. 
 + 
 +The second way you can do text formatting is by using [[http://​www.w3schools.com/​xml/​xml_cdata.asp|CDATA]] within the "​TranslatedText"​ element. "​CDATA"​ is an instruction to the processor that the content is "text only", and that any tags or "<"​ and ">"​ characters (among others) in the content must be ignored by the parser. 
 +"​CDATA"​ is often used to add scripts or code in different languages within XML files, and these of course should not be interpreted by the parser. 
 + 
 +For our example, one could do: 
 + 
 +  <​Question>​ 
 +    <​TranslatedText xml:​lang="​en">​ 
 +    <​![CDATA[ 
 +    <​html>​Is your <​ul>​quick</​ul>​ <​i>​brown</​i>​ <​b>​fox</​b>​ jumping over the <​ul>​lazy</​ul>​ <​b>​dog</​b>?</​html>​ 
 +    ]]> ​  
 +    </​TranslatedText>​ 
 +  </​Question>​ 
 +   
 +In this case, the receiving system MUST be able to interprete the formatting instructions,​ otherwise also the tags will appear on the CRF. 
 + 
 +I will put "​simple text formatting"​ on the "​discussion list" for the next release of ODM. We must however take into account that when we add "​simple text formatting"​ to the ODM specification,​ this also means that vendors will need to completely support it in order to obtain ODM certification. So there __will__ be resistance.
  
text_formatting_in_odm_-_is_it_possible.1427640890.txt.gz · Last modified: 2015/03/29 16:54 by manager