HAPI FHIR Documentation

repository·master·Indexed 25 days ago

https://github.com/hapifhir/hapi-fhir

A Java API for building HL7 FHIR-compliant clients and servers. The project includes the @smile-cdr/fhirts package for TypeScript model definitions (DSTU2, DSTU3, R4, R4B, R5), tools for defining custom FHIR resources via Java annotations, and a CLI for importing/exporting ConceptMaps via CSV for DSTU3 and R4.

Tokens
8.2K
Snippets
4
Records
59
Agent score
81%

What's inside HAPI FHIR

  1. Use the nickname and diminutive names lookup

    master

    The nickname-and-diminutive-names-lookup is a CSV-based dataset containing US given names (first names) and their associated nicknames or diminutive names (e.g., "gregory" maps to "greg", "geoffrey" maps to "geoff").

    It is designed for name matching and lookup tasks. The dataset contains approximately 1,600 names and has been processed to be machine-readable (e.g., splitting names like "rickie(y)" into separate entries for "rickie" and "ricky").

    To use this data, you can utilize the provided parsers for the following languages:

    • Java
    • Perl
    • Python
    • R
  2. Prohibition of fully autonomous AI agents

    master
    Fully autonomous agents are not allowed to contribute to this project. Pull requests that appear to have been created autonomously will be closed, potentially without notice. All contributions require a 'human in the loop' who understands the work produced by AI.
  3. Disclose AI usage in Pull Requests

    master

    If you use AI (e.g., LLMs like Claude Code, Cursor, Amp) as a tool for coding, you must disclose its use in your contribution.

    1. State the tool used and the extent of the AI assistance.
    2. Apply the GitHub label: Any Pull Request built with AI assistance must include the AI Assisted label.
  4. Guidelines for AI-assisted communication

    master

    HAPI FHIR requires human-centric communication. When interacting with maintainers:

    • Do not use AI to generate comments or Pull Request descriptions. Comments are expected to be written by humans; AI-generated comments may be hidden or removed.
    • Issues and PRs must be in your own words. You must be able to explain proposed changes and respond to maintainer questions without copying responses from an AI.
    • Using AI for translation/editing: If using AI to assist as a non-native speaker, ensure the result reflects your own voice. If using AI for translation, write in your native language and include the AI translation in a quote block.
    • Including AI context: If you must include context from an AI interaction, it must be in a quote block (using >) and accompanied by human commentary explaining its relevance. Avoid sharing long snippets.
  5. Create a changelog entry for HAPI FHIR

    master

    HAPI FHIR requires a YAML-based changelog entry for every Pull Request to maintain structured release tracking.

    File Location

    Place your new changelog file in the directory corresponding to the current release: hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/[CURRENT_RELEASE]

    Significant changes must also be documented in the release upgrade notes at: hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/[CURRENT_RELEASE]/upgrade.md

    Naming Convention

    Files must be named using the pattern: PPPP-short-description.yaml where PPPP is the PR or Issue number.

    YAML Format

    Each entry must follow this structure:

    • type: One of add, fix, perf, change, remove, or security.
    • issue: The GitHub issue or PR number.
    • title: A descriptive summary. For bugs, describe the broken behavior and the fix. For features, describe the new functionality.
    ---
    type: perf
    issue: 7297
    title: "The code which detects whether a reference SearchParameter could potentially
       target a CanonicalReference (as opposed to only a standard reference) has been
       improved. This should result in fewer `_include` and `_revinclude` queries being
       processed with an additional canonical lookup, improving speed in these cases."
  6. Use FHIR version namespaces in TypeScript

    master

    To prevent naming collisions between identically named resources across different FHIR versions, @smile-cdr/fhirts exposes each version as a distinct namespace (e.g., R4, R4B, R5). When defining resource objects, use the versioned namespace to type the variable.

    import { R4, R4B, R5 } from '@smile-cdr/fhirts';
    
    const patient: R4.Patient = {
      resourceType: 'Patient',
      gender: 'female',
    };
    
    const r4bPatient: R4B.Patient = {
      resourceType: 'Patient',
      gender: 'female',
    };