> ## Documentation Index
> Fetch the complete documentation index at: https://docs.connectivehealth.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Location

> The FHIR Location resource as produced by Connective Health

[FHIR R4 Location](https://www.hl7.org/fhir/R4/location.html) ·
[US Core Location](https://hl7.org/fhir/us/core/STU9/StructureDefinition-us-core-location.html)

<Info>
  `Location` is used differently across the FHIR outputs. In
  [Bulk Medication History](/fhir/bulk-medication-history-bundle) it is a standalone resource serving **two**
  purposes -- the prescriber's office and the dispensing pharmacy. In the
  [Patient Everything](/fhir/patient-everything-bundle) and [Patient Summary](/fhir/patient-summary-bundle) bundles
  it represents the facility where a clinical activity took place and is **contained** rather than standalone. The
  **Stable ID** and **Fields** sections below cover both, with a column per output.
</Info>

# Stable ID

| Output                       | Recipe                                                                                                                                                                                                                                                                                                     |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Patient Everything / Summary | No `id` is assigned. `Location` is contained inside the [PractitionerRole](/fhir/resources/practitioner-role) referencing it, which is in turn contained inside the clinical resource -- so the same real-world facility appears as a separate contained `Location` under every record associated with it. |
| Bulk Med History             | Fixed to one of two patterns, both tied to the specific medication record rather than to the real-world address or pharmacy: `prescriberLocation-{medicationUniqueId}` for the prescriber's office, `pharmacyLocation-{medicationUniqueId}` for the dispensing pharmacy.                                   |

<Warning>
  Neither `id` scheme deduplicates by real-world identity. In the bundles, the same facility appears as a separate
  contained `Location` under every record associated with it. In Bulk Med History, the same real-world office or
  pharmacy appears as a **separate** `Location` resource for every medication associated with it -- resources are
  not deduplicated by address or NCPDP ID.
</Warning>

# Fields

| Field                   | Patient Everything / Summary | Bulk Med History                           | Notes                                                                                                                                                                                                                                                                                                           |
| ----------------------- | ---------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `meta.profile`          | 1..1                         | 1..1                                       | Always set to the US Core Location profile URL.                                                                                                                                                                                                                                                                 |
| `status`                | 1..1                         | 1..1                                       | Always `active`.                                                                                                                                                                                                                                                                                                |
| `name`                  | 0..1                         | 0..1                                       | Bundles: the facility name, when known. Bulk Med History: for the prescriber's office, the prescriber's **last name** (no separate practice/facility name is available); for the pharmacy, the pharmacy's store name.                                                                                           |
| `address`               | 0..1                         | 0..1                                       | Street line(s), city, state, and postal code. In the bundles, blank street lines are dropped. Unlike [Patient](/fhir/resources/patient), `country` is **not** set in either output.                                                                                                                             |
| `identifier` (NCPDP)    | 0..0                         | 0..0 for the office; 1..1 for the pharmacy | Bulk Med History only, using the [NCPDP Provider ID](http://terminology.hl7.org/CodeSystem/NCPDPProviderIdentificationNumber) system. Only populated for the pharmacy `Location`, not for the prescriber's office. Not populated in the bundles.                                                                |
| `identifier` (NPI)      | 0..0                         | 0..1                                       | Bulk Med History only, when the pharmacy's NPI is present. Only populated for the pharmacy `Location`, not for the prescriber's office. Not populated in the bundles.                                                                                                                                           |
| `type`                  | 0..0                         | 0..1                                       | Bulk Med History only, fixed to `OUTPHARM` ("outpatient pharmacy") from the [HL7 v3 RoleCode](http://terminology.hl7.org/CodeSystem/v3-RoleCode) system. Only populated for the pharmacy `Location`, not for the prescriber's office. Not populated in the bundles.                                             |
| `telecom` (phone / fax) | 0..0                         | 0..1 each                                  | Bulk Med History only, and only for the pharmacy `Location`. The prescriber's phone/fax appear on [PractitionerRole](/fhir/resources/practitioner-role) instead, not on the office `Location`. Not populated in the bundles -- the facility's phone/fax appear on the surrounding `PractitionerRole` there too. |

<Note>
  In the bundles, a `Location` is only produced when the facility has a name or an address. `managingOrganization`
  and `position` are not populated in either output.
</Note>
