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> // </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")); 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) { } catch (Exception e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); e.printStackTrace();

View File

@ -1499,7 +1499,7 @@
"title": { "title": {
"dataString": "Skin Exam" "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": [ "entry": [
{ {
"observation": { "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> <title>Skin Exam</title>
<text>Erythematous rash, palmar surface, left index finger. <text>Erythematous rash, palmar surface, left index finger.
<renderMultiMedia referencedObject=""/> <renderMultiMedia referencedObject="MM1"/>
</text> </text>
<entry> <entry>
<observation classCode="OBS" moodCode="EVN"> <observation classCode="OBS" moodCode="EVN">

View File

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