> ## 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.

# Search Patient profiles by mobile number

> This API provides functionality to get all profiles of patient by their mobile number in business' directory. 

<Note> This API only works on 10 digit mobile number and cannot be used for searching partial phone numbers. The patient with given mobile number should already be registered with business account for results to show up. </Note>


### Request Parameter

| Parameter | Type | Expected Values | Description | Required/Optional/Not Required |
| --- | --- | --- | --- | --- |
| mobile | string | 10 digit phone number | Patient's mobile number | Required |

### **Response parameter**

| Parameter                           | Type      | Expected Values                           | Description                                               |
| ----------------------------------- | --------- | ----------------------------------------- | --------------------------------------------------------- |
| data                                | object    |                                           | Response data object                                      |
| data.profiles                       | array     |                                           | List of patient profiles                                  |
| data.profiles[].name                | string    | "Amit Kumar"                              | Patient's full name                                       |
| data.profiles[].patient_id          | string  | "123456789012345"                        | Unique identifier for the patient (can be null)           |
| data.profiles[].patient_profile     | object    |                                           | Detailed patient profile information                      |
| data.profiles[].patient_profile.created_at | string    | "2024-08-13T07:31:53.750Z"               | Timestamp of profile creation                             |
| data.profiles[].patient_profile.dob | string    | "1990-05-15"                              | Patient's date of birth                                   |
| data.profiles[].patient_profile.first_name | string    | "Amit"                                  | Patient's first name                                      |
| data.profiles[].patient_profile.middle_name | string    | ""                                       | Patient's middle name (can be empty)                      |
| data.profiles[].patient_profile.last_name | string    | "Kumar"                                 | Patient's last name                                       |
| data.profiles[].patient_profile.gender | string    | "M" / "F" / "O"                                  | Patient's gender                                          |
| data.profiles[].patient_profile.mobile | string    | "+919876543210"                           | Patient's mobile number                                   |
| data.profiles[].patient_profile.patient_id | string \| null | "123456789012345"                     | Unique identifier for the patient (can be null)           |
| status_code                         | integer   | 200                                       | HTTP status code of the response                          |
| success                             | boolean   | true                                      | Indicates if the request was successful                   |

**Status Codes**

• 200: Success

• 403: Patient/Business data missing

• 500: Wrong API URL/Wrong JSON request/ Something went wrong



## OpenAPI

````yaml get /dr/v1/business/patients/search
openapi: 3.0.0
info:
  title: Ekacare API & Webhook Documentation
  contact: {}
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /dr/v1/business/patients/search:
    get:
      tags:
        - Patient Registration API
      summary: Search Patient profiles by mobile number
      description: >-
        This API provides functionality to get all profiles of patient by their
        mobile number in business' directory. 


        <Note> This API only works on 10 digit mobile number and cannot be used
        for searching partial phone numbers. The patient with given mobile
        number should already be registered with business account for results to
        show up. </Note>



        ### Request Parameter


        | Parameter | Type | Expected Values | Description |
        Required/Optional/Not Required |

        | --- | --- | --- | --- | --- |

        | mobile | string | 10 digit phone number | Patient's mobile number |
        Required |


        ### **Response parameter**


        | Parameter                           | Type      | Expected
        Values                           |
        Description                                               |

        | ----------------------------------- | --------- |
        ----------------------------------------- |
        --------------------------------------------------------- |

        | data                                | object   
        |                                           | Response data
        object                                      |

        | data.profiles                       | array    
        |                                           | List of patient
        profiles                                  |

        | data.profiles[].name                | string    | "Amit
        Kumar"                              | Patient's full
        name                                       |

        | data.profiles[].patient_id          | string  |
        "123456789012345"                        | Unique identifier for the
        patient (can be null)           |

        | data.profiles[].patient_profile     | object   
        |                                           | Detailed patient profile
        information                      |

        | data.profiles[].patient_profile.created_at | string    |
        "2024-08-13T07:31:53.750Z"               | Timestamp of profile
        creation                             |

        | data.profiles[].patient_profile.dob | string    |
        "1990-05-15"                              | Patient's date of
        birth                                   |

        | data.profiles[].patient_profile.first_name | string    |
        "Amit"                                  | Patient's first
        name                                      |

        | data.profiles[].patient_profile.middle_name | string    |
        ""                                       | Patient's middle name (can be
        empty)                      |

        | data.profiles[].patient_profile.last_name | string    |
        "Kumar"                                 | Patient's last
        name                                       |

        | data.profiles[].patient_profile.gender | string    | "M" / "F" /
        "O"                                  | Patient's
        gender                                          |

        | data.profiles[].patient_profile.mobile | string    |
        "+919876543210"                           | Patient's mobile
        number                                   |

        | data.profiles[].patient_profile.patient_id | string \| null |
        "123456789012345"                     | Unique identifier for the
        patient (can be null)           |

        | status_code                         | integer   |
        200                                       | HTTP status code of the
        response                          |

        | success                             | boolean   |
        true                                      | Indicates if the request was
        successful                   |


        **Status Codes**


        • 200: Success


        • 403: Patient/Business data missing


        • 500: Wrong API URL/Wrong JSON request/ Something went wrong
      operationId: SearchPatientbymobile
      parameters:
        - name: mobile
          in: query
          description: ''
          required: true
          style: form
          explode: true
          schema:
            type: string
            example: <mobile_no>
        - name: auth
          in: header
          required: true
          description: The auth token of the user. It is used to authenticate the user.
          schema:
            type: string
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM
      responses:
        '200':
          description: OK
          headers:
            Date:
              content:
                text/plain:
                  schema:
                    type: string
                  example: Tue, 24 Mar 2020 06:26:06 GMT
            Content-Length:
              content:
                text/plain:
                  schema:
                    type: string
                  example: '380'
            Connection:
              content:
                text/plain:
                  schema:
                    type: string
                  example: keep-alive
            Server:
              content:
                text/plain:
                  schema:
                    type: string
                  example: nginx/1.10.3 (Ubuntu)
            Vary:
              content:
                text/plain:
                  schema:
                    type: string
                  example: Cookie, Accept-Encoding
            Content-Encoding:
              content:
                text/plain:
                  schema:
                    type: string
                  example: gzip
            Strict-Transport-Security:
              content:
                text/plain:
                  schema:
                    type: string
                  example: max-age=15768000
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/200OK2'
                  - example:
                      data:
                        profiles:
                          - name: Amit Kumar
                            patient_id: '987654321098722'
                            patient_profile:
                              patient_id: '987654321098722'
                              first_name: Amit
                              middle_name: ''
                              last_name: Kumar
                              dob: '1990-05-15'
                              gender: M
                              mobile: '+919876543210'
                              created_at: '2024-08-13T07:31:53.750Z'
                          - name: Priya Sharma
                            patient_id: '98765432109222'
                            patient_profile:
                              patient_id: '987654321098722'
                              first_name: Priya
                              middle_name: ''
                              last_name: Sharma
                              dob: '1985-09-20'
                              gender: F
                              mobile: '+918765432109'
                              created_at: '2023-10-26T06:20:36.758Z'
                          - name: Rahul Gupta
                            patient_id: '987654321098765'
                            patient_profile:
                              patient_id: '987654321098765'
                              first_name: Rahul
                              middle_name: ''
                              last_name: Gupta
                              dob: '1978-11-30'
                              gender: M
                              mobile: '+917654321098'
                              created_at: '2024-08-14T09:01:14.806Z'
                      status_code: 200
                      success: true
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                  status_code:
                    type: integer
                  success:
                    type: boolean
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
              example:
                data: {}
                status_code: 403
                success: false
                error:
                  code: UNAUTHORIZED_ACCESS
                  message: You do not have permission to search for patients
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                  status_code:
                    type: integer
                  success:
                    type: boolean
              example:
                error:
                  code: PATIENTS_NOT_FOUND
                  message: No patients found with the provided mobile number
                status_code: 404
                success: false
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                  status_code:
                    type: integer
                  success:
                    type: boolean
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
              example:
                data: {}
                status_code: 500
                success: false
                error:
                  code: SERVER_ERROR
                  message: An unexpected error occurred on the server
      deprecated: false
components:
  schemas:
    200OK2:
      title: 200OK2
      required:
        - data
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Data2'
      example:
        data:
          patients:
            - patient_id: '123456789'
              name: Test Patient
              clinic_id: '12345678'
              patient_profile:
                patient_id: '123456789'
                first_name: Test
                middle_name: ''
                last_name: Patient
                dob: '1984-11-11'
                email: ekademo@gmail.com
                gen: M
                mobile: '+919999999999'
                created_at: '2021-03-19T13:15:26.318Z'
            - patient_id: '234567890'
              name: Test PT 2
              is_recent: false
              clinic_id: null
              patient_profile:
                first_name: Test
                middle_name: PT
                last_name: '2'
                patient_id: '234567890'
                email: demo_test@eka.care
                gen: M
                mobile: '+91999999999'
                dob: '1991-11-11'
                created_at: 2021-03-19T13:15:26318Z
    Data2:
      title: Data2
      required:
        - patients
      type: object
      properties:
        patients:
          type: array
          items:
            $ref: '#/components/schemas/Patient'
          description: ''
      example:
        patients:
          - patient_id: '123456789'
            name: Test Patient
            clinic_id: '12345678'
            patient_profile:
              patient_id: '123456789'
              first_name: Test
              middle_name: ''
              last_name: Patient
              dob: '1984-11-11'
              email: ekademo@gmail.com
              gen: M
              mobile: '+919999999999'
              created_at: '2021-03-19T13:15:26.318Z'
          - patient_id: '234567890'
            name: Test PT 2
            is_recent: false
            clinic_id: null
            patient_profile:
              first_name: Test
              middle_name: PT
              last_name: '2'
              patient_id: '234567890'
              email: demo_test@eka.care
              gen: M
              mobile: '+91999999999'
              dob: '1991-11-11'
              created_at: 2021-03-19T13:15:26318Z
    Patient:
      title: Patient
      required:
        - patient_id
        - name
        - clinic_id
        - patient_profile
      type: object
      properties:
        patient_id:
          type: string
        name:
          type: string
        clinic_id:
          type: string
          nullable: true
        patient_profile:
          $ref: '#/components/schemas/PatientProfile1'
        is_recent:
          type: boolean
      example:
        patient_id: '123456789'
        name: Test Patient
        clinic_id: '12345678'
        patient_profile:
          patient_id: '123456789'
          first_name: Test
          middle_name: ''
          last_name: Patient
          dob: '1984-11-11'
          email: ekademo@gmail.com
          gen: M
          mobile: '+919999999999'
          created_at: '2021-03-19T13:15:26.318Z'
    PatientProfile1:
      title: PatientProfile1
      required:
        - patient_id
        - first_name
        - middle_name
        - last_name
        - dob
        - email
        - gen
        - mobile
        - created_at
      type: object
      properties:
        patient_id:
          type: string
        first_name:
          type: string
        middle_name:
          type: string
        last_name:
          type: string
        dob:
          type: string
        email:
          type: string
        gen:
          type: string
        mobile:
          type: string
        created_at:
          type: string
      example:
        patient_id: '123456789'
        first_name: Test
        middle_name: ''
        last_name: Patient
        dob: '1984-11-11'
        email: ekademo@gmail.com
        gen: M
        mobile: '+919999999999'
        created_at: '2021-03-19T13:15:26.318Z'

````