Merge pull request #891 from hapifhir/gg-202208-ids

Gg 202208 ids
This commit is contained in:
Grahame Grieve 2022-08-09 23:19:24 +10:00 committed by GitHub
commit 1813ed5260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 591 additions and 134 deletions

View File

@ -624,6 +624,8 @@ public class ProfileUtilities extends TranslatingUtilities {
throw new DefinitionException(context.formatMessage(I18nConstants.BASE__DERIVED_PROFILES_HAVE_DIFFERENT_TYPES____VS___, base.getUrl(), base.getType(), derived.getUrl(), derived.getType()));
}
fixTypeOfResourceId(base);
if (snapshotStack.contains(derived.getUrl())) {
throw new DefinitionException(context.formatMessage(I18nConstants.CIRCULAR_SNAPSHOT_REFERENCES_DETECTED_CANNOT_GENERATE_SNAPSHOT_STACK__, snapshotStack.toString()));
}
@ -803,6 +805,25 @@ public class ProfileUtilities extends TranslatingUtilities {
}
}
private void fixTypeOfResourceId(StructureDefinition base) {
if (base.getKind() == StructureDefinitionKind.RESOURCE && (base.getFhirVersion() == null || VersionUtilities.isR4Plus(base.getFhirVersion().toCode()))) {
fixTypeOfResourceId(base.getSnapshot().getElement());
fixTypeOfResourceId(base.getDifferential().getElement());
}
}
private void fixTypeOfResourceId(List<ElementDefinition> list) {
for (ElementDefinition ed : list) {
if (ed.hasBase() && ed.getBase().getPath().equals("Resource.id")) {
for (TypeRefComponent tr : ed.getType()) {
tr.setCode("http://hl7.org/fhirpath/System.String");
tr.removeExtension(ToolingExtensions.EXT_FHIR_TYPE);
ToolingExtensions.addUrlExtension(tr, ToolingExtensions.EXT_FHIR_TYPE, "id");
}
}
}
}
public void checkDifferentialBaseType(StructureDefinition derived) throws Error {
if (derived.hasDifferential() && !derived.getDifferential().getElementFirstRep().getPath().contains(".") && !derived.getDifferential().getElementFirstRep().getType().isEmpty()) {
if (wantFixDifferentialFirstElementType && typeMatchesAncestor(derived.getDifferential().getElementFirstRep().getType(), derived.getBaseDefinition())) {
@ -3740,7 +3761,7 @@ public class ProfileUtilities extends TranslatingUtilities {
}
} else if (Utilities.isAbsoluteUrl(u)) {
StructureDefinition sd = context.fetchResource(StructureDefinition.class, u);
if (sd != null) {
if (sd != null && pkp != null) {
String disp = sd.hasTitle() ? sd.getTitle() : sd.getName();
String ref = pkp.getLinkForProfile(null, sd.getUrl());
if (ref != null && ref.contains("|"))
@ -4214,6 +4235,7 @@ public class ProfileUtilities extends TranslatingUtilities {
Row currRow = row;
List<ElementChoiceGroup> groups = readChoices(element, children);
boolean isExtension = Utilities.existsInList(tail(element.getPath()), "extension", "modifierExtension");
if (!element.prohibited()) {
for (ElementDefinition child : children) {
if (!child.hasSliceName()) {
currRow = row;
@ -4224,6 +4246,7 @@ public class ProfileUtilities extends TranslatingUtilities {
currRow = genElement(defPath, gen, childRow.getSubRows(), child, all, profiles, showMissing, profileBaseFileName, isExtension, snapshot, corePath, imagePath, false, logicalModel, isConstraintMode, allInvariants, currRow, mustSupport, rc);
}
}
}
// if (!snapshot && (extensions == null || !extensions))
// for (ElementDefinition child : children)
// if (child.getPath().endsWith(".extension") || child.getPath().endsWith(".modifierExtension"))
@ -4334,7 +4357,7 @@ public class ProfileUtilities extends TranslatingUtilities {
res.add(addCell(row, gen.new Cell(null, null, "?gen-e1? "+element.getType().get(0).getProfile(), null, null)));
res.add(generateDescription(gen, row, element, (ElementDefinition) element.getUserData(DERIVATION_POINTER), used.used, profile == null ? "" : profile.getUrl(), eurl, profile, corePath, imagePath, root, logicalModel, allInvariants, snapshot, mustSupport, allowSubRows, rc));
} else {
String name = urltail(eurl);
String name = element.hasSliceName() ? element.getSliceName() : urltail(eurl);
nameCell.getPieces().get(0).setText(name);
// left.getPieces().get(0).setReference((String) extDefn.getExtensionStructure().getTag("filename"));
nameCell.getPieces().get(0).setHint(translate("sd.table", "Extension URL")+" = "+extDefn.getUrl());

View File

@ -11464,6 +11464,26 @@ When pattern[x] is used to constrain a complex object, it means that each proper
return getType().size() == 1 && Utilities.existsInList(getType().get(0).getCode(), "Element", "BackboneElement");
}
public boolean prohibited() {
return "0".equals(getMax());
}
public boolean hasFixedOrPattern() {
return hasFixed() || hasPattern();
}
public DataType getFixedOrPattern() {
return hasFixed() ? getFixed() : getPattern();
}
public boolean isProhibited() {
return "0".equals(getMax());
}
public boolean isRequired() {
return getMin() == 1;
}
// end addition

View File

@ -1,5 +1,9 @@
package org.hl7.fhir.r4b.renderers;
import static java.time.temporal.ChronoField.DAY_OF_MONTH;
import static java.time.temporal.ChronoField.MONTH_OF_YEAR;
import static java.time.temporal.ChronoField.YEAR;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
@ -9,8 +13,12 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.chrono.IsoChronology;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.FormatStyle;
import java.time.format.ResolverStyle;
import java.time.format.SignStyle;
import java.util.Currency;
import java.util.List;
import java.util.TimeZone;
@ -22,6 +30,7 @@ import org.hl7.fhir.r4b.context.IWorkerContext;
import org.hl7.fhir.r4b.context.IWorkerContext.ValidationResult;
import org.hl7.fhir.r4b.model.Address;
import org.hl7.fhir.r4b.model.Annotation;
import org.hl7.fhir.r4b.model.BackboneType;
import org.hl7.fhir.r4b.model.Base;
import org.hl7.fhir.r4b.model.BaseDateTimeType;
import org.hl7.fhir.r4b.model.CanonicalResource;
@ -39,6 +48,8 @@ import org.hl7.fhir.r4b.model.DataRequirement.SortDirection;
import org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem;
import org.hl7.fhir.r4b.model.DataType;
import org.hl7.fhir.r4b.model.DateTimeType;
import org.hl7.fhir.r4b.model.DateType;
import org.hl7.fhir.r4b.model.ElementDefinition;
import org.hl7.fhir.r4b.model.Enumeration;
import org.hl7.fhir.r4b.model.Expression;
import org.hl7.fhir.r4b.model.Extension;
@ -69,6 +80,7 @@ import org.hl7.fhir.r4b.renderers.utils.BaseWrappers.BaseWrapper;
import org.hl7.fhir.r4b.renderers.utils.RenderingContext;
import org.hl7.fhir.r4b.renderers.utils.RenderingContext.ResourceRendererMode;
import org.hl7.fhir.r4b.utils.ToolingExtensions;
import org.hl7.fhir.r4b.utils.ToolingExtensions;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.MarkDownProcessor;
import org.hl7.fhir.utilities.MarkDownProcessor.Dialect;
@ -348,8 +360,138 @@ public class DataRenderer extends Renderer {
return value.primitiveValue();
}
// -- 6. General purpose extension rendering ----------------------------------------------
// -- 5. Data type Rendering ----------------------------------------------
public boolean hasRenderableExtensions(DataType element) {
for (Extension ext : element.getExtension()) {
if (canRender(ext)) {
return true;
}
}
return false;
}
public boolean hasRenderableExtensions(BackboneType element) {
for (Extension ext : element.getExtension()) {
if (canRender(ext)) {
return true;
}
}
return element.hasModifierExtension();
}
private String getExtensionLabel(Extension ext) {
StructureDefinition sd = context.getWorker().fetchResource(StructureDefinition.class, ext.getUrl());
if (sd != null && ext.getValue().isPrimitive() && sd.hasSnapshot()) {
for (ElementDefinition ed : sd.getSnapshot().getElement()) {
if (Utilities.existsInList(ed.getPath(), "Extension", "Extension.value[x]") && ed.hasLabel()) {
return ed.getLabel();
}
}
}
return null;
}
private boolean canRender(Extension ext) {
return getExtensionLabel(ext) != null;
}
public void renderExtensionsInList(XhtmlNode ul, DataType element) throws FHIRFormatError, DefinitionException, IOException {
for (Extension ext : element.getExtension()) {
if (canRender(ext)) {
String lbl = getExtensionLabel(ext);
XhtmlNode li = ul.li();
li.tx(lbl);
li.tx(": ");
render(li, ext.getValue());
}
}
}
public void renderExtensionsInList(XhtmlNode ul, BackboneType element) throws FHIRFormatError, DefinitionException, IOException {
for (Extension ext : element.getModifierExtension()) {
if (canRender(ext)) {
String lbl = getExtensionLabel(ext);
XhtmlNode li = ul.li();
li = li.b();
li.tx(lbl);
li.tx(": ");
render(li, ext.getValue());
} else {
// somehow have to do better than this
XhtmlNode li = ul.li();
li.b().tx("WARNING: Unrenderable Modifier Extension!");
}
}
for (Extension ext : element.getExtension()) {
if (canRender(ext)) {
String lbl = getExtensionLabel(ext);
XhtmlNode li = ul.li();
li.tx(lbl);
li.tx(": ");
render(li, ext.getValue());
}
}
}
public void renderExtensionsInText(XhtmlNode div, DataType element, String sep) throws FHIRFormatError, DefinitionException, IOException {
boolean first = true;
for (Extension ext : element.getExtension()) {
if (canRender(ext)) {
if (first) {
first = false;
} else {
div.tx(sep);
div.tx(" ");
}
String lbl = getExtensionLabel(ext);
div.tx(lbl);
div.tx(": ");
render(div, ext.getValue());
}
}
}
public void renderExtensionsInList(XhtmlNode div, BackboneType element, String sep) throws FHIRFormatError, DefinitionException, IOException {
boolean first = true;
for (Extension ext : element.getModifierExtension()) {
if (first) {
first = false;
} else {
div.tx(sep);
div.tx(" ");
}
if (canRender(ext)) {
String lbl = getExtensionLabel(ext);
XhtmlNode b = div.b();
b.tx(lbl);
b.tx(": ");
render(div, ext.getValue());
} else {
// somehow have to do better than this
div.b().tx("WARNING: Unrenderable Modifier Extension!");
}
}
for (Extension ext : element.getExtension()) {
if (canRender(ext)) {
if (first) {
first = false;
} else {
div.tx(sep);
div.tx(" ");
}
String lbl = getExtensionLabel(ext);
div.tx(lbl);
div.tx(": ");
render(div, ext.getValue());
}
}
}
// -- 6. Data type Rendering ----------------------------------------------
public static String display(IWorkerContext context, DataType type) {
return new DataRenderer(new RenderingContext(context, null, null, "http://hl7.org/fhir/R4", "", null, ResourceRendererMode.END_USER)).display(type);
@ -413,15 +555,8 @@ public class DataRenderer extends Renderer {
// mode - if rendering mode is technical, format defaults to XML format
// locale - otherwise, format defaults to SHORT for the Locale (which defaults to default Locale)
if (isOnlyDate(type.getPrecision())) {
DateTimeFormatter fmt = context.getDateFormat();
if (fmt == null) {
if (context.isTechnicalMode()) {
fmt = DateTimeFormatter.ISO_DATE;
} else {
fmt = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT).withLocale(context.getLocale());
}
}
DateTimeFormatter fmt = getDateFormatForPrecision(type);
LocalDate date = LocalDate.of(type.getYear(), type.getMonth()+1, type.getDay());
return fmt.format(date);
}
@ -442,6 +577,43 @@ public class DataRenderer extends Renderer {
return fmt.format(zdt);
}
private DateTimeFormatter getDateFormatForPrecision(BaseDateTimeType type) {
DateTimeFormatter fmt = getContextDateFormat(type);
if (fmt != null) {
return fmt;
}
if (context.isTechnicalMode()) {
switch (type.getPrecision()) {
case YEAR:
return new DateTimeFormatterBuilder().appendValue(YEAR, 4, 10, SignStyle.EXCEEDS_PAD).toFormatter();
case MONTH:
return new DateTimeFormatterBuilder().appendValue(YEAR, 4, 10, SignStyle.EXCEEDS_PAD).appendLiteral('-').appendValue(MONTH_OF_YEAR, 2).toFormatter();
default:
return DateTimeFormatter.ISO_DATE;
}
} else {
switch (type.getPrecision()) {
case YEAR:
return DateTimeFormatter.ofPattern("uuuu");
case MONTH:
return DateTimeFormatter.ofPattern("MMM uuuu");
default:
return DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT).withLocale(context.getLocale());
}
}
}
private DateTimeFormatter getContextDateFormat(BaseDateTimeType type) {
switch (type.getPrecision()) {
case YEAR:
return context.getDateYearFormat();
case MONTH:
return context.getDateYearMonthFormat();
default:
return context.getDateFormat();
}
}
private boolean isOnlyDate(TemporalPrecisionEnum temporalPrecisionEnum) {
return temporalPrecisionEnum == TemporalPrecisionEnum.YEAR || temporalPrecisionEnum == TemporalPrecisionEnum.MONTH || temporalPrecisionEnum == TemporalPrecisionEnum.DAY;
}
@ -533,6 +705,12 @@ public class DataRenderer extends Renderer {
}
}
public void renderDate(XhtmlNode x, Base e) {
if (e.hasPrimitiveValue()) {
x.addText(displayDateTime((DateType) e));
}
}
public void renderDateTime(XhtmlNode x, String s) {
if (s != null) {
DateTimeType dt = new DateTimeType(s);
@ -739,7 +917,7 @@ public class DataRenderer extends Renderer {
CodeSystem cs = context.getWorker().fetchCodeSystem(system, version);
if (cs != null && cs.hasUserData("path")) {
if (!Utilities.noString(code)) {
return cs.getUserString("path")+"#"+Utilities.nmtokenize(code);
return cs.getUserString("path")+"#"+cs.getId()+"-"+Utilities.nmtokenize(code);
} else {
return cs.getUserString("path");
}
@ -755,8 +933,9 @@ public class DataRenderer extends Renderer {
if (Utilities.noString(s))
s = lookupCode(c.getSystem(), c.getVersion(), c.getCode());
CodeSystem cs = context.getWorker().fetchCodeSystem(c.getSystem());
String sn = describeSystem(c.getSystem());
String sn = cs != null ? cs.present() : describeSystem(c.getSystem());
String link = getLinkForCode(c.getSystem(), c.getVersion(), c.getCode());
if (link != null) {
x.ah(link).tx(sn);
@ -821,11 +1000,11 @@ public class DataRenderer extends Renderer {
return s;
}
protected void renderCodeableConcept(XhtmlNode x, CodeableConcept cc) {
protected void renderCodeableConcept(XhtmlNode x, CodeableConcept cc) throws FHIRFormatError, DefinitionException, IOException {
renderCodeableConcept(x, cc, false);
}
protected void renderCodeableReference(XhtmlNode x, CodeableReference e, boolean showCodeDetails) {
protected void renderCodeableReference(XhtmlNode x, CodeableReference e, boolean showCodeDetails) throws FHIRFormatError, DefinitionException, IOException {
if (e.hasConcept()) {
renderCodeableConcept(x, e.getConcept(), showCodeDetails);
}
@ -834,7 +1013,7 @@ public class DataRenderer extends Renderer {
}
}
protected void renderCodeableConcept(XhtmlNode x, CodeableConcept cc, boolean showCodeDetails) {
protected void renderCodeableConcept(XhtmlNode x, CodeableConcept cc, boolean showCodeDetails) throws FHIRFormatError, DefinitionException, IOException {
if (cc.isEmpty()) {
return;
}
@ -890,6 +1069,12 @@ public class DataRenderer extends Renderer {
sp.tx(" \""+c.getDisplay()+"\"");
}
}
if (hasRenderableExtensions(cc)) {
if (!first) {
sp.tx("; ");
}
renderExtensionsInText(sp, cc, ";");
}
sp.tx(")");
} else {
@ -1139,9 +1324,11 @@ public class DataRenderer extends Renderer {
protected String displayQuantity(Quantity q) {
StringBuilder s = new StringBuilder();
s.append("(system = '").append(TerminologyRenderer.describeSystem(q.getSystem()))
.append("' code ").append(q.getCode())
.append(" = '").append(lookupCode(q.getSystem(), null, q.getCode())).append("')");
s.append(q.hasValue() ? q.getValue() : "?");
if (q.hasUnit())
s.append(" ").append(q.getUnit());
else if (q.hasCode())
s.append(" ").append(q.getCode());
return s.toString();
}
@ -1158,26 +1345,33 @@ public class DataRenderer extends Renderer {
}
if (q.hasUnit())
x.tx(" "+q.getUnit());
else if (q.hasCode())
else if (q.hasCode() && q.hasSystem()) {
// if there's a code there *shall* be a system, so if we've got one and not the other, things are invalid and we won't bother trying to render
if (q.hasSystem() && q.getSystem().equals("http://unitsofmeasure.org"))
x.tx(" "+q.getCode());
else
x.tx("(unit "+q.getCode()+" from "+q.getSystem()+")");
}
if (showCodeDetails && q.hasCode()) {
x.span("background: LightGoldenRodYellow", null).tx(" (Details: "+TerminologyRenderer.describeSystem(q.getSystem())+" code "+q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')");
}
}
public String displayRange(Range q) {
if (!q.hasLow() && !q.hasHigh())
return "?";
StringBuilder b = new StringBuilder();
if (q.hasLow())
b.append(q.getLow().getValue().toString());
else
b.append("?");
b.append("-");
if (q.hasHigh())
b.append(q.getHigh().getValue().toString());
else
b.append("?");
if (q.getLow().hasUnit())
b.append(" "+q.getLow().getUnit());
boolean sameUnits = (q.getLow().hasUnit() && q.getHigh().hasUnit() && q.getLow().getUnit().equals(q.getHigh().getUnit()))
|| (q.getLow().hasCode() && q.getHigh().hasCode() && q.getLow().getCode().equals(q.getHigh().getCode()));
String low = "?";
if (q.hasLow() && q.getLow().hasValue())
low = sameUnits ? q.getLow().getValue().toString() : displayQuantity(q.getLow());
String high = displayQuantity(q.getHigh());
if (high.isEmpty())
high = "?";
b.append(low).append("\u00A0to\u00A0").append(high);
return b.toString();
}

View File

@ -106,7 +106,10 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
if (context.isAddGeneratedNarrativeHeader()) {
x.para().b().tx("Generated Narrative: "+r.fhirType());
}
if (context.isTechnicalMode()) {
if (!Utilities.noString(r.getId())) {
x.an(r.getId());
}
if (context.isTechnicalMode() && !context.isContained()) {
renderResourceHeader(r, x);
}
try {
@ -312,9 +315,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
x.addText(new Base64().encodeAsString(((Base64BinaryType) e).getValue()));
else if (e instanceof org.hl7.fhir.r4b.model.DateType) {
org.hl7.fhir.r4b.model.DateType dt = ((org.hl7.fhir.r4b.model.DateType) e);
if (((org.hl7.fhir.r4b.model.DateType) e).hasValue()) {
x.addText(((org.hl7.fhir.r4b.model.DateType) e).toHumanDisplay());
}
renderDate(x, dt);
} else if (e instanceof Enumeration) {
Object ev = ((Enumeration<?>) e).getValue();
x.addText(ev == null ? "" : ev.toString()); // todo: look up a display name if there is one
@ -397,9 +398,17 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
if (rw == null) {
renderReference(res, x, r);
} else {
String ref = context.getResolver().urlForContained(context, res.fhirType(), res.getId(), rw.fhirType(), rw.getId());
if (ref == null) {
x.an(rw.getId());
ResourceRenderer rr = RendererFactory.factory(rw, context.copy().setAddGeneratedNarrativeHeader(false));
RenderingContext ctxtc = context.copy();
ctxtc.setAddGeneratedNarrativeHeader(false);
ctxtc.setContained(true);
ResourceRenderer rr = RendererFactory.factory(rw, ctxtc);
rr.render(parent.blockquote(), rw);
} else {
x.ah(ref).tx("See "+rw.fhirType());
}
}
}
} else {
@ -649,7 +658,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
private boolean generateByProfile(StructureDefinition profile, boolean showCodeDetails) {
XhtmlNode x = new XhtmlNode(NodeType.Element, "div");
if(context.isAddGeneratedNarrativeHeader()) {
x.para().b().tx("Generated Narrative"+(showCodeDetails ? " with Details" : ""));
x.para().b().tx("Generated Narrative: "+profile.present()+(showCodeDetails ? " with Details" : ""));
}
try {
generateByProfile(rcontext.getResourceResource(), profile, rcontext.getResourceResource(), profile.getSnapshot().getElement(), profile.getSnapshot().getElement().get(0), getChildrenForPath(profile.getSnapshot().getElement(), rcontext.getResourceResource().getResourceType().toString()), x, rcontext.getResourceResource().getResourceType().toString(), showCodeDetails);
@ -689,10 +698,13 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
boolean showCodeDetails, int indent, PropertyWrapper p, ElementDefinition child) throws UnsupportedEncodingException, IOException, EOperationOutcome {
Map<String, String> displayHints = readDisplayHints(child);
if ("DomainResource.contained".equals(child.getBase().getPath())) {
// if (p.getValues().size() > 0 && child != null) {
// for (BaseWrapper v : p.getValues()) {
// x.an(v.get("id").primitiveValue());
// }
// x.hr();
// RenderingContext ctxt = context.clone();
// ctxt.setContained(true);
// ResourceRenderer rnd = RendererFactory.factory(v.fhirType(), ctxt);
// ResourceWrapper rw = new ElementWrappers.ResourceWrapperMetaElement(ctxt, (org.hl7.fhir.r5.elementmodel.Element) v.getBase());
// rnd.render(x.blockquote(), rw);
// }
} else if (!exemptFromRendering(child)) {
if (isExtension(p)) {

View File

@ -53,7 +53,10 @@ public class Renderer {
protected static final String RENDER_BUNDLE_IF_MOD = "RENDER_BUNDLE_IF_MOD";
protected static final String RENDER_BUNDLE_IF_MATCH = "RENDER_BUNDLE_IF_MATCH";
protected static final String RENDER_BUNDLE_IF_NONE = "RENDER_BUNDLE_IF_NONE";
protected static final String RENDER_BUNDLE_DOCUMENT_CONTENT = "RENDER_BUNDLE_DOCUMENT_CONTENT";
protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_URD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_URD";
protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_U = "RENDER_BUNDLE_HEADER_DOC_ENTRY_U";
protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_RD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_RD";
/** the plan here is to make this have it's own implementation of messages, rather than using the
* validator messages, for better alignment with publisher I18n strategy

View File

@ -114,6 +114,9 @@ public class RendererFactory {
if ("Library".equals(resource.getName())) {
return new LibraryRenderer(context);
}
if ("Patient".equals(resource.getName())) {
return new PatientRenderer(context);
}
if ("DiagnosticReport".equals(resource.getName())) {
return new DiagnosticReportRenderer(context);
}

View File

@ -158,9 +158,8 @@ public abstract class ResourceRenderer extends DataRenderer {
if (target.hasUserData("path")) {
x.ah(target.getUserString("path")).tx(cr.present());
} else {
url = url.substring(0, url.indexOf("|"));
x.code().tx(url);
x.tx(": "+cr.present());
x.tx(" ("+cr.present()+")");
}
}
}
@ -414,6 +413,8 @@ public abstract class ResourceRenderer extends DataRenderer {
if (id != null || lang != null || versionId != null || lastUpdated != null) {
XhtmlNode p = plateStyle(div.para());
p.tx("Resource ");
p.tx(r.fhirType());
p.tx(" ");
if (id != null) {
p.tx("\""+id+"\" ");
}
@ -489,4 +490,16 @@ public abstract class ResourceRenderer extends DataRenderer {
private String getPrimitiveValue(ResourceWrapper r, String name) throws UnsupportedEncodingException, FHIRException, IOException {
return r.has(name) && r.getChildByName(name).hasValues() ? r.getChildByName(name).getValues().get(0).getBase().primitiveValue() : null;
}
public void renderOrError(DomainResource dr) {
try {
render(dr);
} catch (Exception e) {
XhtmlNode x = new XhtmlNode(NodeType.Element, "div");
x.para().tx("Error rendering: "+e.getMessage());
dr.setText(null);
inject(dr, x, NarrativeStatus.GENERATED);
}
}
}

View File

@ -105,6 +105,7 @@ public class RenderingContext {
private boolean canonicalUrlsAsLinks;
private boolean pretty;
private boolean header;
private boolean contained;
private ValidationOptions terminologyServiceOptions = new ValidationOptions();
private boolean noSlowLookup;
@ -127,6 +128,8 @@ public class RenderingContext {
private ZoneId timeZoneId;
private DateTimeFormatter dateTimeFormat;
private DateTimeFormatter dateFormat;
private DateTimeFormatter dateYearFormat;
private DateTimeFormatter dateYearMonthFormat;
/**
*
@ -151,6 +154,46 @@ public class RenderingContext {
this.locale = new Locale.Builder().setLanguageTag("en-US").build();
profileUtilities = new ProfileUtilities(worker, null, null);
}
public RenderingContext copy() {
RenderingContext res = new RenderingContext(worker, markdown, terminologyServiceOptions, specificationLink, localPrefix, lang, mode);
res.resolver = resolver;
res.templateProvider = templateProvider;
res.services = services;
res.parser = parser;
res.headerLevelContext = headerLevelContext;
res.canonicalUrlsAsLinks = canonicalUrlsAsLinks;
res.pretty = pretty;
res.contained = contained;
res.noSlowLookup = noSlowLookup;
res.tooCostlyNoteEmpty = tooCostlyNoteEmpty;
res.tooCostlyNoteNotEmpty = tooCostlyNoteNotEmpty;
res.tooCostlyNoteEmptyDependent = tooCostlyNoteEmptyDependent;
res.tooCostlyNoteNotEmptyDependent = tooCostlyNoteNotEmptyDependent;
res.codeSystemPropList.addAll(codeSystemPropList);
res.profileUtilities = profileUtilities;
res.definitionsTarget = definitionsTarget;
res.destDir = destDir;
res.addGeneratedNarrativeHeader = addGeneratedNarrativeHeader;
res.questionnaireMode = questionnaireMode;
res.header = header;
res.selfLink = selfLink;
res.inlineGraphics = inlineGraphics;
res.timeZoneId = timeZoneId;
res.dateTimeFormat = dateTimeFormat;
res.dateFormat = dateFormat;
res.dateYearFormat = dateYearFormat;
res.dateYearMonthFormat = dateYearMonthFormat;
res.targetVersion = targetVersion;
res.locale = locale;
res.terminologyServiceOptions = terminologyServiceOptions.copy();
return res;
}
public IWorkerContext getContext() {
return worker;
@ -336,32 +379,6 @@ public class RenderingContext {
return this;
}
public RenderingContext copy() {
RenderingContext res = new RenderingContext(worker, markdown, terminologyServiceOptions, specificationLink, localPrefix, lang, mode);
res.resolver = resolver;
res.templateProvider = templateProvider;
res.services = services;
res.parser = parser;
res.headerLevelContext = headerLevelContext;
res.canonicalUrlsAsLinks = canonicalUrlsAsLinks;
res.pretty = pretty;
res.noSlowLookup = noSlowLookup;
res.tooCostlyNoteEmpty = tooCostlyNoteEmpty;
res.tooCostlyNoteNotEmpty = tooCostlyNoteNotEmpty;
res.tooCostlyNoteEmptyDependent = tooCostlyNoteEmptyDependent;
res.tooCostlyNoteNotEmptyDependent = tooCostlyNoteNotEmptyDependent;
res.codeSystemPropList.addAll(codeSystemPropList);
res.profileUtilities = profileUtilities;
res.definitionsTarget = definitionsTarget;
res.destDir = destDir;
res.addGeneratedNarrativeHeader = addGeneratedNarrativeHeader;
return res;
}
public boolean isInlineGraphics() {
return inlineGraphics;
@ -514,6 +531,30 @@ public class RenderingContext {
this.dateFormat = DateTimeFormatter.ofPattern(dateFormat);
}
public DateTimeFormatter getDateYearFormat() {
return dateYearFormat;
}
public void setDateYearFormat(DateTimeFormatter dateYearFormat) {
this.dateYearFormat = dateYearFormat;
}
public void setDateYearFormatString(String dateYearFormat) {
this.dateYearFormat = DateTimeFormatter.ofPattern(dateYearFormat);
}
public DateTimeFormatter getDateYearMonthFormat() {
return dateYearMonthFormat;
}
public void setDateYearMonthFormat(DateTimeFormatter dateYearMonthFormat) {
this.dateYearMonthFormat = dateYearMonthFormat;
}
public void setDateYearMonthFormatString(String dateYearMonthFormat) {
this.dateYearMonthFormat = DateTimeFormatter.ofPattern(dateYearMonthFormat);
}
public ResourceRendererMode getMode() {
return mode;
}
@ -521,6 +562,14 @@ public class RenderingContext {
public void setMode(ResourceRendererMode mode) {
this.mode = mode;
}
public boolean isContained() {
return contained;
}
public void setContained(boolean contained) {
this.contained = contained;
}
}

View File

@ -18,6 +18,9 @@ public class Resolver {
public interface IReferenceResolver {
ResourceWithReference resolve(RenderingContext context, String url);
// returns null if contained resource is inlined
String urlForContained(RenderingContext context, String containingType, String containingId, String containedType, String containedId);
}
public static class ResourceContext {

View File

@ -639,6 +639,8 @@ public class ProfileUtilities extends TranslatingUtilities {
throw new DefinitionException(context.formatMessage(I18nConstants.BASE__DERIVED_PROFILES_HAVE_DIFFERENT_TYPES____VS___, base.getUrl(), base.getType(), derived.getUrl(), derived.getType()));
}
fixTypeOfResourceId(base);
if (snapshotStack.contains(derived.getUrl())) {
throw new DefinitionException(context.formatMessage(I18nConstants.CIRCULAR_SNAPSHOT_REFERENCES_DETECTED_CANNOT_GENERATE_SNAPSHOT_STACK__, snapshotStack.toString()));
}
@ -818,6 +820,25 @@ public class ProfileUtilities extends TranslatingUtilities {
}
}
private void fixTypeOfResourceId(StructureDefinition base) {
if (base.getKind() == StructureDefinitionKind.RESOURCE && (base.getFhirVersion() == null || VersionUtilities.isR4Plus(base.getFhirVersion().toCode()))) {
fixTypeOfResourceId(base.getSnapshot().getElement());
fixTypeOfResourceId(base.getDifferential().getElement());
}
}
private void fixTypeOfResourceId(List<ElementDefinition> list) {
for (ElementDefinition ed : list) {
if (ed.hasBase() && ed.getBase().getPath().equals("Resource.id")) {
for (TypeRefComponent tr : ed.getType()) {
tr.setCode("http://hl7.org/fhirpath/System.String");
tr.removeExtension(ToolingExtensions.EXT_FHIR_TYPE);
ToolingExtensions.addUrlExtension(tr, ToolingExtensions.EXT_FHIR_TYPE, "id");
}
}
}
}
public void checkDifferentialBaseType(StructureDefinition derived) throws Error {
if (derived.hasDifferential() && !derived.getDifferential().getElementFirstRep().getPath().contains(".") && !derived.getDifferential().getElementFirstRep().getType().isEmpty()) {
if (wantFixDifferentialFirstElementType && typeMatchesAncestor(derived.getDifferential().getElementFirstRep().getType(), derived.getBaseDefinition())) {

View File

@ -111,6 +111,7 @@ import org.hl7.fhir.r5.terminologies.ValueSetCheckerSimple;
import org.hl7.fhir.r5.terminologies.ValueSetExpander.TerminologyServiceErrorClass;
import org.hl7.fhir.r5.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
import org.hl7.fhir.r5.terminologies.ValueSetExpanderSimple;
import org.hl7.fhir.r5.utils.PackageHackerR5;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier;
import org.hl7.fhir.utilities.OIDUtils;
@ -121,6 +122,7 @@ import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.i18n.I18nBase;
import org.hl7.fhir.utilities.i18n.I18nConstants;
import org.hl7.fhir.utilities.npm.PackageHacker;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
import org.hl7.fhir.utilities.validation.ValidationOptions;
@ -312,6 +314,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
public void registerResourceFromPackage(CanonicalResourceProxy r, PackageVersion packageInfo) throws FHIRException {
PackageHackerR5.fixLoadedResource(r, packageInfo);
synchronized (lock) {
if (r.getId() != null) {
@ -326,13 +329,14 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
String url = r.getUrl();
if (!allowLoadingDuplicates && hasResource(r.getType(), url)) {
if (!allowLoadingDuplicates && hasResourceVersion(r.getType(), url, r.getVersion()) && !packageInfo.isHTO()) {
// spcial workaround for known problems with existing packages
if (Utilities.existsInList(url, "http://hl7.org/fhir/SearchParameter/example")) {
return;
}
throw new DefinitionException(formatMessage(I18nConstants.DUPLICATE_RESOURCE_, url,
fetchResourceWithException(r.getType(), url).fhirType()));
CanonicalResource ex = fetchResourceWithException(r.getType(), url);
throw new DefinitionException(formatMessage(I18nConstants.DUPLICATE_RESOURCE_, url, r.getVersion(), ex.getVersion(),
ex.fhirType()));
}
switch(r.getType()) {
case "StructureDefinition":
@ -413,8 +417,9 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
if (Utilities.existsInList(url, "http://hl7.org/fhir/SearchParameter/example")) {
return;
}
throw new DefinitionException(formatMessage(I18nConstants.DUPLICATE_RESOURCE_, url,
fetchResourceWithException(r.getClass(), url).fhirType()));
CanonicalResource ex = (CanonicalResource) fetchResourceWithException(r.getClass(), url);
throw new DefinitionException(formatMessage(I18nConstants.DUPLICATE_RESOURCE_, url, ((CanonicalResource) r).getVersion(), ex.getVersion(),
ex.fhirType()));
}
if (r instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) m;
@ -1364,15 +1369,15 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
public <T extends Resource> T fetchResourceWithException(String cls, String uri) throws FHIRException {
return fetchResourceWithException(cls, uri, null);
return fetchResourceWithExceptionByVersion(cls, uri, null, null);
}
public <T extends Resource> T fetchResourceWithException(Class<T> class_, String uri, CanonicalResource source) throws FHIRException {
return fetchResourceWithException(class_, uri, null, source);
return fetchResourceWithExceptionByVersion(class_, uri, null, source);
}
@SuppressWarnings("unchecked")
public <T extends Resource> T fetchResourceWithException(Class<T> class_, String uri, String version, CanonicalResource source) throws FHIRException {
public <T extends Resource> T fetchResourceWithExceptionByVersion(Class<T> class_, String uri, String version, CanonicalResource source) throws FHIRException {
if (uri == null) {
return null;
}
@ -1382,9 +1387,13 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
synchronized (lock) {
if (uri.contains("|")) {
version = uri.substring(uri.lastIndexOf("|")+1);
uri = uri.substring(0, uri.lastIndexOf("|"));
if (version == null) {
if (uri.contains("|")) {
version = uri.substring(uri.lastIndexOf("|")+1);
uri = uri.substring(0, uri.lastIndexOf("|"));
}
} else {
assert !uri.contains("|");
}
if (uri.contains("#")) {
uri = uri.substring(0, uri.indexOf("#"));
@ -1556,7 +1565,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
@SuppressWarnings("unchecked")
public <T extends Resource> T fetchResourceWithException(String cls, String uri, CanonicalResource source) throws FHIRException {
public <T extends Resource> T fetchResourceWithExceptionByVersion(String cls, String uri, String version, CanonicalResource source) throws FHIRException {
if (uri == null) {
return null;
}
@ -1566,10 +1575,14 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
synchronized (lock) {
String version = null;
if (uri.contains("|")) {
version = uri.substring(uri.lastIndexOf("|")+1);
uri = uri.substring(0, uri.lastIndexOf("|"));
if (version == null) {
if (uri.contains("|")) {
version = uri.substring(uri.lastIndexOf("|")+1);
uri = uri.substring(0, uri.lastIndexOf("|"));
}
} else {
boolean b = !uri.contains("|");
assert b;
}
if (uri.contains("#")) {
uri = uri.substring(0, uri.indexOf("#"));
@ -1728,7 +1741,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
public <T extends Resource> T fetchResource(Class<T> class_, String uri, String version) {
try {
return fetchResourceWithException(class_, uri, version, null);
return fetchResourceWithExceptionByVersion(class_, uri, version, null);
} catch (FHIRException e) {
throw new Error(e);
}
@ -1751,6 +1764,22 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
}
public <T extends Resource> boolean hasResourceVersion(Class<T> class_, String uri, String version) {
try {
return fetchResourceWithExceptionByVersion(class_, uri, version, null) != null;
} catch (Exception e) {
return false;
}
}
public <T extends Resource> boolean hasResourceVersion(String cls, String uri, String version) {
try {
return fetchResourceWithExceptionByVersion(cls, uri, version, null) != null;
} catch (Exception e) {
return false;
}
}
public TranslationServices translator() {
return translator;

View File

@ -86,6 +86,13 @@ public class CanonicalResourceManager<T extends CanonicalResource> {
@Override
public String toString() {
return type+"/"+id+": "+url+"|"+version;
}
public void hack(String url, String version) {
this.url = url;
this.version = version;
getResource().setUrl(url).setVersion(version);
}
}

View File

@ -193,6 +193,10 @@ public interface IWorkerContext {
public Date getDate() {
return date;
}
public boolean isHTO() {
boolean b = id.startsWith("hl7.terminology.r");
return b;
}
}

View File

@ -66,6 +66,7 @@ import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper;
import org.hl7.fhir.r5.renderers.utils.DOMWrappers.BaseWrapperElement;
import org.hl7.fhir.r5.renderers.utils.DOMWrappers.ResourceWrapperElement;
import org.hl7.fhir.r5.renderers.utils.DirectWrappers;
import org.hl7.fhir.r5.renderers.utils.ElementWrappers;
import org.hl7.fhir.r5.renderers.utils.DirectWrappers.BaseWrapperDirect;
import org.hl7.fhir.r5.renderers.utils.DirectWrappers.PropertyWrapperDirect;
import org.hl7.fhir.r5.renderers.utils.DirectWrappers.ResourceWrapperDirect;
@ -106,7 +107,10 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
if (context.isAddGeneratedNarrativeHeader()) {
x.para().b().tx("Generated Narrative: "+r.fhirType());
}
if (context.isTechnicalMode()) {
if (!Utilities.noString(r.getId())) {
x.an(r.getId());
}
if (context.isTechnicalMode() && !context.isContained()) {
renderResourceHeader(r, x);
}
try {
@ -384,7 +388,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
if (r.getReference() != null && r.getReference().contains("#")) {
if (containedIds.contains(r.getReference().substring(1))) {
x.ah(r.getReference()).tx("See "+r.getReference());
} else {
} else {
// in this case, we render the resource in line
ResourceWrapper rw = null;
for (ResourceWrapper t : res.getContained()) {
@ -395,9 +399,17 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
if (rw == null) {
renderReference(res, x, r);
} else {
x.an(rw.getId());
ResourceRenderer rr = RendererFactory.factory(rw, context.copy().setAddGeneratedNarrativeHeader(false));
rr.render(parent.blockquote(), rw);
String ref = context.getResolver().urlForContained(context, res.fhirType(), res.getId(), rw.fhirType(), rw.getId());
if (ref == null) {
x.an(rw.getId());
RenderingContext ctxtc = context.copy();
ctxtc.setAddGeneratedNarrativeHeader(false);
ctxtc.setContained(true);
ResourceRenderer rr = RendererFactory.factory(rw, ctxtc);
rr.render(parent.blockquote(), rw);
} else {
x.ah(ref).tx("See "+rw.fhirType());
}
}
}
} else {
@ -687,11 +699,14 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
boolean showCodeDetails, int indent, PropertyWrapper p, ElementDefinition child) throws UnsupportedEncodingException, IOException, EOperationOutcome {
Map<String, String> displayHints = readDisplayHints(child);
if ("DomainResource.contained".equals(child.getBase().getPath())) {
// if (p.getValues().size() > 0 && child != null) {
// for (BaseWrapper v : p.getValues()) {
// x.an(v.get("id").primitiveValue());
// }
// }
// for (BaseWrapper v : p.getValues()) {
// x.hr();
// RenderingContext ctxt = context.clone();
// ctxt.setContained(true);
// ResourceRenderer rnd = RendererFactory.factory(v.fhirType(), ctxt);
// ResourceWrapper rw = new ElementWrappers.ResourceWrapperMetaElement(ctxt, (org.hl7.fhir.r5.elementmodel.Element) v.getBase());
// rnd.render(x.blockquote(), rw);
// }
} else if (!exemptFromRendering(child)) {
if (isExtension(p)) {
hasExtensions = true;

View File

@ -105,6 +105,7 @@ public class RenderingContext {
private boolean canonicalUrlsAsLinks;
private boolean pretty;
private boolean header;
private boolean contained;
private ValidationOptions terminologyServiceOptions = new ValidationOptions();
private boolean noSlowLookup;
@ -153,11 +154,53 @@ public class RenderingContext {
this.locale = new Locale.Builder().setLanguageTag("en-US").build();
profileUtilities = new ProfileUtilities(worker, null, null);
}
public RenderingContext copy() {
RenderingContext res = new RenderingContext(worker, markdown, terminologyServiceOptions, specificationLink, localPrefix, lang, mode);
res.resolver = resolver;
res.templateProvider = templateProvider;
res.services = services;
res.parser = parser;
res.headerLevelContext = headerLevelContext;
res.canonicalUrlsAsLinks = canonicalUrlsAsLinks;
res.pretty = pretty;
res.contained = contained;
res.noSlowLookup = noSlowLookup;
res.tooCostlyNoteEmpty = tooCostlyNoteEmpty;
res.tooCostlyNoteNotEmpty = tooCostlyNoteNotEmpty;
res.tooCostlyNoteEmptyDependent = tooCostlyNoteEmptyDependent;
res.tooCostlyNoteNotEmptyDependent = tooCostlyNoteNotEmptyDependent;
res.codeSystemPropList.addAll(codeSystemPropList);
res.profileUtilities = profileUtilities;
res.definitionsTarget = definitionsTarget;
res.destDir = destDir;
res.addGeneratedNarrativeHeader = addGeneratedNarrativeHeader;
res.questionnaireMode = questionnaireMode;
res.header = header;
res.selfLink = selfLink;
res.inlineGraphics = inlineGraphics;
res.timeZoneId = timeZoneId;
res.dateTimeFormat = dateTimeFormat;
res.dateFormat = dateFormat;
res.dateYearFormat = dateYearFormat;
res.dateYearMonthFormat = dateYearMonthFormat;
res.targetVersion = targetVersion;
res.locale = locale;
res.terminologyServiceOptions = terminologyServiceOptions.copy();
return res;
}
public IWorkerContext getContext() {
return worker;
}
// -- 2. Markdown support -------------------------------------------------------
public ProfileUtilities getProfileUtilities() {
@ -338,41 +381,6 @@ public class RenderingContext {
return this;
}
public RenderingContext copy() {
RenderingContext res = new RenderingContext(worker, markdown, terminologyServiceOptions, specificationLink, localPrefix, lang, mode);
res.resolver = resolver;
res.templateProvider = templateProvider;
res.services = services;
res.parser = parser;
res.headerLevelContext = headerLevelContext;
res.canonicalUrlsAsLinks = canonicalUrlsAsLinks;
res.pretty = pretty;
res.noSlowLookup = noSlowLookup;
res.tooCostlyNoteEmpty = tooCostlyNoteEmpty;
res.tooCostlyNoteNotEmpty = tooCostlyNoteNotEmpty;
res.tooCostlyNoteEmptyDependent = tooCostlyNoteEmptyDependent;
res.tooCostlyNoteNotEmptyDependent = tooCostlyNoteNotEmptyDependent;
res.codeSystemPropList.addAll(codeSystemPropList);
res.profileUtilities = profileUtilities;
res.definitionsTarget = definitionsTarget;
res.destDir = destDir;
res.addGeneratedNarrativeHeader = addGeneratedNarrativeHeader;
res.questionnaireMode = questionnaireMode;
res.header = header;
res.selfLink = selfLink;
res.inlineGraphics = inlineGraphics;
res.timeZoneId = timeZoneId;
res.dateTimeFormat = dateTimeFormat;
res.dateFormat = dateFormat;
res.dateYearFormat = dateYearFormat;
res.dateYearMonthFormat = dateYearMonthFormat;
return res;
}
public boolean isInlineGraphics() {
return inlineGraphics;
@ -556,6 +564,14 @@ public class RenderingContext {
public void setMode(ResourceRendererMode mode) {
this.mode = mode;
}
public boolean isContained() {
return contained;
}
public void setContained(boolean contained) {
this.contained = contained;
}
}

View File

@ -18,6 +18,9 @@ public class Resolver {
public interface IReferenceResolver {
ResourceWithReference resolve(RenderingContext context, String url);
// returns null if contained resource is inlined
String urlForContained(RenderingContext context, String containingType, String containingId, String containedType, String containedId);
}
public static class ResourceContext {

View File

@ -0,0 +1,40 @@
package org.hl7.fhir.r5.utils;
import org.hl7.fhir.r5.context.CanonicalResourceManager.CanonicalResourceProxy;
import org.hl7.fhir.r5.context.IWorkerContext.PackageVersion;
public class PackageHackerR5 {
public static void fixLoadedResource(CanonicalResourceProxy r, PackageVersion packageInfo) {
if ("http://terminology.hl7.org/CodeSystem/v2-0391|2.6".equals(r.getUrl())) {
r.hack("http://terminology.hl7.org/CodeSystem/v2-0391-2.6", "2.6");
}
if ("http://terminology.hl7.org/CodeSystem/v2-0391|2.4".equals(r.getUrl())) {
r.hack("http://terminology.hl7.org/CodeSystem/v2-0391-2.4", "2.4");
}
if ("http://terminology.hl7.org/CodeSystem/v2-0360|2.7".equals(r.getUrl())) {
r.hack("http://terminology.hl7.org/CodeSystem/v2-0360-2.7", "2.7");
}
if ("http://terminology.hl7.org/CodeSystem/v2-0006|2.1".equals(r.getUrl())) {
r.hack("http://terminology.hl7.org/CodeSystem/v2-0006-2.1", "2.1");
}
if ("http://terminology.hl7.org/CodeSystem/v2-0360|2.7".equals(r.getUrl())) {
r.hack("http://terminology.hl7.org/CodeSystem/v2-0360-2.7", "2.7");
}
if ("http://terminology.hl7.org/CodeSystem/v2-0006|2.4".equals(r.getUrl())) {
r.hack("http://terminology.hl7.org/CodeSystem/v2-0006-2.4", "2.4");
}
if ("http://terminology.hl7.org/CodeSystem/v2-0360|2.3.1".equals(r.getUrl())) {
r.hack("http://terminology.hl7.org/CodeSystem/v2-0360-2.3.1", "2.3.1");
}
if (r.hasUrl() && r.getUrl().contains("|")) {
assert false;
}
}
}

View File

@ -82,6 +82,7 @@ public class I18nConstants {
public static final String DOES_NOT_MATCH_SLICE_ = "Does_not_match_slice_";
public static final String DUPLICATE_ID = "DUPLICATE_ID";
public static final String DUPLICATE_RESOURCE_ = "Duplicate_Resource_";
public static final String DUPLICATE_RESOURCE_VERSION = "DUPLICATE_RESOURCE_VERSION";
public static final String ELEMENT_ID__NULL__ON_ = "element_id__null__on_";
public static final String ELEMENT_MUST_HAVE_SOME_CONTENT = "Element_must_have_some_content";
public static final String ELEMENT__NULL_ = "element__null_";

View File

@ -40,7 +40,7 @@ public class ValidationOptions {
return guessSystem;
}
private ValidationOptions copy() {
public ValidationOptions copy() {
ValidationOptions n = new ValidationOptions(language);
n.useServer = useServer;
n.useClient = useClient;

View File

@ -416,7 +416,8 @@ No_Parameters_provided_to_expandVS = No Parameters provided to expandVS
No_Expansion_Parameters_provided = No Expansion Parameters provided
Unable_to_resolve_value_Set_ = Unable to resolve value Set {0}
Delimited_versions_have_exact_match_for_delimiter____vs_ = Delimited versions have exact match for delimiter ''{0}'' : {1} vs {2}
Duplicate_Resource_ = Duplicate Resource {0} of type {1}
Duplicate_Resource_ = Duplicate Resource {0} of type {3} (existing version {2}, new version {1})
DUPLICATE_RESOURCE_VERSION = Duplicate Resource {0} Version {1} of type {2}
Error_expanding_ValueSet_running_without_terminology_services = Error expanding ValueSet: running without terminology services
Error_validating_code_running_without_terminology_services = Error validating code: running without terminology services
Unable_to_validate_code_without_using_server = Unable to validate code without using server

View File

@ -19,7 +19,7 @@
<properties>
<hapi_fhir_version>5.4.0</hapi_fhir_version>
<validator_test_case_version>1.1.103</validator_test_case_version>
<validator_test_case_version>1.1.104-SNAPSHOT</validator_test_case_version>
<junit_jupiter_version>5.7.1</junit_jupiter_version>
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
<maven_surefire_version>3.0.0-M5</maven_surefire_version>