use of gov.cms.qpp.conversion.model.Decoder in project qpp-conversion-tool by CMSgov.
the class QrdaDecoderEngine method getDecoder.
/**
* Retrieve a permitted {@link Decoder}. {@link #scope} is used to determine which DECODERS are allowable.
*
* @param templateId string representation of a would be decoder's template id
* @return decoder that corresponds to the given template id
*/
private QrdaDecoder getDecoder(TemplateId templateId) {
QrdaDecoder qppDecoder = decoders.get(templateId);
if (qppDecoder != null) {
if (scope == null) {
return qppDecoder;
}
Decoder decoder = qppDecoder.getClass().getAnnotation(Decoder.class);
TemplateId template = decoder == null ? TemplateId.DEFAULT : decoder.value();
return !scope.contains(template) ? null : qppDecoder;
}
return null;
}
Aggregations