use of org.hl7.elm_modelinfo.r1.ChoiceTypeSpecifier in project quality-measure-and-cohort-service by Alvearie.
the class ModelUtils method getChoiceTypeNames.
public static Collection<String> getChoiceTypeNames(TypeInfo typeInfo) {
if (typeInfo != null && typeInfo.getBaseTypeSpecifier() != null && (typeInfo.getBaseTypeSpecifier() instanceof ChoiceTypeSpecifier)) {
List<String> choiceTypes = new ArrayList<>();
ChoiceTypeSpecifier choiceType = (ChoiceTypeSpecifier) typeInfo.getBaseTypeSpecifier();
for (TypeSpecifier typeSpecifier : choiceType.getChoice()) {
if (typeSpecifier instanceof NamedTypeSpecifier) {
String typeName = ((NamedTypeSpecifier) typeSpecifier).getName();
choiceTypes.add(typeName);
}
}
return choiceTypes;
} else {
return Collections.emptyList();
}
}
Aggregations