-
Notifications
You must be signed in to change notification settings - Fork 2
feat: dtoss 3660 nhs id in participant man demograp #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
charanNHS
merged 32 commits into
main
from
feat/DTOSS-3660-NHS--id-in-participant--man-demograp
Mar 20, 2025
Merged
Changes from 13 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
4241a94
Full tested feature and working
charanNHS 0684a3c
Removed api version check in deps yaml
charanNHS 7a0188b
fixed format
charanNHS 52b1c3f
Merge branch 'main' into feat/DTOSS-3660-NHS--id-in-participant--man-…
charanNHS adf0891
Fix issue compose core
charanNHS 9941340
fixed cucumber gherkin issue
charanNHS 89225b6
copied necessary classes from smoke tests project
charanNHS b8865e9
Merge remote-tracking branch 'origin/main' into feat/DTOSS-3660-NHS--…
charanNHS 74d5739
Added gitignore
charanNHS fe22581
Merge remote-tracking branch 'origin/main' into feat/DTOSS-3660-NHS--…
charanNHS 0df490b
Removed reference of epic1 in smoke tests solution
charanNHS 9e0742c
Added end to end tests to gitleaks file
charanNHS b7b276c
Renamed Smoke context to end to end context
charanNHS 03d1d9c
Removed gitginore and using the one on root
charanNHS 90c9b1b
Added check to include test files in gitignore
charanNHS 2f56002
Merge branch 'main' into feat/DTOSS-3660-NHS--id-in-participant--man-…
charanNHS 3ac8383
Removed unused methods in datavalidation helper and included just Tes…
charanNHS 20dbc70
Merge branch 'feat/DTOSS-3660-NHS--id-in-participant--man-demograp' o…
charanNHS f5f1f55
Just ignored csproj file
charanNHS 4614924
Moved Private methods to the bottom of the class
charanNHS 176fcf9
Renamed name spaces and project
charanNHS 31525d5
Edited gitignore file
charanNHS 53d2058
Merge branch 'main' into feat/DTOSS-3660-NHS--id-in-participant--man-…
charanNHS 40f6d7c
Including old project name
charanNHS 33f419e
Merge branch 'feat/DTOSS-3660-NHS--id-in-participant--man-demograp' o…
charanNHS 0c7693e
Renamed feature file
charanNHS 8b3e2c3
Renamed Scenarios with meaningful name
charanNHS b355299
Renamed scenarios to will suggestions
charanNHS e60d4e5
Added missing crt back to gitignore
charanNHS e9cbb4e
Added old proj reference
charanNHS ae7eacc
Renamed appsettings.json
charanNHS 4359ddc
Merge branch 'main' into feat/DTOSS-3660-NHS--id-in-participant--man-…
charanNHS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
charanNHS marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
charanNHS marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # WARNING: Please, DO NOT edit this section of the file! It is maintained in the repository template. | ||
|
|
||
| .scannerwork | ||
| *cloc*report*.json | ||
| *sbom*report*.json | ||
| *vulnerabilities*report*.json | ||
| *report*json.zip | ||
| .version | ||
|
|
||
| *.code-workspace | ||
| !project.code-workspace | ||
|
|
||
| # Please, add your custom content below! | ||
|
|
||
| # keys | ||
|
|
||
| *.pfx | ||
| *.pem | ||
| *.key | ||
|
|
||
| # User-specific files | ||
| *.suo | ||
| *.user | ||
|
|
||
| # Visual Studio 2015/2017 cache/options directory | ||
| .vs/ | ||
|
|
||
| # Visual Studio 2017 auto generated files | ||
| Generated\ Files/ | ||
|
|
||
| # Text Editors | ||
| .vscode/* | ||
| !.vscode/tasks.json | ||
| _ReSharper.*/ | ||
| */*/.idea/* | ||
|
|
||
| # Azurite | ||
| __azurite* | ||
| __blobstorage__ | ||
| __queuestorage__ | ||
|
|
||
| # Tests | ||
| TestResults | ||
|
|
||
| # Builds | ||
| bin | ||
| obj | ||
| OutputDirectory | ||
|
|
||
| # Mac | ||
| .DS_Store | ||
|
|
||
| # User Settings | ||
| local.settings.json | ||
|
|
||
| # Docker | ||
| .env | ||
|
|
||
| # sample data | ||
| application/CohortManager/SampleData/ | ||
| *.csv | ||
| *.parquet | ||
| !tests/UnitTests/CaasIntegrationTests/receiveCaasFileTest/*.parquet | ||
| !tests/smoke-tests/dtos-cohort-manager-smoke-tests/TestFiles/**/*.parquet | ||
|
|
||
| # csv to sql statement scripts | ||
| bs_select_gp_practice_lpk.txt | ||
| current_posting.txt | ||
| select_outcode_mapping_lkp_output.txt | ||
|
|
||
| # Python | ||
| *.pyc | ||
|
|
||
|
|
||
| recreate_local_settings.sh | ||
|
|
||
| .history | ||
| application/CohortManager/Set-up/SampleData/CaaSSchema02.json | ||
| infrastructure/.terraform.lock.hcl | ||
| infrastructure/tf-core/.terraform.lock.hcl | ||
| infrastructure/tf-audit/.terraform.lock.hcl | ||
| application/CohortManager/.vscode/ | ||
|
|
||
| # Ignore generated feature bindings | ||
| *.feature.cs | ||
| tests/smoke-tests/dtos-cohort-manager-smoke-tests/Config/appsettings-local.json | ||
| tests/e2e-tests/dtos-cohort-manager-e2e-tests/Config/appsettings-local.json |
20 changes: 20 additions & 0 deletions
20
tests/e2e-tests/dtos-cohort-manager-e2e-tests/Config/AppSettings.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using dtos_cohort_manager_e2e_tests.Config; | ||
| public class AzureSettings | ||
| { | ||
| public bool IsCloudEnvironment { get; set; } | ||
| } | ||
|
|
||
| public class AppSettings | ||
| { | ||
| public ConnectionStrings ConnectionStrings { get; set; } | ||
| public AzureSettings AzureSettings { get; set; } | ||
| public string? ManagedIdentityClientId { get; set; } | ||
| public FilePaths FilePaths { get; set; } | ||
| public string BlobContainerName { get; set; } | ||
| public string AzureWebJobsStorage { get; set; } | ||
| } | ||
|
|
||
| public class ConnectionStrings | ||
| { | ||
| public string DtOsDatabaseConnectionString { get; set; } | ||
| } |
8 changes: 8 additions & 0 deletions
8
tests/e2e-tests/dtos-cohort-manager-e2e-tests/Config/FilePaths.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| namespace dtos_cohort_manager_e2e_tests.Config; | ||
|
|
||
| public class FilePaths | ||
| { | ||
| public string Add { get; set; } | ||
| public string Amended { get; set; } | ||
| public string Remove { get; set; } | ||
| } |
18 changes: 18 additions & 0 deletions
18
tests/e2e-tests/dtos-cohort-manager-e2e-tests/Config/appsettings.json
|
charanNHS marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "AppSettings": { | ||
| "ConnectionStrings": { | ||
| "DtOsDatabaseConnectionString": "" | ||
| }, | ||
| "AzureSettings": { | ||
| "IsCloudEnvironment": true | ||
| }, | ||
| "FilePaths": { | ||
| "Add": "TestFiles/add/", | ||
| "Amended": "TestFiles/amended/", | ||
| "Remove": "TestFiles/remove/" | ||
| }, | ||
| "CloudFileStorageConnectionString": "", | ||
| "BlobContainerName": "inbound", | ||
| "ManagedIdentityClientId": "" | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
tests/e2e-tests/dtos-cohort-manager-e2e-tests/Contexts/SmokeTestsContext.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using CsvHelper; | ||
| using dtos_cohort_manager_e2e_tests.Models; | ||
|
|
||
| namespace dtos_cohort_manager_e2e_tests.Contexts; | ||
|
|
||
| public class EndToEndTestsContext | ||
| { | ||
| public string FilePath { get; set; } | ||
|
|
||
| public RecordTypesEnum RecordType { get; set; } | ||
|
|
||
| public List<string>? NhsNumbers { get; set; } | ||
| } |
90 changes: 90 additions & 0 deletions
90
...s/e2e-tests/dtos-cohort-manager-e2e-tests/Features/Epic1_AutomatedRegressionSuite.feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| Feature: Epic1_AutomatedRegressionSuite | ||
| DTOSS Regression TEST PACK. | ||
|
|
||
| Background: | ||
| Given the database is cleaned of all records for NHS Numbers: 1111110662, 2222211794,2312514176,2612314172,2612514171 | ||
| And the application is properly configured | ||
|
|
||
| @DTOSS-7583 @Regression | ||
| Scenario: Verify NHS data propagation across participant tables after file upload for ADD record | ||
|
charanNHS marked this conversation as resolved.
Outdated
|
||
| Given file <FileName> exists in the configured location for "Add" with NHS numbers : <NhsNumbers> | ||
| When the file is uploaded to the Blob Storage container | ||
| Then verify the NHS numbers in Participant_Management and Participant_Demographic table should match the file data | ||
|
|
||
| Examples: | ||
| | FileName | RecordType | NhsNumbers | | ||
| | ADD_2_RECORDS_-_CAAS_BREAST_SCREENING_COHORT.parquet | Add | 1111110662, 2222211794 | | ||
|
|
||
| @DTOSS-7583 @Regression | ||
| Scenario: Verify NHS data propagation across participant tables after file upload for AMENDED record | ||
| Given file <AddFileName> exists in the configured location for "Add" with NHS numbers : <NhsNumbers> | ||
| And the file is uploaded to the Blob Storage container | ||
| And the NHS numbers in the database should match the file data | ||
| And file <AmendedFileName> exists in the configured location for "Amended" with NHS numbers : <NhsNumbers> | ||
| When the file is uploaded to the Blob Storage container | ||
| Then verify the NhsNumbers in Participant_Management table should match <RecordType> | ||
| And the Participant_Demographic table should match the <AmendedGivenName> for the NHS Number | ||
|
|
||
| Examples: | ||
| | AddFileName | AmendedFileName | NhsNumbers | AmendedGivenName | RecordType | | ||
| | ADD1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.parquet | AMENDED1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.parquet | 2312514176 | AMENDEDNewTest1 | Amended | | ||
|
|
||
| @DTOSS-7584 @Regression | ||
| Scenario: Confirm NHS Number Count Integrity Across Participant Tables After Processing for ADD record | ||
| Given file <FileName> exists in the configured location for "Add" with NHS numbers : <NhsNumbers> | ||
| When the file is uploaded to the Blob Storage container | ||
| Then the NHS Number should have exactly 1 record in Participant_Management | ||
| And the NHS Number should have exactly 1 record in Participant_Demographic | ||
|
|
||
| Examples: | ||
| | FileName | RecordType | NhsNumbers | | ||
| | ADD_2_RECORDS_-_CAAS_BREAST_SCREENING_COHORT.parquet | Add | 1111110662, 2222211794 | | ||
|
|
||
| @DTOSS-7584 @Regression | ||
| Scenario: Confirm NHS Number Count Integrity Across Participant Tables After Processing for AMENDED record | ||
| Given file <AddFileName> exists in the configured location for "Add" with NHS numbers : <NhsNumbers> | ||
| And the file is uploaded to the Blob Storage container | ||
| And the NHS numbers in the database should match the file data | ||
| And file <AmendedFileName> exists in the configured location for "Amended" with NHS numbers : <NhsNumbers> | ||
| When the file is uploaded to the Blob Storage container | ||
| Then the NHS Number should have exactly 1 record in Participant_Management | ||
| And the NHS Number should have exactly 1 record in Participant_Demographic | ||
|
|
||
| Examples: | ||
| | AddFileName | AmendedFileName | NhsNumbers | | ||
| | ADD1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.parquet | AMENDED1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.parquet | 2312514176 | | ||
|
|
||
| @DTOSS-7585 @Regression | ||
| Scenario: Verify exception records doesn't end up in Participant_Demographic and Participant_Management table for ADD record | ||
|
charanNHS marked this conversation as resolved.
Outdated
|
||
| Given file <AddFileName> exists in the configured location for "Add" with NHS numbers : <NhsNumbers> | ||
| When the file is uploaded to the Blob Storage container | ||
| Then the Exception table should contain the below details for the NHS Number | ||
| | FieldName | FieldValue | | ||
| | RULE_ID | 36 | | ||
| | RULE_DESCRIPTION | Invalid primary care provider GP practice code | | ||
| Then the NHS Number should have exactly 1 record in Participant_Management | ||
| And the NHS Number should have exactly 1 record in Participant_Demographic | ||
| And the NHS Number should have exactly 0 record in Cohort_Distribution table | ||
|
|
||
| Examples: | ||
| | AddFileName | NhsNumbers | | ||
| | Exception_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.parquet | 2612314172 | | ||
|
|
||
| @DTOSS-7585 @Regression | ||
| Scenario: Verify exception records doesn't end up in Participant_Demographic and Participant_Management table for AMENDED record | ||
|
charanNHS marked this conversation as resolved.
Outdated
|
||
| Given file <AddFileName> exists in the configured location for "Add" with NHS numbers : <NhsNumbers> | ||
| And the file is uploaded to the Blob Storage container | ||
| And the NHS numbers in the database should match the file data | ||
| And file <AmendedFileName> exists in the configured location for "Amended" with NHS numbers : <NhsNumbers> | ||
| When the file is uploaded to the Blob Storage container | ||
| Then the Exception table should contain the below details for the NHS Number | ||
| | FieldName | FieldValue | | ||
| | RULE_ID | 17 | | ||
| | RULE_DESCRIPTION | Date of birth invalid | | ||
| Then the NHS Number should have exactly 1 record in Participant_Management | ||
| And the NHS Number should have exactly 1 record in Participant_Demographic | ||
| And the NHS Number should have exactly 1 record in Cohort_Distribution table | ||
|
|
||
| Examples: | ||
| | AddFileName | AmendedFileName | NhsNumbers | | ||
| | ADD_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.parquet | AMENDED_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.parquet | 2612514171 | | ||
38 changes: 38 additions & 0 deletions
38
tests/e2e-tests/dtos-cohort-manager-e2e-tests/Helpers/BlobStorageHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| using System.IO; | ||
| using System.Threading.Tasks; | ||
| using Azure.Storage.Blobs; | ||
| using Microsoft.Extensions.Logging; | ||
|
|
||
| namespace dtos_cohort_manager_e2e_tests.Helpers; | ||
|
|
||
| public class BlobStorageHelper | ||
| { | ||
| private readonly BlobServiceClient _blobServiceClient; | ||
| private readonly ILogger<BlobStorageHelper> _logger; | ||
|
|
||
|
|
||
| public BlobStorageHelper(BlobServiceClient blobServiceClient, ILogger<BlobStorageHelper> logger) | ||
| { | ||
| _blobServiceClient = blobServiceClient; | ||
| _logger = logger; | ||
| } | ||
|
|
||
| public async Task UploadFileToBlobStorageAsync(string filePath, string blobContainerName) | ||
| { | ||
| if (!File.Exists(filePath)) | ||
| { | ||
| _logger.LogError($"File not found at {filePath}"); | ||
| return; | ||
| } | ||
|
|
||
| _logger.LogInformation("Uploading file {FilePath} to blob storage", filePath); | ||
|
|
||
| var blobContainerClient = _blobServiceClient.GetBlobContainerClient(blobContainerName); | ||
| await blobContainerClient.CreateIfNotExistsAsync(); | ||
|
|
||
| var blobClient = blobContainerClient.GetBlobClient(Path.GetFileName(filePath)); | ||
| await blobClient.UploadAsync(File.OpenRead(filePath), true); | ||
|
|
||
| _logger.LogInformation("File uploaded successfully"); | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
tests/e2e-tests/dtos-cohort-manager-e2e-tests/Helpers/CsvHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| using System.Collections.Generic; | ||
| using System.Globalization; | ||
| using System.IO; | ||
| using CsvHelper; | ||
| using CsvHelper.Configuration; | ||
|
|
||
| namespace dtos_cohort_manager_e2e_tests.Helpers | ||
| { | ||
| public static class CsvHelperService | ||
| { | ||
| public static List<string> ExtractNhsNumbersFromCsv(string filePath) | ||
| { | ||
| using var reader = new StreamReader(filePath); | ||
| using var csv = new CsvReader(reader, new CsvConfiguration(CultureInfo.InvariantCulture)); | ||
| var records = new List<string>(); | ||
| csv.Read(); | ||
| csv.ReadHeader(); | ||
| while (csv.Read()) | ||
| { | ||
| records.Add(csv.GetField(3)); | ||
| } | ||
| return records; | ||
| } | ||
|
|
||
| public static List<Dictionary<string, string>> ReadCsv(string filePath) | ||
| { | ||
| using var reader = new StreamReader(filePath); | ||
| using var csv = new CsvReader(reader, new CsvConfiguration(CultureInfo.InvariantCulture)); | ||
| var records = new List<Dictionary<string, string>>(); | ||
| csv.Read(); | ||
| csv.ReadHeader(); | ||
| var headers = csv.HeaderRecord; | ||
|
|
||
| while (csv.Read()) | ||
| { | ||
| var record = new Dictionary<string, string>(); | ||
| foreach (var header in headers) | ||
| { | ||
| record[header] = csv.GetField(header); | ||
| } | ||
| records.Add(record); | ||
| } | ||
|
|
||
| return records; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.