Skip to content

Commit 76e0d6a

Browse files
Merge branch 'main' into Fix/docker-for-mac-fix-suggestion
2 parents 3fa14c8 + 097f6fa commit 76e0d6a

14 files changed

Lines changed: 189 additions & 29 deletions

File tree

.azuredevops/pipelines/cd-infrastructure-sandbox-core.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ parameters:
2424
# PreProd pipeline which needs to retag images to move them from the Dev ACR to the Prod ACR
2525
displayName: 'Re-tag Images'
2626
type: boolean
27-
default: true
27+
default: false
2828

2929
- name: dockerImageReTagFrom
3030
# Only required until commit hashes are passed in by calling pipeline
@@ -92,15 +92,7 @@ stages:
9292
- ${{ each testType in parameters.testTypes }}:
9393
- stage: ${{ testType }}_stage
9494
displayName: Run ${{ testType }} Tests
95-
${{ if eq(testType, 'regression_api') }}:
96-
dependsOn: smoke_e2e_stage
97-
${{ if eq(testType, 'regression_e2e_epic1') }}:
98-
dependsOn: regression_api_stage
99-
${{ if eq(testType, 'regression_e2e_epic2') }}:
100-
dependsOn: regression_e2e_epic1_stage
101-
${{ if eq(testType, 'regression_e2e_epic3') }}:
102-
dependsOn: regression_e2e_epic2_stage
103-
condition: succeededOrFailed()
95+
condition: always()
10496
jobs:
10597
- job: ${{ testType }}_job
10698
pool:

.github/workflows/stage-4-deploy.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Call deployment pipeline
6262
run: |
6363
# Define common variables
64-
organisation='https://dev.azure.com/nhse-dtos/'
64+
organisation='https://dev.azure.com/nhse-dtos'
6565
project_name='dtos-cohort-manager'
6666
6767
# Define which tests to run based on the environment
@@ -86,4 +86,6 @@ jobs:
8686
--parameters $parameters \
8787
--output tsv --query id)
8888
89-
scripts/bash/wait_ado_pipeline.sh "$RUN_ID" https://dev.azure.com/nhse-dtos "${project_name}" 900
89+
echo "Click here to view the ADO pipeline: ${organisation}/${project_name}/_build/results?buildId=${RUN_ID}"
90+
91+
scripts/bash/wait_ado_pipeline.sh "$RUN_ID" "${organisation}" "${project_name}" 1800

application/CohortManager/compose.core.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ services:
289289
- NemsDefaultEventTypes0=pds-record-change-1
290290
- NemsBypassServerCertificateValidation=true
291291
- DtOsDatabaseConnectionString=Server=db,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True
292+
- IsStubbed=true
292293
ports:
293294
- "9081:9081"
294295

application/CohortManager/src/Functions/DemographicServices/ManageNemsSubscription/Program.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@
2222

2323
X509Certificate2 nemsCertificate;
2424

25-
26-
// Load NEMS certificate up-front and inject into DI
27-
28-
nemsCertificate = await nemsConfig.LoadNemsCertificateAsync(logger);
25+
if (nemsConfig.IsStubbed)
26+
{
27+
logger.LogInformation("ManageNemsSubscription is running in stubbed mode; skipping certificate load.");
28+
nemsCertificate = new X509Certificate2();
29+
}
30+
else
31+
{
32+
nemsCertificate = await nemsConfig.LoadNemsCertificateAsync(logger);
33+
}
2934

3035

3136
host.ConfigureFunctionsWebApplication();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"issue": [
3+
{
4+
"code": "not-found",
5+
"details": {
6+
"coding": [
7+
{
8+
"code": "RESOURCE_NOT_FOUND",
9+
"display": "Resource not found",
10+
"system": "https://fhir.nhs.uk/R4/CodeSystem/Spine-ErrorOrWarningCode",
11+
"version": "1"
12+
}
13+
]
14+
},
15+
"severity": "information"
16+
}
17+
],
18+
"resourceType": "OperationOutcome"
19+
}

application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/RetrievePDSDemographic.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,16 @@ public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymou
7676
string jsonResponse = "";
7777

7878
jsonResponse = await _httpClientFunction.GetResponseText(response);
79+
80+
if (response.StatusCode == HttpStatusCode.NotFound)
81+
{
82+
await _pdsProcessor.ProcessPdsNotFoundResponse(response, nhsNumber, sourceFileName);
83+
return _createResponse.CreateHttpResponse(HttpStatusCode.NotFound, req, "PDS returned a 404 please database for details");
84+
}
85+
7986
var pdsDemographic = _fhirPatientDemographicMapper.ParseFhirJson(jsonResponse);
8087

81-
if (response.StatusCode == HttpStatusCode.NotFound || pdsDemographic.ConfidentialityCode == "R")
88+
if (pdsDemographic.ConfidentialityCode == "R")
8289
{
8390
await _pdsProcessor.ProcessPdsNotFoundResponse(response, nhsNumber, sourceFileName);
8491
return _createResponse.CreateHttpResponse(HttpStatusCode.NotFound, req, "PDS returned a 404 please database for details");

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,14 @@ private async Task<BlockParticipantResult> BlockNewParticipant(BlockParticipantD
154154
{
155155
var pdsParticipant = await GetPDSParticipant(blockParticipantRequest.NhsNumber);
156156

157-
if (pdsParticipant == null || !ValidateRecordsMatch(pdsParticipant, blockParticipantRequest))
157+
if (pdsParticipant == null )
158158
{
159159
return new BlockParticipantResult(false, "Participant details do not match a records in Cohort Manager or PDS");
160160
}
161+
if (!ValidateRecordsMatch(pdsParticipant, blockParticipantRequest))
162+
{
163+
return new BlockParticipantResult(false, "Participant record exists with Nhs number but did not match the request");
164+
}
161165

162166
var participantManagementRecord = new ParticipantManagement
163167
{
@@ -259,7 +263,7 @@ private static bool ValidateRecordsMatch(PdsDemographic participant, BlockPartic
259263
throw new FormatException("Date of Birth not in the correct format");
260264
}
261265

262-
if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyyMMdd", new CultureInfo("en-GB"), DateTimeStyles.None, out var parsedDob))
266+
if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyy-MM-dd", new CultureInfo("en-GB"), DateTimeStyles.None, out var parsedDob))
263267
{
264268
return false;
265269
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,22 @@ public override async Task<HttpResponseMessage> SendPdsGet(string url, string be
4242

4343
if (patient == null)
4444
{
45-
return HttpStubUtilities.CreateFakeHttpResponse(url, "NotFound", HttpStatusCode.NotFound);
45+
var notFoundResponseBody = await File.ReadAllTextAsync("MockedPDSData/patient-not-found.json");
46+
return HttpStubUtilities.CreateFakeHttpResponse(url, notFoundResponseBody, HttpStatusCode.NotFound);
4647
}
4748
return HttpStubUtilities.CreateFakeHttpResponse(url, patient);
4849

4950

5051

5152
}
5253

53-
private static async Task<string?> GetPatientMockObject(string? nhsNumber = null)
54+
private async Task<string?> GetPatientMockObject(string? nhsNumber = null)
5455
{
5556

5657
string path = nhsNumber is null ? "MockedPDSData/complete-patient.json" : $"MockedPDSData/complete-patient-{nhsNumber}.json";
5758
if (!File.Exists(path))
5859
{
60+
_logger.LogWarning("Mocked PDS Data file couldn't be found");
5961
return null;
6062
}
6163
return await File.ReadAllTextAsync(path);

application/CohortManager/src/Functions/Shared/Common/Utilities/HTTPStubUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static HttpResponseMessage CreateFakeHttpResponse(string url, string cont
2020
}
2121
HttpResponseData.Headers.Location = location;
2222
HttpResponseData.Content = new StringContent(content);
23-
HttpResponseData.StatusCode = HttpStatusCode.OK;
23+
HttpResponseData.StatusCode = httpStatusCode;
2424
return HttpResponseData;
2525
}
2626

application/CohortManager/src/Web/app/terms-and-conditions/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,19 @@ export default async function Page() {
4545
<p>
4646
Your access to participant and exception data will be used solely
4747
to support the use case of raising exceptions to National Back
48-
Office (NBO). Data viewed in the UI will not be further forwarded
48+
Office (NBO), Cohorting as a Service (CaaS) and Breast Screening
49+
Select (BSS). Data viewed in the UI will not be further forwarded
4950
to users or systems outside of the cohort manager platform, and
50-
NBO.
51+
NBO, CaaS and BSS.
5152
</p>
5253
<p>
5354
Data displayed in the UI is only retained for the duration of an
5455
active exception handling case. Once the exception is resolved,
5556
there is no need to retain it in cohort manager.
5657
</p>
5758
<p>
58-
You acknowledge that your access may also be audited to ensure you
59-
adhere to these conditions.
59+
You acknowledge that your access may also be audited, by CIS2, to
60+
ensure you adhere to these conditions.
6061
</p>
6162
</div>
6263
</div>

0 commit comments

Comments
 (0)