Skip to content

Add endpoint for deleting orphaned persons#221

Merged
m-goggins merged 8 commits into
mainfrom
feature/163-manage-orphan-data
Feb 21, 2025
Merged

Add endpoint for deleting orphaned persons#221
m-goggins merged 8 commits into
mainfrom
feature/163-manage-orphan-data

Conversation

@m-goggins

@m-goggins m-goggins commented Feb 19, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR adds an API endpoint for deleting persons who have no associated patients. It works by checking that the provided person_reference_id is valid and then checking if the person has any associated patients. Persons with associated patients are not deleted.

Related Issues

Addresses 1 of the 3 API endpoints listed in #163

Additional Notes

The other API endpoints in #163 will be in follow-up PRs.

@m-goggins m-goggins marked this pull request as ready for review February 19, 2025 22:51
@codecov

codecov Bot commented Feb 19, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.65%. Comparing base (e7adf72) to head (531393b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   97.62%   97.65%   +0.03%     
==========================================
  Files          32       32              
  Lines        1601     1623      +22     
==========================================
+ Hits         1563     1585      +22     
  Misses         38       38              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m-goggins m-goggins changed the title Delete orphaned persons Add endpoint for deleting orphaned persons Feb 20, 2025
Comment thread src/recordlinker/routes/person_router.py
Comment thread src/recordlinker/routes/person_router.py Outdated
Comment thread src/recordlinker/database/mpi_service.py Outdated
Comment thread src/recordlinker/schemas/__init__.py Outdated
ericbuckley
ericbuckley previously approved these changes Feb 21, 2025

@ericbuckley ericbuckley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just a couple of minor suggestions

@m-goggins m-goggins merged commit f7d3717 into main Feb 21, 2025
@m-goggins m-goggins deleted the feature/163-manage-orphan-data branch February 21, 2025 22:01
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.

2 participants