Merge pull request #331 from hapifhir/gg-v517b

Prepare for new release
This commit is contained in:
Grahame Grieve 2020-09-01 10:43:41 +10:00 committed by GitHub
commit cb73cbe7c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 321 additions and 125 deletions

View File

@ -0,0 +1,14 @@
Validator:
* Better validation of bad references (and fix NPE)
* Rework output to be more informative and cleaner
* Fix bugs in validation of nested bundles
* Fix bug loading package with no specified version
* fix bugs loading discovered packages on the fly
* Validator now supports logical models in XML wkith no namespaces
Other code changes:
* Add version conversion for AllergyIntolerance (1.2 <-> 3.0 & 1.2 <-> 4.0)
* Add version conversion for MedicationRequest
* Fix rendering of documents
* fix for not rendering null values in patterns for must-support view

View File

@ -12,9 +12,9 @@ public class AllergyIntolerance10_30 {
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier identifier : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(identifier));
if (src.hasOnset())
tgt.setOnset(new org.hl7.fhir.dstu3.model.DateTimeType(src.getOnset()));
tgt.setOnset(VersionConvertor_10_30.convertDateTime(src.getOnsetElement()));
if (src.hasRecordedDate())
tgt.setAssertedDate(src.getRecordedDate());
tgt.setAssertedDateElement(VersionConvertor_10_30.convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(VersionConvertor_10_30.convertReference(src.getRecorder()));
if (src.hasPatient())
@ -40,7 +40,7 @@ public class AllergyIntolerance10_30 {
if (src.hasCategory())
tgt.addCategory(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.fromCode(src.getCategory().toCode()));
if (src.hasLastOccurence())
tgt.setLastOccurrence(src.getLastOccurence());
tgt.setLastOccurrenceElement(VersionConvertor_10_30.convertDateTime(src.getLastOccurenceElement()));
if (src.hasNote())
tgt.addNote(VersionConvertor_10_30.convertAnnotation(src.getNote()));
for (org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent reaction : src.getReaction())
@ -63,9 +63,9 @@ public class AllergyIntolerance10_30 {
));
for (org.hl7.fhir.dstu2.model.CodeableConcept concept : src.getManifestation()) tgt.addManifestation(VersionConvertor_10_30.convertCodeableConcept(concept));
if (src.hasDescription())
src.setDescription(src.getDescription());
tgt.setDescriptionElement(VersionConvertor_10_30.convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnset(src.getOnset());
tgt.setOnsetElement(VersionConvertor_10_30.convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverity(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.fromCode(src.getSeverity().toCode()));
if (src.hasExposureRoute())

View File

@ -13,7 +13,7 @@ public class AllergyIntolerance10_40 {
if (src.hasOnset())
tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnsetElement()));
if (src.hasRecordedDate())
tgt.setRecordedDate(src.getRecordedDate());
tgt.setRecordedDateElement(VersionConvertor_10_40.convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(VersionConvertor_10_40.convertReference(src.getRecorder()));
if (src.hasPatient())
@ -44,8 +44,8 @@ public class AllergyIntolerance10_40 {
tgt.setType(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.fromCode(src.getType().toCode()));
if (src.hasCategory())
tgt.addCategory(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.fromCode(src.getCategory().toCode()));
if (src.hasLastOccurence())
tgt.setLastOccurrence(src.getLastOccurence());
if (src.hasLastOccurenceElement())
tgt.setLastOccurrenceElement(VersionConvertor_10_40.convertDateTime(src.getLastOccurenceElement()));
if (src.hasNote())
tgt.addNote(VersionConvertor_10_40.convertAnnotation(src.getNote()));
for (org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent reaction : src.getReaction())
@ -68,9 +68,9 @@ public class AllergyIntolerance10_40 {
));
for (org.hl7.fhir.dstu2.model.CodeableConcept concept : src.getManifestation()) tgt.addManifestation(VersionConvertor_10_40.convertCodeableConcept(concept));
if (src.hasDescription())
src.setDescription(src.getDescription());
tgt.setDescriptionElement(VersionConvertor_10_40.convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnset(src.getOnset());
tgt.setOnsetElement(VersionConvertor_10_40.convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverity(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.fromCode(src.getSeverity().toCode()));
if (src.hasExposureRoute())

View File

@ -36,6 +36,14 @@ public class AllergyIntolerance10_30Test {
org.hl7.fhir.dstu3.formats.JsonParser stu_parser = new org.hl7.fhir.dstu3.formats.JsonParser();
org.hl7.fhir.dstu3.model.Resource stu_expected = stu_parser.parse(stu_exepected_input);
if (!stu_expected.equalsDeep(stu_actual)) {
System.out.println("Expected");
System.out.println(stu_parser.composeString(stu_expected));
System.out.println();
System.out.println("Actual");
System.out.println(stu_parser.composeString(stu_actual));
}
Assertions.assertTrue(stu_expected.equalsDeep(stu_actual),
"Failed comparing\n" + stu_parser.composeString(stu_actual) + "\nand\n" + stu_parser.composeString(stu_expected)
);

View File

@ -36,8 +36,14 @@ public class AllergyIntolerance10_40Test {
org.hl7.fhir.r4.formats.JsonParser r4_parser = new org.hl7.fhir.r4.formats.JsonParser();
org.hl7.fhir.r4.model.Resource r4_expected = r4_parser.parse(r4_exepected_input);
Assertions.assertTrue(r4_expected.equalsDeep(r4_actual),
"Failed comparing\n" + r4_parser.composeString(r4_actual) + "\nand\n" + r4_parser.composeString(r4_expected)
if (!r4_expected.equalsDeep(r4_actual)) {
System.out.println("Expected");
System.out.println(r4_parser.composeString(r4_expected));
System.out.println();
System.out.println("Actual");
System.out.println(r4_parser.composeString(r4_actual));
}
Assertions.assertTrue(r4_expected.equalsDeep(r4_actual), "Failed comparing\n" + r4_parser.composeString(r4_actual) + "\nand\n" + r4_parser.composeString(r4_expected)
);
}
}

View File

@ -1,20 +1,42 @@
{"resourceType": "AllergyIntolerance",
"recordedDate": "2015-08-25T02:11:36",
"status": "confirmed",
"criticality": "CRITL",
"id": "TBwnNbrAqC0Qw5Ha7AFT-2AB",
"onset": "2012-11-07T00:00:00Z",
"recorder": {"display": "MOORE, NICK",
"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB"},
"patient": {"display": "Jason Argonaut",
"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB"},
"substance": {"text": "PENICILLIN G",
"coding": [{"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "7980",
"display": "PENICILLIN G"},
{"system": "http://fdasis.nlm.nih.gov",
"code": "Q42T66VG0C",
"display": "PENICILLIN G"}]},
"reaction": [{"certainty": "confirmed",
"onset": "2012-11-07T00:00:00Z",
"manifestation": [{"text": "Hives"}]}]}
{
"resourceType" : "AllergyIntolerance",
"recordedDate" : "2015-08-25T02:11:36",
"status" : "confirmed",
"criticality" : "CRITL",
"id" : "TBwnNbrAqC0Qw5Ha7AFT-2AB",
"onset" : "2012-11-07T00:00:00Z",
"recorder" : {
"display" : "MOORE, NICK",
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB"
},
"patient" : {
"display" : "Jason Argonaut",
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB"
},
"substance" : {
"text" : "PENICILLIN G",
"coding" : [
{
"system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
"code" : "7980",
"display" : "PENICILLIN G"
},
{
"system" : "http://fdasis.nlm.nih.gov",
"code" : "Q42T66VG0C",
"display" : "PENICILLIN G"
}
]
},
"reaction" : [
{
"certainty" : "confirmed",
"onset" : "2012-11-07T00:00:00Z",
"manifestation" : [
{
"text" : "Hives"
}
]
}
]
}

View File

@ -1,22 +1,48 @@
{"resourceType": "AllergyIntolerance",
"id": "TBwnNbrAqC0Qw5Ha7AFT-2AB",
"clinicalStatus": "active",
"verificationStatus": "confirmed",
"criticality": "low",
"code": {"coding": [{"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "7980",
"display": "PENICILLIN G"},
{"system": "http://fdasis.nlm.nih.gov",
"code": "Q42T66VG0C",
"display": "PENICILLIN G"}],
"text": "PENICILLIN G"},
"patient": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display": "Jason Argonaut"},
"onsetDateTime": "2012-11-07T00:00:00",
"assertedDate": "2015-08-25T02:11:36",
"recorder": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display": "MOORE, NICK"},
"reaction": [{"extension": [{"url": "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString": "confirmed"}],
"manifestation": [{"text": "Hives"}],
"onset": "2012-11-07T00:00:00"}]}
{
"resourceType" : "AllergyIntolerance",
"id" : "TBwnNbrAqC0Qw5Ha7AFT-2AB",
"clinicalStatus" : "active",
"verificationStatus" : "confirmed",
"criticality" : "low",
"code" : {
"coding" : [
{
"system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
"code" : "7980",
"display" : "PENICILLIN G"
},
{
"system" : "http://fdasis.nlm.nih.gov",
"code" : "Q42T66VG0C",
"display" : "PENICILLIN G"
}
],
"text" : "PENICILLIN G"
},
"patient" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display" : "Jason Argonaut"
},
"onsetDateTime" : "2012-11-07T00:00:00Z",
"assertedDate" : "2015-08-25T02:11:36",
"recorder" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display" : "MOORE, NICK"
},
"reaction" : [
{
"extension" : [
{
"url" : "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString" : "confirmed"
}
],
"manifestation" : [
{
"text" : "Hives"
}
],
"onset" : "2012-11-07T00:00:00Z"
}
]
}

View File

@ -1,23 +1,61 @@
{"resourceType": "AllergyIntolerance",
"clinicalStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code": "confirmed"}]},
"verificationStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
"code": "confirmed"}]},
"criticality": "low",
"code": {"coding": [{"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "7980",
"display": "PENICILLIN G"},
{"system": "http://fdasis.nlm.nih.gov",
"code": "Q42T66VG0C",
"display": "PENICILLIN G"}],
"text": "PENICILLIN G"},
"patient": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display": "Jason Argonaut"},
"onsetDateTime": "2012-11-07T00:00:00Z",
"recordedDate": "2015-08-25T02:11:36",
"recorder": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display": "MOORE, NICK"},
"reaction": [{"extension": [{"url": "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString": "confirmed"}],
"manifestation": [{"text": "Hives"}],
"onset": "2012-11-07T00:00:00"}]}
{
"resourceType" : "AllergyIntolerance",
"clinicalStatus" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code" : "confirmed"
}
]
},
"verificationStatus" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
"code" : "confirmed"
}
]
},
"criticality" : "low",
"code" : {
"coding" : [
{
"system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
"code" : "7980",
"display" : "PENICILLIN G"
},
{
"system" : "http://fdasis.nlm.nih.gov",
"code" : "Q42T66VG0C",
"display" : "PENICILLIN G"
}
],
"text" : "PENICILLIN G"
},
"patient" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display" : "Jason Argonaut"
},
"onsetDateTime" : "2012-11-07T00:00:00Z",
"recordedDate" : "2015-08-25T02:11:36",
"recorder" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display" : "MOORE, NICK"
},
"reaction" : [
{
"extension" : [
{
"url" : "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString" : "confirmed"
}
],
"manifestation" : [
{
"text" : "Hives"
}
],
"onset" : "2012-11-07T00:00:00Z"
}
]
}

View File

@ -1,22 +1,48 @@
{"resourceType": "AllergyIntolerance",
"id": "TKebKfLXzu6Sp.LY-IpvpmQB",
"clinicalStatus": "active",
"verificationStatus": "confirmed",
"criticality": "high",
"code": {"coding": [{"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "892484",
"display": "STRAWBERRY"},
{"system": "http://fdasis.nlm.nih.gov",
"code": "4J2TY8Y81V",
"display": "STRAWBERRY"}],
"text": "STRAWBERRY"},
"patient": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display": "Jason Argonaut"},
"onsetDateTime": "2014-03-07T00:00:00",
"assertedDate": "2015-11-07T22:56:34",
"recorder": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display": "MOORE, NICK"},
"reaction": [{"extension": [{"url": "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString": "confirmed"}],
"manifestation": [{"text": "Anaphylaxis"}],
"onset": "2014-03-07T00:00:00"}]}
{
"resourceType" : "AllergyIntolerance",
"id" : "TKebKfLXzu6Sp.LY-IpvpmQB",
"clinicalStatus" : "active",
"verificationStatus" : "confirmed",
"criticality" : "high",
"code" : {
"coding" : [
{
"system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
"code" : "892484",
"display" : "STRAWBERRY"
},
{
"system" : "http://fdasis.nlm.nih.gov",
"code" : "4J2TY8Y81V",
"display" : "STRAWBERRY"
}
],
"text" : "STRAWBERRY"
},
"patient" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display" : "Jason Argonaut"
},
"onsetDateTime" : "2014-03-07T00:00:00Z",
"assertedDate" : "2015-11-07T22:56:34",
"recorder" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display" : "MOORE, NICK"
},
"reaction" : [
{
"extension" : [
{
"url" : "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString" : "confirmed"
}
],
"manifestation" : [
{
"text" : "Anaphylaxis"
}
],
"onset" : "2014-03-07T00:00:00Z"
}
]
}

View File

@ -1,23 +1,61 @@
{"resourceType": "AllergyIntolerance",
"clinicalStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code": "confirmed"}]},
"verificationStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
"code": "confirmed"}]},
"criticality": "high",
"code": {"coding": [{"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "892484",
"display": "STRAWBERRY"},
{"system": "http://fdasis.nlm.nih.gov",
"code": "4J2TY8Y81V",
"display": "STRAWBERRY"}],
"text": "STRAWBERRY"},
"patient": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display": "Jason Argonaut"},
"onsetDateTime": "2014-03-07T00:00:00Z",
"recordedDate": "2015-11-07T22:56:34",
"recorder": {"reference": "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display": "MOORE, NICK"},
"reaction": [{"extension": [{"url": "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString": "confirmed"}],
"manifestation": [{"text": "Anaphylaxis"}],
"onset": "2014-03-07T00:00:00"}]}
{
"resourceType" : "AllergyIntolerance",
"clinicalStatus" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code" : "confirmed"
}
]
},
"verificationStatus" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
"code" : "confirmed"
}
]
},
"criticality" : "high",
"code" : {
"coding" : [
{
"system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
"code" : "892484",
"display" : "STRAWBERRY"
},
{
"system" : "http://fdasis.nlm.nih.gov",
"code" : "4J2TY8Y81V",
"display" : "STRAWBERRY"
}
],
"text" : "STRAWBERRY"
},
"patient" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB",
"display" : "Jason Argonaut"
},
"onsetDateTime" : "2014-03-07T00:00:00Z",
"recordedDate" : "2015-11-07T22:56:34",
"recorder" : {
"reference" : "https://open-ic.epic.com/Argonaut/api/FHIR/DSTU2/Practitioner/TItWfhjChtlo0pFh9nzctSQB",
"display" : "MOORE, NICK"
},
"reaction" : [
{
"extension" : [
{
"url" : "http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
"valueString" : "confirmed"
}
],
"manifestation" : [
{
"text" : "Anaphylaxis"
}
],
"onset" : "2014-03-07T00:00:00Z"
}
]
}

View File

@ -331,6 +331,7 @@ public class I18nConstants {
public static final String REFERENCE_REF_NOTFOUND_BUNDLE = "Reference_REF_NotFound_Bundle";
public static final String REFERENCE_REF_NOTYPE = "Reference_REF_NoType";
public static final String REFERENCE_REF_RESOURCETYPE = "Reference_REF_ResourceType";
public static final String REFERENCE_REF_SUSPICIOUS = "REFERENCE_REF_SUSPICIOUS";
public static final String REFERENCE_REF_WRONGTARGET = "Reference_REF_WrongTarget";
public static final String REFERENCE_TO__CANNOT_BE_RESOLVED = "reference_to__cannot_be_resolved";
public static final String REFERENCE__REFERS_TO_A__NOT_A_VALUESET = "Reference__refers_to_a__not_a_ValueSet";

View File

@ -604,3 +604,4 @@ FHIRPATH_BAD_DATE = Unable to parse Date {0}
FHIRPATH_NUMERICAL_ONLY = Error evaluating FHIRPath expression: The function {0} can only be used on integer, decimal or Quantity but found {1}
FHIRPATH_DECIMAL_ONLY = Error evaluating FHIRPath expression: The function {0} can only be used on a decimal but found {1}
FHIRPATH_FOCUS_PLURAL = Error evaluating FHIRPath expression: focus for {0} has more than one value
REFERENCE_REF_SUSPICIOUS = The syntax of the reference ''{0}'' looks incorrect, and it should be checked

View File

@ -2398,6 +2398,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
// special known URLs that can't be validated but are known to be valid
return;
}
warning(errors, IssueType.STRUCTURE, element.line(), element.col(), path, !isSuspiciousReference(ref), I18nConstants.REFERENCE_REF_SUSPICIOUS, ref);
ResolvedReference we = localResolve(ref, stack, errors, path, (Element) hostContext.getAppContext(), element);
String refType;
@ -2439,10 +2440,11 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
String ft;
if (we != null)
if (we != null) {
ft = we.getType();
else
} else {
ft = tryParse(ref);
}
if (reference.hasType()) { // R4 onwards...
// the type has to match the specified
@ -2596,6 +2598,20 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
}
private boolean isSuspiciousReference(String url) {
if (!assumeValidRestReferences || url == null || Utilities.isAbsoluteUrl(url)) {
return false;
}
String[] parts = url.split("\\/");
if (parts.length == 2 && context.getResourceNames().contains(parts[0]) && Utilities.isValidId(parts[1])) {
return false;
}
if (parts.length == 4 && context.getResourceNames().contains(parts[0]) && Utilities.isValidId(parts[1]) && "_history".equals(parts[2]) && Utilities.isValidId(parts[3])) {
return false;
}
return true;
}
private String asListByUrl(Collection<StructureDefinition> list) {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
for (StructureDefinition sd : list) {
@ -4842,7 +4858,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
case 2:
return checkResourceType(parts[0]);
default:
if (parts[parts.length - 2].equals("_history"))
if (parts[parts.length - 2].equals("_history") && parts.length >= 4)
return checkResourceType(parts[parts.length - 4]);
else
return checkResourceType(parts[parts.length - 2]);