fix R5 --> R4 conversion for ConceptMap equivalence default value

This commit is contained in:
Grahame Grieve 2021-03-03 13:14:12 +11:00
parent c6e815b583
commit a56e269366
1 changed files with 8 additions and 3 deletions

View File

@ -168,11 +168,14 @@ public class ConceptMap40_50 extends VersionConvertor_40_50 {
tgt.setCodeElement(convertCode(src.getCodeElement())); tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay()) if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement())); tgt.setDisplayElement(convertString(src.getDisplayElement()));
for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) if (t.getEquivalence() == org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED) { for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
if (t.getEquivalence() == org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED) {
tgt.setNoMap(true); tgt.setNoMap(true);
} else { }
else {
tgt.addTarget(convertTargetElementComponent(t)); tgt.addTarget(convertTargetElementComponent(t));
} }
}
return tgt; return tgt;
} }
@ -222,6 +225,8 @@ public class ConceptMap40_50 extends VersionConvertor_40_50 {
tgt.setDisplayElement(convertString(src.getDisplayElement())); tgt.setDisplayElement(convertString(src.getDisplayElement()));
if (src.hasRelationship()) if (src.hasRelationship())
tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getRelationshipElement())); tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getRelationshipElement()));
else
tgt.setEquivalence(ConceptMapEquivalence.RELATEDTO);
if (src.hasComment()) if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement())); tgt.setCommentElement(convertString(src.getCommentElement()));
for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t));