updates for version conversion routines

This commit is contained in:
Grahame Grieve 2020-02-24 12:18:14 +11:00
parent 0bd6a4a7eb
commit be38cc8e58
4 changed files with 61 additions and 70 deletions

View File

@ -2685,38 +2685,33 @@ public class VersionConvertor_10_30 {
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory());
VersionConvertor_10_30.copyElement(src, tgt);
switch(src.getValue()) {
case NUMBER:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER);
break;
case DATE:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE);
break;
case STRING:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING);
break;
case TOKEN:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN);
break;
case REFERENCE:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE);
break;
case COMPOSITE:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE);
break;
case QUANTITY:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY);
break;
case URI:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL);
break;
}
tgt.setValue(convertSearchParamType(src.getValue()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumerations.SearchParamType convertSearchParamType(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType src) throws FHIRException {
switch(src) {
case NUMBER:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER;
case DATE:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE;
case STRING:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING;
case TOKEN:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN;
case REFERENCE:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE;
case COMPOSITE:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE;
case QUANTITY:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY;
case URI:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI;
default:
return org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL;
}
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.SearchParamType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;

View File

@ -105,29 +105,27 @@ public class SearchParameter10_30 {
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageTypeEnumFactory());
VersionConvertor_10_30.copyElement(src, tgt);
switch(src.getValue()) {
case NORMAL:
tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NORMAL);
break;
case PHONETIC:
tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.PHONETIC);
break;
case NEARBY:
tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NEARBY);
break;
case DISTANCE:
tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.DISTANCE);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NULL);
break;
}
tgt.setValue(convertXPathUsageType(src.getValue()));
return tgt;
}
static public org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType convertXPathUsageType(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType src) throws FHIRException {
switch(src) {
case NORMAL:
return org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NORMAL;
case PHONETIC:
return org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.PHONETIC;
case NEARBY:
return org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NEARBY;
case DISTANCE:
return org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.DISTANCE;
case OTHER:
return org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.OTHER;
default:
return org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NULL;
}
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType> convertXPathUsageType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;

View File

@ -105,29 +105,27 @@ public class SearchParameter10_40 {
return null;
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.XPathUsageTypeEnumFactory());
VersionConvertor_10_40.copyElement(src, tgt);
switch(src.getValue()) {
case NORMAL:
tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL);
break;
case PHONETIC:
tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC);
break;
case NEARBY:
tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NEARBY);
break;
case DISTANCE:
tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.DISTANCE);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL);
break;
}
tgt.setValue(convertXPathUsageType(src.getValue()));
return tgt;
}
static public org.hl7.fhir.r4.model.SearchParameter.XPathUsageType convertXPathUsageType(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType src) {
switch(src) {
case NORMAL:
return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL;
case PHONETIC:
return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC;
case NEARBY:
return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NEARBY;
case DISTANCE:
return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.DISTANCE;
case OTHER:
return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER;
default:
return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL;
}
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType> convertXPathUsageType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;

View File

@ -152,7 +152,7 @@ import ca.uhn.fhir.util.ObjectUtil;
/**
* Thinking of using this in a java program? Don't!
* You should use one of the wrappers instead. Either in HAPI, or use ValidationEngine
* You should use one of the wrappers instead. Either in HAPI, or use ValidationEngine, or NativeHostServices
* <p>
* Validation todo:
* - support @default slices