Skip to content

Conversation

@IsaacMilarky
Copy link
Contributor

@IsaacMilarky IsaacMilarky commented Dec 12, 2025

[NDH-278] Build out OrganizationAffiliation endpoint

Jira Ticket #NDH-278

Problem

We currently do not have an endpoint that can query OrganizationAffiliation data. This endpoint returns data that represents the affiliation relationship between clinical organizations and EHR Vendors

Additionally, we need to make it so that EHR Vendors can be queried in the Organization view.

Solution

Add a new view set for OrganizationAffiliation data that has list and retrieve endpoints. Also, create a corresponding serializer class that will create FHIR JSON for the data returned.

Additionally, make it so that EHR Vendors can be queried in the Organization viewset.

Tests also need to be created for all this.

Result

Summary:

  • Register new OrganizationAffiliation viewset
  • Add new class OrganizationAffiliationSerializer
  • Add new OrganizationAffiliation viewset class and create query of the Organization table with all the neccessary data attached or annotated with subqueries
  • Add new helper class FHIROrganizationSource that acts as an interface so that EHRVendor objects can be treated as Organizations for the purpose of serialization
  • Edit the Organization viewset to also query EHRVendors
  • Alter the Organization viewset to apply filtersets manually separately to orgs and ehrvendor objects
  • Add an ehr_vendor_filterset file to apply the same filters that orgs can have to EHRVendors
  • Add each retrieved record as a list of FHIROrganizationSource objects and then sort based on name by default or the param processed by ParamOrderingFilter
  • Edit the OrganizationSerializer to also support EHRVendor data.

Test Plan

make test

…erializer

Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
@IsaacMilarky IsaacMilarky marked this pull request as ready for review December 19, 2025 18:45
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Copy link
Contributor

@sachin-panayil sachin-panayil left a comment

Choose a reason for hiding this comment

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

the tests pass but im not getting anything back when i hit the API. im assuming its because their isnt proper data in the db for this endpoint? once this is confirmed and playwright tests pass, i can approve. everything else LGTM

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