prepare release
This commit is contained in:
parent
011e2488a3
commit
47443acaf3
|
@ -19,12 +19,11 @@ import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
|
|||
import org.hl7.fhir.r5.model.UriType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
import org.hl7.fhir.utilities.json.JsonTrackingParser;
|
||||
import org.hl7.fhir.utilities.json.model.JsonElement;
|
||||
import org.hl7.fhir.utilities.json.model.JsonObject;
|
||||
import org.hl7.fhir.utilities.json.parser.JsonParser;
|
||||
import org.hl7.fhir.utilities.npm.PackageHacker;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
public class XVerExtensionManager {
|
||||
|
||||
public enum XVerExtensionStatus {
|
||||
|
@ -54,7 +53,7 @@ public class XVerExtensionManager {
|
|||
if (!lists.containsKey(v)) {
|
||||
if (context.hasBinaryKey("xver-paths-"+v+".json")) {
|
||||
try {
|
||||
lists.put(v, JsonTrackingParser.parseJson(context.getBinaryForKey("xver-paths-"+v+".json")));
|
||||
lists.put(v, JsonParser.parseObject(context.getBinaryForKey("xver-paths-"+v+".json")));
|
||||
} catch (IOException e1) {
|
||||
throw new FHIRException(e);
|
||||
}
|
||||
|
@ -63,9 +62,9 @@ public class XVerExtensionManager {
|
|||
}
|
||||
}
|
||||
JsonObject root = lists.get(v);
|
||||
JsonObject path = root.getAsJsonObject(e);
|
||||
JsonObject path = root.getObj(e);
|
||||
if (path == null) {
|
||||
path = root.getAsJsonObject(e+"[x]");
|
||||
path = root.getObj(e+"[x]");
|
||||
}
|
||||
if (path == null) {
|
||||
return XVerExtensionStatus.Unknown;
|
||||
|
@ -86,9 +85,9 @@ public class XVerExtensionManager {
|
|||
String verTarget = VersionUtilities.getMajMin(context.getVersion());
|
||||
String e = url.substring(54);
|
||||
JsonObject root = lists.get(verSource);
|
||||
JsonObject path = root.getAsJsonObject(e);
|
||||
JsonObject path = root.getObj(e);
|
||||
if (path == null) {
|
||||
path = root.getAsJsonObject(e+"[x]");
|
||||
path = root.getObj(e+"[x]");
|
||||
}
|
||||
|
||||
StructureDefinition sd = new StructureDefinition();
|
||||
|
@ -116,10 +115,10 @@ public class XVerExtensionManager {
|
|||
ElementDefinition val = sd.getDifferential().addElement().setPath("Extension.value[x]").setMin(1);
|
||||
populateTypes(path, val, verSource, verTarget);
|
||||
} else if (path.has("elements")) {
|
||||
for (JsonElement i : path.getAsJsonArray("elements")) {
|
||||
JsonObject elt = root.getAsJsonObject(e+"."+i.getAsString());
|
||||
for (JsonElement i : path.getArr("elements").getItems()) {
|
||||
JsonObject elt = root.getObj(e+"."+i.toString());
|
||||
if (elt != null) {
|
||||
String s = i.getAsString().replace("[x]", "");
|
||||
String s = i.toString().replace("[x]", "");
|
||||
sd.getDifferential().addElement().setPath("Extension.extension").setSliceName(s);
|
||||
sd.getDifferential().addElement().setPath("Extension.extension.extension").setMax("0");
|
||||
sd.getDifferential().addElement().setPath("Extension.extension.url").setFixed(new UriType(s));
|
||||
|
@ -135,7 +134,7 @@ public class XVerExtensionManager {
|
|||
} else {
|
||||
throw new FHIRException("Internal error - attempt to define extension for "+url+" when it is invalid");
|
||||
}
|
||||
if (path.has("modifier") && path.get("modifier").getAsBoolean()) {
|
||||
if (path.has("modifier") && path.getBoolean("modifier")) {
|
||||
ElementDefinition baseDef = new ElementDefinition("Extension");
|
||||
sd.getDifferential().getElement().add(0, baseDef);
|
||||
baseDef.setIsModifier(true);
|
||||
|
@ -144,8 +143,8 @@ public class XVerExtensionManager {
|
|||
}
|
||||
|
||||
public void populateTypes(JsonObject path, ElementDefinition val, String verSource, String verTarget) {
|
||||
for (JsonElement i : path.getAsJsonArray("types")) {
|
||||
String s = i.getAsString();
|
||||
for (JsonElement i : path.getArr("types").getItems()) {
|
||||
String s = i.toString();
|
||||
if (!s.startsWith("!")) {
|
||||
if (s.contains("(")) {
|
||||
String t = s.substring(0, s.indexOf("("));
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.hl7.fhir.utilities.json;
|
||||
|
||||
public class JsonException extends Exception {
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
|
||||
public class JsonException extends FHIRException {
|
||||
|
||||
public JsonException(String msg) {
|
||||
// TODO Auto-generated constructor stub
|
||||
|
|
|
@ -106,7 +106,7 @@ public class JsonObject extends JsonElement {
|
|||
}
|
||||
|
||||
public Boolean getBoolean(String name) {
|
||||
return ((JsonBoolean) get(name)).isValue();
|
||||
return has(name) ? ((JsonBoolean) get(name)).isValue() : false;
|
||||
}
|
||||
|
||||
public JsonObject forceObj(String name) throws JsonException {
|
||||
|
|
|
@ -38,6 +38,8 @@ import org.hl7.fhir.utilities.json.parser.JsonLexer.TokenType;
|
|||
* * missing commas in objects and arrays
|
||||
* * comments - anything starting // will be processed as a comma to the end of the line
|
||||
*
|
||||
* Other JSON5 features might be added in the future
|
||||
*
|
||||
* The FHIR Validator uses this parser in Json5 mode, and the object model is marked up
|
||||
* with deviations from base JSON spec so that the validator can record them as errors
|
||||
* (this is better than blowing up parsing the JSON)
|
||||
|
|
|
@ -5787,7 +5787,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
slicingHint(errors, IssueType.INFORMATIONAL, ei.line(), ei.col(), ei.getPath(), false, isProfile(slicer) || isCritical(ei.sliceInfo),
|
||||
context.formatMessage(I18nConstants.THIS_ELEMENT_DOES_NOT_MATCH_ANY_KNOWN_SLICE_,
|
||||
profile == null ? "" : "defined in the profile " + profile.getVersionedUrl()),
|
||||
context.formatMessage(I18nConstants.THIS_ELEMENT_DOES_NOT_MATCH_ANY_KNOWN_SLICE_, profile == null ? "" : I18nConstants.DEFINED_IN_THE_PROFILE + profile.getVersionedUrl()) + errorSummaryForSlicingAsHtml(ei.sliceInfo),
|
||||
context.formatMessage(I18nConstants.THIS_ELEMENT_DOES_NOT_MATCH_ANY_KNOWN_SLICE_, profile == null ? "" : context.formatMessage(I18nConstants.DEFINED_IN_THE_PROFILE) + " "+profile.getVersionedUrl()) + errorSummaryForSlicingAsHtml(ei.sliceInfo),
|
||||
errorSummaryForSlicingAsText(ei.sliceInfo));
|
||||
} else if (ei.definition.getSlicing().getRules().equals(ElementDefinition.SlicingRules.CLOSED)) {
|
||||
rule(errors, IssueType.INVALID, ei.line(), ei.col(), ei.getPath(), false, I18nConstants.VALIDATION_VAL_PROFILE_NOTSLICE, (profile == null ? "" : " defined in the profile " + profile.getVersionedUrl()), errorSummaryForSlicing(ei.sliceInfo));
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -19,7 +19,7 @@
|
|||
|
||||
<properties>
|
||||
<hapi_fhir_version>5.4.0</hapi_fhir_version>
|
||||
<validator_test_case_version>1.1.123-SNAPSHOT</validator_test_case_version>
|
||||
<validator_test_case_version>1.1.123</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>
|
||||
|
|
Loading…
Reference in New Issue