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

# Retrieve patient history by ID

> Finds history of diseases by patient ID.



## OpenAPI

````yaml GET /history/{patientId}
openapi: 3.0.0
info:
  title: Subin Health API
  description: >

    # Overview

    Subin Health API lets you manage patient data, prescriptions, and inventory.
    You can view, edit, delete patient profiles, history, visits, and medical
    records. You can also track the medicine inventory based on new
    prescriptions. <br>This API is REST-based and is documented in OpenAPI
    format. <br><br>    Base URL for all requests:
    `https://virtserver.swaggerhub.com/SUBIN23K/Subin_Health/1.0.0`.

    # Authentication

    Subin Health API uses API Key authentication. Click `Authorize` and enter a
    string to generate a new API key.

    # Use Case

    ## Prescription and Invoicing

    You can use Subin Health API to generate prescription after a doctor's
    consultation and invoice for payment. The endpoints related to inventory
    check the real-time availability of medicines in your inventory. With the
    help of historic data from prescriptions, you can proactively restock
    medicines that are in demand. <br> <br> The following diagram outlines the
    process flow: <br> ![Flow
    diagram](https://raw.githubusercontent.com/subin23k/apidocs/main/flow_diagram.png
    "Flow diagram") <br> When the flow is complete, the system automatically
    updates the patient's history.
  version: 1.0.0
servers:
  - url: https://virtserver.swaggerhub.com/SUBIN23K/Subin_Health/1.0.0
    description: Subin Health API
security:
  - api_key: []
tags:
  - name: Patient
    description: Manage patient data
  - name: History
    description: Manage patient's history
  - name: Prescriptions
    description: Manage prescriptions
  - name: Inventory
    description: Manage inventory
  - name: Invoice
    description: Manage invoices
paths:
  /history/{patientId}:
    get:
      tags:
        - History
      summary: Find patient history by ID
      description: Finds history of diseases by patient ID.
      operationId: getPatientHistory
      parameters:
        - name: patientId
          in: path
          description: Patient's ID
          required: true
          style: simple
          explode: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/History'
            application/xml:
              schema:
                $ref: '#/components/schemas/History'
        '400':
          description: Invalid patient ID
        '404':
          description: Patient not found
components:
  schemas:
    History:
      type: object
      description: Record of a patient's medical history.
      properties:
        patientId:
          type: integer
          description: Unique identifier for the patient.
          format: int64
          example: 234796
        name:
          type: string
          description: Registered name of the patient.
          example: Subin
        medicine:
          type: string
          description: Name of the prescribed medicine.
          example: Dolo 650
        dosage:
          type: string
          description: Prescribed dosage of the medicine.
          example: 650 mg
        history:
          type: array
          description: List of the patient's previously diagnosed diseases.
          items:
            $ref: '#/components/schemas/History_history'
        visits:
          type: integer
          description: Total number of visits the patient has made to the hospital.
          example: 2
        lastvisit:
          type: string
          description: Date of the patient's most recent hospital visit (DD/MM/YYYY).
          example: 01/03/2024
      xml:
        name: History
    History_history:
      description: Internal object tracking up to three historical diseases.
      type: object
      properties:
        disease1:
          type: string
          description: First recorded disease.
          example: Viral Fever
        disease2:
          type: string
          description: Second recorded disease.
          example: Cold
        disease3:
          type: string
          description: Third recorded disease.
          example: Typhoid
  securitySchemes:
    api_key:
      type: apiKey
      name: api_key
      in: header

````