Skip to content

Commit 9e0ada6

Browse files
author
hospel
authored
NIAD-2997: Don't send "Ssp-From" header to GP Connect Consumer adaptor (#598)
1 parent 4b2254b commit 9e0ada6

File tree

2 files changed

+5
-26
lines changed

2 files changed

+5
-26
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Fixed
10+
- Fix GpConnectException (ASID_CHECK_FAILED_MESSAGESENDER) being thrown, a correct ASID value is fetched in GP Connect Consumer Adapter
11+
912
## [1.5.14] - 2024-01-05
1013

1114
### Added
@@ -36,7 +39,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3639
- Fix errors within the generation of compressed EHR Extracts (happens when the record becomes >5MB) which was causing
3740
SystmOne to reject the transfer.
3841

39-
4042
## [1.5.11] - 2023-09-26
4143

4244
### Fixed

service/src/main/java/uk/nhs/adaptors/gp2gp/gpc/builder/GpcRequestBuilder.java

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import io.netty.handler.ssl.SslContext;
55
import lombok.RequiredArgsConstructor;
66
import lombok.extern.slf4j.Slf4j;
7-
import org.apache.commons.lang3.StringUtils;
87
import org.hl7.fhir.dstu3.model.BooleanType;
98
import org.hl7.fhir.dstu3.model.Identifier;
109
import org.hl7.fhir.dstu3.model.Parameters;
@@ -41,14 +40,14 @@
4140
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
4241
@Slf4j
4342
public class GpcRequestBuilder {
43+
4444
@Value("${gp2gp.gpc.overrideFromAsid}")
4545
private String overrideFromAsid;
4646
@Value("${gp2gp.gpc.overrideToAsid}")
4747
private String overrideToAsid;
4848

4949
private static final String NHS_NUMBER_SYSTEM = "https://fhir.nhs.uk/Id/nhs-number";
5050
private static final String FHIR_CONTENT_TYPE = "application/fhir+json";
51-
private static final String SSP_FROM = "Ssp-From";
5251
private static final String SSP_INTERACTION_ID = "Ssp-InteractionID";
5352
private static final String SSP_TRACE_ID = "Ssp-TraceID";
5453
private static final String AUTHORIZATION = "Authorization";
@@ -130,36 +129,14 @@ private WebClient buildWebClient(HttpClient httpClient, String baseUrl) {
130129
}
131130

132131
private RequestBodySpec buildRequestWithHeaders(RequestBodySpec uri, TaskDefinition taskDefinition, String interactionId) {
133-
/*
134-
* SSP_FROM must be set to GP2GP ASID which is stored in the toAsid property of the task
135-
* SSP_TO is left blank as it will be set in the GPC Consumer Proxy
136-
*/
132+
137133
return uri.accept(MediaType.valueOf(FHIR_CONTENT_TYPE))
138-
.header(SSP_FROM, getToAsid(taskDefinition.getToAsid()))
139134
.header(SSP_INTERACTION_ID, interactionId)
140135
.header(SSP_TRACE_ID, taskDefinition.getConversationId())
141136
.header(AUTHORIZATION, AUTHORIZATION_BEARER + gpcTokenBuilder.buildToken(taskDefinition.getFromOdsCode()))
142137
.header(CONTENT_TYPE, FHIR_CONTENT_TYPE);
143138
}
144139

145-
private String getFromAsid(String fromAsid) {
146-
if (StringUtils.isNotBlank(overrideFromAsid)) {
147-
LOGGER.warn("GP2GP_GPC_OVERRIDE_FROM_ASID is being used, no longer using provided from asid");
148-
return overrideFromAsid;
149-
} else {
150-
return fromAsid;
151-
}
152-
}
153-
154-
private String getToAsid(String toAsid) {
155-
if (StringUtils.isNotBlank(overrideToAsid)) {
156-
LOGGER.warn("GP2GP_GPC_OVERRIDE_TO_ASID is being used, no longer using provided to asid");
157-
return overrideToAsid;
158-
} else {
159-
return toAsid;
160-
}
161-
}
162-
163140
private RequestHeadersSpec<?> buildRequestWithHeadersAndBody(RequestBodySpec uri, String requestBody,
164141
BodyInserter<Object, ReactiveHttpOutputMessage> bodyInserter, TaskDefinition taskDefinition, String interactionId) {
165142
return buildRequestWithHeaders(uri, taskDefinition, interactionId)

0 commit comments

Comments
 (0)