Search in sources :

Example 1 with ConceptMapGroupUnmappedComponent

use of org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent in project bunsen by cerner.

the class BroadcastableMappingsTest method setUp.

/**
 * Sets up Spark and concept maps for testing.
 */
@BeforeClass
public static void setUp() {
    spark = SparkSession.builder().master("local[2]").appName("BroadcastableMappingsTest").getOrCreate();
    ConceptMap conceptMap = new ConceptMap();
    conceptMap.setUrl("uri:test:concept:map").setVersion("0").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    ConceptMapGroupComponent group = conceptMap.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system");
    group.addElement().setCode("abc").addTarget().setCode("123");
    group.addElement().setCode("def").addTarget().setCode("456");
    ConceptMap delegatingMap = new ConceptMap();
    delegatingMap.setUrl("uri:test:concept:delegating").setVersion("0").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    delegatingMap.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system").setUnmapped(new ConceptMapGroupUnmappedComponent().setMode(ConceptMapGroupUnmappedMode.OTHERMAP).setUrl("uri:test:concept:map"));
    broadcast = BroadcastableMappings.broadcast(spark, ImmutableList.of(conceptMap, delegatingMap));
}
Also used : ConceptMapGroupUnmappedComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedComponent) ConceptMap(org.hl7.fhir.dstu3.model.ConceptMap) ConceptMapGroupComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent) UriType(org.hl7.fhir.dstu3.model.UriType) BeforeClass(org.junit.BeforeClass)

Example 2 with ConceptMapGroupUnmappedComponent

use of org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent in project bunsen by cerner.

the class BroadcastableMappingsTest method setUp.

/**
 * Sets up Spark and concept maps for testing.
 */
@BeforeClass
public static void setUp() {
    spark = SparkSession.builder().master("local[2]").appName("BroadcastableMappingsTest").getOrCreate();
    ConceptMap conceptMap = new ConceptMap();
    conceptMap.setUrl("uri:test:concept:map").setVersion("0").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    ConceptMapGroupComponent group = conceptMap.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system");
    group.addElement().setCode("abc").addTarget().setCode("123");
    group.addElement().setCode("def").addTarget().setCode("456");
    ConceptMap delegatingMap = new ConceptMap();
    delegatingMap.setUrl("uri:test:concept:delegating").setVersion("0").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    delegatingMap.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system").setUnmapped(new ConceptMapGroupUnmappedComponent().setMode(ConceptMapGroupUnmappedMode.OTHERMAP).setUrl("uri:test:concept:map"));
    broadcast = ConceptMaps.getEmpty(spark).withConceptMaps(conceptMap, delegatingMap).broadcast(ImmutableMap.of("uri:test:concept:map", "0", "uri:test:concept:delegating", "0"));
    ConceptMap conceptMapLatest = new ConceptMap();
    conceptMapLatest.setUrl("uri:test:concept:map").setVersion("1").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    ConceptMapGroupComponent groupLatest = conceptMapLatest.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system");
    groupLatest.addElement().setCode("abc").addTarget().setCode("123");
    groupLatest.addElement().setCode("def").addTarget().setCode("xyz");
    ConceptMaps maps = ConceptMaps.getEmpty(spark).withConceptMaps(conceptMap, conceptMapLatest);
    broadcastLatest = maps.broadcast(maps.getLatestVersions(true));
}
Also used : ConceptMapGroupUnmappedComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedComponent) ConceptMaps(com.cerner.bunsen.stu3.codes.ConceptMaps) BroadcastableConceptMap(com.cerner.bunsen.spark.codes.broadcast.BroadcastableConceptMap) ConceptMap(org.hl7.fhir.dstu3.model.ConceptMap) ConceptMapGroupComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent) UriType(org.hl7.fhir.dstu3.model.UriType) BeforeClass(org.junit.BeforeClass)

Example 3 with ConceptMapGroupUnmappedComponent

use of org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent in project bunsen by cerner.

the class BroadcastableMappingsTest method setUp.

/**
 * Sets up Spark and concept maps for testing.
 */
@BeforeClass
public static void setUp() {
    spark = SparkSession.builder().master("local[2]").appName("BroadcastableMappingsTest").getOrCreate();
    ConceptMap conceptMap = new ConceptMap();
    conceptMap.setUrl("uri:test:concept:map").setVersion("0").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    ConceptMapGroupComponent group = conceptMap.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system");
    group.addElement().setCode("abc").addTarget().setCode("123");
    group.addElement().setCode("def").addTarget().setCode("456");
    ConceptMap delegatingMap = new ConceptMap();
    delegatingMap.setUrl("uri:test:concept:delegating").setVersion("0").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    delegatingMap.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system").setUnmapped(new ConceptMapGroupUnmappedComponent().setMode(ConceptMapGroupUnmappedMode.OTHERMAP).setUrl("uri:test:concept:map"));
    broadcast = ConceptMaps.getEmpty(spark).withConceptMaps(conceptMap, delegatingMap).broadcast(ImmutableMap.of("uri:test:concept:map", "0", "uri:test:concept:delegating", "0"));
    ConceptMap conceptMapLatest = new ConceptMap();
    conceptMapLatest.setUrl("uri:test:concept:map").setVersion("1").setSource(new UriType("uri:test:source:valueset")).setTarget(new UriType("uri:test:target:valueset"));
    ConceptMapGroupComponent groupLatest = conceptMapLatest.addGroup().setSource("uri:test:source:system").setTarget("uri:test:target:system");
    groupLatest.addElement().setCode("abc").addTarget().setCode("123");
    groupLatest.addElement().setCode("def").addTarget().setCode("xyz");
    ConceptMaps maps = ConceptMaps.getEmpty(spark).withConceptMaps(conceptMap, conceptMapLatest);
    broadcastLatest = maps.broadcast(maps.getLatestVersions(true));
}
Also used : ConceptMapGroupUnmappedComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent) ConceptMaps(com.cerner.bunsen.r4.codes.ConceptMaps) BroadcastableConceptMap(com.cerner.bunsen.codes.broadcast.BroadcastableConceptMap) ConceptMap(org.hl7.fhir.r4.model.ConceptMap) ConceptMapGroupComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent) UriType(org.hl7.fhir.r4.model.UriType) BeforeClass(org.junit.BeforeClass)

Aggregations

BeforeClass (org.junit.BeforeClass)3 ConceptMap (org.hl7.fhir.dstu3.model.ConceptMap)2 ConceptMapGroupComponent (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent)2 ConceptMapGroupUnmappedComponent (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedComponent)2 UriType (org.hl7.fhir.dstu3.model.UriType)2 BroadcastableConceptMap (com.cerner.bunsen.codes.broadcast.BroadcastableConceptMap)1 ConceptMaps (com.cerner.bunsen.r4.codes.ConceptMaps)1 BroadcastableConceptMap (com.cerner.bunsen.spark.codes.broadcast.BroadcastableConceptMap)1 ConceptMaps (com.cerner.bunsen.stu3.codes.ConceptMaps)1 ConceptMap (org.hl7.fhir.r4.model.ConceptMap)1 ConceptMapGroupComponent (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent)1 ConceptMapGroupUnmappedComponent (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent)1 UriType (org.hl7.fhir.r4.model.UriType)1