Skip to content

RetrieveEvaluator doesnt pass on valueset version to DataProvider/RetrieveProvider #1460

Open
@Zylox

Description

The retrieve evaluator has access to the valueset version when it resolves the valuesetRef here:

ValueSet vs = ValueSetRefEvaluator.toValueSet(state, (ValueSetRef) elm.getCodes());
valueSet = vs.getId();

As that code shows, it then extracts ONLY the id when passed to the DataProvider below:

result = dataProvider.retrieve(
state.getCurrentContext(),
(String) dataProvider.getContextPath(state.getCurrentContext(), dataType.getLocalPart()),
state.getCurrentContextValue(),
dataType.getLocalPart(),
elm.getTemplateId(),
elm.getCodeProperty(),
codes,
valueSet,
elm.getDateProperty(),
elm.getDateLowProperty(),
elm.getDateHighProperty(),
dateRange);

This leads to a situation where it is ambiguous what version of the valueset is to be used by the retreive/data provider.

It is NOT ambigious when referenced as part of an expression:

if (valueset instanceof ValueSet) {
ValueSetInfo vsi = ValueSetInfo.fromValueSet((ValueSet) valueset);
TerminologyProvider provider = state.getEnvironment().getTerminologyProvider();
// perform operation
if (code instanceof String) {
if (provider.in(new Code().withCode((String) code), vsi)) {
return true;
}
return false;
} else if (code instanceof Code) {
if (provider.in((Code) code, vsi)) {
return true;
}
return false;
} else if (code instanceof Concept) {
for (Code codes : ((Concept) code).getCodes()) {
if (codes == null) return null;
if (provider.in(codes, vsi)) return true;
}
return false;
}
}

It seems the simplest solution would be to pass the ValueSet object in place of the valuesetId string, the retreiveprovider can strip it down to just the id if that is desired.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions