use of com.ibm.cohort.cql.library.Format in project quality-measure-and-cohort-service by Alvearie.
the class CohortCLI method toCqlLibraryMap.
private Map<CqlLibraryDescriptor, CqlLibrary> toCqlLibraryMap(List<Library> libraries) {
Map<CqlLibraryDescriptor, CqlLibrary> retVal = new HashMap<>();
for (Library library : libraries) {
String libraryId = library.getName();
String version = library.getVersion();
for (Attachment attachment : library.getContent()) {
Format libraryFormat = Format.lookupByName(attachment.getContentType());
if (libraryFormat != null) {
CqlLibraryDescriptor key = new CqlLibraryDescriptor().setLibraryId(libraryId).setVersion(version).setFormat(libraryFormat);
CqlLibrary value = new CqlLibrary().setContent(new String(attachment.getData())).setDescriptor(key);
retVal.put(key, value);
}
}
}
return retVal;
}
Aggregations