prepare for changing the way the IG publisher generates narrative

This commit is contained in:
Grahame Grieve 2022-11-24 18:02:21 -03:00
parent 618f98e323
commit 962f3f09ea
2 changed files with 14 additions and 1 deletions

View File

@ -790,7 +790,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
if ("DomainResource.contained".equals(child.getBase().getPath())) {
if (round2) {
for (BaseWrapper v : p.getValues()) {
if (!RendererFactory.hasSpecificRenderer(v.fhirType())) {
if (v.getBase() != null && !RendererFactory.hasSpecificRenderer(v.fhirType())) {
x.hr();
RenderingContext ctxt = context.copy();
ctxt.setContained(true);

View File

@ -4,6 +4,7 @@ import org.hl7.fhir.r5.model.DomainResource;
import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
import org.hl7.fhir.r5.renderers.utils.RenderingContext.GenerationRules;
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
import org.hl7.fhir.utilities.Utilities;
@ -145,5 +146,17 @@ public class RendererFactory {
"CapabilityStatement", "CompartmentDefinition", "ImplementationGuide", "Library", "NamingSystem", "OperationDefinition",
"Questionnaire", "SearchParameter", "StructureDefinition", "ActorDefinition", "Requirements");
}
/**
* This is a list of renderers that return something different in IG mode, and the implementation guide
* publisher will regenerate the narrative for the IG mode
* @param rt
* @return
*/
public static boolean hasIGSpecificRenderer(String rt) {
return Utilities.existsInList(rt, "ValueSet", "CapabilityStatement", "Questionnaire");
}
}