refactor profile rendering (more to StructureDefinitionRenderer)
This commit is contained in:
parent
aacefd6581
commit
b014401dd4
|
@ -13,8 +13,8 @@ import org.hl7.fhir.r5.comparison.CodeSystemComparer.CodeSystemComparison;
|
|||
import org.hl7.fhir.r5.comparison.ProfileComparer.ProfileComparison;
|
||||
import org.hl7.fhir.r5.comparison.ResourceComparer.ResourceComparison;
|
||||
import org.hl7.fhir.r5.comparison.ValueSetComparer.ValueSetComparison;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.r5.model.CanonicalResource;
|
||||
import org.hl7.fhir.r5.model.CapabilityStatement;
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.hl7.fhir.exceptions.FHIRException;
|
|||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.comparison.ValueSetComparer.ValueSetComparison;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.UnusedTracker;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.r5.formats.IParser;
|
||||
import org.hl7.fhir.r5.formats.JsonParser;
|
||||
|
@ -33,10 +32,16 @@ import org.hl7.fhir.r5.model.StringType;
|
|||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
|
||||
import org.hl7.fhir.r5.model.ValueSet;
|
||||
import org.hl7.fhir.r5.renderers.StructureDefinitionRenderer;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext.GenerationRules;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode;
|
||||
import org.hl7.fhir.r5.utils.DefinitionNavigator;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.MarkDownProcessor;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
|
||||
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell;
|
||||
|
@ -988,22 +993,27 @@ public class ProfileComparer extends CanonicalResourceComparer {
|
|||
String sn = getSliceName(combined);
|
||||
if (sn != null)
|
||||
sName = sName +":"+sn;
|
||||
UnusedTracker used = new UnusedTracker();
|
||||
StructureDefinitionRenderer.UnusedTracker used = new StructureDefinitionRenderer.UnusedTracker();
|
||||
StructureDefinitionRenderer sdrLeft = new StructureDefinitionRenderer(new RenderingContext(utilsLeft.getContext(), null, utilsLeft.getTerminologyServiceOptions(), corePath, prefix, null, ResourceRendererMode.TECHNICAL, GenerationRules.IG_PUBLISHER));
|
||||
StructureDefinitionRenderer sdrRight= new StructureDefinitionRenderer(new RenderingContext(utilsRight.getContext(), null, utilsRight.getTerminologyServiceOptions(), corePath, prefix, null, ResourceRendererMode.TECHNICAL, GenerationRules.IG_PUBLISHER));
|
||||
|
||||
|
||||
|
||||
Cell nc;
|
||||
String leftColor = !combined.hasLeft() ? COLOR_NO_ROW_LEFT : combined.hasErrors() ? COLOR_DIFFERENT : null;
|
||||
String rightColor = !combined.hasRight() ? COLOR_NO_ROW_LEFT : combined.hasErrors() ? COLOR_DIFFERENT : null;
|
||||
if (combined.hasLeft()) {
|
||||
nc = utilsLeft.genElementNameCell(gen, combined.getLeft().getDef(), "??", true, corePath, prefix, root, false, false, combined.getLeft().getSrc(), typesRow, row, false, ext, used , ref, sName, null);
|
||||
nc = sdrLeft.genElementNameCell(gen, combined.getLeft().getDef(), "??", true, corePath, prefix, root, false, false, combined.getLeft().getSrc(), typesRow, row, false, ext, used , ref, sName, null);
|
||||
} else {
|
||||
nc = utilsRight.genElementNameCell(gen, combined.getRight().getDef(), "??", true, corePath, prefix, root, false, false, combined.getRight().getSrc(), typesRow, row, false, ext, used , ref, sName, null);
|
||||
nc = sdrRight.genElementNameCell(gen, combined.getRight().getDef(), "??", true, corePath, prefix, root, false, false, combined.getRight().getSrc(), typesRow, row, false, ext, used , ref, sName, null);
|
||||
}
|
||||
if (combined.hasLeft()) {
|
||||
frame(utilsLeft.genElementCells(gen, combined.getLeft().getDef(), "??", true, corePath, prefix, root, false, false, combined.getLeft().getSrc(), typesRow, row, true, ext, used , ref, sName, nc, false, false, null), leftColor);
|
||||
frame(sdrLeft.genElementCells(gen, combined.getLeft().getDef(), "??", true, corePath, prefix, root, false, false, combined.getLeft().getSrc(), typesRow, row, true, ext, used , ref, sName, nc, false, false, null), leftColor);
|
||||
} else {
|
||||
frame(spacers(row, 4, gen), leftColor);
|
||||
}
|
||||
if (combined.hasRight()) {
|
||||
frame(utilsRight.genElementCells(gen, combined.getRight().getDef(), "??", true, corePath, prefix, root, false, false, combined.getRight().getSrc(), typesRow, row, true, ext, used, ref, sName, nc, false, false, null), rightColor);
|
||||
frame(sdrRight.genElementCells(gen, combined.getRight().getDef(), "??", true, corePath, prefix, root, false, false, combined.getRight().getSrc(), typesRow, row, true, ext, used, ref, sName, nc, false, false, null), rightColor);
|
||||
} else {
|
||||
frame(spacers(row, 4, gen), rightColor);
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ import java.util.List;
|
|||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.conformance.profile.BindingResolution;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider.BindingResolution;
|
||||
import org.hl7.fhir.r5.model.Extension;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
import org.hl7.fhir.r5.model.UsageContext;
|
||||
|
@ -106,7 +106,7 @@ public class AdditionalBindingsRenderer {
|
|||
abr.compare = new AdditionalBindingDetail();
|
||||
abr.compare.valueSet = compExt==null ? null : compExt.getValue().primitiveValue();
|
||||
} else {
|
||||
abr.isUnchanged = ext.hasUserData(ProfileUtilities.DERIVATION_EQUALS);
|
||||
abr.isUnchanged = ext.hasUserData(ProfileUtilities.UD_DERIVATION_EQUALS);
|
||||
}
|
||||
bindings.add(abr);
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ public class AdditionalBindingsRenderer {
|
|||
abr.docoShort = ext.getExtensionString("shortDoco");
|
||||
abr.usage = (ext.hasExtension("usage")) && ext.getExtensionByUrl("usage").hasValueUsageContext() ? ext.getExtensionByUrl("usage").getValueUsageContext() : null;
|
||||
abr.any = "any".equals(ext.getExtensionString("scope"));
|
||||
abr.isUnchanged = ext.hasUserData(ProfileUtilities.DERIVATION_EQUALS);
|
||||
abr.isUnchanged = ext.hasUserData(ProfileUtilities.UD_DERIVATION_EQUALS);
|
||||
return abr;
|
||||
}
|
||||
|
||||
|
@ -309,16 +309,19 @@ public class AdditionalBindingsRenderer {
|
|||
case "minimum":
|
||||
td.ah(corePath+"extension-elementdefinition-minvalueset.html", "The minimum allowable value set - any conformant system SHALL support all these codes").tx("Min Binding");
|
||||
break;
|
||||
case "conformance" :
|
||||
case "required" :
|
||||
td.ah(corePath+"terminologies.html#strength", "Validators will check this binding (strength = required)").tx("Validation Binding");
|
||||
break;
|
||||
case "extensible" :
|
||||
td.ah(corePath+"terminologies.html#strength", "Validators will check this binding (strength = extensible)").tx("Validation Binding");
|
||||
break;
|
||||
case "candidate" :
|
||||
td.ah(corePath+"terminologies.html#strength", "This is a candidate binding that constraints on this profile may consider (see doco)").tx("Candidate Validation Binding");
|
||||
break;
|
||||
case "current" :
|
||||
td.span(null, "New records are required to use this value set, but legacy records may use other codes").tx("Required");
|
||||
break;
|
||||
case "recommended" :
|
||||
case "preferred" :
|
||||
td.span(null, "This is the value set that is recommended (documentation should explain why)").tx("Recommended");
|
||||
break;
|
||||
case "ui" :
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package org.hl7.fhir.r5.conformance.profile;
|
||||
|
||||
public class BindingResolution {
|
||||
public BindingResolution(String display, String url) {
|
||||
this.display = display;
|
||||
this.url = url;
|
||||
}
|
||||
public BindingResolution() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
public String display;
|
||||
public String url;
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
package org.hl7.fhir.r5.conformance.profile;
|
||||
|
||||
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||
|
||||
@AllArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
public class PathSlicingParams {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package org.hl7.fhir.r5.conformance.profile;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
|
||||
public interface ProfileKnowledgeProvider {
|
||||
boolean isDatatype(String typeSimple);
|
||||
boolean isPrimitiveType(String typeSimple);
|
||||
boolean isResource(String typeSimple);
|
||||
boolean hasLinkFor(String typeSimple);
|
||||
String getLinkFor(String corePath, String typeSimple);
|
||||
BindingResolution resolveBinding(StructureDefinition def,
|
||||
ElementDefinitionBindingComponent binding, String path) throws FHIRException;
|
||||
BindingResolution resolveBinding(StructureDefinition def, String url, String path) throws FHIRException;
|
||||
String getLinkForProfile(StructureDefinition profile, String url);
|
||||
boolean prependLinks();
|
||||
String getLinkForUrl(String corePath, String s);
|
||||
}
|
|
@ -1,24 +1,26 @@
|
|||
package org.hl7.fhir.r5.conformance.profile;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.With;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.conformance.ElementRedirection;
|
||||
import org.hl7.fhir.r5.model.CanonicalType;
|
||||
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent;
|
||||
import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
import org.hl7.fhir.utilities.i18n.I18nConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.With;
|
||||
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class ProfilePathProcessor {
|
||||
|
@ -279,7 +281,7 @@ public class ProfilePathProcessor {
|
|||
throw new DefinitionException(profileUtilities.getContext().formatMessage(I18nConstants.NOT_DONE_YET));
|
||||
}
|
||||
if (profileUtilities.hasInnerDiffMatches(getDifferential(), currentBasePath, cursors.diffCursor, getDiffLimit(), cursors.base.getElement(), false)) {
|
||||
if (profileUtilities.baseHasChildren(cursors.base, currentBase)) { // not a new type here
|
||||
if (baseHasChildren(cursors.base, currentBase)) { // not a new type here
|
||||
throw new Error("This situation is not yet handled (constrain slicing to 1..1 and fix base slice for inline structure - please report issue to grahame@fhir.org along with a test case that reproduces this error (@ " + currentBasePath + " | " + currentBase.getPath() + ")");
|
||||
} else {
|
||||
StructureDefinition dt = profileUtilities.getTypeForElement(getDifferential(), cursors.diffCursor, getProfileName(), diffMatches, outcome, getWebUrl(), getDerived());
|
||||
|
@ -689,6 +691,28 @@ public class ProfilePathProcessor {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int indexOfFirstNonChild(StructureDefinitionSnapshotComponent base, ElementDefinition currentBase, int i, int baseLimit) {
|
||||
return baseLimit+1;
|
||||
}
|
||||
|
||||
private boolean baseHasChildren(StructureDefinitionSnapshotComponent base, ElementDefinition ed) {
|
||||
int index = base.getElement().indexOf(ed);
|
||||
if (index == -1 || index >= base.getElement().size()-1)
|
||||
return false;
|
||||
String p = base.getElement().get(index+1).getPath();
|
||||
return isChildOf(p, ed.getPath());
|
||||
}
|
||||
|
||||
|
||||
private boolean isChildOf(String sub, String focus) {
|
||||
if (focus.endsWith("[x]")) {
|
||||
focus = focus.substring(0, focus.length()-3);
|
||||
return sub.startsWith(focus);
|
||||
} else
|
||||
return sub.startsWith(focus+".");
|
||||
}
|
||||
|
||||
|
||||
private void processSimplePathWithEmptyDiffMatches(ElementDefinition currentBase, String currentBasePath, List<ElementDefinition> diffMatches, ProfilePathProcessorState cursors) {
|
||||
ElementDefinition outcome = profileUtilities.updateURLs(getUrl(), getWebUrl(), currentBase.copy());
|
||||
outcome.setPath(profileUtilities.fixedPathDest(getContextPathTarget(), outcome.getPath(), getRedirector(), getContextPathSource()));
|
||||
|
@ -703,10 +727,10 @@ public class ProfilePathProcessor {
|
|||
if (profileUtilities.hasInnerDiffMatches(getDifferential(), currentBasePath, cursors.diffCursor, getDiffLimit(), cursors.base.getElement(), true)) {
|
||||
// well, the profile walks into this, so we need to as well
|
||||
// did we implicitly step into a new type?
|
||||
if (profileUtilities.baseHasChildren(cursors.base, currentBase)) { // not a new type here
|
||||
if (baseHasChildren(cursors.base, currentBase)) { // not a new type here
|
||||
|
||||
this.incrementDebugIndent().withSlicing(new PathSlicingParams()). processPaths( new ProfilePathProcessorState(cursors.base, cursors.baseCursor + 1, cursors.diffCursor, cursors.contextName, cursors.resultPathBase));
|
||||
cursors.baseCursor = profileUtilities.indexOfFirstNonChild(cursors.base, currentBase, cursors.baseCursor + 1, getBaseLimit());
|
||||
cursors.baseCursor = indexOfFirstNonChild(cursors.base, currentBase, cursors.baseCursor + 1, getBaseLimit());
|
||||
}
|
||||
else {
|
||||
if (outcome.getType().size() == 0 && !outcome.hasContentReference()) {
|
||||
|
@ -858,7 +882,7 @@ public class ProfilePathProcessor {
|
|||
profileUtilities.updateFromDefinition(outcome, diffMatches.get(0), getProfileName(), closed, getUrl(), getSourceStructureDefinition(), getDerived()); // if there's no slice, we don't want to update the unsliced description
|
||||
profileUtilities.removeStatusExtensions(outcome);
|
||||
} else if (!diffMatches.get(0).hasSliceName()) {
|
||||
diffMatches.get(0).setUserData(profileUtilities.GENERATED_IN_SNAPSHOT, outcome); // because of updateFromDefinition isn't called
|
||||
diffMatches.get(0).setUserData(profileUtilities.UD_GENERATED_IN_SNAPSHOT, outcome); // because of updateFromDefinition isn't called
|
||||
}
|
||||
|
||||
getResult().getElement().add(outcome);
|
||||
|
@ -954,8 +978,8 @@ public class ProfilePathProcessor {
|
|||
outcome.setPath(profileUtilities.fixedPathDest(getContextPathTarget(), outcome.getPath(), getRedirector(), getContextPathSource()));
|
||||
if (!outcome.getPath().startsWith(cursors.resultPathBase))
|
||||
throw new DefinitionException(profileUtilities.getContext().formatMessage(I18nConstants.ADDING_WRONG_PATH));
|
||||
outcome.setUserData(profileUtilities.BASE_PATH, outcome.getPath());
|
||||
outcome.setUserData(profileUtilities.BASE_MODEL, getSourceStructureDefinition().getUrl());
|
||||
outcome.setUserData(profileUtilities.UD_BASE_PATH, outcome.getPath());
|
||||
outcome.setUserData(profileUtilities.UD_BASE_MODEL, getSourceStructureDefinition().getUrl());
|
||||
getResult().getElement().add(outcome);
|
||||
cursors.baseCursor++;
|
||||
}
|
||||
|
@ -1223,13 +1247,13 @@ public class ProfilePathProcessor {
|
|||
getResult().getElement().add(outcome);
|
||||
// the profile walks into this, so we need to as well
|
||||
// did we implicitly step into a new type?
|
||||
if (profileUtilities.baseHasChildren(cursors.base, currentBase)) { // not a new type here
|
||||
if (baseHasChildren(cursors.base, currentBase)) { // not a new type here
|
||||
|
||||
this
|
||||
.incrementDebugIndent()
|
||||
.withSlicing(new PathSlicingParams()).processPaths(
|
||||
new ProfilePathProcessorState(cursors.base, cursors.baseCursor + 1, cursors.diffCursor, cursors.contextName, cursors.resultPathBase));
|
||||
cursors.baseCursor = profileUtilities.indexOfFirstNonChild(cursors.base, currentBase, cursors.baseCursor, getBaseLimit());
|
||||
cursors.baseCursor = indexOfFirstNonChild(cursors.base, currentBase, cursors.baseCursor, getBaseLimit());
|
||||
} else {
|
||||
StructureDefinition dt = profileUtilities.getTypeForElement(getDifferential(), cursors.diffCursor, getProfileName(), diffMatches, outcome, getWebUrl(), getDerived());
|
||||
cursors.contextName = dt.getUrl();
|
||||
|
@ -1264,8 +1288,8 @@ public class ProfilePathProcessor {
|
|||
if (!outcome.getPath().startsWith(cursors.resultPathBase))
|
||||
throw new DefinitionException(profileUtilities.getContext().formatMessage(I18nConstants.ADDING_WRONG_PATH_IN_PROFILE___VS_, getProfileName(), outcome.getPath(), cursors.resultPathBase));
|
||||
getResult().getElement().add(outcome); // so we just copy it in
|
||||
outcome.setUserData(profileUtilities.BASE_MODEL, getSourceStructureDefinition().getUrl());
|
||||
outcome.setUserData(profileUtilities.BASE_PATH, cursors.resultPathBase);
|
||||
outcome.setUserData(profileUtilities.UD_BASE_MODEL, getSourceStructureDefinition().getUrl());
|
||||
outcome.setUserData(profileUtilities.UD_BASE_PATH, cursors.resultPathBase);
|
||||
cursors.baseCursor++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package org.hl7.fhir.r5.conformance.profile;
|
||||
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
|
||||
@AllArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
public class ProfilePathProcessorState {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,8 +10,9 @@ import java.util.Set;
|
|||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.conformance.profile.BindingResolution;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.model.CanonicalResource;
|
||||
import org.hl7.fhir.r5.model.CodeSystem;
|
||||
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||
|
|
|
@ -15,7 +15,6 @@ import java.time.format.FormatStyle;
|
|||
import java.time.format.SignStyle;
|
||||
import java.util.Currency;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.hl7.fhir.r5.context.IWorkerContext;
|
|||
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext.GenerationRules;
|
||||
import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode;
|
||||
import org.hl7.fhir.r5.utils.TranslatingUtilities;
|
||||
import org.hl7.fhir.utilities.MarkDownProcessor;
|
||||
import org.hl7.fhir.utilities.MarkDownProcessor.Dialect;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
|
@ -25,7 +26,7 @@ import org.hl7.fhir.utilities.validation.ValidationOptions;
|
|||
* @author graha
|
||||
*
|
||||
*/
|
||||
public class Renderer {
|
||||
public class Renderer extends TranslatingUtilities {
|
||||
|
||||
protected RenderingContext context;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ 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;
|
||||
|
||||
|
|
|
@ -2,11 +2,9 @@ package org.hl7.fhir.r5.renderers;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.context.ContextUtilities;
|
||||
import org.hl7.fhir.r5.model.ActorDefinition;
|
||||
import org.hl7.fhir.r5.model.CanonicalResource;
|
||||
import org.hl7.fhir.r5.model.CanonicalType;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -11,8 +11,8 @@ import java.util.Map;
|
|||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.r5.elementmodel.Element;
|
||||
import org.hl7.fhir.r5.model.Base;
|
||||
|
@ -356,6 +356,9 @@ public class RenderingContext {
|
|||
|
||||
public RenderingContext setProfileUtilities(ProfileUtilities profileUtilities) {
|
||||
this.profileUtilitiesR = profileUtilities;
|
||||
if (pkp == null && profileUtilities.getPkp() != null) {
|
||||
pkp = profileUtilities.getPkp();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ package org.hl7.fhir.r5.utils.structuremap;
|
|||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.context.ContextUtilities;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult;
|
||||
|
|
|
@ -106,7 +106,7 @@ public class PETests {
|
|||
checkElement(gchildren.get(0), "extension", "extension", 0, Integer.MAX_VALUE, false, "http://hl7.org/fhir/StructureDefinition/Extension", 3, "extension");
|
||||
checkElement(gchildren.get(1), "extension", "slice1", 0, 2, false, "http://hl7.org/fhir/StructureDefinition/Coding", 6, "extension('slice1').value");
|
||||
checkElement(gchildren.get(2), "extension", "slice2", 0, Integer.MAX_VALUE, false, "http://hl7.org/fhir/StructureDefinition/string", 2, "extension('slice2').value");
|
||||
checkElement(gchildren.get(3), "extension", "slice3", 1, 1, false, "http://hl7.org/fhir/StructureDefinition/Extension", 3, "extension('slice3').extension");
|
||||
checkElement(gchildren.get(3), "extension", "slice3", 1, 1, false, "http://hl7.org/fhir/StructureDefinition/Extension", 3, "extension('slice3')");
|
||||
|
||||
ggchildren = gchildren.get(3).children("http://hl7.org/fhir/StructureDefinition/Extension");
|
||||
checkElement(ggchildren.get(0), "extension", "extension", 0, Integer.MAX_VALUE, false, "http://hl7.org/fhir/StructureDefinition/Extension", 3, "extension");
|
||||
|
|
|
@ -11,8 +11,9 @@ import javax.xml.parsers.ParserConfigurationException;
|
|||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.conformance.profile.BindingResolution;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.r5.elementmodel.Manager;
|
||||
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
|
||||
|
|
|
@ -17,8 +17,9 @@ import org.hl7.fhir.exceptions.FHIRException;
|
|||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.exceptions.PathEngineException;
|
||||
import org.hl7.fhir.r5.DiffUtils;
|
||||
import org.hl7.fhir.r5.conformance.profile.BindingResolution;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.test.utils.TestPackageLoader;
|
||||
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
||||
import org.hl7.fhir.r5.formats.JsonParser;
|
||||
|
|
|
@ -16,8 +16,9 @@ import org.hl7.fhir.exceptions.DefinitionException;
|
|||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.exceptions.PathEngineException;
|
||||
import org.hl7.fhir.r5.conformance.profile.BindingResolution;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.ProfileKnowledgeProvider;
|
||||
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
||||
import org.hl7.fhir.r5.formats.XmlParser;
|
||||
import org.hl7.fhir.r5.model.Base;
|
||||
|
|
Loading…
Reference in New Issue