more bug fixes in R3/R5 conversions

This commit is contained in:
Grahame Grieve 2020-02-12 18:02:36 +11:00
parent 582a2699a5
commit 9b562f3489
2 changed files with 27 additions and 3 deletions

View File

@ -154,8 +154,32 @@ public class VersionConvertor_30_50 {
return tgt; return tgt;
} }
public static org.hl7.fhir.r5.model.CodeType convertStringToCode(org.hl7.fhir.dstu3.model.StringType src) throws FHIRException {
org.hl7.fhir.r5.model.CodeType tgt = new org.hl7.fhir.r5.model.CodeType(src.getValue());
copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.StringType convertCodeToString(org.hl7.fhir.r5.model.CodeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.StringType tgt = new org.hl7.fhir.dstu3.model.StringType(src.getValue());
copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.CodeType convertStringToCode(org.hl7.fhir.r5.model.StringType 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.StringType convertCodeToString(org.hl7.fhir.dstu3.model.CodeType src) throws FHIRException {
org.hl7.fhir.r5.model.StringType tgt = new org.hl7.fhir.r5.model.StringType(src.getValue());
copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.DateType convertDate(org.hl7.fhir.dstu3.model.DateType src) throws FHIRException { public static org.hl7.fhir.r5.model.DateType convertDate(org.hl7.fhir.dstu3.model.DateType src) throws FHIRException {
org.hl7.fhir.r5.model.DateType tgt = new org.hl7.fhir.r5.model.DateType(src.getValueAsString()); org.hl7.fhir.r5.model.DateType tgt = new org.hl7.fhir.r5.model.DateType(src.getValueAsString());
copyElement(src, tgt); copyElement(src, tgt);
return tgt; return tgt;
} }

View File

@ -117,7 +117,7 @@ public class ValueSet30_50 {
if (src.hasOp()) if (src.hasOp())
tgt.setOp(convertFilterOperator2(src.getOp())); tgt.setOp(convertFilterOperator2(src.getOp()));
if (src.hasValueElement()) if (src.hasValueElement())
tgt.setValueElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_30_50.convertType(src.getValueElement())); tgt.setValueElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_30_50.convertStringToCode(src.getValueElement()));
return tgt; return tgt;
} }
@ -131,7 +131,7 @@ public class ValueSet30_50 {
if (src.hasOp()) if (src.hasOp())
tgt.setOp(VersionConvertor_30_50.convertFilterOperator(src.getOp())); tgt.setOp(VersionConvertor_30_50.convertFilterOperator(src.getOp()));
if (src.hasValueElement()) if (src.hasValueElement())
tgt.setValueElement((org.hl7.fhir.r5.model.StringType) VersionConvertor_30_50.convertType(src.getValueElement())); tgt.setValueElement((org.hl7.fhir.r5.model.StringType) VersionConvertor_30_50.convertCodeToString(src.getValueElement()));
return tgt; return tgt;
} }