Skip to content

feat: implement #563 #564 #565 #566 — pagination, cross-state Rx enfo…#576

Merged
Emeka000 merged 2 commits into
Healthy-Stellar:mainfrom
chidinma000:feature/issues-563-564-565-566
Jun 30, 2026
Merged

feat: implement #563 #564 #565 #566 — pagination, cross-state Rx enfo…#576
Emeka000 merged 2 commits into
Healthy-Stellar:mainfrom
chidinma000:feature/issues-563-564-565-566

Conversation

@chidinma000

Copy link
Copy Markdown
Contributor

…rcement, and integration tests

closes #566 nutrition-care-management:

  • Add get_outcome_history(patient, page, page_size) -> OutcomePageResult with MAX = 50
  • Add link_to_care_plan(outcome_id, care_plan_id) — idempotent, emits outcome_linked_to_care_plan event
  • Add set_care_plan_contract(admin, addr) for admin-settable CarePlanContractAddress config
  • Update link_outcome to index outcomes per patient (PatientOutcomes DataKey)
  • Tests: first/last/empty page, link fails without configured address, idempotent re-link

closes #564 rehabilitation-services:

  • Add get_therapy_sessions_paged(plan_id, page, page_size) -> TherapyPage (MAX_PAGE_SIZE = 50)
  • Add get_progress_notes_paged(plan_id, page, page_size) -> NotePage
  • Tests: first page, last page, empty, beyond range, page_size clamped

closes #563 telemedicine security:

  • prescribe_during_visit now checks session is InProgress (SessionNotActive error)
  • Checks provider holds a direct license in patient's jurisdiction (ProviderNotLicensedInPatientState)
  • Controlled-substance flag on PrescriptionRequest; jurisdiction policy blocks CS if requires_inperson
  • New set_controlled_substance_policy(admin, jurisdiction, requires_inperson) function
  • Add SECURITY.md documenting enforcement logic
  • Tests: cross-state allowed, cross-state blocked, controlled substance extra check, post-session block

closes #565 telemedicine integration tests:

  • New integration_test.rs with full clinical flow tests using Soroban register_contract harness
  • Happy path: licensed provider → schedule → start → prescribe → rx_id returned
  • Unhappy: unlicensed provider blocked at session start
  • Unhappy: wrong-state provider blocked at prescribe
  • Unhappy: prescribing after session end returns SessionNotActive

Summary

Changelog

  • I have updated CHANGELOG.md for any user-facing contract API change (new functions, breaking changes, deprecations, or security fixes).

Test plan

  • Unit / integration tests added or updated
  • cargo test passes locally (if applicable)

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@chidinma000 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…ar#565 Healthy-Stellar#566 — pagination, cross-state Rx enforcement, and integration tests

Healthy-Stellar#566 nutrition-care-management:
- Add get_outcome_history(patient, page, page_size) -> OutcomePageResult with MAX = 50
- Add link_to_care_plan(outcome_id, care_plan_id) — idempotent, emits outcome_linked_to_care_plan event
- Add set_care_plan_contract(admin, addr) for admin-settable CarePlanContractAddress config
- Update link_outcome to index outcomes per patient (PatientOutcomes DataKey)
- Tests: first/last/empty page, link fails without configured address, idempotent re-link

Healthy-Stellar#564 rehabilitation-services:
- Add get_therapy_sessions_paged(plan_id, page, page_size) -> TherapyPage (MAX_PAGE_SIZE = 50)
- Add get_progress_notes_paged(plan_id, page, page_size) -> NotePage
- Tests: first page, last page, empty, beyond range, page_size clamped

Healthy-Stellar#563 telemedicine security:
- prescribe_during_visit now checks session is InProgress (SessionNotActive error)
- Checks provider holds a direct license in patient's jurisdiction (ProviderNotLicensedInPatientState)
- Controlled-substance flag on PrescriptionRequest; jurisdiction policy blocks CS if requires_inperson
- New set_controlled_substance_policy(admin, jurisdiction, requires_inperson) function
- Add SECURITY.md documenting enforcement logic
- Tests: cross-state allowed, cross-state blocked, controlled substance extra check, post-session block

Healthy-Stellar#565 telemedicine integration tests:
- New integration_test.rs with full clinical flow tests using Soroban register_contract harness
- Happy path: licensed provider → schedule → start → prescribe → rx_id returned
- Unhappy: unlicensed provider blocked at session start
- Unhappy: wrong-state provider blocked at prescribe
- Unhappy: prescribing after session end returns SessionNotActive
@chidinma000 chidinma000 force-pushed the feature/issues-563-564-565-566 branch from 1b245c2 to f04d68e Compare June 29, 2026 22:34
@Emeka000 Emeka000 merged commit 205702d into Healthy-Stellar:main Jun 30, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment