Skip to content
Merged
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
7 changes: 7 additions & 0 deletions application/CohortManager/compose.core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,16 @@ services:
environment:
- ASPNETCORE_URLS=http://*:9084
- FUNCTIONS_WORKER_RUNTIME=dotnet-isolated
- AzureWebJobsStorage=${AZURITE_CONNECTION_STRING}
- ExceptionFunctionURL=http://create-exception:7070/api/CreateException
- ManageNemsSubscriptionDataServiceURL=http://manage-nems-subscription:9081/api/NemsSubscriptionDataService
- ManageNemsSubscriptionBaseURL=http://manage-nems-subscription:9081
- MeshApiBaseUrl=https://localhost:8700/messageexchange
- MeshCaasPassword=password
- MeshCaasSharedKey=TestKey
- MeshCaasKeyName=
- MeshCaasKeyPassword=
- IsStubbed=false
- CaasToMailbox=${CAAS_SUBSCRIBE_TO_MAILBOX:-CAAS_TO}
- CaasFromMailbox=${CAAS_SUBSCRIBE_FROM_MAILBOX:-CAAS_FROM}
- DtOsDatabaseConnectionString=Server=db,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ public async Task<HttpResponseData> Subscribe([HttpTrigger(AuthorizationLevel.An
var toMailbox = _config.CaasToMailbox!;
var fromMailbox = _config.CaasFromMailbox!;
var messageId = await _meshSendCaasSubscribe.SendSubscriptionRequest(nhsNo, toMailbox, fromMailbox);

// Save a record to NEMS_SUBSCRIPTION table with source = MESH
var record = new NemsSubscription
{
SubscriptionId = messageId,
NhsNumber = nhsNo,
RecordInsertDateTime = DateTime.UtcNow,
SubscriptionSource = SubscriptionSource.MESH
};
var saved = await _nemsSubscriptionAccessor.InsertSingle(record);
if (!saved)
{
_logger.LogError("Failed to write CAAS subscription record to database");
return await _createResponse.CreateHttpResponseWithBodyAsync(HttpStatusCode.InternalServerError, req, "Failed to save subscription record.");
}

_logger.LogInformation("CAAS Subscribe forwarded to Mesh stub. MessageId: {Msg}", messageId);
return await _createResponse.CreateHttpResponseWithBodyAsync(HttpStatusCode.OK, req, $"Subscription request accepted. MessageId: {messageId}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ public async Task<bool> SaveSubscriptionInDatabase(string nhsNumber, string subs
{
SubscriptionId = subscriptionId,
NhsNumber = Convert.ToInt64(nhsNumber),
RecordInsertDateTime = DateTime.UtcNow
RecordInsertDateTime = DateTime.UtcNow,
SubscriptionSource = SubscriptionSource.NEMS
};
bool subscriptionCreated = await _nemsSubscriptionAccessor.InsertSingle(subscription);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using NHS.Screening.NemsMeshRetrieval;
using HealthChecks.Extensions;
using Azure.Security.KeyVault.Secrets;
using NHS.CohortManager.CaasIntegrationService;


var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
Expand All @@ -20,7 +19,7 @@
{
var host = new HostBuilder();

X509Certificate2 cohortManagerPrivateKey = null;
X509Certificate2 cohortManagerPrivateKey = null!;
X509Certificate2Collection meshCerts = [];

host.AddConfiguration<NemsMeshRetrievalConfig>(out NemsMeshRetrievalConfig config);
Expand Down Expand Up @@ -83,4 +82,3 @@
logger.LogCritical(ex, "Failed to start up Function");
}


Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private static byte[] CreateParquetFile(long nhsNumber)
{
var columns = new Column[]
{
new Column<long>("NhsNumber"),
new Column<long>("nhs_number"),
};
long[] nhsNumberList = { nhsNumber };

Expand Down
Loading
Loading