Skip to content

Commit

Permalink
COnfirm validation support comntains codesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed May 2, 2019
1 parent 8c7f065 commit 5132f1f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ public List<StructureDefinition> fetchAllStructureDefinitions(FhirContext theCon
@Override
public CodeSystem fetchCodeSystem(FhirContext theCtx, String theSystem) {
for (IValidationSupport next : myChain) {
CodeSystem retVal = next.fetchCodeSystem(theCtx, theSystem);
if (retVal != null) {
return retVal;
if (next.isCodeSystemSupported(theCtx, theSystem)) {
CodeSystem retVal = next.fetchCodeSystem(theCtx, theSystem);
if (retVal != null) {
return retVal;
}
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ public List<IBaseResource> fetchAllConformanceResources(FhirContext theContext)
}

@Override
public CodeSystem fetchCodeSystem(FhirContext theCtx, String uri) {
public CodeSystem fetchCodeSystem(FhirContext theCtx, String theSystem) {
for (IValidationSupport next : myChain) {
CodeSystem retVal = next.fetchCodeSystem(theCtx, uri);
if (retVal != null) {
return retVal;
if (next.isCodeSystemSupported(theCtx, theSystem)) {
CodeSystem retVal = next.fetchCodeSystem(theCtx, theSystem);
if (retVal != null) {
return retVal;
}
}
}
return null;
Expand Down
5 changes: 5 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@
Fixed "because at least one resource has a reference to this resource" delete error message that mistakingly reported
the target instead of the source with the reference.
</action>
<action type="add">
ValidationSupportChain will now call isCodeSystemSupported() on each entry in the chain before
calling fetchCodeSystem() in order to reduce the work required by chain entries. Thanks to
Anders Havn for the suggestion!
</action>
</release>
<release version="3.7.0" date="2019-02-06" description="Gale">
<action type="add">
Expand Down

0 comments on commit 5132f1f

Please sign in to comment.