processRenderMultiMedia add src attribute

This commit is contained in:
Oliver Egger 2019-10-14 22:36:16 +02:00
parent 04ff81682b
commit 220a668e68
4 changed files with 7 additions and 3 deletions

View File

@ -110,6 +110,10 @@ public class CDARoundTripTests {
// </text>
assertEquals("Skin Exam", fp.evaluateToString(e, "component.structuredBody.component.section.component.section.where(code.code='8709-8' and code.codeSystem='2.16.840.1.113883.6.1').title.dataString"));
// <div>Erythematous rash, palmar surface, left index finger.
// <img src="MM1"/></div>
String text = fp.evaluateToString(e, "component.structuredBody.component.section.component.section.where(code.code='8709-8' and code.codeSystem='2.16.840.1.113883.6.1').text");
assertTrue(text.contains("<img src=\"MM1\"/>"));
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();

View File

@ -1499,7 +1499,7 @@
"title": {
"dataString": "Skin Exam"
},
"text": "<div src=\"MM1\">Erythematous rash, palmar surface, left index finger.\n\t\t\t\t\t\t\t\t <img/></div>",
"text": "<div>Erythematous rash, palmar surface, left index finger.\n\t\t\t\t\t\t\t\t <img src=\"MM1\"/></div>",
"entry": [
{
"observation": {

View File

@ -735,7 +735,7 @@ Readers should be aware of the evolving "Using SNOMED CT in HL7 Version 3" imple
<title>Skin Exam</title>
<text>Erythematous rash, palmar surface, left index finger.
<renderMultiMedia referencedObject=""/>
<renderMultiMedia referencedObject="MM1"/>
</text>
<entry>
<observation classCode="OBS" moodCode="EVN">

View File

@ -187,7 +187,7 @@ public class CDANarrativeFormat {
private void processRenderMultiMedia(Element e, XhtmlNode xn) throws FHIRException {
XhtmlNode xc = xn.addTag("img");
String v = e.getAttribute("referencedObject");
xn.attribute("src", v);
xc.attribute("src", v);
processAttributes(e, xc, "ID", "language", "styleCode");
processChildren(e, xc);
}