Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow array fields on Patient to be empty #70

Merged
merged 2 commits into from
Feb 3, 2025
Merged

Conversation

gffking
Copy link
Contributor

@gffking gffking commented Jan 31, 2025

Due to the combination of how PatientUpdate is structured and how JSON serialization works in Go, it has not been possible to completely remove emails and phones from a Patient record.

This PR updates PatientUpdate so that if Emails or Phones is non-nil, the field will be included in the JSON serialization output, even if the slice the field points to is empty. This allows consumers of the client to pass an empty array for these fields to Elation to allow them to be completely cleared.

If Emails or Phones is nil, then it will not be included in the JSON serialization output. This allows consumers of the client to change other fields on the Patient record without affecting emails or phones.

For consistency, the Consents and Insurances fields have been similarly modified to allow the fields in the Patient record to be cleared.

@gffking gffking changed the title Allow emails and phones to be cleared Allow array fields on Patient to be cleared Jan 31, 2025
@gffking gffking changed the title Allow array fields on Patient to be cleared Allow fields on Patient to be cleared Jan 31, 2025
@gffking gffking changed the title Allow fields on Patient to be cleared Allow array fields on Patient to be cleared Jan 31, 2025
@gffking gffking changed the title Allow array fields on Patient to be cleared Allow array fields on Patient to be empty Jan 31, 2025
@gffking gffking merged commit bc25044 into main Feb 3, 2025
2 checks passed
@gffking gffking deleted the clear-emails-phones branch February 3, 2025 14:41
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