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

# Update EMR user profile

> Updates an EMR user profile with validated and normalized data.

**Authorization Rules**:
  - Users can update their own profile.
  - Admins can update any profile within their workspace.

**Name Handling**:
  - If `fln` is provided, it will be split into `fn`, `mn`, `ln`.
  - If updating name, ensure either `fn` or `fln` is provided.




## OpenAPI

````yaml patch /profiles/v1/emr-user/{oid}
openapi: 3.0.3
info:
  title: Patient APIs
  description: Patient Directory CRUD
  version: 1.0.0
servers:
  - url: https://api.eka.care
security: []
paths:
  /profiles/v1/emr-user/{oid}:
    patch:
      tags:
        - Patient
      summary: Update EMR user profile
      description: |
        Updates an EMR user profile with validated and normalized data.

        **Authorization Rules**:
          - Users can update their own profile.
          - Admins can update any profile within their workspace.

        **Name Handling**:
          - If `fln` is provided, it will be split into `fn`, `mn`, `ln`.
          - If updating name, ensure either `fn` or `fln` is provided.
      parameters:
        - in: header
          name: client-id
          required: true
          schema:
            type: string
            example: EC_1431
        - in: path
          name: oid
          required: true
          schema:
            type: string
            example: 18661861868168
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mobile:
                  type: string
                  description: Mobile number in E.164 format
                  example: '+919876543210'
                email:
                  type: string
                  format: email
                  example: testuser@eka.care
                gen:
                  type: string
                  enum:
                    - M
                    - F
                    - O
                  description: Gender
                  example: M
                dob:
                  type: string
                  format: date
                  example: '2000-01-02'
                fn:
                  type: string
                  description: First name
                  example: eka
                mn:
                  type: string
                  description: Middle name
                  example: kumar
                ln:
                  type: string
                  description: Last name
                  example: user
                fln:
                  type: string
                  description: Full name
                  example: eka user
                bg:
                  type: string
                  enum:
                    - A+
                    - A-
                    - B+
                    - B-
                    - AB+
                    - AB-
                    - O+
                    - O-
                  description: Blood group
                  example: B+
                s:
                  type: string
                  description: Salutation
                  example: Mr
                extras:
                  type: object
                  additionalProperties: true
                  description: Additional arbitrary data as JSON
                  example:
                    preferred_language: en
                    city: Bangalore
      responses:
        '200':
          description: Profile updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Profile updated successfully
        '400':
          description: Validation or request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400Error'
      security:
        - bearerAuth: []
components:
  schemas:
    400Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid Gender Enum
            code:
              type: string
              example: invalid_request
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````