mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-08 05:48:12 +00:00
release new pubpack
This commit is contained in:
parent
69862fdcb7
commit
f618d15623
@ -5218,10 +5218,10 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||||||
}
|
}
|
||||||
// ok, now we collect constraints on the value domain, which maybe in sub-elements, though at some point we give up
|
// ok, now we collect constraints on the value domain, which maybe in sub-elements, though at some point we give up
|
||||||
if (defn.hasFixed()) {
|
if (defn.hasFixed()) {
|
||||||
e.getConstraints().add(TableElementConstraint.makeValue(TableElementConstraintType.FIXED, path, defn.getFixed()));
|
e.getConstraints().add(TableElementConstraint.makeValueVS(TableElementConstraintType.FIXED, path, defn.getFixed(), defn.getBinding().getStrength(), defn.getBinding().getValueSet()));
|
||||||
}
|
}
|
||||||
if (defn.hasPattern()) {
|
if (defn.hasPattern()) {
|
||||||
e.getConstraints().add(TableElementConstraint.makeValue(TableElementConstraintType.PATTERN, path, defn.getPattern()));
|
e.getConstraints().add(TableElementConstraint.makeValueVS(TableElementConstraintType.PATTERN, path, defn.getPattern(), defn.getBinding().getStrength(), defn.getBinding().getValueSet()));
|
||||||
}
|
}
|
||||||
if (defn.hasMinValue() || defn.hasMaxValue()) {
|
if (defn.hasMinValue() || defn.hasMaxValue()) {
|
||||||
e.getConstraints().add(TableElementConstraint.makeRange(TableElementConstraintType.RANGE, path, defn.getMinValue(), defn.getMaxValue()));
|
e.getConstraints().add(TableElementConstraint.makeRange(TableElementConstraintType.RANGE, path, defn.getMinValue(), defn.getMaxValue()));
|
||||||
@ -5229,7 +5229,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||||||
if (defn.hasMaxLength()) {
|
if (defn.hasMaxLength()) {
|
||||||
e.getConstraints().add(TableElementConstraint.makeValue(TableElementConstraintType.MAXLENGTH, path, defn.getMaxLengthElement()));
|
e.getConstraints().add(TableElementConstraint.makeValue(TableElementConstraintType.MAXLENGTH, path, defn.getMaxLengthElement()));
|
||||||
}
|
}
|
||||||
if (defn.hasBinding() && defn.getBinding().hasValueSet() && (!cardinality || (diffDefn != null && diffDefn.hasBinding())) && !defn.hasFixed()) {
|
if (defn.hasBinding() && defn.getBinding().hasValueSet() && (!cardinality || (diffDefn != null && diffDefn.hasBinding())) && !defn.hasFixedOrPattern()) {
|
||||||
e.getConstraints().add(TableElementConstraint.makeBinding(TableElementConstraintType.BINDING, path, defn.getBinding().getStrength(), defn.getBinding().getValueSet()));
|
e.getConstraints().add(TableElementConstraint.makeBinding(TableElementConstraintType.BINDING, path, defn.getBinding().getStrength(), defn.getBinding().getValueSet()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -225,6 +225,16 @@ public class ElementTable {
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TableElementConstraint makeValueVS(TableElementConstraintType type, String path, DataType value, BindingStrength strength, String valueSet) {
|
||||||
|
TableElementConstraint self = new TableElementConstraint();
|
||||||
|
self.type = type;
|
||||||
|
self.path = path;
|
||||||
|
self.value = value;
|
||||||
|
self.strength = strength;
|
||||||
|
self.valueSet = valueSet;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
public static TableElementConstraint makeRange(TableElementConstraintType type, String path, DataType value, DataType value2) {
|
public static TableElementConstraint makeRange(TableElementConstraintType type, String path, DataType value, DataType value2) {
|
||||||
TableElementConstraint self = new TableElementConstraint();
|
TableElementConstraint self = new TableElementConstraint();
|
||||||
self.type = type;
|
self.type = type;
|
||||||
@ -597,12 +607,16 @@ public class ElementTable {
|
|||||||
private void renderBindingConstraint(XhtmlNode x, TableElementConstraint c) {
|
private void renderBindingConstraint(XhtmlNode x, TableElementConstraint c) {
|
||||||
String name = c.path == null ? "value" : c.path;
|
String name = c.path == null ? "value" : c.path;
|
||||||
x.code().tx(name);
|
x.code().tx(name);
|
||||||
|
renderBinding(x, c, " is bound to ");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderBinding(XhtmlNode x, TableElementConstraint c, String phrase) {
|
||||||
ValueSet vs = context.getContext().findTxResource(ValueSet.class, c.valueSet);
|
ValueSet vs = context.getContext().findTxResource(ValueSet.class, c.valueSet);
|
||||||
if (vs == null) {
|
if (vs == null) {
|
||||||
x.tx(" is bound to an unknown valueset ");
|
x.tx(phrase+"an unknown valueset ");
|
||||||
x.code().tx(c.valueSet);
|
x.code().tx(c.valueSet);
|
||||||
} else {
|
} else {
|
||||||
x.tx(" is bound to ");
|
x.tx(phrase);
|
||||||
x.ah(vs.getWebPath()).tx(vs.present());
|
x.ah(vs.getWebPath()).tx(vs.present());
|
||||||
try {
|
try {
|
||||||
ValueSetExpansionOutcome exp = context.getContext().expandVS(vs, true, false);
|
ValueSetExpansionOutcome exp = context.getContext().expandVS(vs, true, false);
|
||||||
@ -688,6 +702,9 @@ public class ElementTable {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
renderValue(x, c.value);
|
renderValue(x, c.value);
|
||||||
|
if (c.strength != null && c.valueSet != null) {
|
||||||
|
renderBinding(x, c, " from ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderValue(XhtmlNode x, DataType v) throws IOException {
|
public void renderValue(XhtmlNode x, DataType v) throws IOException {
|
||||||
|
@ -6,6 +6,6 @@ public class CommonPackages {
|
|||||||
public static final String VER_XVER = "0.1.0";
|
public static final String VER_XVER = "0.1.0";
|
||||||
|
|
||||||
public static final String ID_PUBPACK = "hl7.fhir.pubpack";
|
public static final String ID_PUBPACK = "hl7.fhir.pubpack";
|
||||||
public static final String VER_PUBPACK = "0.2.0";
|
public static final String VER_PUBPACK = "0.2.1";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,7 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
|
|||||||
public String getLatestVersion(String id) throws IOException {
|
public String getLatestVersion(String id) throws IOException {
|
||||||
for (PackageServer nextPackageServer : getPackageServers()) {
|
for (PackageServer nextPackageServer : getPackageServers()) {
|
||||||
// special case:
|
// special case:
|
||||||
if (!(Utilities.existsInList(id, CommonPackages.ID_PUBPACK, "hl7.terminology.r5") && PackageServer.PRIMARY_SERVER.equals(nextPackageServer.getUrl()))) {
|
if (!(Utilities.existsInList(id, CommonPackages.ID_PUBPACK, "hl7.terminology.r5") && PackageServer.SECONDARY_SERVER.equals(nextPackageServer.getUrl()))) {
|
||||||
PackageClient pc = new PackageClient(nextPackageServer);
|
PackageClient pc = new PackageClient(nextPackageServer);
|
||||||
try {
|
try {
|
||||||
return pc.getLatestVersion(id);
|
return pc.getLatestVersion(id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user