Merge pull request #1702 from hapifhir/2024-07-gg-rendering-issues
2024 07 gg rendering issues
This commit is contained in:
commit
144131d529
|
@ -734,12 +734,12 @@ public class SpecDifferenceEvaluator {
|
|||
if (cDel > 0) {
|
||||
XhtmlNode li = ul.li();
|
||||
li.tx("Remove " + Utilities.pluralize("code", cDel) + " ");
|
||||
li.getChildNodes().addAll(liDel.getChildNodes());
|
||||
li.addChildNodes(liDel.getChildNodes());
|
||||
}
|
||||
if (cAdd > 0) {
|
||||
XhtmlNode li = ul.li();
|
||||
li.tx("Add " + Utilities.pluralize("code", cAdd) + " ");
|
||||
li.getChildNodes().addAll(liAdd.getChildNodes());
|
||||
li.addChildNodes(liAdd.getChildNodes());
|
||||
}
|
||||
}
|
||||
if (rev.getStrength() == BindingStrength.EXTENSIBLE && orig.getStrength() == BindingStrength.EXTENSIBLE) {
|
||||
|
|
|
@ -169,7 +169,7 @@ public class ResourceWrapperR4 extends ResourceWrapper {
|
|||
r.getText().getDiv().getChildNodes().removeIf(c -> !"div".equals(c.getName()) || !c.hasAttribute("xml:lang"));
|
||||
}
|
||||
markLanguage(x, locale);
|
||||
r.getText().getDiv().getChildNodes().add(x);
|
||||
r.getText().getDiv().addChildNode(x);
|
||||
} else {
|
||||
if (!x.hasAttribute("xmlns"))
|
||||
x.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
||||
|
|
|
@ -169,7 +169,7 @@ public class ResourceWrapperR4B extends ResourceWrapper {
|
|||
r.getText().getDiv().getChildNodes().removeIf(c -> !"div".equals(c.getName()) || !c.hasAttribute("xml:lang"));
|
||||
}
|
||||
markLanguage(x, locale);
|
||||
r.getText().getDiv().getChildNodes().add(x);
|
||||
r.getText().getDiv().addChildNode(x);
|
||||
} else {
|
||||
if (!x.hasAttribute("xmlns"))
|
||||
x.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
||||
|
|
|
@ -1133,9 +1133,9 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
XhtmlNode div = res.getNarrative();
|
||||
if (div != null) {
|
||||
if (div.allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes());
|
||||
if (div.getChildNodes().size() == 1 && div.getChildNodes().get(0).allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes().get(0).getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes().get(0).getChildNodes());
|
||||
}
|
||||
x.addText("Generated Summary: ");
|
||||
}
|
||||
|
@ -1902,7 +1902,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
} else {
|
||||
XhtmlNode n = r.getText().getDiv();
|
||||
n.addTag("hr");
|
||||
n.getChildNodes().addAll(x.getChildNodes());
|
||||
n.addChildNodes(x.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2920,7 +2920,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
"NarrativeGenerator");
|
||||
XhtmlParser p = new XhtmlParser();
|
||||
XhtmlNode m = p.parse("<div>" + s + "</div>", "div");
|
||||
x.getChildNodes().addAll(m.getChildNodes());
|
||||
x.addChildNodes(m.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3002,11 +3002,11 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
*/
|
||||
XhtmlNode root = new XhtmlNode(NodeType.Element, "div");
|
||||
Composition comp = (Composition) feed.getEntry().get(0).getResource();
|
||||
root.getChildNodes().add(comp.getText().getDiv());
|
||||
root.addChildNode(comp.getText().getDiv());
|
||||
Resource subject = ResourceUtilities.getById(feed, null, comp.getSubject().getReference());
|
||||
if (subject != null && subject instanceof DomainResource) {
|
||||
root.addTag("hr");
|
||||
root.getChildNodes().add(((DomainResource) subject).getText().getDiv());
|
||||
root.addChildNode(((DomainResource) subject).getText().getDiv());
|
||||
}
|
||||
List<SectionComponent> sections = comp.getSection();
|
||||
renderSections(feed, root, sections, 1);
|
||||
|
@ -3022,7 +3022,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
// node.addTag("h"+Integer.toString(level)).addText(displayCodeableConcept(section.getCode()));
|
||||
|
||||
// if (section.hasText()) {
|
||||
// node.getChildNodes().add(section.getText().getDiv());
|
||||
// node.addChildNode(section.getText().getDiv());
|
||||
// }
|
||||
//
|
||||
// if (!section.getSection().isEmpty()) {
|
||||
|
|
|
@ -1151,9 +1151,9 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
XhtmlNode div = res.getNarrative();
|
||||
if (div != null) {
|
||||
if (div.allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes());
|
||||
if (div.getChildNodes().size() == 1 && div.getChildNodes().get(0).allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes().get(0).getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes().get(0).getChildNodes());
|
||||
}
|
||||
x.addText("Generated Summary: ");
|
||||
}
|
||||
|
@ -1920,7 +1920,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
} else {
|
||||
XhtmlNode n = r.getText().getDiv();
|
||||
n.addTag("hr");
|
||||
n.getChildNodes().addAll(x.getChildNodes());
|
||||
n.addChildNodes(x.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2990,7 +2990,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
} catch (org.hl7.fhir.exceptions.FHIRFormatError e) {
|
||||
throw new FHIRFormatError(e.getMessage(), e);
|
||||
}
|
||||
x.getChildNodes().addAll(m.getChildNodes());
|
||||
x.addChildNodes(m.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3101,11 +3101,11 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
*/
|
||||
XhtmlNode root = new XhtmlNode(NodeType.Element, "div");
|
||||
Composition comp = (Composition) feed.getEntry().get(0).getResource();
|
||||
root.getChildNodes().add(comp.getText().getDiv());
|
||||
root.addChildNode(comp.getText().getDiv());
|
||||
Resource subject = ResourceUtilities.getById(feed, null, comp.getSubject().getReference());
|
||||
if (subject != null && subject instanceof DomainResource) {
|
||||
root.addTag("hr");
|
||||
root.getChildNodes().add(((DomainResource) subject).getText().getDiv());
|
||||
root.addChildNode(((DomainResource) subject).getText().getDiv());
|
||||
}
|
||||
List<SectionComponent> sections = comp.getSection();
|
||||
renderSections(feed, root, sections, 1);
|
||||
|
@ -3121,7 +3121,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
// node.addTag("h"+Integer.toString(level)).addText(displayCodeableConcept(section.getCode()));
|
||||
|
||||
// if (section.hasText()) {
|
||||
// node.getChildNodes().add(section.getText().getDiv());
|
||||
// node.addChildNode(section.getText().getDiv());
|
||||
// }
|
||||
//
|
||||
// if (!section.getSection().isEmpty()) {
|
||||
|
|
|
@ -1537,9 +1537,9 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
XhtmlNode div = res.getNarrative();
|
||||
if (div != null) {
|
||||
if (div.allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes());
|
||||
if (div.getChildNodes().size() == 1 && div.getChildNodes().get(0).allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes().get(0).getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes().get(0).getChildNodes());
|
||||
}
|
||||
x.tx("Generated Summary: ");
|
||||
}
|
||||
|
@ -2304,7 +2304,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
} else {
|
||||
XhtmlNode n = r.getText().getDiv();
|
||||
n.hr();
|
||||
n.getChildNodes().addAll(x.getChildNodes());
|
||||
n.addChildNodes(x.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3704,7 +3704,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
public boolean generate(ResourceContext rcontext, StructureDefinition sd, java.util.Set<String> outputTracker) throws EOperationOutcome, FHIRException, IOException {
|
||||
ProfileUtilities pu = new ProfileUtilities(context, null, pkp);
|
||||
XhtmlNode x = new XhtmlNode(NodeType.Element, "div");
|
||||
x.getChildNodes().add(pu.generateTable(definitionsTarget, sd, true, destDir, false, sd.getId(), false, corePath, "", false, false, outputTracker));
|
||||
x.addChildNode(pu.generateTable(definitionsTarget, sd, true, destDir, false, sd.getId(), false, corePath, "", false, false, outputTracker));
|
||||
inject(sd, x, NarrativeStatus.GENERATED);
|
||||
return true;
|
||||
}
|
||||
|
@ -3808,7 +3808,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
} catch (org.hl7.fhir.exceptions.FHIRFormatError e) {
|
||||
throw new FHIRFormatError(e.getMessage(), e);
|
||||
}
|
||||
x.getChildNodes().addAll(m.getChildNodes());
|
||||
x.addChildNodes(m.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3925,11 +3925,11 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
*/
|
||||
XhtmlNode root = new XhtmlNode(NodeType.Element, "div");
|
||||
Composition comp = (Composition) feed.getEntry().get(0).getResource();
|
||||
root.getChildNodes().add(comp.getText().getDiv());
|
||||
root.addChildNode(comp.getText().getDiv());
|
||||
Resource subject = ResourceUtilities.getById(feed, null, comp.getSubject().getReference());
|
||||
if (subject != null && subject instanceof DomainResource) {
|
||||
root.hr();
|
||||
root.getChildNodes().add(((DomainResource)subject).getText().getDiv());
|
||||
root.addChildNode(((DomainResource)subject).getText().getDiv());
|
||||
}
|
||||
List<SectionComponent> sections = comp.getSection();
|
||||
renderSections(feed, root, sections, 1);
|
||||
|
@ -3945,7 +3945,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
// node.addTag("h"+Integer.toString(level)).addText(displayCodeableConcept(section.getCode()));
|
||||
|
||||
// if (section.hasText()) {
|
||||
// node.getChildNodes().add(section.getText().getDiv());
|
||||
// node.addChildNode(section.getText().getDiv());
|
||||
// }
|
||||
//
|
||||
// if (!section.getSection().isEmpty()) {
|
||||
|
@ -4218,7 +4218,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
if (be.hasResource() && be.getResource() instanceof DomainResource) {
|
||||
DomainResource dr = (DomainResource) be.getResource();
|
||||
if ( dr.getText().hasDiv())
|
||||
root.blockquote().getChildNodes().addAll(dr.getText().getDiv().getChildNodes());
|
||||
root.blockquote().addChildNodes(dr.getText().getDiv().getChildNodes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4272,7 +4272,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
for (Base b : element.listChildrenByName("entry")) {
|
||||
XhtmlNode c = getHtmlForResource(((org.hl7.fhir.dstu3.elementmodel.Element) b).getNamedChild("resource"));
|
||||
if (c != null)
|
||||
root.getChildNodes().addAll(c.getChildNodes());
|
||||
root.addChildNodes(c.getChildNodes());
|
||||
root.hr();
|
||||
}
|
||||
return root;
|
||||
|
|
|
@ -340,6 +340,7 @@ public class Narrative extends BaseNarrative implements INarrative {
|
|||
children.add(new Property("status", "code",
|
||||
"The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.",
|
||||
0, 1, status));
|
||||
children.add(new Property("div", "xhtml", "The actual narrative content, a stripped down version of XHTML", 0, 1, new XhtmlType(this)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1722,9 +1722,9 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
XhtmlNode div = res.getNarrative();
|
||||
if (div != null) {
|
||||
if (div.allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes());
|
||||
if (div.getChildNodes().size() == 1 && div.getChildNodes().get(0).allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes().get(0).getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes().get(0).getChildNodes());
|
||||
}
|
||||
x.tx("Generated Summary: ");
|
||||
}
|
||||
|
@ -2596,7 +2596,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
} else {
|
||||
XhtmlNode n = r.getText().getDiv();
|
||||
n.hr();
|
||||
n.getChildNodes().addAll(x.getChildNodes());
|
||||
n.addChildNodes(x.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4230,7 +4230,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
throws EOperationOutcome, FHIRException, IOException {
|
||||
ProfileUtilities pu = new ProfileUtilities(context, null, pkp);
|
||||
XhtmlNode x = new XhtmlNode(NodeType.Element, "div");
|
||||
x.getChildNodes().add(pu.generateTable(definitionsTarget, sd, true, destDir, false, sd.getId(), false, corePath, "",
|
||||
x.addChildNode(pu.generateTable(definitionsTarget, sd, true, destDir, false, sd.getId(), false, corePath, "",
|
||||
false, false, outputTracker));
|
||||
inject(sd, x, NarrativeStatus.GENERATED);
|
||||
return true;
|
||||
|
@ -4362,7 +4362,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
} catch (org.hl7.fhir.exceptions.FHIRFormatError e) {
|
||||
throw new FHIRFormatError(e.getMessage(), e);
|
||||
}
|
||||
x.getChildNodes().addAll(m.getChildNodes());
|
||||
x.addChildNodes(m.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4511,11 +4511,11 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
*/
|
||||
XhtmlNode root = new XhtmlNode(NodeType.Element, "div");
|
||||
Composition comp = (Composition) feed.getEntry().get(0).getResource();
|
||||
root.getChildNodes().add(comp.getText().getDiv());
|
||||
root.addChildNode(comp.getText().getDiv());
|
||||
Resource subject = ResourceUtilities.getById(feed, null, comp.getSubject().getReference());
|
||||
if (subject != null && subject instanceof DomainResource) {
|
||||
root.hr();
|
||||
root.getChildNodes().add(((DomainResource) subject).getText().getDiv());
|
||||
root.addChildNode(((DomainResource) subject).getText().getDiv());
|
||||
}
|
||||
List<SectionComponent> sections = comp.getSection();
|
||||
renderSections(feed, root, sections, 1);
|
||||
|
@ -4531,7 +4531,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
// node.addTag("h"+Integer.toString(level)).addText(displayCodeableConcept(section.getCode()));
|
||||
|
||||
// if (section.hasText()) {
|
||||
// node.getChildNodes().add(section.getText().getDiv());
|
||||
// node.addChildNode(section.getText().getDiv());
|
||||
// }
|
||||
//
|
||||
// if (!section.getSection().isEmpty()) {
|
||||
|
@ -4807,7 +4807,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
if (be.hasResource() && be.getResource() instanceof DomainResource) {
|
||||
DomainResource dr = (DomainResource) be.getResource();
|
||||
if (dr.getText().hasDiv())
|
||||
root.blockquote().getChildNodes().addAll(dr.getText().getDiv().getChildNodes());
|
||||
root.blockquote().addChildNodes(dr.getText().getDiv().getChildNodes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4863,7 +4863,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
if (r != null) {
|
||||
XhtmlNode c = getHtmlForResource(r);
|
||||
if (c != null)
|
||||
root.getChildNodes().addAll(c.getChildNodes());
|
||||
root.addChildNodes(c.getChildNodes());
|
||||
root.hr();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -348,6 +348,7 @@ public class Narrative extends BaseNarrative implements INarrative {
|
|||
children.add(new Property("status", "code",
|
||||
"The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.",
|
||||
0, 1, status));
|
||||
children.add(new Property("div", "xhtml", "The actual narrative content, a stripped down version of XHTML", 0, 1, new XhtmlType(this)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -318,7 +318,7 @@ public class BundleRenderer extends ResourceRenderer {
|
|||
xn = makeExceptionXhtml(e, "generating narrative");
|
||||
}
|
||||
}
|
||||
root.blockquote().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes()));
|
||||
root.blockquote().addChildNodes(checkInternalLinks(b, xn.getChildNodes()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class CompartmentDefinitionRenderer extends ResourceRenderer {
|
|||
+ "<p>\r\nA resource is in this compartment if the nominated search parameter (or chain) refers to the patient resource that defines the compartment.\r\n</p>\r\n"
|
||||
+ "<p>\r\n\r\n</p>\r\n" + "<p>\r\nThe following resources are never in this compartment:\r\n</p>\r\n"
|
||||
+ "<ul>\r\n" + out.toString() + "</ul></div>\r\n");
|
||||
x.getChildNodes().addAll(xn.getChildNodes());
|
||||
x.addChildNodes(xn.getChildNodes());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ public class DataRenderer extends Renderer {
|
|||
} catch (org.hl7.fhir.exceptions.FHIRFormatError e) {
|
||||
throw new FHIRFormatError(e.getMessage(), e);
|
||||
}
|
||||
x.getChildNodes().addAll(m.getChildNodes());
|
||||
x.addChildNodes(m.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class LiquidRenderer extends ResourceRenderer {
|
|||
xn = new XhtmlNode(NodeType.Element, "div");
|
||||
xn.para().b().style("color: maroon").tx("Exception generating Narrative: " + e.getMessage());
|
||||
}
|
||||
x.getChildNodes().addAll(xn.getChildNodes());
|
||||
x.addChildNodes(xn.getChildNodes());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class LiquidRenderer extends ResourceRenderer {
|
|||
xn = new XhtmlNode(NodeType.Element, "div");
|
||||
xn.para().b().style("color: maroon").tx("Exception generating Narrative: " + e.getMessage());
|
||||
}
|
||||
x.getChildNodes().addAll(xn.getChildNodes());
|
||||
x.addChildNodes(xn.getChildNodes());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -239,9 +239,9 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
|
|||
XhtmlNode div = res.getNarrative();
|
||||
if (div != null) {
|
||||
if (div.allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes());
|
||||
if (div.getChildNodes().size() == 1 && div.getChildNodes().get(0).allChildrenAreText())
|
||||
x.getChildNodes().addAll(div.getChildNodes().get(0).getChildNodes());
|
||||
x.addChildNodes(div.getChildNodes().get(0).getChildNodes());
|
||||
}
|
||||
x.tx("Generated Summary: ");
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
|
|||
hasExt = renderTreeItem(gen, row.getSubRows(), q, i, hasFlags) || hasExt;
|
||||
}
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
if (doOpts) {
|
||||
renderOptions(q, x);
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
|
|||
}
|
||||
}
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
return hasExt;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
|
|||
hasExt = renderTreeItem(gen, row.getSubRows(), qr, i) || hasExt;
|
||||
}
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
return hasExt;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
|
|||
hasExt = renderTreeItem(gen, row.getSubRows(), q, i) || hasExt;
|
||||
}
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
return hasExt;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ public abstract class ResourceRenderer extends DataRenderer {
|
|||
} else {
|
||||
XhtmlNode n = r.getText().getDiv();
|
||||
n.clear();
|
||||
n.getChildNodes().addAll(x.getChildNodes());
|
||||
n.addChildNodes(x.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ public class Narrative extends BaseNarrative implements INarrative {
|
|||
protected void listChildren(List<Property> children) {
|
||||
super.listChildren(children);
|
||||
children.add(new Property("status", "code", "The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.", 0, 1, status));
|
||||
children.add(new Property("div", "xhtml", "he actual narrative content, a stripped down version of XHTML", 0, 1, new XhtmlType(this)));
|
||||
children.add(new Property("div", "xhtml", "The actual narrative content, a stripped down version of XHTML", 0, 1, new XhtmlType(this)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -52,7 +52,8 @@ public class ActorDefinitionRenderer extends ResourceRenderer {
|
|||
}
|
||||
}
|
||||
if (acd.has("capabilities")) {
|
||||
tbl.tr().td().tx(context.formatPhrase(RenderingContext.ACTOR_DEF_CAP));
|
||||
tr = tbl.tr();
|
||||
tr.td().tx(context.formatPhrase(RenderingContext.ACTOR_DEF_CAP));
|
||||
td = tr.td().colspan("2");
|
||||
renderCanonical(status, td, acd.child("capabilities"));
|
||||
}
|
||||
|
|
|
@ -60,12 +60,18 @@ public class BundleRenderer extends ResourceRenderer {
|
|||
for (ResourceWrapper be : entries) {
|
||||
i++;
|
||||
if (i >= start) {
|
||||
String link = null;
|
||||
if (be.has("fullUrl")) {
|
||||
root.an(context.prefixAnchor(makeInternalBundleLink(b, be.primitiveValue("fullUrl"))));
|
||||
link = makeInternalBundleLink(b, be.primitiveValue("fullUrl"));
|
||||
if (!context.hasAnchor(link)) {
|
||||
context.addAnchor(link);
|
||||
root.an(context.prefixAnchor(link));
|
||||
}
|
||||
}
|
||||
ResourceWrapper res = be.child("resource");
|
||||
if (be.has("resource")) {
|
||||
String id = be.child("resource").has("id") ? be.child("resource").primitiveValue("id") : makeIdFromBundleEntry(be.primitiveValue("fullUrl"));
|
||||
String anchor = be.child("resource").fhirType() + "_" + id;
|
||||
String id = res.has("id") ? res.primitiveValue("id") : makeIdFromBundleEntry(be.primitiveValue("fullUrl"));
|
||||
String anchor = res.fhirType() + "_" + id;
|
||||
if (id != null && !context.hasAnchor(anchor)) {
|
||||
context.addAnchor(anchor);
|
||||
root.an(context.prefixAnchor(anchor));
|
||||
|
@ -75,6 +81,23 @@ public class BundleRenderer extends ResourceRenderer {
|
|||
context.addAnchor(anchor);
|
||||
root.an(context.prefixAnchor(anchor));
|
||||
}
|
||||
String ver = res.has("meta") ? res.child("meta").primitiveValue("version") : null;
|
||||
if (ver != null) {
|
||||
if (link != null) {
|
||||
link = link + "/"+ver;
|
||||
if (!context.hasAnchor(link)) {
|
||||
context.addAnchor(link);
|
||||
root.an(context.prefixAnchor(link));
|
||||
}
|
||||
}
|
||||
if (id != null) {
|
||||
anchor = anchor + "/"+ver;
|
||||
if (!context.hasAnchor(anchor)) {
|
||||
context.addAnchor(anchor);
|
||||
root.an(context.prefixAnchor(anchor));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
root.hr();
|
||||
if (be.has("fullUrl")) {
|
||||
|
@ -92,7 +115,7 @@ public class BundleRenderer extends ResourceRenderer {
|
|||
// if (be.hasResponse())
|
||||
// renderResponse(root, be.getResponse());
|
||||
if (be.has("resource")) {
|
||||
ResourceWrapper r = be.child("resource");
|
||||
ResourceWrapper r = res;
|
||||
root.para().addText(formatPhrase(RenderingContext.BUNDLE_RESOURCE, r.fhirType()));
|
||||
XhtmlNode xn = r.getNarrative();
|
||||
if (xn == null || xn.isEmpty()) {
|
||||
|
|
|
@ -63,7 +63,7 @@ public class CompartmentDefinitionRenderer extends ResourceRenderer {
|
|||
"<ul>\r\n"+
|
||||
out.toString()+
|
||||
"</ul></div>\r\n");
|
||||
x.getChildNodes().addAll(xn.getChildNodes());
|
||||
x.addChildNodes(xn.getChildNodes());
|
||||
}
|
||||
|
||||
public void describe(XhtmlNode x, CompartmentDefinition cd) {
|
||||
|
|
|
@ -164,7 +164,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
|
|||
} catch (org.hl7.fhir.exceptions.FHIRFormatError e) {
|
||||
throw new FHIRFormatError(e.getMessage(), e);
|
||||
}
|
||||
x.getChildNodes().addAll(m.getChildNodes());
|
||||
x.addChildNodes(m.getChildNodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,6 +585,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
|
|||
case "Annotation": return displayAnnotation(type);
|
||||
case "Ratio": return displayRatio(type);
|
||||
case "Reference" : return displayReference(type);
|
||||
case "Money" : return displayMoney(type);
|
||||
case "dateTime":
|
||||
case "date" :
|
||||
case "instant" :
|
||||
|
@ -594,12 +595,20 @@ public class DataRenderer extends Renderer implements CodeResolver {
|
|||
return context.getTranslated(type);
|
||||
} else if (Utilities.existsInList(type.fhirType(), "Meta", "Dosage", "Signature", "UsageContext", "RelatedArtifact", "ElementDefinition", "Base64BinaryType", "Attachment")) {
|
||||
return "";
|
||||
} else if ("Extension".equals(type.fhirType())) {
|
||||
return displayDataType(type.child("value"));
|
||||
} else {
|
||||
return (context.formatPhrase(RenderingContext.DATA_REND_NO_DISP, type.fhirType()) + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String displayMoney(ResourceWrapper type) {
|
||||
String currency = type.primitiveValue("currency");
|
||||
String value = type.primitiveValue("value");
|
||||
return context.formatPhrase(RenderingContext.DATA_REND_CURRENCY, currency, value);
|
||||
}
|
||||
|
||||
private String displayAnnotation(ResourceWrapper type) {
|
||||
return type.primitiveValue("text");
|
||||
}
|
||||
|
@ -781,6 +790,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
|
|||
renderContactPoint(status, x, type);
|
||||
break;
|
||||
case "Quantity":
|
||||
case "Age":
|
||||
renderQuantity(status, x, type);
|
||||
break;
|
||||
case "Range":
|
||||
|
|
|
@ -78,7 +78,7 @@ public class LiquidRenderer extends ResourceRenderer implements ILiquidRendering
|
|||
xn = new XhtmlNode(NodeType.Element, "div");
|
||||
xn.para().b().style("color: maroon").tx("Exception generating Narrative: "+e.getMessage());
|
||||
}
|
||||
x.getChildNodes().addAll(xn.getChildNodes());
|
||||
x.addChildNodes(xn.getChildNodes());
|
||||
status.setExtensions(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,18 @@ public class ParametersRenderer extends ResourceRenderer {
|
|||
td = tr.td();
|
||||
XhtmlNode para = td.para();
|
||||
para.tx(rw.fhirType()+"/"+rw.getId());
|
||||
para.an(context.prefixAnchor(rw.fhirType()+"_"+rw.getId())).tx(" ");
|
||||
para.an(context.prefixAnchor("hc"+rw.fhirType()+"_"+rw.getId())).tx(" ");
|
||||
checkAddLink(para, rw.fhirType()+"_"+rw.getId());
|
||||
checkAddLink(para, rw.fhirType()+"_"+rw.getScopedId());
|
||||
checkAddLink(para, "hc"+rw.fhirType()+"_"+rw.getId());
|
||||
checkAddLink(para, "hc"+rw.fhirType()+"_"+rw.getScopedId());
|
||||
if (rw.has("meta")) {
|
||||
ResourceWrapper m = rw.child("meta");
|
||||
String ver = m.primitiveValue("version");
|
||||
if (ver != null) {
|
||||
checkAddLink(para, "hc"+rw.fhirType()+"_"+rw.getId()+"/"+ver);
|
||||
checkAddLink(para, "hc"+rw.fhirType()+"_"+rw.getScopedId()+"/"+ver);
|
||||
}
|
||||
}
|
||||
XhtmlNode x = rw.getNarrative();
|
||||
if (x != null) {
|
||||
td.addChildren(x);
|
||||
|
@ -82,4 +92,14 @@ public class ParametersRenderer extends ResourceRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void checkAddLink(XhtmlNode para, String anchor) {
|
||||
if (!context.hasAnchor(anchor)) {
|
||||
context.addAnchor(anchor);
|
||||
para.an(context.prefixAnchor(anchor)).tx(" ");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -236,7 +236,11 @@ public class PatientRenderer extends ResourceRenderer {
|
|||
private void addContained(RenderingStatus status, XhtmlNode x, List<ResourceWrapper> list) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome {
|
||||
for (ResourceWrapper c : list) {
|
||||
x.hr();
|
||||
x.an(context.prefixAnchor(c.getId()));
|
||||
String id = c.getScopedId();
|
||||
if (!context.hasAnchor(id)) {
|
||||
context.addAnchor(id);
|
||||
x.an(context.prefixAnchor(id));
|
||||
}
|
||||
RendererFactory.factory(c, context.forContained()).buildNarrative(status, x, c);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,15 +173,21 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
|
|||
} else if (!renderDataType(status, parent, x, ew)) {
|
||||
// well, we have a cell (x) to render this thing, whatever it is
|
||||
// it's not a data type for which we have a built rendering, so we're going to get a list of it's renderable datatype properties, and render them in a list
|
||||
XhtmlNode ul = x.ul();
|
||||
SourcedChildDefinitions childDefs = context.getProfileUtilities().getChildMap(sd, defn);
|
||||
boolean first = true;
|
||||
x.tx(" (");
|
||||
for (ResourceWrapper child : ew.children()) {
|
||||
// ElementDefinition childDefn = getElementDefinition(childDefs.getList(), child.name());
|
||||
if (child != null && !"Extension".equals(child.fhirType()) && canRenderDataType(child.fhirType())) {
|
||||
XhtmlNode li = ul.li();
|
||||
li.tx(context.formatMessage(RenderingContext.GENERAL_DATA_DISPLAY_PROPERTY, child.name(), displayDataType(child)));
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
x.tx("; ");
|
||||
}
|
||||
x.tx(context.formatMessage(RenderingContext.GENERAL_DATA_DISPLAY_PROPERTY, child.name(), displayDataType(child)));
|
||||
}
|
||||
}
|
||||
x.tx(")");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
|
|||
renderTreeItem(status, gen, row.getSubRows(), q, i, hasFlags);
|
||||
}
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
if (doOpts) {
|
||||
renderOptions(q, x);
|
||||
}
|
||||
|
@ -133,40 +133,28 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
|
|||
|
||||
public void renderItemOptions(XhtmlNode x, ResourceWrapper i) {
|
||||
if (i.has("answerOption")) {
|
||||
boolean useSelect = false;
|
||||
assert x.getName().equals("select");
|
||||
for (ResourceWrapper opt : i.children("answerOption")) {
|
||||
useSelect = useSelect || "true".equals(opt.primitiveValue("initialSelected"));
|
||||
}
|
||||
x.an(context.prefixAnchor("opt-item."+i.primitiveValue("linkId")));
|
||||
x.para().b().tx(context.formatPhrase(RenderingContext.QUEST_ANSW, i.primitiveValue("linkId"))+" ");
|
||||
XhtmlNode ul = x.ul();
|
||||
for (ResourceWrapper opt : i.children("answerOption")) {
|
||||
XhtmlNode li = ul.li();
|
||||
li.style("font-size: 11px");
|
||||
if (useSelect) {
|
||||
if ("true".equals(opt.primitiveValue("initialSelected"))) {
|
||||
li.img("icon-selected.png", "icon");
|
||||
} else {
|
||||
li.img("icon-not-selected.png", "icon");
|
||||
}
|
||||
}
|
||||
String value = "??";
|
||||
String text = "??";
|
||||
ResourceWrapper v = opt.child("value");
|
||||
if (v.isPrimitive()) {
|
||||
li.tx(v.primitiveValue());
|
||||
} else if (v.fhirType().equals("Coding")) {
|
||||
String link = v.has("system") ? new ContextUtilities(context.getWorker()).getLinkForUrl(context.getLink(KnownLinkType.SPEC), v.primitiveValue("system")) : null;
|
||||
if (link == null) {
|
||||
li.tx(v.primitiveValue("system")+"#"+v.primitiveValue("code"));
|
||||
} else {
|
||||
li.ah(link).tx(displaySystem(v.primitiveValue("system")));
|
||||
li.tx(": "+v.primitiveValue("code"));
|
||||
}
|
||||
if (v.isPrimitive()) {
|
||||
value = v.primitiveValue();
|
||||
text = v.primitiveValue();
|
||||
} else if (v.fhirType().equals("Coding")) {
|
||||
if (v.has("system")) {
|
||||
value = v.primitiveValue("system")+"#"+v.primitiveValue("code");
|
||||
} else {
|
||||
value = v.primitiveValue("code");
|
||||
}
|
||||
if (v.has("display")) {
|
||||
li.tx(" (\""+v.primitiveValue("display")+"\")");
|
||||
}
|
||||
} else {
|
||||
li.tx("??");
|
||||
}
|
||||
text = v.primitiveValue("display");
|
||||
} else {
|
||||
text = v.primitiveValue("code");
|
||||
}
|
||||
}
|
||||
boolean selected = "true".equals(opt.primitiveValue("initialSelected"));
|
||||
x.option(value, text, selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -513,7 +501,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
|
|||
}
|
||||
}
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
}
|
||||
|
||||
private void renderLogicItem(RenderingStatus status, HierarchicalTableGenerator gen, List<Row> rows, ResourceWrapper q, ResourceWrapper i) throws IOException {
|
||||
|
|
|
@ -86,7 +86,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
|
|||
renderTreeItem(status, gen, row.getSubRows(), qr, i);
|
||||
}
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
}
|
||||
|
||||
private Row addTreeRoot(HierarchicalTableGenerator gen, List<Row> rows, ResourceWrapper qr) throws IOException {
|
||||
|
|
|
@ -111,7 +111,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
if (context.getStructureMode() == StructureDefinitionRendererMode.DATA_DICT) {
|
||||
renderDict(status, sd, sd.getDifferential().getElement(), x.table("dict"), false, GEN_MODE_DIFF, "", r);
|
||||
} else {
|
||||
x.getChildNodes().add(generateTable(status, context.getDefinitionsTarget(), sd, true, context.getDestDir(), false, sd.getId(), false,
|
||||
x.addChildNode(generateTable(status, context.getDefinitionsTarget(), sd, true, context.getDestDir(), false, sd.getId(), false,
|
||||
context.getLink(KnownLinkType.SPEC), "", sd.getKind() == StructureDefinitionKind.LOGICAL, false, null, false, context.withUniqueLocalPrefix(null), "r", r));
|
||||
}
|
||||
status.setExtensions(true);
|
||||
|
@ -3679,7 +3679,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
if (x1 == null) {
|
||||
return false;
|
||||
} else {
|
||||
x.getChildNodes().addAll(x1.getChildNodes());
|
||||
x.addChildNodes(x1.getChildNodes());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1038,7 +1038,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
x.br();
|
||||
x.tx("table");
|
||||
XhtmlNode xn = gen.generate(model, context.getLocalPrefix(), 1, null);
|
||||
x.getChildNodes().add(xn);
|
||||
x.addChildNode(xn);
|
||||
}
|
||||
|
||||
private void renderExpandGroup(HierarchicalTableGenerator gen, TableModel model, Extension ext, ConceptSetComponent inc, Map<String, ConceptDefinitionComponent> definitions) {
|
||||
|
|
|
@ -297,7 +297,7 @@ public class RenderingContext extends RenderingI18nContext {
|
|||
}
|
||||
}
|
||||
|
||||
public RenderingContext copy() {
|
||||
public RenderingContext copy(boolean copyAnchors) {
|
||||
RenderingContext res = new RenderingContext(worker, markdown, terminologyServiceOptions, getLink(KnownLinkType.SPEC), localPrefix, locale, mode, rules);
|
||||
|
||||
res.resolver = resolver;
|
||||
|
@ -339,6 +339,9 @@ public class RenderingContext extends RenderingI18nContext {
|
|||
res.typeMap.putAll(typeMap);
|
||||
res.multiLanguagePolicy = multiLanguagePolicy;
|
||||
res.allowedLanguages.addAll(allowedLanguages);
|
||||
if (copyAnchors) {
|
||||
res.anchors = anchors;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -994,13 +997,13 @@ public class RenderingContext extends RenderingI18nContext {
|
|||
}
|
||||
|
||||
public RenderingContext withUniqueLocalPrefix(String uniqueLocalPrefix) {
|
||||
RenderingContext self = this.copy();
|
||||
RenderingContext self = this.copy(true);
|
||||
self.uniqueLocalPrefix = uniqueLocalPrefix;
|
||||
return self;
|
||||
}
|
||||
|
||||
public RenderingContext forContained() {
|
||||
RenderingContext self = this.copy();
|
||||
RenderingContext self = this.copy(true);
|
||||
self.contained = true;
|
||||
return self;
|
||||
}
|
||||
|
@ -1016,4 +1019,8 @@ public class RenderingContext extends RenderingI18nContext {
|
|||
public Set<String> getAnchors() {
|
||||
return anchors;
|
||||
}
|
||||
|
||||
public void clearAnchors() {
|
||||
anchors.clear();
|
||||
}
|
||||
}
|
|
@ -79,21 +79,21 @@ public class ResourceWrapperModel extends ResourceWrapper {
|
|||
return ElementKind.DataType;
|
||||
} else if (!child.isResource()) {
|
||||
return ElementKind.BackboneElement;
|
||||
} else if (parent == null) {
|
||||
return ElementKind.IndependentResource;
|
||||
} else switch (child.getSpecial()) {
|
||||
case BUNDLE_ENTRY:
|
||||
return ElementKind.BundleEntry;
|
||||
case BUNDLE_ISSUES:
|
||||
return ElementKind.InlineResource;
|
||||
case BUNDLE_OUTCOME:
|
||||
return ElementKind.InlineResource;
|
||||
case CONTAINED:
|
||||
return ElementKind.ContainedResource;
|
||||
case PARAMETER:
|
||||
return ElementKind.InlineResource;
|
||||
default:
|
||||
return ElementKind.IndependentResource;
|
||||
} else {
|
||||
switch (child.getSpecial()) {
|
||||
case BUNDLE_ENTRY:
|
||||
return ElementKind.BundleEntry;
|
||||
case BUNDLE_ISSUES:
|
||||
return ElementKind.InlineResource;
|
||||
case BUNDLE_OUTCOME:
|
||||
return ElementKind.InlineResource;
|
||||
case CONTAINED:
|
||||
return ElementKind.ContainedResource;
|
||||
case PARAMETER:
|
||||
return ElementKind.InlineResource;
|
||||
default:
|
||||
return ElementKind.IndependentResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ public class ResourceWrapperModel extends ResourceWrapper {
|
|||
xd.getChildNodes().removeIf(c -> !"div".equals(c.getName()) || !c.hasAttribute("xml:lang"));
|
||||
}
|
||||
markLanguage(x, locale);
|
||||
xd.getChildNodes().add(x);
|
||||
xd.addChildNode(x);
|
||||
} else {
|
||||
if (!x.hasAttribute("xmlns")) {
|
||||
x.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
||||
|
|
|
@ -86,8 +86,6 @@ public class ResourceWrapperNative extends ResourceWrapper {
|
|||
return ElementKind.DataType;
|
||||
} else if (!v.isResource()) {
|
||||
return ElementKind.BackboneElement;
|
||||
} else if (parent == null) {
|
||||
return ElementKind.IndependentResource;
|
||||
} else if ("Bundle.entry".equals(fhirType()) && "resource".equals(p.getName())) {
|
||||
return ElementKind.BundleEntry;
|
||||
} else if ("Bundle".equals(fhirType()) && "outcome".equals(p.getName())) {
|
||||
|
@ -159,7 +157,7 @@ public class ResourceWrapperNative extends ResourceWrapper {
|
|||
r.getText().getDiv().getChildNodes().removeIf(c -> !"div".equals(c.getName()) || !c.hasAttribute("xml:lang"));
|
||||
}
|
||||
markLanguage(x, locale);
|
||||
r.getText().getDiv().getChildNodes().add(x);
|
||||
r.getText().getDiv().addChildNode(x);
|
||||
} else {
|
||||
if (!x.hasAttribute("xmlns"))
|
||||
x.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
||||
|
|
|
@ -233,6 +233,7 @@ public class NarrativeGenerationTests {
|
|||
@ParameterizedTest(name = "{index}: file {0}")
|
||||
@MethodSource("data")
|
||||
public void test(String id, TestDetails test) throws Exception {
|
||||
XhtmlNode.setCheckPara(true);
|
||||
if (test.getRegister() != null) {
|
||||
if (test.getRegister().endsWith(".json")) {
|
||||
context.cacheResource(new JsonParser().parse(TestingUtilities.loadTestResourceStream("r5", "narrative", test.getRegister())));
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.hl7.fhir.r5.test.rendering;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -13,6 +14,7 @@ import org.hl7.fhir.r5.context.IWorkerContext;
|
|||
import org.hl7.fhir.r5.elementmodel.Manager;
|
||||
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
|
||||
import org.hl7.fhir.r5.elementmodel.ValidatedFragment;
|
||||
import org.hl7.fhir.r5.formats.JsonParser;
|
||||
import org.hl7.fhir.r5.formats.XmlParser;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.renderers.utils.ResourceWrapper;
|
||||
|
@ -24,21 +26,70 @@ import org.junit.jupiter.api.Test;
|
|||
public class ResourceElementTests {
|
||||
|
||||
@Test
|
||||
public void testDirect() throws FHIRFormatError, IOException {
|
||||
public void testDirectBundleXml() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
Resource res = new XmlParser().parse(TestingUtilities.loadTestResource("r5", "bundle-resource-element-test.xml"));
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res);
|
||||
checkTree(re);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIndirect() throws FHIRFormatError, IOException {
|
||||
public void testIndirectBundleXml() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
List<ValidatedFragment> res = Manager.parse(worker, TestingUtilities.loadTestResourceStream("r5", "bundle-resource-element-test.xml"), FhirFormat.XML);
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res.get(0).getElement());
|
||||
checkTree(re);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testDirectBundleJson() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
Resource res = new JsonParser().parse(TestingUtilities.loadTestResource("r5", "bundle-resource-element-test.json"));
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res);
|
||||
checkTree(re); }
|
||||
|
||||
@Test
|
||||
public void testIndirectBundleJson() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
List<ValidatedFragment> res = Manager.parse(worker, TestingUtilities.loadTestResourceStream("r5", "bundle-resource-element-test.json"), FhirFormat.JSON);
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res.get(0).getElement());
|
||||
checkTree(re);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDirectObservationXml() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
Resource res = new XmlParser().parse(TestingUtilities.loadTestResource("r5", "obs-resource-element-test.xml"));
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res);
|
||||
checkObservation(re, false, "Observation");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIndirectObservationXml() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
List<ValidatedFragment> res = Manager.parse(worker, TestingUtilities.loadTestResourceStream("r5", "obs-resource-element-test.xml"), FhirFormat.XML);
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res.get(0).getElement());
|
||||
checkObservation(re, false, "Observation");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testDirectObservationJson() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
Resource res = new JsonParser().parse(TestingUtilities.loadTestResource("r5", "obs-resource-element-test.json"));
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res);
|
||||
checkObservation(re, false, "Observation");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIndirectObservationJson() throws FHIRFormatError, IOException {
|
||||
IWorkerContext worker = TestingUtilities.getSharedWorkerContext();
|
||||
List<ValidatedFragment> res = Manager.parse(worker, TestingUtilities.loadTestResourceStream("r5", "obs-resource-element-test.json"), FhirFormat.JSON);
|
||||
ResourceWrapper re = ResourceWrapper.forResource(new ContextUtilities(worker), res.get(0).getElement());
|
||||
checkObservation(re, false, "Observation");
|
||||
}
|
||||
|
||||
private void checkTree(ResourceWrapper bnd) {
|
||||
Assertions.assertTrue(bnd.fhirType().equals("Bundle"));
|
||||
Assertions.assertNull(bnd.name());
|
||||
|
@ -48,7 +99,7 @@ public class ResourceElementTests {
|
|||
Assertions.assertFalse(bnd.canHaveNarrative());
|
||||
Assertions.assertFalse(bnd.hasNarrative());
|
||||
Assertions.assertEquals(ElementKind.IndependentResource, bnd.kind());
|
||||
|
||||
|
||||
ResourceWrapper type = bnd.child("type");
|
||||
Assertions.assertTrue(type.fhirType().equals("code"));
|
||||
Assertions.assertEquals("type", type.name());
|
||||
|
@ -58,7 +109,7 @@ public class ResourceElementTests {
|
|||
Assertions.assertEquals("collection", type.primitiveValue());
|
||||
Assertions.assertFalse(type.hasChildren());
|
||||
Assertions.assertEquals(ElementKind.PrimitiveType, type.kind());
|
||||
|
||||
|
||||
ResourceWrapper id = bnd.child("identifier");
|
||||
Assertions.assertEquals("Identifier", id.fhirType());
|
||||
Assertions.assertEquals("identifier", id.name());
|
||||
|
@ -114,56 +165,56 @@ public class ResourceElementTests {
|
|||
Assertions.assertEquals(ElementKind.PrimitiveType, fu.kind());
|
||||
|
||||
ResourceWrapper obs = entry.child("resource");
|
||||
checkObservation(obs);
|
||||
checkObservation(obs, true, "Bundle.entry[0].resource");
|
||||
}
|
||||
|
||||
private void checkObservation(ResourceWrapper obs) {
|
||||
private void checkObservation(ResourceWrapper obs, boolean fromBundle, String rootPath) {
|
||||
Assertions.assertTrue(obs.fhirType().equals("Observation"));
|
||||
Assertions.assertEquals("resource", obs.name());
|
||||
Assertions.assertEquals(fromBundle ? "resource" : null, obs.name());
|
||||
Assertions.assertEquals("obs1", obs.getId());
|
||||
Assertions.assertEquals("Bundle.entry[0].resource", obs.path());
|
||||
Assertions.assertEquals(ElementKind.BundleEntry, obs.kind());
|
||||
Assertions.assertEquals(rootPath, obs.path());
|
||||
Assertions.assertEquals(fromBundle ? ElementKind.BundleEntry : ElementKind.IndependentResource, obs.kind());
|
||||
Assertions.assertTrue(obs.canHaveNarrative());
|
||||
Assertions.assertTrue(obs.hasNarrative());
|
||||
Assertions.assertNotNull(obs.getNarrative());
|
||||
|
||||
|
||||
List<ResourceWrapper> children = obs.children();
|
||||
assertEquals(5, children.size());
|
||||
|
||||
checkObsCode(children.get(3));
|
||||
checkObsCode(children.get(3), rootPath);
|
||||
|
||||
assertEquals(children.get(4), obs.child("value"));
|
||||
assertEquals(children.get(4), obs.child("value[x]"));
|
||||
checkObsValue(children.get(4));
|
||||
|
||||
checkObsValue(children.get(4), rootPath);
|
||||
|
||||
assertEquals(children.get(2), obs.child("contained"));
|
||||
checkContained(children.get(2));
|
||||
checkContained(children.get(2), rootPath);
|
||||
}
|
||||
|
||||
private void checkContained(ResourceWrapper cont) {
|
||||
private void checkContained(ResourceWrapper cont, String rootPath) {
|
||||
Assertions.assertEquals("Provenance", cont.fhirType());
|
||||
Assertions.assertEquals("contained", cont.name());
|
||||
Assertions.assertEquals("Bundle.entry[0].resource.contained[0]", cont.path());
|
||||
Assertions.assertEquals(rootPath+".contained[0]", cont.path());
|
||||
Assertions.assertFalse(cont.isPrimitive());
|
||||
Assertions.assertFalse(cont.hasPrimitiveValue());
|
||||
Assertions.assertTrue(cont.hasChildren());
|
||||
Assertions.assertEquals(ElementKind.ContainedResource, cont.kind());
|
||||
}
|
||||
|
||||
private void checkObsValue(ResourceWrapper obsValue) {
|
||||
private void checkObsValue(ResourceWrapper obsValue, String rootPath) {
|
||||
Assertions.assertEquals("Quantity", obsValue.fhirType());
|
||||
Assertions.assertEquals("value[x]", obsValue.name());
|
||||
Assertions.assertEquals("Bundle.entry[0].resource.value[x]", obsValue.path());
|
||||
Assertions.assertEquals(rootPath+".value[x]", obsValue.path());
|
||||
Assertions.assertFalse(obsValue.isPrimitive());
|
||||
Assertions.assertFalse(obsValue.hasPrimitiveValue());
|
||||
Assertions.assertTrue(obsValue.hasChildren());
|
||||
Assertions.assertEquals(ElementKind.DataType, obsValue.kind());
|
||||
}
|
||||
|
||||
private void checkObsCode(ResourceWrapper obsCode) {
|
||||
private void checkObsCode(ResourceWrapper obsCode, String rootPath) {
|
||||
Assertions.assertEquals("CodeableConcept", obsCode.fhirType());
|
||||
Assertions.assertEquals("code", obsCode.name());
|
||||
Assertions.assertEquals("Bundle.entry[0].resource.code", obsCode.path());
|
||||
Assertions.assertEquals(rootPath+".code", obsCode.path());
|
||||
Assertions.assertFalse(obsCode.isPrimitive());
|
||||
Assertions.assertFalse(obsCode.hasPrimitiveValue());
|
||||
Assertions.assertTrue(obsCode.hasChildren());
|
||||
|
@ -172,7 +223,7 @@ public class ResourceElementTests {
|
|||
ResourceWrapper txt = obsCode.children().get(1);
|
||||
Assertions.assertEquals("string", txt.fhirType());
|
||||
Assertions.assertEquals("text", txt.name());
|
||||
Assertions.assertEquals("Bundle.entry[0].resource.code.text", txt.path());
|
||||
Assertions.assertEquals(rootPath+".code.text", txt.path());
|
||||
Assertions.assertTrue(txt.isPrimitive());
|
||||
Assertions.assertFalse(txt.hasPrimitiveValue());
|
||||
Assertions.assertTrue(txt.hasChildren());
|
||||
|
@ -181,20 +232,20 @@ public class ResourceElementTests {
|
|||
ResourceWrapper e1 = txt.extension("http://something11");
|
||||
Assertions.assertEquals("Extension", e1.fhirType());
|
||||
Assertions.assertEquals("extension", e1.name());
|
||||
Assertions.assertEquals("Bundle.entry[0].resource.code.text.extension[0]", e1.path());
|
||||
Assertions.assertEquals(rootPath+".code.text.extension[0]", e1.path());
|
||||
Assertions.assertFalse(e1.isPrimitive());
|
||||
Assertions.assertFalse(e1.hasPrimitiveValue());
|
||||
Assertions.assertTrue(e1.hasChildren());
|
||||
Assertions.assertEquals(ElementKind.DataType, e1.kind());
|
||||
Assertions.assertEquals("http://something11", e1.primitiveValue("url"));
|
||||
|
||||
|
||||
ResourceWrapper ev = txt.extensionValue("http://something11");
|
||||
Assertions.assertEquals(ev, e1.child("value"));
|
||||
Assertions.assertEquals(ev, e1.child("value[x]"));
|
||||
|
||||
|
||||
Assertions.assertEquals("string", ev.fhirType());
|
||||
Assertions.assertEquals("value[x]", ev.name());
|
||||
Assertions.assertEquals("Bundle.entry[0].resource.code.text.extension[0].value[x]", ev.path());
|
||||
Assertions.assertEquals(rootPath+".code.text.extension[0].value[x]", ev.path());
|
||||
Assertions.assertTrue(ev.isPrimitive());
|
||||
Assertions.assertTrue(ev.hasPrimitiveValue());
|
||||
Assertions.assertFalse(ev.hasChildren());
|
||||
|
@ -231,5 +282,5 @@ public class ResourceElementTests {
|
|||
Assertions.assertFalse(url.hasChildren());
|
||||
Assertions.assertEquals(ElementKind.PrimitiveType, url.kind());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1098,4 +1098,8 @@ public class I18nConstants {
|
|||
public static final String MEASURE_MR_GRP_POP_COUNT_UNRESOLVED = "MEASURE_MR_GRP_POP_COUNT_UNRESOLVED";
|
||||
public static final String MEASURE_MR_GRP_POP_COUNT_NO_REF_RES = "MEASURE_MR_GRP_POP_COUNT_NO_REF_RES";
|
||||
public static final String MEASURE_MR_GRP_POP_COUNT_REF_UNPROCESSIBLE = "MEASURE_MR_GRP_POP_COUNT_REF_UNPROCESSIBLE";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_XHTML_EMPTY_HREF = "TYPE_SPECIFIC_CHECKS_DT_XHTML_EMPTY_HREF";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_XHTML_ACTIVE_HREF = "TYPE_SPECIFIC_CHECKS_DT_XHTML_ACTIVE_HREF";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_XHTML_UNKNOWN_HREF = "TYPE_SPECIFIC_CHECKS_DT_XHTML_UNKNOWN_HREF";
|
||||
public static final String TYPE_SPECIFIC_CHECKS_DT_XHTML_LITERAL_HREF = "TYPE_SPECIFIC_CHECKS_DT_XHTML_LITERAL_HREF";
|
||||
}
|
||||
|
|
|
@ -905,6 +905,7 @@ public class RenderingI18nContext extends I18nBase {
|
|||
public static final String DATA_REND_ATT_URL = "DATA_REND_ATT_URL";
|
||||
public static final String DATA_REND_ATT_DATA = "DATA_REND_ATT_DATA";
|
||||
public static final String GENERAL_DATA_DISPLAY_PROPERTY = "GENERAL_DATA_DISPLAY_PROPERTY";
|
||||
public static final String DATA_REND_CURRENCY = "DATA_REND_CURRENCY";
|
||||
|
||||
protected String getMessagesSourceFileName() {
|
||||
return "rendering-phrases";
|
||||
|
|
|
@ -921,7 +921,7 @@ public class HierarchicalTableGenerator {
|
|||
tag.setAttribute("title", p.getHint());
|
||||
addStyle(tag, p);
|
||||
if (p.hasChildren()) {
|
||||
tag.getChildNodes().addAll(p.getChildren());
|
||||
tag.addChildNodes(p.getChildren());
|
||||
}
|
||||
} else if (!Utilities.noString(p.getReference())) {
|
||||
XhtmlNode a = addStyle(tc.addTag("a"), p);
|
||||
|
@ -943,7 +943,7 @@ public class HierarchicalTableGenerator {
|
|||
}
|
||||
|
||||
if (p.hasChildren()) {
|
||||
tc.getChildNodes().addAll(p.getChildren());
|
||||
tc.addChildNodes(p.getChildren());
|
||||
}
|
||||
} else {
|
||||
if (!Utilities.noString(p.getHint())) {
|
||||
|
@ -957,7 +957,7 @@ public class HierarchicalTableGenerator {
|
|||
tc.addText(p.getText());
|
||||
}
|
||||
if (p.hasChildren()) {
|
||||
tc.getChildNodes().addAll(p.getChildren());
|
||||
tc.addChildNodes(p.getChildren());
|
||||
}
|
||||
if (p.getTagImg() != null) {
|
||||
tc.tx(" ");
|
||||
|
|
|
@ -72,6 +72,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean checkPara = false;
|
||||
public static final String NBSP = Character.toString((char)0xa0);
|
||||
public static final String XMLNS = "http://www.w3.org/1999/xhtml";
|
||||
private static final String DECL_XMLNS = " xmlns=\""+XMLNS+"\"";
|
||||
|
@ -118,6 +119,9 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
|
||||
public XhtmlNode setName(String name) {
|
||||
assert name.contains(":") == false : "Name should not contain any : but was " + name;
|
||||
if (checkPara && "p".equals(name)) {
|
||||
isInPara = true;
|
||||
}
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
@ -230,23 +234,25 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
|
||||
public XhtmlNode addTag(String name) {
|
||||
XhtmlNode node = makeTag(name);
|
||||
getChildNodes().add(node);
|
||||
addChildNode(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public XhtmlNode addTag(int index, String name) {
|
||||
XhtmlNode node = makeTag(name);
|
||||
getChildNodes().add(index, node);
|
||||
addChildNode(index, node);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
public XhtmlNode addComment(String content) {
|
||||
if (!(nodeType == NodeType.Element || nodeType == NodeType.Document))
|
||||
throw new Error("Wrong node type");
|
||||
XhtmlNode node = new XhtmlNode(NodeType.Comment);
|
||||
node.setContent(content);
|
||||
getChildNodes().add(node);
|
||||
addChildNode(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -255,7 +261,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
throw new Error("Wrong node type");
|
||||
XhtmlNode node = new XhtmlNode(NodeType.DocType);
|
||||
node.setContent(content);
|
||||
getChildNodes().add(node);
|
||||
addChildNode(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -264,7 +270,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
throw new Error("Wrong node type");
|
||||
XhtmlNode node = new XhtmlNode(NodeType.Instruction);
|
||||
node.setContent(content);
|
||||
getChildNodes().add(node);
|
||||
addChildNode(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -274,7 +280,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
if (content != null) {
|
||||
XhtmlNode node = new XhtmlNode(NodeType.Text);
|
||||
node.setContent(content);
|
||||
getChildNodes().add(node);
|
||||
addChildNode(node);
|
||||
return node;
|
||||
} else
|
||||
return null;
|
||||
|
@ -288,7 +294,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
|
||||
XhtmlNode node = new XhtmlNode(NodeType.Text);
|
||||
node.setContent(content);
|
||||
getChildNodes().add(index, node);
|
||||
addChildNode(index, node);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -402,7 +408,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
}
|
||||
if (hasChildren()) {
|
||||
for (XhtmlNode n : childNodes)
|
||||
dst.getChildNodes().add(n.copy());
|
||||
dst.addChildNode(n.copy());
|
||||
}
|
||||
dst.content = content;
|
||||
return dst;
|
||||
|
@ -587,6 +593,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
}
|
||||
|
||||
private Map<String, Object> userData;
|
||||
private boolean isInPara;
|
||||
|
||||
public Object getUserData(String theName) {
|
||||
if (hasUserData(theName)) {
|
||||
|
@ -693,19 +700,19 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
}
|
||||
|
||||
public XhtmlNode add(XhtmlNode n) {
|
||||
getChildNodes().add(n);
|
||||
addChildNode(n);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public XhtmlNode addChildren(List<XhtmlNode> children) {
|
||||
getChildNodes().addAll(children);
|
||||
addChildNodes(children);
|
||||
return this;
|
||||
}
|
||||
|
||||
public XhtmlNode addChildren(XhtmlNode x) {
|
||||
if (x != null) {
|
||||
getChildNodes().addAll(x.getChildNodes());
|
||||
addChildNodes(x.getChildNodes());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
@ -717,7 +724,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
p.attribute("type", type);
|
||||
p.attribute("placeholder", placeholder);
|
||||
p.attribute("size", Integer.toString(size));
|
||||
getChildNodes().add(p);
|
||||
addChildNode(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -725,7 +732,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
XhtmlNode p = new XhtmlNode(NodeType.Element, "select");
|
||||
p.attribute("name", name);
|
||||
p.attribute("size", "1");
|
||||
getChildNodes().add(p);
|
||||
addChildNode(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -734,7 +741,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
p.attribute("value", value);
|
||||
p.attribute("selected", Boolean.toString(selected));
|
||||
p.tx(text);
|
||||
getChildNodes().add(p);
|
||||
addChildNode(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -792,7 +799,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
|
||||
@Override
|
||||
protected void addChildren(XhtmlNodeList childNodes) {
|
||||
this.getChildNodes().addAll(childNodes);
|
||||
this.addChildNodes(childNodes);
|
||||
}
|
||||
|
||||
|
||||
|
@ -950,7 +957,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
|
||||
|
||||
public void copyAllContent(XhtmlNode other) {
|
||||
getChildNodes().addAll(other.getChildNodes());
|
||||
addChildNodes(other.getChildNodes());
|
||||
getAttributes().putAll(other.getAttributes());
|
||||
if (!Utilities.noString(other.getContent())) {
|
||||
tx(other.getContent());
|
||||
|
@ -1138,5 +1145,44 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addChildNodes(List<XhtmlNode> nodes) {
|
||||
for (XhtmlNode node : nodes) {
|
||||
addChildNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void addChildNode(XhtmlNode node) {
|
||||
checkWhenAddingNode(node);
|
||||
getChildNodes().add(node);
|
||||
}
|
||||
|
||||
|
||||
private void checkWhenAddingNode(XhtmlNode node) {
|
||||
if (checkPara) {
|
||||
if (isInPara) {
|
||||
if (Utilities.existsInList(node.name, "div", "blockquote", "table", "ol", "ul", "p")) {
|
||||
throw new Error("Error: attempt to add "+node.name+" inside an html paragraph");
|
||||
}
|
||||
node.isInPara = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addChildNode(int index, XhtmlNode node) {
|
||||
checkWhenAddingNode(node);
|
||||
getChildNodes().add(index, node);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isCheckPara() {
|
||||
return checkPara;
|
||||
}
|
||||
|
||||
|
||||
public static void setCheckPara(boolean checkPara) {
|
||||
XhtmlNode.checkPara = checkPara;
|
||||
}
|
||||
|
||||
}
|
|
@ -371,7 +371,7 @@ public class XhtmlParser {
|
|||
res.addComment(child.getTextContent());
|
||||
} else if (child.getNodeType() == Node.ELEMENT_NODE) {
|
||||
if (elementIsOk(child.getLocalName()))
|
||||
res.getChildNodes().add(parseNode((Element) child, defaultNS));
|
||||
res.addChildNode(parseNode((Element) child, defaultNS));
|
||||
} else
|
||||
throw new FHIRFormatError("Unhandled XHTML feature: "+Integer.toString(child.getNodeType())+descLoc());
|
||||
child = child.getNextSibling();
|
||||
|
@ -418,7 +418,7 @@ public class XhtmlParser {
|
|||
xpp.next();
|
||||
} else if (eventType == XmlPullParser.START_TAG) {
|
||||
if (elementIsOk(xpp.getName()))
|
||||
res.getChildNodes().add(parseNode(xpp));
|
||||
res.addChildNode(parseNode(xpp));
|
||||
} else
|
||||
throw new FHIRFormatError("Unhandled XHTML feature: "+Integer.toString(eventType)+descLoc());
|
||||
eventType = xpp.getEventType();
|
||||
|
@ -630,12 +630,12 @@ public class XhtmlParser {
|
|||
return;
|
||||
if (i == parents.size())
|
||||
{
|
||||
parents.get(i - 1).getChildNodes().addAll(node.getChildNodes());
|
||||
parents.get(i - 1).addChildNodes(node.getChildNodes());
|
||||
node.getChildNodes().clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
parents.get(i - 1).getChildNodes().addAll(parents.get(i).getChildNodes());
|
||||
parents.get(i - 1).addChildNodes(parents.get(i).getChildNodes());
|
||||
parents.get(i).getChildNodes().clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1126,3 +1126,7 @@ IG_DEPENDENCY_VERSION_ERROR = The ImplementationGuide is based on FHIR version {
|
|||
IG_DEPENDENCY_VERSION_WARNING = The ImplementationGuide is based on FHIR version {0} but package {1} is based on FHIR version {2}. In general, this version mismatch should be avoided - some tools will try to make this work with variable degrees of success, but others will not even try
|
||||
IG_DEPENDENCY_EXCEPTION = Exception checking package version consistency: {0}
|
||||
NDJSON_EMPTY_LINE_WARNING = The NDJSON source contains an empty line. This may not be accepted by some processors
|
||||
TYPE_SPECIFIC_CHECKS_DT_XHTML_EMPTY_HREF = Hyperlink at ''{0}'' for ''{1}'' is empty
|
||||
TYPE_SPECIFIC_CHECKS_DT_XHTML_ACTIVE_HREF = Hyperlink scheme ''{3}'' in ''{0}'' at ''{1}'' for ''{2}'' has active content, which is a security risk and not allowed
|
||||
TYPE_SPECIFIC_CHECKS_DT_XHTML_UNKNOWN_HREF = Hyperlink scheme ''{3}'' in ''{0}'' at ''{1}'' for ''{2}'' is not a widely supported protocol and should be checked
|
||||
TYPE_SPECIFIC_CHECKS_DT_XHTML_LITERAL_HREF = Hyperlink scheme ''{3}'' in ''{0}'' at ''{1}'' for ''{2}'' is not a valid hyperlinkable scheme
|
||||
|
|
|
@ -909,4 +909,4 @@ DOCUMENT_SUMMARY = <param name="status"/> Document at <param name="date"/> by <p
|
|||
DATA_REND_ATT_URL = {0} @ {1}
|
||||
DATA_REND_ATT_DATA = {0}: {1}
|
||||
GENERAL_DATA_DISPLAY_PROPERTY = {0}: {1}
|
||||
|
||||
DATA_REND_CURRENCY = {1} {0}
|
||||
|
|
|
@ -3315,18 +3315,31 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
boolean ok = true;
|
||||
if (node.getNodeType() == NodeType.Element & "a".equals(node.getName()) && node.getAttribute("href") != null) {
|
||||
String href = node.getAttribute("href");
|
||||
if (!Utilities.noString(href) && href.startsWith("#") && !href.equals("#")) {
|
||||
String ref = href.substring(1);
|
||||
valContext.getInternalRefs().add(ref);
|
||||
Set<String> refs = new HashSet<>();
|
||||
int count = countTargetMatches(resource, ref, true, "$", refs);
|
||||
if (count == 0) {
|
||||
rule(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_RESOLVE, href, xpath, Utilities.stripEoln(node.allText()));
|
||||
} else if (count > 1) {
|
||||
warning(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_MULTIPLE_MATCHES, href, xpath, node.allText(), CommaSeparatedStringBuilder.join(", ", refs));
|
||||
if (rule(errors, "2024-07-20", IssueType.INVALID, e.line(), e.col(), path, !Utilities.noString(href), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_EMPTY_HREF, xpath, Utilities.stripEoln(node.allText()))) {
|
||||
if ( href.startsWith("#") && !href.equals("#")) {
|
||||
String ref = href.substring(1);
|
||||
valContext.getInternalRefs().add(ref);
|
||||
Set<String> refs = new HashSet<>();
|
||||
int count = countTargetMatches(resource, ref, true, "$", refs);
|
||||
if (count == 0) {
|
||||
rule(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_RESOLVE, href, xpath, Utilities.stripEoln(node.allText()).trim());
|
||||
} else if (count > 1) {
|
||||
warning(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_MULTIPLE_MATCHES, href, xpath, node.allText(), CommaSeparatedStringBuilder.join(", ", refs));
|
||||
}
|
||||
} else if (href.contains(":")) {
|
||||
String scheme = href.substring(0, href.indexOf(":"));
|
||||
if (rule(errors, "2024-07-20", IssueType.INVALID, e.line(), e.col(), path, !isActiveScheme(scheme), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_ACTIVE_HREF, href, xpath, Utilities.stripEoln(node.allText()).trim(), scheme)) {
|
||||
if (rule(errors, "2024-07-20", IssueType.INVALID, e.line(), e.col(), path, isLiteralScheme(scheme), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_LITERAL_HREF, href, xpath, Utilities.stripEoln(node.allText()).trim(), scheme)) {
|
||||
hint(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, isKnownScheme(scheme), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_UNKNOWN_HREF, href, xpath, node.allText().trim(), scheme);
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
} else {
|
||||
// we can't validate at this point. Come back and revisit this some time in the future
|
||||
}
|
||||
} else {
|
||||
// we can't validate at this point. Come back and revisit this some time in the future
|
||||
}
|
||||
}
|
||||
if (node.hasChildren()) {
|
||||
|
@ -3338,6 +3351,18 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
}
|
||||
|
||||
|
||||
private boolean isActiveScheme(String scheme) {
|
||||
return Utilities.existsInList(scheme, "javascript", "vbscript");
|
||||
}
|
||||
|
||||
private boolean isLiteralScheme(String scheme) {
|
||||
return !Utilities.existsInList(scheme, "urn", "cid");
|
||||
}
|
||||
|
||||
private boolean isKnownScheme(String scheme) {
|
||||
return Utilities.existsInList(scheme, "http", "https", "tel", "mailto", "data");
|
||||
}
|
||||
|
||||
protected int countTargetMatches(Element element, String fragment, boolean checkBundle, String path,Set<String> refs) {
|
||||
int count = 0;
|
||||
if (fragment.equals(element.getIdBase())) {
|
||||
|
@ -4647,7 +4672,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
}
|
||||
}
|
||||
if (focus.getSpecial() == SpecialElement.PARAMETER && focus.getParentForValidator() != null) {
|
||||
NodeStack tgt = findInParams(focus.getParentForValidator().getParentForValidator(), ref, stack);
|
||||
NodeStack tgt = findInParams(findParameters(focus), ref, stack);
|
||||
if (tgt != null) {
|
||||
ResolvedReference rr = new ResolvedReference();
|
||||
rr.setResource(tgt.getElement());
|
||||
|
@ -4684,7 +4709,20 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
return null;
|
||||
}
|
||||
|
||||
private Element findParameters(Element focus) {
|
||||
while (focus != null) {
|
||||
if ("Parameters".equals(focus.fhirType())) {
|
||||
return focus;
|
||||
}
|
||||
focus = focus.getParentForValidator();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private NodeStack findInParams(Element params, String ref, NodeStack stack) {
|
||||
if (params == null) {
|
||||
return null;
|
||||
}
|
||||
int i = 0;
|
||||
for (Element child : params.getChildren("parameter")) {
|
||||
NodeStack p = stack.push(child, i, child.getProperty().getDefinition(), child.getProperty().getDefinition());
|
||||
|
|
|
@ -3651,3 +3651,52 @@ v: {
|
|||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"code" : "OK"
|
||||
}, "valueSet" :{
|
||||
"resourceType" : "ValueSet",
|
||||
"compose" : {
|
||||
"include" : [{
|
||||
"system" : "https://www.usps.com/"
|
||||
}]
|
||||
}
|
||||
}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Oklahoma",
|
||||
"code" : "OK",
|
||||
"system" : "https://www.usps.com/",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"code" : "OK"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Oklahoma",
|
||||
"code" : "OK",
|
||||
"system" : "https://www.usps.com/",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
|
|
|
@ -15,10 +15,51 @@ v: {
|
|||
"system" : "http://www.ama-assn.org/go/cpt",
|
||||
"version" : "2023",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "http://www.ama-assn.org/go/cpt",
|
||||
"code" : "43235",
|
||||
"display" : "Esophagogastroduodenoscopy (EGD), a tiny camera at the end of a flexible tube inserted through the mouth and into the esophagus (a tube that carries food and liquid to the stomach), stomach and small intestine with removal of tissue"
|
||||
}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Esophagogastroduodenoscopy, flexible, transoral; diagnostic, including collection of specimen(s) by brushing or washing, when performed (separate procedure)",
|
||||
"code" : "43235",
|
||||
"severity" : "error",
|
||||
"error" : "Wrong Display Name 'Esophagogastroduodenoscopy (EGD), a tiny camera at the end of a flexible tube inserted through the mouth and into the esophagus (a tube that carries food and liquid to the stomach), stomach and small intestine with removal of tissue' for http://www.ama-assn.org/go/cpt#43235. Valid display is 'Esophagogastroduodenoscopy, flexible, transoral; diagnostic, including collection of specimen(s) by brushing or washing, when performed (separate procedure)' (en) (for the language(s) '--')",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "invalid-display"
|
||||
}],
|
||||
"text" : "Wrong Display Name 'Esophagogastroduodenoscopy (EGD), a tiny camera at the end of a flexible tube inserted through the mouth and into the esophagus (a tube that carries food and liquid to the stomach), stomach and small intestine with removal of tissue' for http://www.ama-assn.org/go/cpt#43235. Valid display is 'Esophagogastroduodenoscopy, flexible, transoral; diagnostic, including collection of specimen(s) by brushing or washing, when performed (separate procedure)' (en) (for the language(s) '--')"
|
||||
},
|
||||
"location" : ["Coding.display"],
|
||||
"expression" : ["Coding.display"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,529 @@
|
|||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2106-3",
|
||||
"display" : "White"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-race-category", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "White",
|
||||
"code" : "2106-3",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "1002-5",
|
||||
"display" : "American Indian or Alaska Native"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-race-category", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "American Indian or Alaska Native",
|
||||
"code" : "1002-5",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2028-9",
|
||||
"display" : "Asian"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-race-category", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Asian",
|
||||
"code" : "2028-9",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "1586-7",
|
||||
"display" : "Shoshone"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-race", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Shoshone",
|
||||
"code" : "1586-7",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#1586-7 ('Shoshone')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#1586-7 ('Shoshone')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2036-2",
|
||||
"display" : "Filipino"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-race", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Filipino",
|
||||
"code" : "2036-2",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2036-2 ('Filipino')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2036-2 ('Filipino')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2135-2",
|
||||
"display" : "Hispanic or Latino"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Hispanic or Latino",
|
||||
"code" : "2135-2",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2184-0",
|
||||
"display" : "Dominican"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Dominican",
|
||||
"code" : "2184-0",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2184-0 ('Dominican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2184-0 ('Dominican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2148-5",
|
||||
"display" : "Mexican"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity", "version": "6.1.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Mexican",
|
||||
"code" : "2148-5",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2148-5 ('Mexican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2148-5 ('Mexican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2106-3",
|
||||
"display" : "White"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-race-category", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "White",
|
||||
"code" : "2106-3",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "1002-5",
|
||||
"display" : "American Indian or Alaska Native"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-race-category", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "American Indian or Alaska Native",
|
||||
"code" : "1002-5",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2028-9",
|
||||
"display" : "Asian"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-race-category", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Asian",
|
||||
"code" : "2028-9",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "1586-7",
|
||||
"display" : "Shoshone"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-race", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Shoshone",
|
||||
"code" : "1586-7",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#1586-7 ('Shoshone')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#1586-7 ('Shoshone')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2036-2",
|
||||
"display" : "Filipino"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-race", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Filipino",
|
||||
"code" : "2036-2",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2036-2 ('Filipino')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2036-2 ('Filipino')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-race|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2135-2",
|
||||
"display" : "Hispanic or Latino"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Hispanic or Latino",
|
||||
"code" : "2135-2",
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"version" : "1.2",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome"
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2184-0",
|
||||
"display" : "Dominican"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Dominican",
|
||||
"code" : "2184-0",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2184-0 ('Dominican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2184-0 ('Dominican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
||||
{"code" : {
|
||||
"system" : "urn:oid:2.16.840.1.113883.6.238",
|
||||
"code" : "2148-5",
|
||||
"display" : "Mexican"
|
||||
}, "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity", "version": "6.1.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
|
||||
"resourceType" : "Parameters",
|
||||
"parameter" : [{
|
||||
"name" : "profile-url",
|
||||
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
|
||||
}]
|
||||
}}####
|
||||
v: {
|
||||
"display" : "Mexican",
|
||||
"code" : "2148-5",
|
||||
"severity" : "error",
|
||||
"error" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2148-5 ('Mexican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'",
|
||||
"class" : "UNKNOWN",
|
||||
"server" : "http://tx-dev.fhir.org/r4",
|
||||
"unknown-systems" : "",
|
||||
"issues" : {
|
||||
"resourceType" : "OperationOutcome",
|
||||
"issue" : [{
|
||||
"extension" : [{
|
||||
"url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server",
|
||||
"valueUrl" : "http://tx-dev.fhir.org/r4"
|
||||
}],
|
||||
"severity" : "error",
|
||||
"code" : "code-invalid",
|
||||
"details" : {
|
||||
"coding" : [{
|
||||
"system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type",
|
||||
"code" : "not-in-vs"
|
||||
}],
|
||||
"text" : "The provided code 'urn:oid:2.16.840.1.113883.6.238#2148-5 ('Mexican')' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity|6.1.0'"
|
||||
},
|
||||
"location" : ["Coding.code"],
|
||||
"expression" : ["Coding.code"]
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
||||
-------------------------------------------------------------------------------------
|
2
pom.xml
2
pom.xml
|
@ -21,7 +21,7 @@
|
|||
<commons_compress_version>1.26.0</commons_compress_version>
|
||||
<guava_version>32.0.1-jre</guava_version>
|
||||
<hapi_fhir_version>6.4.1</hapi_fhir_version>
|
||||
<validator_test_case_version>1.5.16</validator_test_case_version>
|
||||
<validator_test_case_version>1.5.17-SNAPSHOT</validator_test_case_version>
|
||||
<jackson_version>2.17.0</jackson_version>
|
||||
<junit_jupiter_version>5.9.2</junit_jupiter_version>
|
||||
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
|
||||
|
|
Loading…
Reference in New Issue