Merge pull request #404 from mion00/fix-id-dstu2org

Fix missing ID with JAX-RS and DSTU2 RI
This commit is contained in:
James Agnew 2016-07-19 19:16:55 -04:00 committed by GitHub
commit d0383a29da
1 changed files with 3 additions and 3 deletions

View File

@ -137,7 +137,7 @@ public class JaxRsRequest extends RequestDetails {
FhirVersionEnum fhirContextVersion = myServer.getFhirContext().getVersion().getVersion(); FhirVersionEnum fhirContextVersion = myServer.getFhirContext().getVersion().getVersion();
if (StringUtils.isNotBlank(myVersion)) { if (StringUtils.isNotBlank(myVersion)) {
if (FhirVersionEnum.DSTU3.equals(fhirContextVersion)) { if (FhirVersionEnum.DSTU3.equals(fhirContextVersion) || FhirVersionEnum.DSTU2_HL7ORG.equals(fhirContextVersion)) {
result.setId( result.setId(
new IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion))); new IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
} else if (FhirVersionEnum.DSTU2.equals(fhirContextVersion)) { } else if (FhirVersionEnum.DSTU2.equals(fhirContextVersion)) {
@ -145,7 +145,7 @@ public class JaxRsRequest extends RequestDetails {
new IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion))); new IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
} }
} else if (StringUtils.isNotBlank(myId)) { } else if (StringUtils.isNotBlank(myId)) {
if (FhirVersionEnum.DSTU3.equals(fhirContextVersion)) { if (FhirVersionEnum.DSTU3.equals(fhirContextVersion) || FhirVersionEnum.DSTU2_HL7ORG.equals(fhirContextVersion)) {
result.setId(new IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId))); result.setId(new IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
} else if (FhirVersionEnum.DSTU2.equals(fhirContextVersion)) { } else if (FhirVersionEnum.DSTU2.equals(fhirContextVersion)) {
result.setId(new IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId))); result.setId(new IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
@ -155,7 +155,7 @@ public class JaxRsRequest extends RequestDetails {
if (myRestOperation == RestOperationTypeEnum.UPDATE) { if (myRestOperation == RestOperationTypeEnum.UPDATE) {
String contentLocation = result.getHeader(Constants.HEADER_CONTENT_LOCATION); String contentLocation = result.getHeader(Constants.HEADER_CONTENT_LOCATION);
if (contentLocation != null) { if (contentLocation != null) {
if (FhirVersionEnum.DSTU3.equals(fhirContextVersion)) { if (FhirVersionEnum.DSTU3.equals(fhirContextVersion) || FhirVersionEnum.DSTU2_HL7ORG.equals(fhirContextVersion)) {
result.setId(new IdType(contentLocation)); result.setId(new IdType(contentLocation));
} else if (FhirVersionEnum.DSTU2.equals(fhirContextVersion)) { } else if (FhirVersionEnum.DSTU2.equals(fhirContextVersion)) {
result.setId(new IdDt(contentLocation)); result.setId(new IdDt(contentLocation));