mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-09 06:14:45 +00:00
don't throw error for wrong rendering mode
This commit is contained in:
parent
eecd04924b
commit
7670422a6c
@ -53,7 +53,8 @@ public class CapabilityStatementRenderer extends ResourceRenderer {
|
|||||||
renderResourceTechDetails(r, x);
|
renderResourceTechDetails(r, x);
|
||||||
render(status, x, (CapabilityStatement) r.getBase(), r);
|
render(status, x, (CapabilityStatement) r.getBase(), r);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("CapabilityStatementRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("CapabilityStatementRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,7 +423,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer {
|
|||||||
private void addSupportedCSs(RenderingStatus status, XhtmlNode x, CapabilityStatement cap, ResourceWrapper res) throws UnsupportedEncodingException, IOException {
|
private void addSupportedCSs(RenderingStatus status, XhtmlNode x, CapabilityStatement cap, ResourceWrapper res) throws UnsupportedEncodingException, IOException {
|
||||||
if (cap.hasInstantiates()) {
|
if (cap.hasInstantiates()) {
|
||||||
XhtmlNode p = x.para();
|
XhtmlNode p = x.para();
|
||||||
p.tx(cap.getInstantiates().size() > 1 ? "This CapabilityStatement instantiates these CapabilityStatements" : "This CapabilityStatement instantiates the CapabilityStatement");
|
p.tx(cap.getInstantiates().size() > 1 ? "This CapabilityStatement instantiates these CapabilityStatements " : "This CapabilityStatement instantiates the CapabilityStatement ");
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (CanonicalType ct : cap.getInstantiates()) {
|
for (CanonicalType ct : cap.getInstantiates()) {
|
||||||
if (first) {first = false;} else {p.tx(", ");};
|
if (first) {first = false;} else {p.tx(", ");};
|
||||||
@ -431,7 +432,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer {
|
|||||||
}
|
}
|
||||||
if (cap.hasImports()) {
|
if (cap.hasImports()) {
|
||||||
XhtmlNode p = x.para();
|
XhtmlNode p = x.para();
|
||||||
p.tx(cap.getImports().size() > 1 ? "This CapabilityStatement imports these CapabilityStatements" : "This CapabilityStatement imports the CapabilityStatement");
|
p.tx(cap.getImports().size() > 1 ? "This CapabilityStatement imports these CapabilityStatements " : "This CapabilityStatement imports the CapabilityStatement ");
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (CanonicalType ct : cap.getImports()) {
|
for (CanonicalType ct : cap.getImports()) {
|
||||||
if (first) {first = false;} else {p.tx(", ");};
|
if (first) {first = false;} else {p.tx(", ");};
|
||||||
|
@ -53,7 +53,8 @@ public class CodeSystemRenderer extends TerminologyRenderer {
|
|||||||
genSummaryTable(status, x, (CodeSystem) r.getBase());
|
genSummaryTable(status, x, (CodeSystem) r.getBase());
|
||||||
render(status, x, (CodeSystem) r.getBase(), r);
|
render(status, x, (CodeSystem) r.getBase(), r);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("CodeSystemRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("CodeSystemRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,8 @@ public class CompartmentDefinitionRenderer extends ResourceRenderer {
|
|||||||
genSummaryTable(status, x, (CompartmentDefinition) r.getBase());
|
genSummaryTable(status, x, (CompartmentDefinition) r.getBase());
|
||||||
render(status, x, (CompartmentDefinition) r.getBase());
|
render(status, x, (CompartmentDefinition) r.getBase());
|
||||||
} else {
|
} else {
|
||||||
throw new Error("CompartmentDefinitionRenderer only renders native resources directly");
|
// it seems very inlikely this will change
|
||||||
|
x.para().tx("CompartmentDefinitionRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,8 @@ public class ConceptMapRenderer extends TerminologyRenderer {
|
|||||||
genSummaryTable(status, x, (ConceptMap) r.getBase());
|
genSummaryTable(status, x, (ConceptMap) r.getBase());
|
||||||
render(status, r, x, (ConceptMap) r.getBase(), false);
|
render(status, r, x, (ConceptMap) r.getBase(), false);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("ConceptMapRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("ConceptMapRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,8 @@ public class ExampleScenarioRenderer extends TerminologyRenderer {
|
|||||||
genSummaryTable(status, x, (ExampleScenario) r.getBase());
|
genSummaryTable(status, x, (ExampleScenario) r.getBase());
|
||||||
render(status, x, (ExampleScenario) r.getBase(), r);
|
render(status, x, (ExampleScenario) r.getBase(), r);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("ExampleScenarioRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("ExampleScenarioRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,8 @@ public class ImplementationGuideRenderer extends ResourceRenderer {
|
|||||||
genSummaryTable(status, x, (ImplementationGuide) r.getBase());
|
genSummaryTable(status, x, (ImplementationGuide) r.getBase());
|
||||||
render(status, x, (ImplementationGuide) r.getBase());
|
render(status, x, (ImplementationGuide) r.getBase());
|
||||||
} else {
|
} else {
|
||||||
throw new Error("ImplementationGuideRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("ImplementationGuideRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,8 @@ public class NamingSystemRenderer extends ResourceRenderer {
|
|||||||
genSummaryTable(status, x, (NamingSystem) r.getBase());
|
genSummaryTable(status, x, (NamingSystem) r.getBase());
|
||||||
render(status, x, (NamingSystem) r.getBase());
|
render(status, x, (NamingSystem) r.getBase());
|
||||||
} else {
|
} else {
|
||||||
throw new Error("NamingSystemRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("NamingSystemRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@ public class OperationDefinitionRenderer extends TerminologyRenderer {
|
|||||||
genSummaryTable(status, x, (OperationDefinition) r.getBase());
|
genSummaryTable(status, x, (OperationDefinition) r.getBase());
|
||||||
render(status, x, (OperationDefinition) r.getBase());
|
render(status, x, (OperationDefinition) r.getBase());
|
||||||
} else {
|
} else {
|
||||||
throw new Error("OperationDefinitionRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("OperationDefinitionRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,8 @@ public class SearchParameterRenderer extends TerminologyRenderer {
|
|||||||
|
|
||||||
render(status, x, (SearchParameter) r.getBase());
|
render(status, x, (SearchParameter) r.getBase());
|
||||||
} else {
|
} else {
|
||||||
throw new Error("SearchParameterRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("SearchParameterRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,18 +103,20 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||||||
@Override
|
@Override
|
||||||
public void buildNarrative(RenderingStatus status, XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome {
|
public void buildNarrative(RenderingStatus status, XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome {
|
||||||
if (!r.isDirect()) {
|
if (!r.isDirect()) {
|
||||||
throw new Error("StructureDefinitionRenderer only renders native resources directly");
|
// it seems very unlikely that this will change in the future
|
||||||
}
|
x.para().tx("StructureDefinitionRenderer only renders native resources directly");
|
||||||
renderResourceTechDetails(r, x);
|
|
||||||
StructureDefinition sd = (StructureDefinition) r.getBase();
|
|
||||||
genSummaryTable(status, x, sd);
|
|
||||||
if (context.getStructureMode() == StructureDefinitionRendererMode.DATA_DICT) {
|
|
||||||
renderDict(status, sd, sd.getDifferential().getElement(), x.table("dict"), false, GEN_MODE_DIFF, "", r);
|
|
||||||
} else {
|
} else {
|
||||||
x.addChildNode(generateTable(status, context.getDefinitionsTarget(), sd, true, context.getDestDir(), false, sd.getId(), false,
|
renderResourceTechDetails(r, x);
|
||||||
context.getLink(KnownLinkType.SPEC), "", sd.getKind() == StructureDefinitionKind.LOGICAL, false, null, false, context.withUniqueLocalPrefix(null), "r", r));
|
StructureDefinition sd = (StructureDefinition) r.getBase();
|
||||||
|
genSummaryTable(status, x, sd);
|
||||||
|
if (context.getStructureMode() == StructureDefinitionRendererMode.DATA_DICT) {
|
||||||
|
renderDict(status, sd, sd.getDifferential().getElement(), x.table("dict"), false, GEN_MODE_DIFF, "", r);
|
||||||
|
} else {
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
status.setExtensions(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,7 +57,8 @@ public class StructureMapRenderer extends TerminologyRenderer {
|
|||||||
genSummaryTable(status, x, (StructureMap) r.getBase());
|
genSummaryTable(status, x, (StructureMap) r.getBase());
|
||||||
renderMap(status, x.pre("fml"), (StructureMap) r.getBase());
|
renderMap(status, x.pre("fml"), (StructureMap) r.getBase());
|
||||||
} else {
|
} else {
|
||||||
throw new Error("StructureMapRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
|
x.para().tx("StructureMapRenderer only renders native resources directly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,18 +73,20 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||||||
@Override
|
@Override
|
||||||
public void buildNarrative(RenderingStatus status, XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome {
|
public void buildNarrative(RenderingStatus status, XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome {
|
||||||
if (!r.isDirect()) {
|
if (!r.isDirect()) {
|
||||||
throw new Error("ValueSetRenderer only renders native resources directly");
|
// the intention is to change this in the future
|
||||||
}
|
x.para().tx("ValueSetRenderer only renders native resources directly");
|
||||||
renderResourceTechDetails(r, x);
|
|
||||||
ValueSet vs = (ValueSet) r.getBase();
|
|
||||||
genSummaryTable(status, x, vs);
|
|
||||||
List<UsedConceptMap> maps = findReleventMaps(vs);
|
|
||||||
|
|
||||||
if (vs.hasExpansion()) {
|
|
||||||
// for now, we just accept an expansion if there is one
|
|
||||||
generateExpansion(status, r, x, vs, false, maps);
|
|
||||||
} else {
|
} else {
|
||||||
generateComposition(status, r, x, vs, false, maps);
|
renderResourceTechDetails(r, x);
|
||||||
|
ValueSet vs = (ValueSet) r.getBase();
|
||||||
|
genSummaryTable(status, x, vs);
|
||||||
|
List<UsedConceptMap> maps = findReleventMaps(vs);
|
||||||
|
|
||||||
|
if (vs.hasExpansion()) {
|
||||||
|
// for now, we just accept an expansion if there is one
|
||||||
|
generateExpansion(status, r, x, vs, false, maps);
|
||||||
|
} else {
|
||||||
|
generateComposition(status, r, x, vs, false, maps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user