Skip to content

Commit 288f8c5

Browse files
MWClayson-NHSCopilot
andauthored
fix: correct participant record type sent to AllocateServiceProvidee (#1889)
* fix: correct participant record type sent to AllocateServiceProvider and add caching TODO for allocation config Co-authored-by: Copilot <copilot@github.com> * use CohortDistributionParticipant Instead --------- Co-authored-by: Copilot <copilot@github.com>
1 parent c2cbdc6 commit 288f8c5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

application/CohortManager/src/Functions/CohortDistributionServices/DistributeParticipant/DistributeParticipantActivities.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ public DistributeParticipantActivities(IDataServiceClient<CohortDistribution> co
8080
/// <param name="participant"></param>
8181
/// <returns>A string representing the service provider</returns>
8282
[Function(nameof(AllocateServiceProvider))]
83-
public async Task<string> AllocateServiceProvider([ActivityTrigger] Participant participant)
83+
public async Task<string> AllocateServiceProvider([ActivityTrigger] CohortDistributionParticipant participant)
8484
{
8585
if (string.IsNullOrEmpty(participant.Postcode) || string.IsNullOrEmpty(participant.ScreeningAcronym))
8686
{
8787
return EnumHelper.GetDisplayName(ServiceProvider.BSS);
8888
}
8989

90+
//TODO: This should be pre-cached rather than read from file every time. This is fine for now as the file is small and this function is not called frequently, but if this becomes a bottleneck we should look at caching the config data in memory and refreshing it periodically instead of reading from file on every function call.
9091
string configFilePath = Path.Combine(Environment.CurrentDirectory, "AllocateServiceProvider", "allocationConfig.json");
9192
string configFile = await File.ReadAllTextAsync(configFilePath);
9293

0 commit comments

Comments
 (0)