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

# Reconcile one patient's medication records

> FHIR system-level operation `$reconcile-medications`. POST one patient's MedicationRequest, MedicationStatement, MedicationDispense and MedicationAdministration records, with the Medications they reference, as a `collection` or `searchset` Bundle; every entry needs a `fullUrl`. The response is one reconciled medication list: a `collection` Bundle holding one reconciled MedicationRequest per clinical drug, a Provenance for each naming the records behind it, and an OperationOutcome when a record was skipped. To evaluate the list as of another date, POST a Parameters resource with `resource` parts, or one `bundle` part, and an `asOf` part. This operation receives patient data, so send it only under an executed agreement. Nothing a request carries is stored or logged, and the operation is not offered inside a batch. The contract is published at https://fhir.haau3.com/OperationDefinition-reconcile-medications.html.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/fhir/r4/$reconcile-medications
openapi: 3.1.0
info:
  title: haau3 Platform API
  version: 1.0.0
  description: >-
    The haau3 platform API. Endpoints require a free API key — send it as
    `Authorization: Bearer <key>`. Requests without a valid key return 401.
    Create a key in the dashboard at https://platform.haau3.com.
servers:
  - url: https://api.haau3.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Scheduling
    description: Provider availability (SMART Scheduling Links) — slots and publishers.
  - name: Terminology
    description: >-
      FHIR terminology operations over the code systems listed in
      TerminologyCapabilities. Some are resolved from their own source when you
      ask; others are held here at a named release, which that resource also
      names.
  - name: Provider directory
    description: >-
      FHIR Practitioner and PractitionerRole, resolved from the national
      provider directory. Resolution, not discovery: bring an NPI and get what
      the directory publishes for it.
  - name: Questionnaires
    description: >-
      FHIR Questionnaire, served as its source publishes it. This service holds
      copies of a curated set and reaches any other questionnaire its source
      publishes by canonical URL. Read one by id, and build the
      QuestionnaireResponse in your own application.
  - name: MedList
    description: >-
      One reconciled medication list from one patient's FHIR medication records,
      as US Core MedicationRequests with a Provenance for each. This operation
      receives patient data, so send it only under an executed agreement.
paths:
  /v1/fhir/r4/$reconcile-medications:
    post:
      tags:
        - MedList
      summary: Reconcile one patient's medication records
      description: >-
        FHIR system-level operation `$reconcile-medications`. POST one patient's
        MedicationRequest, MedicationStatement, MedicationDispense and
        MedicationAdministration records, with the Medications they reference,
        as a `collection` or `searchset` Bundle; every entry needs a `fullUrl`.
        The response is one reconciled medication list: a `collection` Bundle
        holding one reconciled MedicationRequest per clinical drug, a Provenance
        for each naming the records behind it, and an OperationOutcome when a
        record was skipped. To evaluate the list as of another date, POST a
        Parameters resource with `resource` parts, or one `bundle` part, and an
        `asOf` part. This operation receives patient data, so send it only under
        an executed agreement. Nothing a request carries is stored or logged,
        and the operation is not offered inside a batch. The contract is
        published at
        https://fhir.haau3.com/OperationDefinition-reconcile-medications.html.
      operationId: reconcileMedications
      requestBody:
        required: true
        content:
          application/fhir+json:
            schema:
              oneOf:
                - type: object
                  properties:
                    resourceType:
                      type: string
                      const: Bundle
                    type:
                      type: string
                      minLength: 1
                    entry:
                      type: array
                      items:
                        type: object
                        properties:
                          fullUrl:
                            type: string
                          resource:
                            type: object
                            properties:
                              resourceType:
                                type: string
                                minLength: 1
                            required:
                              - resourceType
                            additionalProperties: {}
                          search:
                            type: object
                            properties:
                              mode:
                                type: string
                            additionalProperties: {}
                        additionalProperties: {}
                  required:
                    - resourceType
                    - type
                  additionalProperties: {}
                - type: object
                  properties:
                    resourceType:
                      type: string
                      const: Parameters
                    parameter:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                            minLength: 1
                          resource:
                            type: object
                            properties:
                              resourceType:
                                type: string
                                minLength: 1
                            required:
                              - resourceType
                            additionalProperties: {}
                          valueDateTime:
                            type: string
                        required:
                          - name
                        additionalProperties: {}
                  required:
                    - resourceType
                  additionalProperties: {}
      responses:
        '200':
          description: >-
            The reconciled list: a FHIR `Bundle` of type `collection` conforming
            to haau3 Reconciled Medication Bundle, returned as the response body
            itself.
          content:
            application/fhir+json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: >-
            The request was refused: a resource of another type, records that
            name two patients or none, a Bundle of another type, a resource part
            with no id, or malformed content. The OperationOutcome names the
            reason.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '405':
          description: The operation is invoked with POST only.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '406':
          description: >-
            A FHIR release this endpoint does not serve was requested via the
            `fhirVersion` media-type parameter.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '413':
          description: The request body is over 16 MiB.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '502':
          description: >-
            The terminology store behind RxNorm could not be reached. No partial
            list is returned.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '503':
          description: >-
            RxNorm is not configured on this deployment, no release has been
            published to it, or the release changed while the request was being
            answered. No partial list is returned.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '504':
          description: >-
            The terminology store behind RxNorm did not respond in time. No
            partial list is returned.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
components:
  schemas:
    OperationOutcome:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - OperationOutcome
        issue:
          type: array
          items:
            type: object
            properties:
              severity:
                type: string
                enum:
                  - fatal
                  - error
                  - warning
                  - information
              code:
                type: string
              details:
                type: object
                properties:
                  text:
                    type: string
                additionalProperties: true
              diagnostics:
                type: string
              expression:
                type: array
                items:
                  type: string
            required:
              - severity
              - code
            additionalProperties: true
      required:
        - resourceType
        - issue
    AuthError:
      type: object
      properties:
        error:
          type: string
          examples:
            - API key required
        message:
          type: string
      required:
        - error
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your platform API key (`haau3_sk_…`), sent as `Authorization: Bearer
        <key>`.

````