use of com.b2international.snowowl.snomed.core.domain.refset.SnomedRefSetType in project snow-owl by b2ihealthcare.
the class SnomedRf2ExportRequest method exportCombinedRefSets.
private void exportCombinedRefSets(final Path releaseDirectory, final RepositoryContext context, final String branch, final String archiveEffectiveTime, final long effectiveTimeFilterStart, final long effectiveTimeFilterEnd, final Collection<String> languageCodes, final Set<String> visitedComponentEffectiveTimes) throws IOException {
final Multimap<SnomedRefSetType, SnomedConcept> referenceSetsByType = FluentIterable.from(getIdentifierConcepts(context, getBranchOrRangeTarget(branch))).index(c -> c.getReferenceSet().getType());
// Create single exporter instance for each reference set type
for (final SnomedRefSetType refSetType : referenceSetsByType.keySet()) {
// We will handle language reference sets separately
if (SnomedRefSetType.LANGUAGE.equals(refSetType)) {
continue;
}
final Rf2RefSetExporter refSetExporter = new Rf2RefSetExporter(releaseType, countryNamespaceElement, namespaceFilter, transientEffectiveTime, archiveEffectiveTime, modules, refSetExportLayout, refSetType, referenceSetsByType.get(refSetType));
refSetExporter.exportBranch(releaseDirectory, context, branch, effectiveTimeFilterStart, effectiveTimeFilterEnd, visitedComponentEffectiveTimes);
}
exportLanguageRefSets(releaseDirectory, context, branch, archiveEffectiveTime, effectiveTimeFilterStart, effectiveTimeFilterEnd, languageCodes, referenceSetsByType.get(SnomedRefSetType.LANGUAGE), visitedComponentEffectiveTimes);
}
use of com.b2international.snowowl.snomed.core.domain.refset.SnomedRefSetType in project snow-owl by b2ihealthcare.
the class SnomedRefSetMemberUpdateRequest method execute.
@Override
public Boolean execute(TransactionContext context) {
SnomedRefSetMemberIndexEntry member = context.lookup(componentId(), SnomedRefSetMemberIndexEntry.class);
SnomedRefSetMemberIndexEntry.Builder updatedMember = SnomedRefSetMemberIndexEntry.builder(member);
/*
* TODO: Generalize the logic below: any attempts of retrieving a missing component during component update
* (with the exception of the component that is being updated) should return a 400 response instead of a 404.
*/
try {
SnomedRefSetType type = member.getReferenceSetType();
boolean changed = false;
changed |= updateStatus(member, updatedMember);
changed |= updateModule(member, updatedMember);
changed |= updateEffectiveTime(member, updatedMember);
SnomedRefSetMemberUpdateDelegate delegate = getDelegate(type);
changed |= delegate.execute(member, updatedMember, context);
if (changed) {
if (!isEffectiveTimeUpdate()) {
updatedMember.effectiveTime(EffectiveTimes.UNSET_EFFECTIVE_TIME);
}
context.update(member, updatedMember.build());
}
return changed;
} catch (ComponentNotFoundException e) {
throw e.toBadRequestException();
}
}
Aggregations