Updated R5 reverse $translate test case for more coverage
@@ -13,6 +13,7 @@ import org.hl7.fhir.r5.model.ConceptMap;
import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent;
import org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent;
import org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent;
+import org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship;
import org.hl7.fhir.r5.model.Parameters;
import org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent;
import org.hl7.fhir.r5.model.StringType;
@@ -121,7 +122,7 @@ public class ResourceProviderR5ConceptMapTest extends BaseResourceProviderR5Test
element1.setCode("12222").setDisplay("Source Code 12222");
TargetElementComponent target1 = element1.addTarget();
- target1.setCode("11111").setDisplay("11111");
+ target1.setCode("11111").setDisplay("11111").setRelationship(ConceptMapRelationship.EQUIVALENT);
IIdType conceptMapId1 = myConceptMapDao.create(conceptMap1, mySrd).getId().toUnqualifiedVersionless();
conceptMap1 = myConceptMapDao.read(conceptMapId1);
@@ -139,7 +140,7 @@ public class ResourceProviderR5ConceptMapTest extends BaseResourceProviderR5Test
element2.setCode("13333").setDisplay("Source Code 13333");
TargetElementComponent target2 = element2.addTarget();
- target2.setCode("11111").setDisplay("Target Code 11111");
+ target2.setCode("11111").setDisplay("Target Code 11111").setRelationship(ConceptMapRelationship.EQUIVALENT);
IIdType conceptMapId2 = myConceptMapDao.create(conceptMap2, mySrd).getId().toUnqualifiedVersionless();
conceptMap2 = myConceptMapDao.read(conceptMapId2);
@@ -174,8 +175,10 @@ public class ResourceProviderR5ConceptMapTest extends BaseResourceProviderR5Test
assertEquals(1, getNumberOfParametersByName(respParams, "match"));
param = getParametersByName(respParams, "match").get(0);
- assertEquals(2, param.getPart().size());
- ParametersParameterComponent part = getPartByName(param, "concept");
+ assertEquals(3, param.getPart().size());
+ ParametersParameterComponent part = getPartByName(param, "equivalence");
+ assertEquals("equivalent", ((CodeType) part.getValue()).getCode());
+ part = getPartByName(param, "concept");
Coding coding = (Coding) part.getValue();
assertEquals("13333", coding.getCode());
assertEquals("Source Code 13333", coding.getDisplay());
