More work to get build working

This commit is contained in:
James Agnew 2015-05-01 11:44:06 -04:00
parent 61f2838b3a
commit cb9716f885
6 changed files with 26 additions and 7 deletions

View File

@ -82,6 +82,8 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini
myDatatypeToElementName = new HashMap<Class<? extends IBase>, String>();
myDatatypeToElementDefinition = new HashMap<Class<? extends IBase>, BaseRuntimeElementDefinition<?>>();
String referenceChildName = theContext.getVersion().getVersion().equals(FhirVersionEnum.DSTU1) ? "Resource" : "Reference";
for (Class<? extends IBase> next : myChoiceTypes) {
String elementName;
@ -89,7 +91,7 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini
BaseRuntimeElementDefinition<?> nextDef;
if (IBaseResource.class.isAssignableFrom(next)) {
elementName = getElementName() + StringUtils.capitalize(next.getSimpleName());
alternateElementName = getElementName() + "Reference";
alternateElementName = getElementName() + referenceChildName;
List<Class<? extends IBaseResource>> types = new ArrayList<Class<? extends IBaseResource>>();
types.add((Class<? extends IBaseResource>) next);
nextDef = new RuntimeResourceReferenceDefinition(elementName, types);
@ -107,7 +109,7 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini
if (IBaseResource.class.isAssignableFrom(next)) {
Class<? extends IBase> refType = theContext.getVersion().getResourceReferenceType();
myDatatypeToElementDefinition.put(refType, nextDef);
alternateElementName = getElementName() + "Reference";
alternateElementName = getElementName() + referenceChildName;
myDatatypeToElementName.put(refType, alternateElementName);
}

View File

@ -143,14 +143,22 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
/*
* Resource reference - The correct name is 'valueReference', but
* we allow for valueResource because some incorrect parsers may use this
* we allow for valueResource because some incorrect parsers may use this.
* valueResource was the correct name in DSTU1. We put the correct name
* second so that it gets stored as the appropriate name for the
* reference datatype.
*/
addReferenceBinding(theContext, theClassToElementDefinitions, "valueResource");
addReferenceBinding(theContext, theClassToElementDefinitions, "valueReference");
}
private void addReferenceBinding(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions, String value) {
myDatatypeToAttributeName.put(theContext.getVersion().getResourceReferenceType(), value);
if (theContext.getVersion().getVersion().equals(FhirVersionEnum.DSTU1) && "valueReference".equals(value)) {
// This changed between DSTU1 and DSTU2 so don't store the DSTU2 name here
} else {
myDatatypeToAttributeName.put(theContext.getVersion().getResourceReferenceType(), value);
}
List<Class<? extends IBaseResource>> types = new ArrayList<Class<? extends IBaseResource>>();
types.add(IBaseResource.class);
RuntimeResourceReferenceDefinition def = new RuntimeResourceReferenceDefinition(value, types);

View File

@ -286,7 +286,7 @@ public class SearchTest {
IOUtils.closeQuietly(status.getEntity().getContent());
ourLog.info(responseContent);
assertEquals(400, status.getStatusLine().getStatusCode());
assertThat(responseContent, containsString("<details value=\"Incorrect Content-Type header value of &quot;application/x-www-form-urlencoded; charset=UTF-8&quot; was provided in the request. This is required for &quot;CREATE&quot; operation\"/>"));
assertThat(responseContent, containsString("<details value=\"Incorrect Content-Type header value of &quot;application/x-www-form-urlencoded; charset=UTF-8&quot; was provided in the request. A FHIR Content-Type is required for &quot;CREATE&quot; operation\"/>"));
}
/**
@ -473,7 +473,9 @@ public class SearchTest {
patient.addIdentifier("system", "identifier123");
if (theParam != null) {
patient.addName().addFamily("id" + theParam.getValue());
patient.addName().addFamily("name" + theName.getValue());
if (theName != null) {
patient.addName().addFamily("name" + theName.getValue());
}
}
retVal.add(patient);
return retVal;

View File

@ -10,7 +10,10 @@
<logger name="org.eclipse" additivity="false" level="info">
<appender-ref ref="STDOUT" />
</logger>
<logger name="org.apache" additivity="false" level="debug">
<logger name="org.apache" additivity="false" level="info">
<appender-ref ref="STDOUT" />
</logger>
<logger name="org.thymeleaf" additivity="false" level="warn">
<appender-ref ref="STDOUT" />
</logger>

View File

@ -137,3 +137,4 @@ local.properties
# TeXlipse plugin
.texlipse
/target/

View File

@ -13,6 +13,9 @@
<logger name="org.apache" additivity="false" level="info">
<appender-ref ref="STDOUT" />
</logger>
<logger name="org.thymeleaf" additivity="false" level="warn">
<appender-ref ref="STDOUT" />
</logger>
<!--
<logger name="ca.uhn.fhir.rest.client" additivity="false" level="trace">