Blog

    FHIR Patient Resource

    By GauravNovember 13, 202610 mins read
    On this page

    Every lab, visit, and document in a FHIR API points at a patient. If two Patient records exist for one person, the chart splits. If one Patient record quietly covers two people, the chart mixes. Both failures look like interface bugs later, and both start here.

    The FHIR Patient resource is the demographic and identifier record. This guide covers how to assign identifiers, what US Core Patient adds, how to search without creating a duplicate, and how a merge should link records. It is for teams building a FHIR server or a facade on a master patient index. Remote monitoring programs are a different design. They still need this record to be right, but the work on this page is the person, not the device.

    What does the FHIR Patient resource have to contain?

    Building a FHIR Patient API?

    Agnotic Technologies builds FHIR R4 servers and facades, including US Core Patient, matching, and merge from the master patient index.

    The FHIR Patient resource is the demographic and identifier record other resources point at. A usable one carries a stable identifier and a name, supports birth date and address when the source has them, and can be matched or linked when two records are the same person. Getting Patient wrong duplicates every later result.

    FHIR R4 Patient can hold identifiers, names, telecom, gender, birth date, address, contacts, communication preferences, a general practitioner, and a link to another Patient. Very little of that is required by the base resource. A payload that is merely valid FHIR can still be useless to a caller who needs to know which person this is. Profiles, especially US Core Patient, set the floor for United States APIs.

    How should identifiers be modeled?

    Model each identifier as a system plus a value. The system names the authority that issued it. The value is the number. Two hospitals can both use '10001' and they are not the same person unless the system URI is the same.

    • MRN: identifier.type of MR, identifier.system set to the hospital's assigning authority, identifier.value set to the medical record number.
    • More than one: A person can hold an MRN, a payer member id, and a national health id. Send the ones your use case needs. Do not drop the MRN because a member id also exists.
    • Not the resource id: Patient.id is the server's address for this resource. It is not the MRN. Callers search identifier, then store the id they got back.
    • No SSN as the working key: Do not match or log a Social Security Number as the everyday identifier. If a profile allows it for a narrow purpose, keep it out of routine searches.
    • Assigning authority: When two facilities merge, keep the old system URI. Rewriting history to one system without a link loses the crosswalk.

    US Core's Patient profile describes the MRN case directly: query demographic information using a medical record number, which is an identifier, and tells you the MRN is distinguished by identifier.system and may be location specific. If your facade ignores system and matches on value alone, that query will attach the wrong chart as soon as two sites share a number.

    How do you search and match without creating a duplicate?

    Search by identifier first. If you only have a name and a birth date, search those and require a person to confirm when more than one row returns. Never create a Patient because the first search timed out.

    The US Core Patient page gives two example queries: by MRN, and by first name, last name, and birth date. Implement those before you invent a fuzzy match. FHIR also defines a Patient $match operation. Many servers do not support it. Read the CapabilityStatement. If $match is absent, do not document it as available, and do not silently insert a patient on a weak name match.

    • Exact identifier: One hit. Use it.
    • Exact identifier, no hit: Create only if this system is allowed to register patients. A results-only interface should park the message.
    • Name and birth date, one hit: Use it only if the rest of the demographics do not contradict.
    • Name and birth date, many hits: Return the list. Do not pick the first.
    • Timeout: Retry the search. Creating during the timeout is how duplicates are born.

    What does US Core Patient add on top of base FHIR?

    US Core Patient sets a floor for demographics in US APIs. The version matters. Build to the version your server advertises and the version your certification or partner contract names, not automatically to the newest STU.

    US Core 9.0.0 states that each Patient must have a patient identifier, such as an MRN, and a patient name. It states that each Patient must support a birth date and an address when the sending system has them. The same page lists additional USCDI elements that are not labeled must-support but are required for ONC Health IT certification testing, including a contact detail, a communication language, race, ethnicity, sex, and tribal affiliation. Earlier US Core versions required administrative gender as well. A client written against one version will misread a server on another. Publish the version in the CapabilityStatement and test against that package.

    • Name: Support more than one, including a previous name. US Core 9 tells certifying systems to mark a previous name with name.use old or with an end date on name.period.
    • Address: For records you are creating now, US Core 9 points certifying systems at the Project US@ address specification. Historical rows can differ. State codes for US addresses are the USPS two-letter codes.
    • Sex and gender: Do not assume a single field covers both administrative use and clinical sex. Follow the version's extensions rather than overloading one code.
    • Missing data: Must-support means you carry the element when you have it. It does not mean you invent a birth date to satisfy a sample.

    A merge keeps one active Patient and points the retired record at it with Patient.link. Deleting the retired resource breaks every client that stored the old id.

    FHIR R4 defines Patient.link with types that include replaced-by, replaces, refer, and seealso. A typical merge sets the losing record to active false and adds a link of type replaced-by to the surviving Patient. The survivor can link back with replaces. Clients that stored the old id follow the link instead of failing. Refer and seealso are for relationships that are not a merge, such as a chart you want people to see without retiring either record. Do not use seealso to paper over a duplicate you should have merged.

    • Survive: One MRN remains the identifier callers should search.
    • Retire: active false, link populated, resource still readable.
    • Repoint: New writes go to the survivor. Old resources that reference the retired id stay valid because the link remains.
    • Unmerge: Rare and explicit. Do not implement unmerge by deleting the link without a documented process.

    What breaks later when Patient is wrong?

    A wrong Patient does not stay inside demographics. Every resource that references it, including results and documents posted the same day, files on the wrong person or on a duplicate nobody opens.

    • Split chart: Labs land on a new Patient created by a typo in the MRN. The clinician's view stays empty.
    • Overlay: Two people share one Patient because a name search picked the first row. Results are now a privacy incident.
    • Stale id: A partner cached Patient.id and you merged overnight. Their next write hits the retired record and they treat the error as downtime.
    • Identifier rewrite: You changed identifier.system during a conversion and historical bundles no longer search.

    Fix overlays as an incident, not as a data-cleanse ticket. The retired record, the survivor, and a list of resources that moved are the audit. A silent update of Patient.name is not a merge.

    How should a facade expose Patient from a legacy index?

    The master patient index remains the source of truth. The FHIR Patient is a projection: same identifiers, same link after a merge, no second MRN minted by the API layer.

    • Read: Map MPI fields onto the US Core version you claim. Leave absent what the MPI does not store.
    • Search: Identifier search hits the MPI, not a stale copy in the facade cache.
    • Create: If the facade can register patients, the MPI performs the match first and returns the existing person when it finds one.
    • Merge events: When the MPI merges, the facade updates link and active. It does not wait for a full reload.
    • Cache: Cache demographics briefly if you must. Do not cache 'this person has no chart' longer than the timeout you just had.

    What should you test before calling the interface done?

    Test the identifier round trip, the ambiguous name search, and a merge. A single happy-path patient with one name and one MRN will not catch the defects that split a chart. Include a patient with a previous name and a previous address. US Core 9 expects those to be representable, and a facade that keeps only the current legal name will fail a partner looking for the name on an older order.

    • Round trip: Create or load a patient, search by system and value, and get the same Patient.id.
    • Two facilities: Same numeric MRN, different system URIs, two people. Search must not collapse them.
    • Ambiguous name: Two patients, same family name and birth date. The API returns both.
    • Merge: After the MPI merge, the old id is still readable, active is false, and link points at the survivor.
    • Version: The CapabilityStatement names the US Core version you tested, and a client from that package validates.

    How Agnotic can help

    Agnotic Technologies builds the Patient API for EHR vendors, digital health products, and health systems standing up a FHIR facade. Agnotic maps the master patient index onto the US Core version you must meet, implements identifier search and merge links, and tests the duplicate and overlay cases before go-live. We do not treat Patient as a formality in front of a more interesting resource.

    If your contract names an older US Core package than the current STU, we build to that package and say so in the CapabilityStatement.

    Review your Patient resource

    Walk identifiers, match, and merge with an engineer, or read more FHIR guides.

    Related reading on Agnotic

    US Core, the observation resource, FHIR standards, and how an EHR database holds identity.

    Sources

    Frequently Asked Questions

    No. Patient.id is how this server addresses the resource. The MRN is an identifier with a system URI for the assigning authority and the number as the value. Callers should search the identifier, then keep the id the server returned.

    Talk to an engineer about your project

    We implement FHIR Patient on US Core, including identifier search, merge links, and a facade in front of the master patient index.

    Go deeper

    Services and solutions on this topic