mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-07 13:28:12 +00:00
Merge pull request #743 from hapifhir/gg-202202-ws-msg
Gg 202202 ws msg
This commit is contained in:
commit
32927e29bd
@ -1,7 +1,16 @@
|
||||
## Validator Changes
|
||||
|
||||
* no changes
|
||||
* accept regex on ElementDefinition and ElementDefinition.type, and an error for regex on ElementDefintion.type (though core packages have it on the wrong place)
|
||||
* fix handling of cross-version extensions on choice elements
|
||||
* fix OID validation (accept 1.3.88 GTIN OID)
|
||||
* only consider bindable types when checking for multi-type bindings
|
||||
|
||||
## Other code changes
|
||||
|
||||
* no changes
|
||||
* Fix definitions in ListResource ("List" not "ListResource")
|
||||
* introduce fhir-tools-settings.conf (see https://confluence.hl7.org/display/FHIR/Using+fhir-tool-settings.conf)
|
||||
* Rendering fixes & improvements for Questionnaire and Patient and partial dates
|
||||
* improvements to relative link handling in markdown when generating snapshots
|
||||
* updates to package tools for changes to package.json#type (see https://confluence.hl7.org/pages/viewpage.action?pageId=35718629#NPMPackageSpecification-Packagemanifest)
|
||||
* fix semver handling for tags in versions
|
||||
* Bump mockito and bytebuddy versions for Java 17 compatibility & fix Kotlin ref
|
||||
|
@ -686,7 +686,7 @@ public class ListResource extends DomainResource {
|
||||
public Enumeration<ListStatus> getStatusElement() {
|
||||
if (this.status == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.status");
|
||||
throw new Error("Attempt to auto-create List.status");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.status = new Enumeration<ListStatus>(new ListStatusEnumFactory()); // bb
|
||||
return this.status;
|
||||
@ -731,7 +731,7 @@ public class ListResource extends DomainResource {
|
||||
public Enumeration<ListMode> getModeElement() {
|
||||
if (this.mode == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.mode");
|
||||
throw new Error("Attempt to auto-create List.mode");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.mode = new Enumeration<ListMode>(new ListModeEnumFactory()); // bb
|
||||
return this.mode;
|
||||
@ -776,7 +776,7 @@ public class ListResource extends DomainResource {
|
||||
public StringType getTitleElement() {
|
||||
if (this.title == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.title");
|
||||
throw new Error("Attempt to auto-create List.title");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.title = new StringType(); // bb
|
||||
return this.title;
|
||||
@ -825,7 +825,7 @@ public class ListResource extends DomainResource {
|
||||
public CodeableConcept getCode() {
|
||||
if (this.code == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.code");
|
||||
throw new Error("Attempt to auto-create List.code");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.code = new CodeableConcept(); // cc
|
||||
return this.code;
|
||||
@ -849,7 +849,7 @@ public class ListResource extends DomainResource {
|
||||
public Reference getSubject() {
|
||||
if (this.subject == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.subject");
|
||||
throw new Error("Attempt to auto-create List.subject");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.subject = new Reference(); // cc
|
||||
return this.subject;
|
||||
@ -873,7 +873,7 @@ public class ListResource extends DomainResource {
|
||||
public Reference getEncounter() {
|
||||
if (this.encounter == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.encounter");
|
||||
throw new Error("Attempt to auto-create List.encounter");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.encounter = new Reference(); // cc
|
||||
return this.encounter;
|
||||
@ -897,7 +897,7 @@ public class ListResource extends DomainResource {
|
||||
public DateTimeType getDateElement() {
|
||||
if (this.date == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.date");
|
||||
throw new Error("Attempt to auto-create List.date");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.date = new DateTimeType(); // bb
|
||||
return this.date;
|
||||
@ -946,7 +946,7 @@ public class ListResource extends DomainResource {
|
||||
public Reference getSource() {
|
||||
if (this.source == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.source");
|
||||
throw new Error("Attempt to auto-create List.source");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.source = new Reference(); // cc
|
||||
return this.source;
|
||||
@ -970,7 +970,7 @@ public class ListResource extends DomainResource {
|
||||
public CodeableConcept getOrderedBy() {
|
||||
if (this.orderedBy == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.orderedBy");
|
||||
throw new Error("Attempt to auto-create List.orderedBy");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.orderedBy = new CodeableConcept(); // cc
|
||||
return this.orderedBy;
|
||||
@ -1100,7 +1100,7 @@ public class ListResource extends DomainResource {
|
||||
public CodeableConcept getEmptyReason() {
|
||||
if (this.emptyReason == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create ListResource.emptyReason");
|
||||
throw new Error("Attempt to auto-create List.emptyReason");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.emptyReason = new CodeableConcept(); // cc
|
||||
return this.emptyReason;
|
||||
|
@ -206,7 +206,7 @@ Type_Specific_Checks_DT_Primitive_Regex = Element value ''{0}'' does not meet re
|
||||
Type_Specific_Checks_DT_Primitive_ValueExt = Primitive types must have a value or must have child extensions
|
||||
Type_Specific_Checks_DT_Primitive_WS = Primitive types should not only be whitespace
|
||||
Type_Specific_Checks_DT_String_Length = value is longer than permitted maximum length of 1 MB (1048576 bytes)
|
||||
Type_Specific_Checks_DT_String_WS = value should not start or finish with whitespace
|
||||
Type_Specific_Checks_DT_String_WS = value should not start or finish with whitespace ''{0}''
|
||||
Type_Specific_Checks_DT_Time_Valid = Not a valid time ({0})
|
||||
Type_Specific_Checks_DT_URI_OID = URI values cannot start with oid:
|
||||
Type_Specific_Checks_DT_URI_UUID = URI values cannot start with uuid:
|
||||
|
@ -2143,7 +2143,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||
}
|
||||
if (type.equalsIgnoreCase("string") && e.hasPrimitiveValue()) {
|
||||
if (rule(errors, IssueType.INVALID, e.line(), e.col(), path, e.primitiveValue() == null || e.primitiveValue().length() > 0, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_NOTEMPTY)) {
|
||||
warning(errors, IssueType.INVALID, e.line(), e.col(), path, e.primitiveValue() == null || e.primitiveValue().trim().equals(e.primitiveValue()), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_STRING_WS);
|
||||
warning(errors, IssueType.INVALID, e.line(), e.col(), path, e.primitiveValue() == null || e.primitiveValue().trim().equals(e.primitiveValue()), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_STRING_WS, prepWSPresentation(e.primitiveValue()));
|
||||
if (rule(errors, IssueType.INVALID, e.line(), e.col(), path, e.primitiveValue().length() <= 1048576, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_STRING_LENGTH)) {
|
||||
rule(errors, IssueType.INVALID, e.line(), e.col(), path, !context.hasMaxLength() || context.getMaxLength() == 0 || e.primitiveValue().length() <= context.getMaxLength(), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_LENGTH, context.getMaxLength());
|
||||
}
|
||||
@ -2296,6 +2296,30 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||
// for nothing to check
|
||||
}
|
||||
|
||||
private Object prepWSPresentation(String s) {
|
||||
if (Utilities.noString(s)) {
|
||||
return "";
|
||||
}
|
||||
if (!StringUtils.containsWhitespace(s.trim())) {
|
||||
return s;
|
||||
}
|
||||
int b = 0;
|
||||
while (Character.isWhitespace(s.charAt(b))) {
|
||||
b++;
|
||||
}
|
||||
while (!Character.isWhitespace(s.charAt(b))) {
|
||||
b++;
|
||||
}
|
||||
int e = s.length() - 1;
|
||||
while (Character.isWhitespace(s.charAt(e))) {
|
||||
e--;
|
||||
}
|
||||
while (!Character.isWhitespace(s.charAt(e))) {
|
||||
e--;
|
||||
}
|
||||
return s.substring(0, b)+"..."+s.substring(e+1);
|
||||
}
|
||||
|
||||
public void validateReference(ValidatorHostContext hostContext, List<ValidationMessage> errors, String path, String type, ElementDefinition context, Element e, String url) {
|
||||
// now, do we check the URI target?
|
||||
if (fetcher != null && !type.equals("uuid")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user