commit
07a3962ac2
|
@ -3906,5 +3906,13 @@ public class ProfileUtilities extends TranslatingUtilities {
|
||||||
this.allowUnknownProfile = allowUnknownProfile;
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,8 +83,14 @@ public class FmlParser extends ParserBase {
|
||||||
if (!result.hasChild("status")) {
|
if (!result.hasChild("status")) {
|
||||||
result.makeElement("status").setValue("draft");
|
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")) {
|
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"))
|
while (lexer.hasToken("conceptmap"))
|
||||||
|
|
|
@ -1234,8 +1234,11 @@ public class StructureDefinition extends CanonicalResource {
|
||||||
// added from java-adornments.txt:
|
// added from java-adornments.txt:
|
||||||
|
|
||||||
public ElementDefinition getElementByPath(String path) {
|
public ElementDefinition getElementByPath(String path) {
|
||||||
|
if (path == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (ElementDefinition ed : getElement()) {
|
for (ElementDefinition ed : getElement()) {
|
||||||
if (path.equals(ed.getPath())) {
|
if (path.equals(ed.getPath()) || (path+"[x]").equals(ed.getPath())) {
|
||||||
return ed;
|
return ed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.hl7.fhir.exceptions.FHIRException;
|
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.CodeType;
|
||||||
import org.hl7.fhir.r5.model.ConceptMap;
|
import org.hl7.fhir.r5.model.ConceptMap;
|
||||||
import org.hl7.fhir.r5.model.Enumeration;
|
import org.hl7.fhir.r5.model.Enumeration;
|
||||||
|
@ -155,7 +156,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
|
||||||
x.b().tx(" prefix ");
|
x.b().tx(" prefix ");
|
||||||
x.tx(""+prefix);
|
x.tx(""+prefix);
|
||||||
x.color(COLOR_SYNTAX).tx(" = \"");
|
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");
|
x.color(COLOR_SYNTAX).tx("\"\r\n");
|
||||||
prefix++;
|
prefix++;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +170,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
|
||||||
x.b().tx(" prefix ");
|
x.b().tx(" prefix ");
|
||||||
x.tx(""+prefix);
|
x.tx(""+prefix);
|
||||||
x.color(COLOR_SYNTAX).tx(" = \"");
|
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");
|
x.color(COLOR_SYNTAX).tx("\"\r\n");
|
||||||
prefix++;
|
prefix++;
|
||||||
}
|
}
|
||||||
|
@ -247,7 +258,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
|
||||||
for (StructureMapStructureComponent s : map.getStructure()) {
|
for (StructureMapStructureComponent s : map.getStructure()) {
|
||||||
x.b().tx("uses");
|
x.b().tx("uses");
|
||||||
x.color(COLOR_SYNTAX).tx(" \"");
|
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("\" ");
|
x.color(COLOR_SYNTAX).tx("\" ");
|
||||||
if (s.hasAlias()) {
|
if (s.hasAlias()) {
|
||||||
x.b().tx("alias ");
|
x.b().tx("alias ");
|
||||||
|
@ -267,7 +283,12 @@ public class StructureMapRenderer extends TerminologyRenderer {
|
||||||
for (UriType s : map.getImport()) {
|
for (UriType s : map.getImport()) {
|
||||||
x.b().tx("imports");
|
x.b().tx("imports");
|
||||||
x.color(COLOR_SYNTAX).tx(" \"");
|
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");
|
x.color(COLOR_SYNTAX).tx("\"\r\n");
|
||||||
}
|
}
|
||||||
if (map.hasImport())
|
if (map.hasImport())
|
||||||
|
|
|
@ -5027,10 +5027,11 @@ public class FHIRPathEngine {
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
Base res = null;
|
Base res = null;
|
||||||
if (s.startsWith("#")) {
|
if (s.startsWith("#")) {
|
||||||
|
String t = s.substring(1);
|
||||||
Property p = context.rootResource.getChildByName("contained");
|
Property p = context.rootResource.getChildByName("contained");
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
for (Base c : p.getValues()) {
|
for (Base c : p.getValues()) {
|
||||||
if (chompHash(s).equals(chompHash(c.getIdBase()))) {
|
if (t.equals(c.getIdBase())) {
|
||||||
res = c;
|
res = c;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5052,17 +5053,6 @@ public class FHIRPathEngine {
|
||||||
return result;
|
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<Base> funcExtension(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
|
private List<Base> funcExtension(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
|
||||||
List<Base> result = new ArrayList<Base>();
|
List<Base> result = new ArrayList<Base>();
|
||||||
List<Base> nl = execute(context, focus, exp.getParameters().get(0), true);
|
List<Base> nl = execute(context, focus, exp.getParameters().get(0), true);
|
||||||
|
|
|
@ -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"))
|
while (lexer.hasToken("conceptmap"))
|
||||||
parseConceptMap(result, lexer);
|
parseConceptMap(result, lexer);
|
||||||
|
|
||||||
|
|
|
@ -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_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 = 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})
|
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_Length = Invalid Resource id: Too long ({0} chars)
|
||||||
Resource_RES_ID_Malformed_Chars = Invalid Resource id: Invalid Characters
|
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_Missing = Resource requires an id, but none is present
|
||||||
Resource_RES_ID_Prohibited = Resource has an id, but none is allowed
|
Resource_RES_ID_Prohibited = Resource has an id, but none is allowed
|
||||||
Terminology_PassThrough_TX_Message = {0} for ''{1}#{2}''
|
Terminology_PassThrough_TX_Message = {0} for ''{1}#{2}''
|
||||||
|
|
|
@ -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")) {
|
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);
|
NodeStack ns = stack.push(eid, -1, eid.getProperty().getDefinition(), null);
|
||||||
if (eid.primitiveValue() != null && eid.primitiveValue().length() > 64) {
|
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 {
|
} 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<hapi_fhir_version>6.2.1</hapi_fhir_version>
|
<hapi_fhir_version>6.2.1</hapi_fhir_version>
|
||||||
<validator_test_case_version>1.2.19</validator_test_case_version>
|
<validator_test_case_version>1.2.20-SNAPSHOT</validator_test_case_version>
|
||||||
<junit_jupiter_version>5.7.1</junit_jupiter_version>
|
<junit_jupiter_version>5.7.1</junit_jupiter_version>
|
||||||
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
|
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
|
||||||
<maven_surefire_version>3.0.0-M5</maven_surefire_version>
|
<maven_surefire_version>3.0.0-M5</maven_surefire_version>
|
||||||
|
|
Loading…
Reference in New Issue