> This page is for version 0.0.76.
> For other versions, use one of these documentation indexes:
> - 0.0.79 (default): https://docs.refer.health.gov.sg/0-0-79/llms.txt
> - 0.0.78: https://docs.refer.health.gov.sg/0-0-78/llms.txt
> - 0.0.77: https://docs.refer.health.gov.sg/0-0-77/llms.txt
> - 0.0.76: https://docs.refer.health.gov.sg/0-0-76/llms.txt
> - 0.0.75: https://docs.refer.health.gov.sg/0-0-75/llms.txt
> - 0.0.74: https://docs.refer.health.gov.sg/0-0-74/llms.txt
> - 0.0.73: https://docs.refer.health.gov.sg/0-0-73/llms.txt
> - 0.0.72: https://docs.refer.health.gov.sg/0-0-72/llms.txt
> - 0.0.71: https://docs.refer.health.gov.sg/0-0-71/llms.txt
> - 0.0.70: https://docs.refer.health.gov.sg/0-0-70/llms.txt
> - 0.0.69: https://docs.refer.health.gov.sg/0-0-69/llms.txt
> - 0.0.68: https://docs.refer.health.gov.sg/0-0-68/llms.txt
> - 0.0.67: https://docs.refer.health.gov.sg/0-0-67/llms.txt
> - 0.0.66: https://docs.refer.health.gov.sg/0-0-66/llms.txt
> - 0.0.65: https://docs.refer.health.gov.sg/0-0-65/llms.txt
> - 0.0.64: https://docs.refer.health.gov.sg/0-0-64/llms.txt
> - 0.0.63: https://docs.refer.health.gov.sg/0-0-63/llms.txt
> - 0.0.62: https://docs.refer.health.gov.sg/0-0-62/llms.txt
> - 0.0.61: https://docs.refer.health.gov.sg/0-0-61/llms.txt
> - 0.0.60: https://docs.refer.health.gov.sg/0-0-60/llms.txt
> - 0.0.59: https://docs.refer.health.gov.sg/0-0-59/llms.txt
> - 0.0.58: https://docs.refer.health.gov.sg/0-0-58/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.refer.health.gov.sg/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.refer.health.gov.sg/_mcp/server.

RefX exposes the following fields on referrals that are designed to be forwarded to the National Electronic Health Record (NEHR) `putComposition` API.

## The fields

| Field          | Location in `Get referral details` response                     | Description                                                                                                     |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `nehrCode`     | `offering.nehrCode`                                             | The NEHR coded value that identifies referral destination.                                                      |
| `specialty`    | `offering.specialty`                                            | The specialty name that identifies referral destination.                                                        |
| `nehrForm`     | top-level `nehrForm` (only when `additionalField=nehrForm`)     | A self-contained HTML document that renders the full referral form.                                             |
| `nehrFormType` | top-level `nehrFormType` (only when `additionalField=nehrForm`) | Human-readable description of the NEHR forms attached in the referral. Multiple templates are joined with `\|`. |

## How to use them when calling NEHR `putComposition`

When constructing the `putComposition` request to NEHR, plug the RefX fields into the payload as follows.

| RefX field     | NEHR `putComposition` mapping                                                     | Notes                                                           |
| -------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `nehrCode`     | `composition > section > content > referralRequest > specialty > code`            | Coded value identifying the referral destination.               |
| `specialty`    | `composition > section > content > referralRequest > specialty > textDescription` | Free-text specialty name describing the referral destination.   |
| `nehrFormType` | `composition > section > content > referralRequest > type > textDescription`      | Free-text description of the form type(s) used by the referral. |
| `nehrForm`     | `composition > section > content > other > extension > notesItem > text`          | Pass the raw HTML string as the `text` value.                   |

The remaining fields are not provided by RefX and should be populated by your integration from your own system context, per the NEHR specification.

## Implementation notes

* **Fetch just-in-time.** `nehrForm` reflects the referral's current state. Re-fetch it immediately before submitting to NEHR rather than caching it.
* **HTML safety.** The `nehrForm` HTML is already escaped and uses inline styles only. Forward it as-is; do not modify, reflow, or strip styles, otherwise it may not render correctly in NEHR.