Skip to content

Commit

Permalink
string param support added
Browse files Browse the repository at this point in the history
  • Loading branch information
melihaydogd committed Jun 27, 2024
1 parent b525db8 commit 4a33a01
Showing 1 changed file with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -663,20 +663,9 @@ private boolean matchChainedReferenceParam(

// Create new search parameter map to match the next resource
SearchParameterMap searchParameterMap = new SearchParameterMap();
if (resourceSearchParam.getParamType().equals(RestSearchParameterTypeEnum.REFERENCE)) {
searchParameterMap.add(
parameterName, new ReferenceParam(modifier, chain, referenceParam.getValue()));
} else {
TokenParam tokenParam;
if (referenceParam.getValue().contains("|")) {
String[] systemAndValue = referenceParam.getValue().split("\\|");
tokenParam = new TokenParam(systemAndValue[0], systemAndValue[1]);
} else {
tokenParam = new TokenParam(referenceParam.getValue());
}
tokenParam.setModifier(TokenParamModifier.forValue(":" + modifier));
searchParameterMap.add(parameterName, tokenParam);
}
IQueryParameterType theParam =
convertReferenceParam(referenceParam, resourceSearchParam, modifier, chain);
searchParameterMap.add(parameterName, theParam);

// Recursively match the chained resources
return searchParamMatcher
Expand All @@ -685,6 +674,25 @@ private boolean matchChainedReferenceParam(
});
}

private static IQueryParameterType convertReferenceParam(
ReferenceParam referenceParam, RuntimeSearchParam resourceSearchParam, String modifier, String chain) {
if (resourceSearchParam.getParamType().equals(RestSearchParameterTypeEnum.REFERENCE)) {
return new ReferenceParam(modifier, chain, referenceParam.getValue());
} else if (resourceSearchParam.getParamType().equals(RestSearchParameterTypeEnum.STRING)) {
return new StringParam(referenceParam.getValue(), "exact".equals(modifier));
} else {
TokenParam tokenParam;
if (referenceParam.getValue().contains("|")) {
String[] systemAndValue = referenceParam.getValue().split("\\|");
tokenParam = new TokenParam(systemAndValue[0], systemAndValue[1]);
} else {
tokenParam = new TokenParam(referenceParam.getValue());
}
tokenParam.setModifier(TokenParamModifier.forValue(":" + modifier));
return tokenParam;
}
}

private boolean systemContainsCode(TokenParam theQueryParam, ResourceIndexedSearchParamToken theSearchParamToken) {
IValidationSupport validationSupport = getValidationSupportOrNull();
if (validationSupport == null) {
Expand Down

0 comments on commit 4a33a01

Please sign in to comment.