use of org.opencds.cqf.ruler.utility.CanonicalParts in project cqf-ruler by DBCG.
the class DataOperationsProvider method visitLibrary.
private void visitLibrary(Library library, List<Library> queue, Map<String, Library> resources, RequestDetails theRequestDetails) {
for (RelatedArtifact relatedArtifact : library.getRelatedArtifact()) {
if (relatedArtifact.getType().equals(RelatedArtifact.RelatedArtifactType.DEPENDSON) && relatedArtifact.hasResource()) {
// FHIR R4+, resource is defined as a canonical
String resourceString = relatedArtifact.getResource();
CanonicalParts parts = Canonicals.getParts(resourceString);
if (parts.resourceType().equals("Library")) {
Library lib = search(Library.class, Searches.byCanonical(resourceString), theRequestDetails).firstOrNull();
if (lib != null) {
resources.putIfAbsent(lib.getId(), lib);
queue.add(lib);
}
}
}
}
}
Aggregations