Skip to content

Commit 58c3bdb

Browse files
committed
CCM-12875: remove unused header
1 parent 81b2a8a commit 58c3bdb

File tree

2 files changed

+1
-37
lines changed

2 files changed

+1
-37
lines changed

lambdas/pdm-uploader-lambda/src/__tests__/infra/pdm-api-client.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ describe('PdmClient', () => {
7272
const result = await pdmClient.createDocumentReference(
7373
mockFhirRequest,
7474
mockRequestId,
75-
mockCorrelationId,
7675
);
7776

7877
expect(mockAccessTokenRepository.getAccessToken).toHaveBeenCalled();
@@ -83,7 +82,6 @@ describe('PdmClient', () => {
8382
headers: {
8483
'Content-Type': 'application/json',
8584
'X-Request-ID': mockRequestId,
86-
'X-Correlation-ID': mockCorrelationId,
8785
Authorization: 'Bearer mock-access-token',
8886
},
8987
},
@@ -97,27 +95,6 @@ describe('PdmClient', () => {
9795
});
9896
});
9997

100-
it('should handle request without correlation ID', async () => {
101-
const mockResponse = { data: { id: 'doc-123' } };
102-
conditionalRetry.mockImplementation(async (fn: any) => fn(1));
103-
mockAxiosInstance.post.mockResolvedValue(mockResponse);
104-
105-
await pdmClient.createDocumentReference(mockFhirRequest, mockRequestId);
106-
107-
expect(mockAxiosInstance.post).toHaveBeenCalledWith(
108-
'/patient-data-manager/FHIR/R4/DocumentReference',
109-
mockFhirRequest,
110-
{
111-
headers: {
112-
'Content-Type': 'application/json',
113-
'X-Request-ID': mockRequestId,
114-
'X-Correlation-ID': undefined,
115-
Authorization: 'Bearer mock-access-token',
116-
},
117-
},
118-
);
119-
});
120-
12198
it('should handle empty access token', async () => {
12299
mockAccessTokenRepository.getAccessToken.mockResolvedValue('');
123100
const mockResponse = { data: { id: 'doc-123' } };
@@ -133,7 +110,6 @@ describe('PdmClient', () => {
133110
headers: {
134111
'Content-Type': 'application/json',
135112
'X-Request-ID': mockRequestId,
136-
'X-Correlation-ID': undefined,
137113
},
138114
},
139115
);
@@ -157,7 +133,6 @@ describe('PdmClient', () => {
157133
const result = await pdmClient.createDocumentReference(
158134
mockFhirRequest,
159135
mockRequestId,
160-
mockCorrelationId,
161136
);
162137

163138
expect(result).toEqual(mockResponse.data);
@@ -185,7 +160,6 @@ describe('PdmClient', () => {
185160
pdmClient.createDocumentReference(
186161
mockFhirRequest,
187162
mockRequestId,
188-
mockCorrelationId,
189163
),
190164
).rejects.toThrow('Network error');
191165

lambdas/pdm-uploader-lambda/src/infra/pdm-api-client.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import axios, { AxiosInstance, isAxiosError } from 'axios';
22
import { constants as HTTP2_CONSTANTS } from 'node:http2';
3-
import {
4-
Logger,
5-
PdmResponse,
6-
RetryConfig,
7-
conditionalRetry,
8-
} from 'utils';
3+
import { Logger, PdmResponse, RetryConfig, conditionalRetry } from 'utils';
94

105
export interface IAccessTokenRepository {
116
getAccessToken(): Promise<string>;
@@ -15,7 +10,6 @@ export interface IPdmClient {
1510
createDocumentReference(
1611
fhirRequest: string,
1712
requestId: string,
18-
correlationId?: string,
1913
): Promise<PdmResponse>;
2014
}
2115

@@ -41,7 +35,6 @@ export class PdmClient implements IPdmClient {
4135
public async createDocumentReference(
4236
fhirRequest: string,
4337
requestId: string,
44-
correlationId?: string,
4538
): Promise<PdmResponse> {
4639
try {
4740
return await conditionalRetry(
@@ -50,15 +43,13 @@ export class PdmClient implements IPdmClient {
5043

5144
this.logger.debug({
5245
requestId,
53-
correlationId,
5446
description: 'Sending request',
5547
attempt,
5648
});
5749

5850
const headers = {
5951
'Content-Type': 'application/json',
6052
'X-Request-ID': requestId,
61-
'X-Correlation-ID': correlationId,
6253
...(accessToken === ''
6354
? {}
6455
: {
@@ -85,7 +76,6 @@ export class PdmClient implements IPdmClient {
8576
this.logger.error({
8677
description: 'Failed sending PDM request',
8778
requestId,
88-
correlationId,
8979
err: error,
9080
});
9181

0 commit comments

Comments
 (0)