FHIR-27761 Tooling issues around multi-level Operations

This commit is contained in:
Grahame Grieve 2023-02-14 15:08:55 +11:00
parent de3ec0d27b
commit b46160bc8b
1 changed files with 12 additions and 0 deletions

View File

@ -5,9 +5,11 @@ import java.io.UnsupportedEncodingException;
import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.r5.model.CodeType;
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.model.Extension; import org.hl7.fhir.r5.model.Extension;
import org.hl7.fhir.r5.model.OperationDefinition; import org.hl7.fhir.r5.model.OperationDefinition;
import org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent; import org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent;
import org.hl7.fhir.r5.model.OperationDefinition.OperationParameterScope;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.renderers.utils.RenderingContext; import org.hl7.fhir.r5.renderers.utils.RenderingContext;
@ -15,6 +17,7 @@ import org.hl7.fhir.r5.renderers.utils.RenderingContext.KnownLinkType;
import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext; import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext;
import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.r5.utils.EOperationOutcome;
import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.StandardsStatus; import org.hl7.fhir.utilities.StandardsStatus;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.xhtml.XhtmlNode; import org.hl7.fhir.utilities.xhtml.XhtmlNode;
@ -75,6 +78,7 @@ public class OperationDefinitionRenderer extends TerminologyRenderer {
XhtmlNode tr = tbl.tr(); XhtmlNode tr = tbl.tr();
tr.td().b().tx("Use"); tr.td().b().tx("Use");
tr.td().b().tx("Name"); tr.td().b().tx("Name");
tr.td().b().tx("Scope");
tr.td().b().tx("Cardinality"); tr.td().b().tx("Cardinality");
tr.td().b().tx("Type"); tr.td().b().tx("Type");
tr.td().b().tx("Binding"); tr.td().b().tx("Binding");
@ -112,6 +116,14 @@ public class OperationDefinitionRenderer extends TerminologyRenderer {
a.style("padding-left: 3px; padding-right: 3px; border: 1px grey solid; font-weight: bold; color: black; background-color: "+ss.getColor()); a.style("padding-left: 3px; padding-right: 3px; border: 1px grey solid; font-weight: bold; color: black; background-color: "+ss.getColor());
a.tx(ss.getAbbrev()); a.tx(ss.getAbbrev());
} }
td = tr.td();
if (p.hasScope()) {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
for (Enumeration<OperationParameterScope> s : p.getScope()) {
b.append(s.getCode());
}
td.tx(b.toString());
}
tr.td().addText(Integer.toString(p.getMin())+".."+p.getMax()); tr.td().addText(Integer.toString(p.getMin())+".."+p.getMax());
td = tr.td(); td = tr.td();
StructureDefinition sd = p.getType() != null ? context.getWorker().fetchTypeDefinition(p.getType().toCode()) : null; StructureDefinition sd = p.getType() != null ? context.getWorker().fetchTypeDefinition(p.getType().toCode()) : null;