> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/health/v2.1/design/architecture/field-app-architecture/ui-packages/referral-reconciliation-package/hf-referral-downsync.md).

# HF Referral Downsync

#### HF Referral — what's new

HF Referral downsync is now reliable — the single biggest improvement in the registration\_delivery area for HCM v2.1.

* **Beneficiary referral downsync** correctly pulls referrals raised at the facility back into the field-worker device, so a returning beneficiary's referral history is visible at the doorstep.
* **Multi-cycle HF Referral support** — re-entering a beneficiary into a new cycle now resolves the correct referral state instead of carrying forward stale data.
* **Notifications unified** — stock and referral notifications share a single notification handler; new referrals are surfaced to the relevant worker.
* **Referral reason logic** — referral reasons are read from navigation context and threaded into the symptoms field consistently. A default reason (`DRUG_SE_CC`) is applied when no symptom-derived reason is found, so a partially-completed referral is never blocked.
* **Multiple-reason cases** are handled correctly — a single referral can carry more than one reason without losing data.
* **Age handling** — HF referral age model corrected to use months (max 59) with a custom age function, fixing the prior age-mismatch behavior that caused referrals to be rejected.
* **Boundary module wired** for HF referral and complaint flows, enabling boundary-scoped referral searches and pickups.
* **Pagination** on HF referral lists now works correctly for high-volume facilities.
* **Referral metrics** updated to reflect the new model.

### **HF Referral (bidirectional, multi-cycle, boundary-scoped) Sequence Diagram**

<figure><img src="https://2077406040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI0KFbSBTySIQ7TCOKnJF%2Fuploads%2FH1JXIAek9IM2PH4qCSOu%2Fimage.png?alt=media&amp;token=157e2b95-5644-4d84-ac57-1629e81c5db7" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digit.org/health/v2.1/design/architecture/field-app-architecture/ui-packages/referral-reconciliation-package/hf-referral-downsync.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
