Skip to content

Conversation

skalwaghe-56
Copy link

Description

Clarifies the behavior of resource list setters in the FhirData class by adding explicit control over whether they add to or replace existing resources.

Related Issue

Closes #123 - Clarify Resource List Setter Behavior in FhirData

Changes Made

  • Modified problem_list, medication_list, and allergy_list setters in FhirData class to accept explicit replace parameter
  • Added dict-based interface for replace control: {'resources': [...], 'replace': True}
  • Maintained backward compatibility - existing list assignments default to add behavior
  • Updated documentation for all three setters with clear examples and parameter descriptions

Testing

  • All existing tests pass (475/475) confirming backward compatibility
  • No breaking changes introduced
  • Existing functionality preserved while adding new explicit control

Checklist

  • I have read the contributing guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

The implementation uses a dict-based approach for the replace parameter since Python property setters can only accept a single value argument. This provides explicit control while maintaining full backward compatibility with existing code.

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.

Clarify Resource List Setter Behavior in FhirData

1 participant