Skip to content

fix: RetrievePdsDemographic API to return PdsDemographic objects instead of ParticipantDemographic#1462

Merged
SamAinsworth-NHS merged 7 commits intomainfrom
Fix/retrieve-pds-demo-to-demographic-response
Aug 12, 2025
Merged

fix: RetrievePdsDemographic API to return PdsDemographic objects instead of ParticipantDemographic#1462
SamAinsworth-NHS merged 7 commits intomainfrom
Fix/retrieve-pds-demo-to-demographic-response

Conversation

@SamAinsworth-NHS
Copy link
Copy Markdown
Contributor

Description

This PR implements an architectural improvement to the RetrievePdsDemographic API to return PdsDemographic objects instead of ParticipantDemographic objects, ensuring type consistency and resolving JSON deserialization errors.

The RetrievePdsDemographic function was incorrectly returning ParticipantDemographic objects (where ParticipantId is a long) instead of PdsDemographic objects (where properties are strings). This caused JSON deserialization errors in ProcessNemsUpdate.

Changes made include updating the API response serialisation, updating all consuming functions to work with PdsDemographic objects, adding method overloading for backward compatibility, and fixing all test mocks to use the correct types.

Context

The RetrievePdsDemographic function name suggests it returns PdsDemographic objects, but it was actually returning ParticipantDemographic objects. This type mismatch caused JSON deserialisation failures in ProcessNemsUpdate function that expected string-based properties but received numeric values for fields like ParticipantId.

This architectural inconsistency needed to be resolved to ensure proper API contract adherence and eliminate runtime errors.

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 12, 2025

Unit Test Results

✔️ Tests 744 / 744 - passed in 11.2s
📝 Coverage 56.05%
📏 4090 / 7197 lines covered 🌿 979 / 1846 branches covered
🔍 click here for more details

✏️ updated for commit 30b23f3

@SamAinsworth-NHS SamAinsworth-NHS marked this pull request as ready for review August 12, 2025 09:46
@sonarqubecloud
Copy link
Copy Markdown

@SamAinsworth-NHS SamAinsworth-NHS added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit c213c2a Aug 12, 2025
64 checks passed
@SamAinsworth-NHS SamAinsworth-NHS deleted the Fix/retrieve-pds-demo-to-demographic-response branch August 12, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants