Skip to content

Commit

Permalink
Merge pull request #2116 from IBM/tbieste-issue-1323
Browse files Browse the repository at this point in the history
Issue #1323 - Add support for ':of-type' modifier
  • Loading branch information
tbieste authored Mar 22, 2021
2 parents 6d00ba4 + 7dd99b6 commit 23046b7
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 63 deletions.
8 changes: 4 additions & 4 deletions docs/src/pages/Conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: Conformance
description: Notes on the Conformance of the IBM FHIR Server
date: 2021-03-17 12:00:00 -0400
date: 2021-03-22 12:00:00 -0400
permalink: /conformance/
---

Expand Down Expand Up @@ -165,16 +165,16 @@ FHIR search modifiers are described at https://www.hl7.org/fhir/R4/search.html#m
|String |`:exact`,`:contains`,`:missing` |"starts with" search that is case-insensitive and accent-insensitive|
|Reference |`:[type]`,`:missing`,`:identifier` |exact match search and targets are implicitly added|
|URI |`:below`,`:above`,`:missing` |exact match search|
|Token |`:missing`,`:not` |exact match search|
|Token |`:missing`,`:not`,`:of-type` |exact match search|
|Number |`:missing` |implicit range search (see http://hl7.org/fhir/R4/search.html#number)|
|Date |`:missing` |implicit range search (see https://www.hl7.org/fhir/search.html#date)|
|Quantity |`:missing` |implicit range search (see http://hl7.org/fhir/R4/search.html#quantity)|
|Composite |`:missing` |processes each parameter component according to its type|
|Special (near) | none |searches a bounding area according to the value of the `fhirServer/search/useBoundingRadius` property|

Due to performance implications, the `:exact` modifier should be used for String searches where possible.
Due to performance implications, the `:exact` modifier should be used for String search parameters when possible.

The `:text`, `:above`, `:below`, `:in`, `:not-in`, and `:of-type` modifiers are not supported in this version of the IBM FHIR server and use of these modifiers will result in an HTTP 400 error with an OperationOutcome that describes the failure.
The `:text` modifier, as well as the `:above`, `:below`, `:in`, and `:not-in` modifiers for Token search parameters, are not yet supported by the IBM FHIR server. Use of these modifiers will result in an HTTP 400 error with an OperationOutcome that describes the failure.

### Search prefixes
FHIR search prefixes are described at https://www.hl7.org/fhir/R4/search.html#prefix.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public class JDBCConstants {
supportedModifiersMap.put(Type.STRING, Arrays.asList(Modifier.EXACT, Modifier.CONTAINS, Modifier.MISSING));
supportedModifiersMap.put(Type.REFERENCE, Arrays.asList(Modifier.TYPE, Modifier.MISSING, Modifier.IDENTIFIER));
supportedModifiersMap.put(Type.URI, Arrays.asList(Modifier.BELOW, Modifier.ABOVE, Modifier.MISSING));
supportedModifiersMap.put(Type.TOKEN, Arrays.asList(Modifier.MISSING, Modifier.NOT));
supportedModifiersMap.put(Type.TOKEN, Arrays.asList(Modifier.MISSING, Modifier.NOT, Modifier.OF_TYPE));
supportedModifiersMap.put(Type.NUMBER, Arrays.asList(Modifier.MISSING));
supportedModifiersMap.put(Type.DATE, Arrays.asList(Modifier.MISSING));
supportedModifiersMap.put(Type.QUANTITY, Arrays.asList(Modifier.MISSING));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ private List<ExtractedParameterValue> extractSearchParameters(Resource fhirResou
// Of course, that would require adding extension-search-params to the Registry which would require the Registry to be tenant-aware.
// SearchParameter compSP = FHIRRegistry.getInstance().getResource(component.getDefinition().getValue(), SearchParameter.class);
SearchParameter compSP = SearchUtil.getSearchParameter(p.getResourceType(), component.getDefinition());
JDBCParameterBuildingVisitor parameterBuilder = new JDBCParameterBuildingVisitor(compSP);
JDBCParameterBuildingVisitor parameterBuilder = new JDBCParameterBuildingVisitor(p.getResourceType(), compSP);
FHIRPathNode node = nodes.iterator().next();
if (nodes.size() > 1 ) {
// TODO: support component expressions that result in multiple nodes
Expand Down Expand Up @@ -1455,7 +1455,6 @@ private List<ExtractedParameterValue> extractSearchParameters(Resource fhirResou
ExtractedParameterValue componentParam = parameters.get(0);
// override the component parameter name with the composite parameter name
componentParam.setName(SearchUtil.makeCompositeSubCode(code, componentParam.getName()));
componentParam.setResourceType(p.getResourceType());
componentParam.setBase(p.getBase());
p.addComponent(componentParam);
} else if (node.isSystemValue()){
Expand Down Expand Up @@ -1498,7 +1497,7 @@ private List<ExtractedParameterValue> extractSearchParameters(Resource fhirResou
}
}
} else { // ! SearchParamType.COMPOSITE.equals(sp.getType())
JDBCParameterBuildingVisitor parameterBuilder = new JDBCParameterBuildingVisitor(sp);
JDBCParameterBuildingVisitor parameterBuilder = new JDBCParameterBuildingVisitor(fhirResource.getClass().getSimpleName(), sp);

for (FHIRPathNode value : values) {

Expand Down Expand Up @@ -1542,7 +1541,6 @@ private List<ExtractedParameterValue> extractSearchParameters(Resource fhirResou
// retrieve the list of parameters built from all the FHIRPathElementNode values
List<ExtractedParameterValue> parameters = parameterBuilder.getResult();
for (ExtractedParameterValue p : parameters) {
p.setResourceType(fhirResource.getClass().getSimpleName());
allParameters.add(p);
if (log.isLoggable(Level.FINE)) {
log.fine("Extracted Parameter '" + p.getName() + "' from Resource.");
Expand Down
Loading

0 comments on commit 23046b7

Please sign in to comment.