Related to issue #764, changed the private conformanceDate method in DSTU2_HL7ORG's ServerConformanceProvider to be consistent with the ServerConformanceProvider in other FHIR contexts

This commit is contained in:
Clayton Bodendein 2017-10-30 12:48:23 -05:00
parent 277eddc8d2
commit d7f13432df
1 changed files with 6 additions and 6 deletions

View File

@ -29,6 +29,7 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.parser.DataFormatException;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.instance.model.*;
import org.hl7.fhir.instance.model.Conformance.*;
@ -165,7 +166,7 @@ public class ServerConformanceProvider implements IServerConformanceProvider<Con
Conformance retVal = new Conformance();
retVal.setPublisher(myPublisher);
retVal.setDate(conformanceDate());
retVal.setDateElement(conformanceDate());
retVal.setFhirVersion(FhirVersionEnum.DSTU2_HL7ORG.getFhirVersionString());
retVal.setAcceptUnknown(UnknownContentCode.EXTENSIONS); // TODO: make this configurable - this is a fairly big effort since the parser
// needs to be modified to actually allow it
@ -303,17 +304,16 @@ public class ServerConformanceProvider implements IServerConformanceProvider<Con
return retVal;
}
private Date conformanceDate() {
private DateTimeType conformanceDate() {
String buildDate = myServerConfiguration.getConformanceDate();
if (buildDate != null) {
DateFormat dateFormat = new SimpleDateFormat();
try {
return dateFormat.parse(buildDate);
} catch (ParseException e) {
return new DateTimeType(buildDate);
} catch (DataFormatException e) {
// fall through
}
}
return new Date();
return DateTimeType.now();
}
private void handleDynamicSearchMethodBinding(ConformanceRestResourceComponent resource,