diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java
index 3864901c3..9b32e57e4 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java
@@ -3906,5 +3906,13 @@ public class ProfileUtilities extends TranslatingUtilities {
this.allowUnknownProfile = allowUnknownProfile;
}
+ public static boolean isSimpleExtension(StructureDefinition sd) {
+ if (!isExtensionDefinition(sd)) {
+ return false;
+ }
+ ElementDefinition value = sd.getSnapshot().getElementByPath("Extension.value");
+ return value != null && !value.isProhibited();
+ }
+
}
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java
index a36c7a3c9..463264666 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java
@@ -83,8 +83,14 @@ public class FmlParser extends ParserBase {
if (!result.hasChild("status")) {
result.makeElement("status").setValue("draft");
}
+ if (!result.hasChild("id") && result.hasChild("name")) {
+ String id = Utilities.makeId(result.getChildValue("name"));
+ if (!Utilities.noString(id)) {
+ result.makeElement("id").setValue(id);
+ }
+ }
if (!result.hasChild("description") && result.hasChild("title")) {
- result.makeElement("description").setValue(result.getChildValue("title"));
+ result.makeElement("description").setValue(Utilities.makeId(result.getChildValue("title")));
}
while (lexer.hasToken("conceptmap"))
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java
index 912ae8444..0861ad248 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java
@@ -1234,8 +1234,11 @@ public class StructureDefinition extends CanonicalResource {
// added from java-adornments.txt:
public ElementDefinition getElementByPath(String path) {
+ if (path == null) {
+ return null;
+ }
for (ElementDefinition ed : getElement()) {
- if (path.equals(ed.getPath())) {
+ if (path.equals(ed.getPath()) || (path+"[x]").equals(ed.getPath())) {
return ed;
}
}
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java
index 76c0445ed..4c1dfd2de 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java
@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.Set;
import org.hl7.fhir.exceptions.FHIRException;
+import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.CodeType;
import org.hl7.fhir.r5.model.ConceptMap;
import org.hl7.fhir.r5.model.Enumeration;
@@ -155,7 +156,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
x.b().tx(" prefix ");
x.tx(""+prefix);
x.color(COLOR_SYNTAX).tx(" = \"");
- x.tx(cg.getSource());
+ CodeSystem cs = context.getContext().fetchResource(CodeSystem.class, cg.getSource());
+ if (cs != null && cs.hasUserData("path")) {
+ x.ah(cs.getUserString("path"), cs.present()).tx(cg.getSource());
+ } else {
+ x.tx(cg.getSource());
+ }
x.color(COLOR_SYNTAX).tx("\"\r\n");
prefix++;
}
@@ -164,7 +170,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
x.b().tx(" prefix ");
x.tx(""+prefix);
x.color(COLOR_SYNTAX).tx(" = \"");
- x.tx(""+cg.getTarget());
+ CodeSystem cs = context.getContext().fetchResource(CodeSystem.class, cg.getTarget());
+ if (cs != null && cs.hasUserData("path")) {
+ x.ah(cs.getUserString("path"), cs.present()).tx(cg.getTarget());
+ } else {
+ x.tx(""+cg.getTarget());
+ }
x.color(COLOR_SYNTAX).tx("\"\r\n");
prefix++;
}
@@ -247,7 +258,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
for (StructureMapStructureComponent s : map.getStructure()) {
x.b().tx("uses");
x.color(COLOR_SYNTAX).tx(" \"");
- x.tx(s.getUrl());
+ StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, s.getUrl());
+ if (sd != null && sd.hasUserData("path")) {
+ x.ah(sd.getUserString("path"), sd.present()).tx(s.getUrl());
+ } else {
+ x.tx(s.getUrl());
+ }
x.color(COLOR_SYNTAX).tx("\" ");
if (s.hasAlias()) {
x.b().tx("alias ");
@@ -267,7 +283,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
for (UriType s : map.getImport()) {
x.b().tx("imports");
x.color(COLOR_SYNTAX).tx(" \"");
- x.tx(s.getValue());
+ StructureMap m = context.getContext().fetchResource(StructureMap.class, s.getValue());
+ if (m != null) {
+ x.ah(m.getUserString("path"), m.present()).tx(s.getValue());
+ } else {
+ x.tx(s.getValue());
+ }
x.color(COLOR_SYNTAX).tx("\"\r\n");
}
if (map.hasImport())
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java
index 3ef9b1634..97d851c94 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java
@@ -5027,10 +5027,11 @@ public class FHIRPathEngine {
if (s != null) {
Base res = null;
if (s.startsWith("#")) {
+ String t = s.substring(1);
Property p = context.rootResource.getChildByName("contained");
if (p != null) {
for (Base c : p.getValues()) {
- if (chompHash(s).equals(chompHash(c.getIdBase()))) {
+ if (t.equals(c.getIdBase())) {
res = c;
break;
}
@@ -5052,17 +5053,6 @@ public class FHIRPathEngine {
return result;
}
- /**
- * Strips a leading hashmark (#) if present at the start of a string
- */
- private String chompHash(String theId) {
- String retVal = theId;
- while (retVal.startsWith("#")) {
- retVal = retVal.substring(1);
- }
- return retVal;
- }
-
private List funcExtension(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException {
List result = new ArrayList();
List nl = execute(context, focus, exp.getParameters().get(0), true);
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java
index 7ad8632e1..fcf608def 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java
@@ -664,6 +664,19 @@ public class StructureMapUtilities {
}
}
}
+ if (!result.hasId() && result.hasName()) {
+ String id = Utilities.makeId(result.getName());
+ if (Utilities.noString(id)) {
+ result.setId(id);
+ }
+ }
+ if (!result.hasStatus()) {
+ result.setStatus(PublicationStatus.DRAFT);
+ }
+ if (!result.hasDescription() && result.hasTitle()) {
+ result.setDescription(result.getTitle());
+ }
+
while (lexer.hasToken("conceptmap"))
parseConceptMap(result, lexer);
diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties
index 4e18e76f7..8604cd89c 100644
--- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties
+++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties
@@ -130,8 +130,8 @@ Reference_REF_NotFound_Bundle = Bundled or contained reference not found within
Reference_REF_ResourceType = Matching reference for reference {0} has resourceType {1}
Reference_REF_WrongTarget = The type ''{0}'' is not a valid Target for this element (must be one of {1})
REFERENCE_REF_WRONGTARGET_LOAD = The type ''{2}'' is not a valid Target for the element {0} (must be {1})
-Resource_RES_ID_Malformed_Length = Invalid Resource id: Too long
-Resource_RES_ID_Malformed_Chars = Invalid Resource id: Invalid Characters
+Resource_RES_ID_Malformed_Length = Invalid Resource id: Too long ({0} chars)
+Resource_RES_ID_Malformed_Chars = Invalid Resource id: Invalid Characters (''{0}'')
Resource_RES_ID_Missing = Resource requires an id, but none is present
Resource_RES_ID_Prohibited = Resource has an id, but none is allowed
Terminology_PassThrough_TX_Message = {0} for ''{1}#{2}''
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
index 15f06b042..211e759c9 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
@@ -6222,9 +6222,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (eid.getProperty() != null && eid.getProperty().getDefinition() != null && eid.getProperty().getDefinition().getBase().getPath().equals("Resource.id")) {
NodeStack ns = stack.push(eid, -1, eid.getProperty().getDefinition(), null);
if (eid.primitiveValue() != null && eid.primitiveValue().length() > 64) {
- ok = rule(errors, NO_RULE_DATE, IssueType.INVALID, eid.line(), eid.col(), ns.getLiteralPath(), false, I18nConstants.RESOURCE_RES_ID_MALFORMED_LENGTH) && ok;
+ ok = rule(errors, NO_RULE_DATE, IssueType.INVALID, eid.line(), eid.col(), ns.getLiteralPath(), false, I18nConstants.RESOURCE_RES_ID_MALFORMED_LENGTH, eid.primitiveValue().length()) && ok;
} else {
- ok = rule(errors, NO_RULE_DATE, IssueType.INVALID, eid.line(), eid.col(), ns.getLiteralPath(), FormatUtilities.isValidId(eid.primitiveValue()), I18nConstants.RESOURCE_RES_ID_MALFORMED_CHARS) && ok;
+ ok = rule(errors, NO_RULE_DATE, IssueType.INVALID, eid.line(), eid.col(), ns.getLiteralPath(), FormatUtilities.isValidId(eid.primitiveValue()), I18nConstants.RESOURCE_RES_ID_MALFORMED_CHARS, eid.primitiveValue()) && ok;
}
}
}
diff --git a/pom.xml b/pom.xml
index 6ac057aea..a1e98f012 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
6.2.1
- 1.2.19
+ 1.2.20-SNAPSHOT
5.7.1
1.8.2
3.0.0-M5