Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Set up dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
dotnet-version: '8.0.x'

- name: Build dotnet solution
run: dotnet build source/gpconnect-analytics.sln

Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

.vs
*.ps1
.vscode
**/CoverageReport/
**/TestResults/
database/flyway-7.0.0/
serviceDependencies.json
serviceDependencies.local.json
*.arm.json
/source/gpconnect-analytics.Functions/Properties/PublishProfiles/GPConnectAnalytics - Zip Deploy.pubxml
/source/gpconnect-analytics.Functions/Properties/PublishProfiles/GPConnectAnalytics - Zip Deploy.pubxml.DS_Store
.DS_Store
57 changes: 50 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![Build Actions Status](https://github.com/nhsconnect/gpconnect-analytics/workflows/continuous-integration/badge.svg)](https://github.com/nhsconnect/gpconnect-analytics/actions?)

## End-to-end data flow

![End-to-end diagram](documentation/end-to-end-data-flow.png)

## Data extracts
Expand Down Expand Up @@ -41,21 +42,22 @@ General format:

`PROJECTNAME-EXTRACTNAME-QUERYFROMDATE-QUERYTODATE-SPLUNKINSTANCE-EXTRACTDATE.csv`

Where
- PROJECTNAME is `gpcanalytics`
- EXTRACTNAME is `asidlookup`, `ssptrans` (MESH transactions TBC)
- QUERYDATEFROM and QUERYDATETO is `YYYYMMDDTHHmmss`
- SPLUNKINSTANCE is `cloud`, `spinea`, `spineb`
- EXTRACTDATE is `YYYYMMDDTHHmmss`
Where

- PROJECTNAME is `gpcanalytics`
- EXTRACTNAME is `asidlookup`, `ssptrans` (MESH transactions TBC)
- QUERYDATEFROM and QUERYDATETO is `YYYYMMDDTHHmmss`
- SPLUNKINSTANCE is `cloud`, `spinea`, `spineb`
- EXTRACTDATE is `YYYYMMDDTHHmmss`

Examples:

- `gpcanalytics-asidlookup-20200101T000000-20200101T000000-cloud-20210301T123200.csv`
- `gpcanalytics-ssptrans-20200101T000000-20200107T000000-cloud-20210105T103000.csv`
- `gpcanalytics-ssptrans-20200107T000000-2020014T000000-spinea-20210105T103000.csv`

Note: The QUERYDATEFROM and QUERYDATETO don't affect the output of the ASID lookup data query from Splunk, however are included for consistency.
Note: The QUERYDATEFROM and QUERYDATETO don't affect the output of the ASID lookup data query from Splunk, however are
included for consistency.

## Run a local SQL Server instance

Expand All @@ -67,3 +69,44 @@ To run the instance on the default port:

`docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=StrongP@ssword1' -p 1433:1433 -d mcr.microsoft.com/mssql/server`

## Testing

Tests were added the project on 8th Feb 2025 by Grant Riordan covering:

- Core Project
- Functions Project
- Integration test for Hierarchy repository

### How To Run Coverage Report

**Run the coverage tests**:

If you do not own a DotCover license or equivalent, you can use `coverlet` a free tool for running coverage reports.

- navigate to the `/source` directory
- open terminal and paste

```bash
dotnet test --collect:"XPlat Code Coverage" -m:1
```

or

```bash
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov

```

**Install Report Generator Globally**
Report generator allows us to build a html report of the coverage making it easier to view.

run the following to install:
```bash
dotnet tool install -g dotnet-reportgenerator-globaltool

```
then run the following to merge the coverage results into 1 report file

```bash
reportgenerator -reports:"../**/coverage.cobertura.xml" -reporttypes:"html" -targetdir:"./CoverageReport"
- ```
20 changes: 20 additions & 0 deletions database/schema/V1.6__AddHierarchyProviderTable.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
SET
ANSI_NULLS ON;

SET
QUOTED_IDENTIFIER ON;

CREATE TABLE Data.HierarchyProviderConsumers (
OdsCode NVARCHAR(450) NOT NULL,
PracticeName NVARCHAR(MAX) NULL,
RegisteredPatientCount INT NOT NULL,
RegionCode NVARCHAR(MAX) NULL,
RegionName NVARCHAR(MAX) NULL,
Icb22Name NVARCHAR(MAX) NULL,
PcnName NVARCHAR(MAX) NULL,
Appointments13000 INT NOT NULL,
CONSTRAINT PK_HierarchyProviderConsumers PRIMARY KEY CLUSTERED (OdsCode ASC)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];

SET
ANSI_PADDING ON;
3 changes: 2 additions & 1 deletion source/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dlldata.c
project.lock.json
project.fragment.lock.json
artifacts/
coverage/*

*_i.c
*_p.c
Expand Down Expand Up @@ -254,4 +255,4 @@ paket-files/
*.sln.iml

# CodeRush
.cr/
.cr/.DS_Store
26 changes: 26 additions & 0 deletions source/.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>cobertura,opencover</Format>
<Exclude>
[Core.DTOs]*,
[Core.DTOs.*]*
</Exclude>
<ExcludeByFile>
**/*.g.cs,
**/Generated*.cs,
**/Program.cs,
**/Microsoft.Azure.Functions.Worker.Sdk.Generators/**/*.cs
</ExcludeByFile>
<ExcludeByAttribute>
<Attribute>GeneratedCodeAttribute</Attribute>
</ExcludeByAttribute>
<SkipAutoProps>true</SkipAutoProps>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Loading