Search in sources :

Example 1 with SimpleSnomedDsvExportItem

use of com.b2international.snowowl.snomed.datastore.internal.rf2.SimpleSnomedDsvExportItem in project snow-owl by b2ihealthcare.

the class SnomedRefSetDSVExportTest method transformToExportItems.

private List<AbstractSnomedDsvExportItem> transformToExportItems() /*final Iterable<SnomedConstraint> constraints*/
{
    // XXX: Migrate to new MRCM model
    List<AbstractSnomedDsvExportItem> results = Lists.newArrayList();
    // for (final SnomedConstraint constraint : constraints) {
    // SnomedPredicate predicate = constraint.getPredicate();
    // 
    // // Inspect the predicate within the cardinality predicate
    // if (predicate instanceof SnomedCardinalityPredicate) {
    // predicate = ((SnomedCardinalityPredicate) predicate).getPredicate();
    // }
    // 
    // if (predicate instanceof SnomedDescriptionPredicate) {
    // final String descriptionTypeId = ((SnomedDescriptionPredicate) predicate).getTypeId();
    // final ComponentIdSnomedDsvExportItem descriptionExportItem = new ComponentIdSnomedDsvExportItem(SnomedDsvExportItemType.DESCRIPTION, descriptionTypeId, descriptionTypeId);
    // results.add(descriptionExportItem);
    // } else if (predicate instanceof SnomedRelationshipPredicate) {
    // final String typeId = ((SnomedRelationshipPredicate) predicate).getAttributeExpression(); // XXX: only single-SCTID expressions are accepted
    // final ComponentIdSnomedDsvExportItem relationshipExportItem = new ComponentIdSnomedDsvExportItem(SnomedDsvExportItemType.RELATIONSHIP, typeId, typeId);
    // results.add(relationshipExportItem);
    // } else if (predicate instanceof SnomedConcreteDomainPredicate) {
    // final String attributeId = ((SnomedConcreteDomainPredicate) predicate).getAttributeExpression(); // XXX: only single-SCTID expressions are accepted
    // final DataType dataType = ((SnomedConcreteDomainPredicate) predicate).getRange();
    // final boolean dataTypeBoolean = DataType.BOOLEAN.equals(dataType);
    // final DatatypeSnomedDsvExportItem datatypeExportItem = new DatatypeSnomedDsvExportItem(SnomedDsvExportItemType.DATAYPE, attributeId, attributeId, dataTypeBoolean);
    // results.add(datatypeExportItem);
    // }
    // }
    results.add(new SimpleSnomedDsvExportItem(SnomedDsvExportItemType.PREFERRED_TERM));
    results.add(new SimpleSnomedDsvExportItem(SnomedDsvExportItemType.MODULE));
    results.add(new SimpleSnomedDsvExportItem(SnomedDsvExportItemType.EFFECTIVE_TIME));
    results.add(new SimpleSnomedDsvExportItem(SnomedDsvExportItemType.STATUS_LABEL));
    results.add(new SimpleSnomedDsvExportItem(SnomedDsvExportItemType.DEFINITION_STATUS));
    return results;
}
Also used : AbstractSnomedDsvExportItem(com.b2international.snowowl.snomed.datastore.internal.rf2.AbstractSnomedDsvExportItem) SimpleSnomedDsvExportItem(com.b2international.snowowl.snomed.datastore.internal.rf2.SimpleSnomedDsvExportItem)

Aggregations

AbstractSnomedDsvExportItem (com.b2international.snowowl.snomed.datastore.internal.rf2.AbstractSnomedDsvExportItem)1 SimpleSnomedDsvExportItem (com.b2international.snowowl.snomed.datastore.internal.rf2.SimpleSnomedDsvExportItem)1