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

# Notify the admission's pharmacies of a discharge

> Tells every pharmacy this admission ordered from that the patient is being discharged, so they close unreturned medicines and dues. Recipients are resolved from the admission's own orders, not chosen by the caller. Responds 200 even when a pharmacy could not be reached — that failure is carried per-pharmacy in `targets`, and the caller can resend.



## OpenAPI

````yaml api-reference/doc-tool/ipd-api/ipd-sdk-openapi.json post /ipd/v1/sdk/admissions/{admission_id}/pharmacy-clearance-notify
openapi: 3.1.0
info:
  title: Eka IPD Admission API
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /ipd/v1/sdk/admissions/{admission_id}/pharmacy-clearance-notify:
    post:
      tags:
        - IPD API
      summary: Notify the admission's pharmacies of a discharge
      description: >-
        Tells every pharmacy this admission ordered from that the patient is
        being discharged, so they close unreturned medicines and dues.
        Recipients are resolved from the admission's own orders, not chosen by
        the caller. Responds 200 even when a pharmacy could not be reached —
        that failure is carried per-pharmacy in `targets`, and the caller can
        resend.
      operationId: IpdSdkNotifyTheAdmissionSPharmaciesOfADischarge
      parameters:
        - name: auth
          in: header
          required: true
          schema:
            type: string
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM
        - schema:
            minLength: 1
            type: string
          in: path
          name: admission_id
          required: true
          description: Id of the IPD admission.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              properties:
                only:
                  description: >-
                    Notify only these pharmacies (as `provider` + `pharmacy_id`,
                    the same values as in `targets`) — for example to resend to
                    one pharmacy. Omit to notify every pharmacy the admission
                    ordered from.
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - provider
                      - pharmacy_id
                    properties:
                      provider:
                        minLength: 1
                        description: Pharmacy provider, for example `evital`.
                        type: string
                      pharmacy_id:
                        minLength: 1
                        description: The provider's pharmacy id.
                        type: string
                by:
                  description: >-
                    Actor recorded against the attempt; defaults to the
                    authenticated operator.
                  additionalProperties: true
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    role:
                      type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                required:
                  - state
                  - targets
                properties:
                  skipped:
                    description: Set when the round was a deliberate no-op.
                    anyOf:
                      - type: string
                        enum:
                          - no-ipid
                      - type: string
                        enum:
                          - no-targets
                  state:
                    description: Rolled-up state across every pharmacy.
                    anyOf:
                      - type: string
                        enum:
                          - none
                      - type: string
                        enum:
                          - partial
                      - type: string
                        enum:
                          - all
                      - type: string
                        enum:
                          - failed
                  targets:
                    description: Per-pharmacy state, keyed by "provider:pharmacyId".
                    type: object
                    additionalProperties:
                      additionalProperties: true
                      type: object
                      required:
                        - provider
                        - pharmacy_id
                        - status
                        - attempts
                      properties:
                        provider:
                          type: string
                        pharmacy_id:
                          type: string
                        pharmacy_name:
                          type: string
                        status:
                          anyOf:
                            - type: string
                              enum:
                                - NOTIFIED
                            - type: string
                              enum:
                                - FAILED
                            - type: string
                              enum:
                                - CLEARED
                            - type: string
                              enum:
                                - CANCELLED
                            - type: string
                              enum:
                                - UNSUPPORTED
                        attempts:
                          description: Total attempts — drives the "Sent 4 times" copy.
                          type: number
                        last_error:
                          type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '404':
          description: >-
            Not Found — the admission (or the addressed record) does not exist
            in your workspace.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.