fix problem with conversion of ElementDefinition between R3 and R5

This commit is contained in:
Grahame Grieve 2020-02-12 17:36:37 +11:00
parent 9bcc947885
commit 9dc8b910c3
2 changed files with 15 additions and 2 deletions

View File

@ -328,6 +328,18 @@ public class VersionConvertor_30_50 {
return tgt;
}
public static org.hl7.fhir.r5.model.UriType convertCodeToUri(org.hl7.fhir.dstu3.model.CodeType src) throws FHIRException {
org.hl7.fhir.r5.model.UriType tgt = new org.hl7.fhir.r5.model.UriType(src.getValue());
copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.CodeType convertUriToCode(org.hl7.fhir.r5.model.UriType src) throws FHIRException {
org.hl7.fhir.dstu3.model.CodeType tgt = new org.hl7.fhir.dstu3.model.CodeType(src.getValue());
copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.UuidType convertUuid(org.hl7.fhir.dstu3.model.UuidType src) throws FHIRException {
org.hl7.fhir.r5.model.UuidType tgt = new org.hl7.fhir.r5.model.UuidType(src.getValue());
copyElement(src, tgt);

View File

@ -175,8 +175,9 @@ public class StructureDefinition30_50 {
if (src.hasAbstractElement())
tgt.setAbstractElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_30_50.convertType(src.getAbstractElement()));
for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) {
if (!tgt.hasContextType())
tgt.setTypeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_30_50.convertType(src.getTypeElement()));
if (!tgt.hasContextType()) {
tgt.setTypeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_30_50.convertUriToCode(src.getTypeElement()));
}
tgt.addContext("Element".equals(t.getExpression()) ? "*" : t.getExpression());
}
if (src.hasContextInvariant()) {