Skip to content

Commit

Permalink
Issue #1323 - Extract :of-type parameter as internal composite
Browse files Browse the repository at this point in the history
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
  • Loading branch information
tbieste committed Mar 19, 2021
1 parent beceb5f commit d86e9d2
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 51 deletions.
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 d86e9d2

Please sign in to comment.