fix wrong code generation for Expression.language

This commit is contained in:
Grahame Grieve 2019-08-05 07:33:30 +10:00
parent 670ae0c79a
commit 26a6659d2e
11 changed files with 46 additions and 50 deletions

View File

@ -3358,7 +3358,7 @@ public class VersionConvertor_30_40 {
if (src.hasPath())
tgt.setPath(src.getPath());
if (src.hasLanguage())
tgt.getExpression().setLanguage(ExpressionLanguage.fromCode(src.getLanguage()));
tgt.getExpression().setLanguage(src.getLanguage());
if (src.hasExpression())
tgt.getExpression().setExpression(src.getExpression());
return tgt;
@ -3374,7 +3374,7 @@ public class VersionConvertor_30_40 {
if (src.getExpression().hasDescription())
tgt.setDescription(src.getExpression().getDescription());
if (src.getExpression().hasLanguage())
tgt.setLanguage(src.getExpression().getLanguage().toCode());
tgt.setLanguage(src.getExpression().getLanguage());
if (src.getExpression().hasExpression())
tgt.setExpression(src.getExpression().getExpression());
return tgt;
@ -22531,7 +22531,7 @@ public class VersionConvertor_30_40 {
if (src.hasDescription())
tgt.getExpression().setDescription(src.getDescription());
if (src.hasLanguage())
tgt.getExpression().setLanguage(ExpressionLanguage.fromCode(src.getLanguage()));
tgt.getExpression().setLanguage(src.getLanguage());
if (src.hasExpression())
tgt.getExpression().setExpression(src.getExpression());
return tgt;
@ -22547,7 +22547,7 @@ public class VersionConvertor_30_40 {
if (src.getExpression().hasDescription())
tgt.setDescription(src.getExpression().getDescription());
if (src.getExpression().hasLanguage())
tgt.setLanguage(src.getExpression().getLanguage().toCode());
tgt.setLanguage(src.getExpression().getLanguage());
if (src.getExpression().hasExpression())
tgt.setExpression(src.getExpression().getExpression());
return tgt;
@ -22693,7 +22693,7 @@ public class VersionConvertor_30_40 {
if (src.hasPath())
tgt.setPath(src.getPath());
if (src.hasLanguage())
tgt.getExpression().setLanguage(ExpressionLanguage.fromCode(src.getLanguage()));
tgt.getExpression().setLanguage(src.getLanguage());
if (src.hasExpression())
tgt.getExpression().setExpression(src.getExpression());
return tgt;
@ -22709,7 +22709,7 @@ public class VersionConvertor_30_40 {
if (src.hasPath())
tgt.setPath(src.getPath());
if (src.getExpression().hasLanguage())
tgt.setLanguage(src.getExpression().getLanguage().toCode());
tgt.setLanguage(src.getExpression().getLanguage());
if (src.getExpression().hasExpression())
tgt.setExpression(src.getExpression().getExpression());
return tgt;

View File

@ -3348,7 +3348,7 @@ public class VersionConvertor_30_50 {
if (src.hasPath())
tgt.setPath(src.getPath());
if (src.hasLanguage())
tgt.getExpression().setLanguage(ExpressionLanguage.fromCode(src.getLanguage()));
tgt.getExpression().setLanguage(src.getLanguage());
if (src.hasExpression())
tgt.getExpression().setExpression(src.getExpression());
return tgt;
@ -3364,7 +3364,7 @@ public class VersionConvertor_30_50 {
if (src.getExpression().hasDescription())
tgt.setDescription(src.getExpression().getDescription());
if (src.getExpression().hasLanguage())
tgt.setLanguage(src.getExpression().getLanguage().toCode());
tgt.setLanguage(src.getExpression().getLanguage());
if (src.getExpression().hasExpression())
tgt.setExpression(src.getExpression().getExpression());
return tgt;
@ -21861,7 +21861,7 @@ public class VersionConvertor_30_50 {
if (src.hasDescription())
tgt.getExpression().setDescription(src.getDescription());
if (src.hasLanguage())
tgt.getExpression().setLanguage(ExpressionLanguage.fromCode(src.getLanguage()));
tgt.getExpression().setLanguage(src.getLanguage());
if (src.hasExpression())
tgt.getExpression().setExpression(src.getExpression());
return tgt;
@ -21877,7 +21877,7 @@ public class VersionConvertor_30_50 {
if (src.getExpression().hasDescription())
tgt.setDescription(src.getExpression().getDescription());
if (src.getExpression().hasLanguage())
tgt.setLanguage(src.getExpression().getLanguage().toCode());
tgt.setLanguage(src.getExpression().getLanguage());
if (src.getExpression().hasExpression())
tgt.setExpression(src.getExpression().getExpression());
return tgt;
@ -22023,7 +22023,7 @@ public class VersionConvertor_30_50 {
if (src.hasPath())
tgt.setPath(src.getPath());
if (src.hasLanguage())
tgt.getExpression().setLanguage(ExpressionLanguage.fromCode(src.getLanguage()));
tgt.getExpression().setLanguage(src.getLanguage());
if (src.hasExpression())
tgt.getExpression().setExpression(src.getExpression());
return tgt;
@ -22039,7 +22039,7 @@ public class VersionConvertor_30_50 {
if (src.hasPath())
tgt.setPath(src.getPath());
if (src.getExpression().hasLanguage())
tgt.setLanguage(src.getExpression().getLanguage().toCode());
tgt.setLanguage(src.getExpression().getLanguage());
if (src.getExpression().hasExpression())
tgt.setExpression(src.getExpression().getExpression());
return tgt;

View File

@ -1153,7 +1153,7 @@ public class VersionConvertor_40_50 {
if (src.hasName())
tgt.setNameElement(convertId(src.getNameElement()));
if (src.hasLanguage())
tgt.setLanguage(convertExpressionLanguage(src.getLanguage()));
tgt.setLanguageElement(convertCode(src.getLanguageElement()));
if (src.hasExpression())
tgt.setExpressionElement(convertString(src.getExpressionElement()));
if (src.hasReference())
@ -1171,7 +1171,7 @@ public class VersionConvertor_40_50 {
if (src.hasName())
tgt.setNameElement(convertId(src.getNameElement()));
if (src.hasLanguage())
tgt.setLanguage(convertExpressionLanguage(src.getLanguage()));
tgt.setLanguageElement(convertCode(src.getLanguageElement()));
if (src.hasExpression())
tgt.setExpressionElement(convertString(src.getExpressionElement()));
if (src.hasReference())

View File

@ -1200,7 +1200,7 @@ public class JsonParser extends JsonParserBase {
if (json.has("_name"))
parseElementProperties(json.getAsJsonObject("_name"), res.getNameElement());
if (json.has("language"))
res.setLanguageElement(parseEnumeration(json.get("language").getAsString(), Expression.ExpressionLanguage.NULL, new Expression.ExpressionLanguageEnumFactory()));
res.setLanguageElement(parseCode(json.get("language").getAsString()));
if (json.has("_language"))
parseElementProperties(json.getAsJsonObject("_language"), res.getLanguageElement());
if (json.has("expression"))
@ -30075,8 +30075,8 @@ public class JsonParser extends JsonParserBase {
composeIdExtras("name", element.getNameElement(), false);
}
if (element.hasLanguageElement()) {
composeEnumerationCore("language", element.getLanguageElement(), new Expression.ExpressionLanguageEnumFactory(), false);
composeEnumerationExtras("language", element.getLanguageElement(), new Expression.ExpressionLanguageEnumFactory(), false);
composeCodeCore("language", element.getLanguageElement(), false);
composeCodeExtras("language", element.getLanguageElement(), false);
}
if (element.hasExpressionElement()) {
composeStringCore("expression", element.getExpressionElement(), false);

View File

@ -1004,7 +1004,7 @@ public class RdfParser extends RdfParserBase {
if (element.hasNameElement())
composeId(t, "Expression", "name", element.getNameElement(), -1);
if (element.hasLanguageElement())
composeEnum(t, "Expression", "language", element.getLanguageElement(), -1);
composeCode(t, "Expression", "language", element.getLanguageElement(), -1);
if (element.hasExpressionElement())
composeString(t, "Expression", "expression", element.getExpressionElement(), -1);
if (element.hasReferenceElement())

View File

@ -1496,7 +1496,7 @@ public class XmlParser extends XmlParserBase {
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
res.setNameElement(parseId(xpp));
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
res.setLanguageElement(parseEnumeration(xpp, Expression.ExpressionLanguage.NULL, new Expression.ExpressionLanguageEnumFactory()));
res.setLanguageElement(parseCode(xpp));
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
res.setExpressionElement(parseString(xpp));
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
@ -26490,7 +26490,7 @@ public class XmlParser extends XmlParserBase {
composeId("name", element.getNameElement());
}
if (element.hasLanguageElement())
composeEnumeration("language", element.getLanguageElement(), new Expression.ExpressionLanguageEnumFactory());
composeCode("language", element.getLanguageElement());
if (element.hasExpressionElement()) {
composeString("expression", element.getExpressionElement());
}

View File

@ -193,7 +193,7 @@ public class Expression extends Type implements ICompositeType {
@Child(name = "language", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
@Description(shortDefinition="text/cql | text/fhirpath | application/x-fhir-query | etc.", formalDefinition="The media type of the language for the expression." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/expression-language")
protected Enumeration<ExpressionLanguage> language;
protected CodeType language;
/**
* An expression in the specified language that returns a value.
@ -221,7 +221,7 @@ public class Expression extends Type implements ICompositeType {
/**
* Constructor
*/
public Expression(Enumeration<ExpressionLanguage> language) {
public Expression(CodeType language) {
super();
this.language = language;
}
@ -327,12 +327,12 @@ public class Expression extends Type implements ICompositeType {
/**
* @return {@link #language} (The media type of the language for the expression.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
*/
public Enumeration<ExpressionLanguage> getLanguageElement() {
public CodeType getLanguageElement() {
if (this.language == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Expression.language");
else if (Configuration.doAutoCreate())
this.language = new Enumeration<ExpressionLanguage>(new ExpressionLanguageEnumFactory()); // bb
this.language = new CodeType(); // bb
return this.language;
}
@ -347,7 +347,7 @@ public class Expression extends Type implements ICompositeType {
/**
* @param value {@link #language} (The media type of the language for the expression.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
*/
public Expression setLanguageElement(Enumeration<ExpressionLanguage> value) {
public Expression setLanguageElement(CodeType value) {
this.language = value;
return this;
}
@ -355,16 +355,16 @@ public class Expression extends Type implements ICompositeType {
/**
* @return The media type of the language for the expression.
*/
public ExpressionLanguage getLanguage() {
public String getLanguage() {
return this.language == null ? null : this.language.getValue();
}
/**
* @param value The media type of the language for the expression.
*/
public Expression setLanguage(ExpressionLanguage value) {
public Expression setLanguage(String value) {
if (this.language == null)
this.language = new Enumeration<ExpressionLanguage>(new ExpressionLanguageEnumFactory());
this.language = new CodeType();
this.language.setValue(value);
return this;
}
@ -512,8 +512,7 @@ public class Expression extends Type implements ICompositeType {
this.name = castToId(value); // IdType
return value;
case -1613589672: // language
value = new ExpressionLanguageEnumFactory().fromType(castToCode(value));
this.language = (Enumeration) value; // Enumeration<ExpressionLanguage>
this.language = castToCode(value); // Enumeration<ExpressionLanguage>
return value;
case -1795452264: // expression
this.expression = castToString(value); // StringType
@ -533,8 +532,7 @@ public class Expression extends Type implements ICompositeType {
} else if (name.equals("name")) {
this.name = castToId(value); // IdType
} else if (name.equals("language")) {
value = new ExpressionLanguageEnumFactory().fromType(castToCode(value));
this.language = (Enumeration) value; // Enumeration<ExpressionLanguage>
this.language = castToCode(value); // Enumeration<ExpressionLanguage>
} else if (name.equals("expression")) {
this.expression = castToString(value); // StringType
} else if (name.equals("reference")) {

View File

@ -1200,7 +1200,7 @@ public class JsonParser extends JsonParserBase {
if (json.has("_name"))
parseElementProperties(json.getAsJsonObject("_name"), res.getNameElement());
if (json.has("language"))
res.setLanguageElement(parseEnumeration(json.get("language").getAsString(), Expression.ExpressionLanguage.NULL, new Expression.ExpressionLanguageEnumFactory()));
res.setLanguageElement(parseCode(json.get("language").getAsString()));
if (json.has("_language"))
parseElementProperties(json.getAsJsonObject("_language"), res.getLanguageElement());
if (json.has("expression"))
@ -30075,8 +30075,8 @@ public class JsonParser extends JsonParserBase {
composeIdExtras("name", element.getNameElement(), false);
}
if (element.hasLanguageElement()) {
composeEnumerationCore("language", element.getLanguageElement(), new Expression.ExpressionLanguageEnumFactory(), false);
composeEnumerationExtras("language", element.getLanguageElement(), new Expression.ExpressionLanguageEnumFactory(), false);
composeCodeCore("language", element.getLanguageElement(), false);
composeCodeExtras("language", element.getLanguageElement(), false);
}
if (element.hasExpressionElement()) {
composeStringCore("expression", element.getExpressionElement(), false);

View File

@ -1004,7 +1004,7 @@ public class RdfParser extends RdfParserBase {
if (element.hasNameElement())
composeId(t, "Expression", "name", element.getNameElement(), -1);
if (element.hasLanguageElement())
composeEnum(t, "Expression", "language", element.getLanguageElement(), -1);
composeCode(t, "Expression", "language", element.getLanguageElement(), -1);
if (element.hasExpressionElement())
composeString(t, "Expression", "expression", element.getExpressionElement(), -1);
if (element.hasReferenceElement())

View File

@ -1496,7 +1496,7 @@ public class XmlParser extends XmlParserBase {
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
res.setNameElement(parseId(xpp));
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
res.setLanguageElement(parseEnumeration(xpp, Expression.ExpressionLanguage.NULL, new Expression.ExpressionLanguageEnumFactory()));
res.setLanguageElement(parseCode(xpp));
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
res.setExpressionElement(parseString(xpp));
} else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
@ -26490,7 +26490,7 @@ public class XmlParser extends XmlParserBase {
composeId("name", element.getNameElement());
}
if (element.hasLanguageElement())
composeEnumeration("language", element.getLanguageElement(), new Expression.ExpressionLanguageEnumFactory());
composeCode("language", element.getLanguageElement());
if (element.hasExpressionElement()) {
composeString("expression", element.getExpressionElement());
}

View File

@ -193,7 +193,7 @@ public class Expression extends Type implements ICompositeType {
@Child(name = "language", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
@Description(shortDefinition="text/cql | text/fhirpath | application/x-fhir-query | etc.", formalDefinition="The media type of the language for the expression." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/expression-language")
protected Enumeration<ExpressionLanguage> language;
protected CodeType language;
/**
* An expression in the specified language that returns a value.
@ -221,7 +221,7 @@ public class Expression extends Type implements ICompositeType {
/**
* Constructor
*/
public Expression(Enumeration<ExpressionLanguage> language) {
public Expression(CodeType language) {
super();
this.language = language;
}
@ -327,12 +327,12 @@ public class Expression extends Type implements ICompositeType {
/**
* @return {@link #language} (The media type of the language for the expression.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
*/
public Enumeration<ExpressionLanguage> getLanguageElement() {
public CodeType getLanguageElement() {
if (this.language == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Expression.language");
else if (Configuration.doAutoCreate())
this.language = new Enumeration<ExpressionLanguage>(new ExpressionLanguageEnumFactory()); // bb
this.language = new CodeType(); // bb
return this.language;
}
@ -347,7 +347,7 @@ public class Expression extends Type implements ICompositeType {
/**
* @param value {@link #language} (The media type of the language for the expression.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
*/
public Expression setLanguageElement(Enumeration<ExpressionLanguage> value) {
public Expression setLanguageElement(CodeType value) {
this.language = value;
return this;
}
@ -355,16 +355,16 @@ public class Expression extends Type implements ICompositeType {
/**
* @return The media type of the language for the expression.
*/
public ExpressionLanguage getLanguage() {
public String getLanguage() {
return this.language == null ? null : this.language.getValue();
}
/**
* @param value The media type of the language for the expression.
*/
public Expression setLanguage(ExpressionLanguage value) {
public Expression setLanguage(String value) {
if (this.language == null)
this.language = new Enumeration<ExpressionLanguage>(new ExpressionLanguageEnumFactory());
this.language = new CodeType();
this.language.setValue(value);
return this;
}
@ -512,8 +512,7 @@ public class Expression extends Type implements ICompositeType {
this.name = castToId(value); // IdType
return value;
case -1613589672: // language
value = new ExpressionLanguageEnumFactory().fromType(castToCode(value));
this.language = (Enumeration) value; // Enumeration<ExpressionLanguage>
this.language = castToCode(value); // Enumeration<ExpressionLanguage>
return value;
case -1795452264: // expression
this.expression = castToString(value); // StringType
@ -533,8 +532,7 @@ public class Expression extends Type implements ICompositeType {
} else if (name.equals("name")) {
this.name = castToId(value); // IdType
} else if (name.equals("language")) {
value = new ExpressionLanguageEnumFactory().fromType(castToCode(value));
this.language = (Enumeration) value; // Enumeration<ExpressionLanguage>
this.language = castToCode(value); // Enumeration<ExpressionLanguage>
} else if (name.equals("expression")) {
this.expression = castToString(value); // StringType
} else if (name.equals("reference")) {