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));
}
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));
}
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));
}
Aggregations