Skip to content

Commit e9d49a8

Browse files
Merge branch 'main' into Fix/DTOSS-10655-Fixing-date-formating
2 parents 7373c83 + a30260d commit e9d49a8

12 files changed

Lines changed: 284 additions & 16 deletions

File tree

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
deploy-stage:
151151
if: github.ref == 'refs/heads/main' && github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy')
152152
name: Deploy pr-${{ github.event.pull_request.number }} for commit ${{ github.event.pull_request.head.sha }}
153-
needs: [acceptance-stage]
153+
needs: [metadata, build-image-stage]
154154
permissions:
155155
id-token: write
156156
contents: read

.github/workflows/cicd-2-publish.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: "CI/CD publish"
22

3-
on:
4-
pull_request:
5-
types: [closed]
6-
branches:
7-
- main
8-
93
jobs:
104
metadata:
115
name: "Set CI/CD metadata"

.github/workflows/stage-3-build-images.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Docker Image CI
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
84
workflow_call:
95
inputs:
106
environment_tag:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*.suo
2424
*.user
2525

26+
*host.json
27+
2628
# Visual Studio 2015/2017 cache/options directory
2729
.vs/
2830

@@ -115,3 +117,4 @@ application/CohortManager/src/Functions/*.json
115117
# Explicitly include test JSON files
116118
!**/playwright-tests/src/tests/e2e/testFiles/**/*.json
117119

120+

application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,16 @@ private async Task<PdsDemographic> GetPDSParticipant(long nhsNumber)
236236
private static bool ValidateRecordsMatch(ParticipantDemographic participant, BlockParticipantDto dto)
237237
{
238238

239-
if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd",new CultureInfo("en-GB"),DateTimeStyles.None, out var dtoDateOfBirth ))
239+
if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd", new CultureInfo("en-GB"), DateTimeStyles.None, out var dtoDateOfBirth))
240240
{
241241
throw new FormatException("Date of Birth not in the correct format");
242242
}
243243

244-
if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyyMMdd",new CultureInfo("en-GB"),DateTimeStyles.None, out var parsedDob))
244+
if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyyMMdd", new CultureInfo("en-GB"), DateTimeStyles.None, out var parsedDob))
245245
{
246246
return false;
247247
}
248+
248249
return string.Equals(participant.FamilyName, dto.FamilyName, StringComparison.InvariantCultureIgnoreCase)
249250
&& participant.NhsNumber == dto.NhsNumber
250251
&& parsedDob == dtoDateOfBirth;
@@ -253,12 +254,12 @@ private static bool ValidateRecordsMatch(ParticipantDemographic participant, Blo
253254
private static bool ValidateRecordsMatch(PdsDemographic participant, BlockParticipantDto dto)
254255
{
255256

256-
if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd",new CultureInfo("en-GB"),DateTimeStyles.None, out var dtoDateOfBirth ))
257+
if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd", new CultureInfo("en-GB"), DateTimeStyles.None, out var dtoDateOfBirth))
257258
{
258259
throw new FormatException("Date of Birth not in the correct format");
259260
}
260261

261-
if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyyMMdd",new CultureInfo("en-GB"),DateTimeStyles.None, out var parsedDob))
262+
if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyyMMdd", new CultureInfo("en-GB"), DateTimeStyles.None, out var parsedDob))
262263
{
263264
return false;
264265
}

application/CohortManager/src/Functions/Shared/Common/PdsHttpClientMock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public override async Task<HttpResponseMessage> SendPdsGet(string url, string be
5454
{
5555

5656
string path = nhsNumber is null ? "MockedPDSData/complete-patient.json" : $"MockedPDSData/complete-patient-{nhsNumber}.json";
57-
if(!File.Exists(path))
57+
if (!File.Exists(path))
5858
{
5959
return null;
6060
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export const sendHttpPOSTCall =
2+
async (
3+
url: string,
4+
body: string
5+
): Promise<Response> =>
6+
{
7+
const response = await fetch(url, {
8+
method: "POST",
9+
headers: {
10+
"Content-Type": "application/json",
11+
},
12+
body: body
13+
});
14+
15+
return response;
16+
}
17+
18+
export const sendHttpGet =
19+
async (
20+
url: string
21+
): Promise<Response> =>
22+
{
23+
const response = await fetch(url);
24+
return response;
25+
}
26+

tests/playwright-tests/src/api/distributionService/bsSelectService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export const BlockParticipant = (
5555
return apiClient.postWithQuery(request, endpoint, payload);
5656
};
5757

58+
5859
export const UnblockParticipant = (
5960
request: APIRequestContext,
6061
payload: {

tests/playwright-tests/src/config/env.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const endpointBsSelectGetValidationExceptions = process.env.ENDPOINT_BS_SELECT_G
2121
const endpointSerNowReceiveParticipant = process.env.ENDPOINT_SERVICE_NOW_MESSAGE_HANDLER ?? '';
2222
const invalidEndpointSerNow = process.env.INVALID_ENDPOINT_SERVICE_NOW_MESSAGE_HANDLER ?? '';
2323
const participantPayloadPath = process.env.PARTICIPANT_PAYLOAD_PATH ?? '';
24+
const createPDSDemographicEnv = process.env.ENDPOINT_PDS_DEMOGRAPHIC ?? '';
25+
const subToNemsEndPoint = process.env.ENDPOINT_SUB_TO_NEMS ?? ''
2426

2527
export const config = {
2628
baseURL,
@@ -36,7 +38,10 @@ export const config = {
3638
endpointBsSelectUpdateBlockFlag: endpointBsSelectUpdateBlockFlag,
3739
endpointBsSelectGetValidationExceptions: endpointBsSelectGetValidationExceptions,
3840
endpointSerNowReceiveParticipant: endpointSerNowReceiveParticipant,
41+
createPDSDemographic: createPDSDemographicEnv,
3942
invalidEndpointSerNow: invalidEndpointSerNow,
43+
SubToNems: subToNemsEndPoint,
44+
SubToNemsPath: 'api/Subscribe',
4045
routeBsSelectRetrieveCohortDistributionData: 'api/RetrieveCohortDistributionData',
4146
routeBsSelectRetrieveCohortRequestAudit: 'api/RetrieveCohortRequestAudit',
4247
routeBsSelectDeleteParticipant: 'api/DeleteParticipant',
@@ -49,6 +54,7 @@ export const config = {
4954
participantManagementService: 'ParticipantManagementDataService',
5055
exceptionManagementService: 'ExceptionManagementDataService',
5156
participantDemographicDataService: 'ParticipantDemographicDataService',
57+
createPDSDemographicPath: 'api/RetrievePdsDemographic',
5258
participantPayloadPath: 'src/tests/api/testFiles',
5359
e2eTestFilesPath: 'e2e/testFiles',
5460
apiTestFilesPath: 'api/testFiles',
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"validations": [
3+
{
4+
"validations": {
5+
"apiEndpoint": "api/CohortDistributionDataService",
6+
"NHSNumber": 9998380197
7+
}
8+
}
9+
],
10+
"inputParticipantRecord": [
11+
{
12+
"record_type": "ADD",
13+
"change_time_stamp": null,
14+
"serial_change_number": 1,
15+
"nhs_number": 9998380197,
16+
"superseded_by_nhs_number": null,
17+
"primary_care_provider": "A81623",
18+
"primary_care_effective_from_date": "20240101",
19+
"current_posting": "LA",
20+
"current_posting_effective_from_date": "20240101",
21+
"name_prefix": "BRO",
22+
"given_name": "smith",
23+
"other_given_name": "OtherGivenName 1",
24+
"family_name": "smith",
25+
"previous_family_name": "PreviousFamilyName 1",
26+
"date_of_birth": "20101022",
27+
"gender": 2,
28+
"address_line_1": "1 Test Street",
29+
"address_line_2": "Test Area",
30+
"address_line_3": "TestAddress",
31+
"address_line_4": "Chelmsford",
32+
"address_line_5": "United Kingdom",
33+
"postcode": "LS1 1AA",
34+
"paf_key": "Z3S4Q5X9",
35+
"address_effective_from_date": "20240101",
36+
"reason_for_removal": "ORR",
37+
"reason_for_removal_effective_from_date": null,
38+
"date_of_death": null,
39+
"death_status": null,
40+
"home_telephone_number": "01619999999",
41+
"home_telephone_effective_from_date": "20240101",
42+
"mobile_telephone_number": "07888888888",
43+
"mobile_telephone_effective_from_date": "20240101",
44+
"email_address": "blockedadd@example.com",
45+
"email_address_effective_from_date": "20240101",
46+
"preferred_language": "en",
47+
"is_interpreter_required": false,
48+
"invalid_flag": false,
49+
"eligibility": true
50+
}
51+
],
52+
"nhsNumbers": [
53+
"9998380197"
54+
]
55+
}

0 commit comments

Comments
 (0)