swagger: '2.0'
info:
  x-ibm-name: ndis-plans
  title: NDIS Plans
  version: 4.0.0
  description: Digital Partners are able to retrieve the appropriate approved plans and goals
  contact:
    name: NDIA Support Team
    email: api.support@ndis.gov.au
schemes:
  - https
host: api.ndis.gov.au
basePath: /sharedservices/ndis-api/ndis/4.0/plans
consumes:
  - application/json
produces:
  - application/json
security:
  - clientIdHeader: []
securityDefinitions:
  clientIdHeader:
    type: apiKey
    in: header
    name: X-IBM-Client-Id
    description: 'apiKey provided during registration. Max Length(64). example: aa111aa-11a1-1a11-111a-1a1a11aa111a'
x-ibm-configuration:
  testable: true
  enforced: true
  cors:
    enabled: true
  phase: realized
  type: rest
  servers:
    - url: https://api.ndis.gov.au/sharedservices/ndis-api/ndis/4.0/plans
      description: ''
      type:
        - production
        - development
    - url: https://api.ndis.gov.au/sharedservices/ndis-api/ndis/4.0/plans
      description: ''
      type:
        - production
        - development
paths:
  /:
    get:
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/get_plans_response'
        '400':
          description: 'Bad Request: A validation resulted in the request being rejected.'
          schema:
            $ref: '#/definitions/http_error'
        '401':
          description: 'Unauthorised: No authentication credentials provided or authentication has failed.'
          schema:
            $ref: '#/definitions/http_error'
        '404':
          description: The URI path or the requested record was not found.
          schema:
            $ref: '#/definitions/http_error'
        '500':
          description: 'Internal Server Error: An internal error has occurred and the server is unable to respond.'
          schema:
            $ref: '#/definitions/http_error'
      tags:
        - GET
      summary: This operation will allow Digital Partners to retreive details of active plans
      operationId: get_plan
      description: |-

        <b>Participant with Existing Plan</b></br>

        This operation will retrieve a participant's approved plan details, for up to 2 plans. This includes the Plan ID, Plan Start Date and Plan End Date. In order to get a successful response, Digital Partners will require the Participant's NDIS Number, Surname and DOB.
        * Plan First Start Date will have 0001-01-01 by default.

        Existing participant migrated to PACE should use current NDIS number

        <b>Participant with PACE Plan</b></br>

        This operation will retrieve a participant's approved plan details, there will be only 1 plan
        New participant created in PACE should use NDIS number from PACE

        <b>Note:</b> 
        * Access to a participants plan will be through consent only 
        * It will display single response - not a list of plans and it will be Plan for life
        * Participant Plan ID will not be applicable
        * Plans will have default 3 years for Start Date and End Date and will be reviewed after 3 years
    parameters:
      - $ref: '#/parameters/participant'
      - $ref: '#/parameters/participant_surname'
      - $ref: '#/parameters/date_of_birth'
      - $ref: '#/parameters/authorization'
  /goals:
    get:
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/get_plan_goals_response'
      tags:
        - GET
      summary: This operation will allow Digital Partners to retrieve details of Participant's goal for approved Plan
      operationId: get_plan_goals
      description: |-

        <b>Participant with Existing Plan</b></br>

        This API operation will retrieve the goals and nominee details associated to a participant's plan. 
        Existing participant migrated to PACE should use current NDIS number

        All Digital Partners (Registered Providers, Plan Managers and Support Co-ordinators) will be able to view the below plan details:

        - Plan Goals include (Short Term Goals)
        - Medium to Long term goals
        - Nominee details     

        In addition to the above plan details, only Support Co-ordinators will additionally be able to view the below plan details:

        - About Participant 
        - Participant Community and Mainstream Supports.

        In order to get a successful response, there must exist an active service booking directly linked to the participant and consent to share plan must be active.  

        <b>Participant with PACE Plan</b></br>

        This API operation will retrieve the active goals details associated to a participant's plan. 

        All Digital Partners (Registered Providers, Plan Managers) will be able to view the below plan details:

        - Plan Goals
        - In order to get a successful response,  the consent to share plan must be given.
        - New participant created in PACE should use NDIS number from PACE

        <b>Note:</b> 
        * No more Short/Long term goals in PACE 
    parameters:
      - name: participant
        type: integer
        required: true
        in: header
        description: NDIS number of Participant
        format: int64
        x-example: 430111111
      - name: participant_surname
        type: string
        required: true
        in: query
        description: Participant surname
        x-example: surname
      - name: date_of_birth
        type: string
        required: true
        in: query
        description: Participant DOB
        format: date
      - $ref: '#/parameters/participant_plan_id'
      - $ref: '#/parameters/authorization'
parameters:
  authorization:
    name: authorization
    type: string
    required: true
    in: header
    description: Bearer token
    x-example: valid Authorizaton Token
  participant:
    name: participant
    type: string
    required: true
    in: query
    description: NDIS number of Participant
    x-example: 430111111
  participant_surname:
    name: participant_surname
    type: string
    required: true
    in: query
    description: Participant surname
    x-example: surname
  date_of_birth:
    name: date_of_birth
    type: string
    required: true
    in: query
    description: Participant DOB
    format: date
  participant_plan_id:
    name: participant_plan_id
    type: integer
    required: false
    in: header
    description: Plan ID for which details are required
    format: int64
    x-example: 1011111
definitions:
  get_plans_response:
    description: Response for getting approved plans for a Participant
    properties:
      success:
        type: boolean
        example: true
        description: Status of the request
      result:
        $ref: '#/definitions/get_plan_response_data_array'
        description: Result of the request
      errors:
        $ref: '#/definitions/errors'
        description: Array of string errors
    additionalProperties: false
    required:
      - success
  get_plan_response_data_array:
    type: array
    items:
      $ref: '#/definitions/get_plan_response_data'
  get_plan_response_data:
    properties:
      is_pace_plan:
        type: boolean
        description: Is PACE plan status
        example: true
      participant_plan_id:
        type: integer
        description: Participant Plan-id
        maxLength: 10
        example: 1010101
        format: int32
      plan_start_date:
        type: string
        description: Plan Start Date
        format: date
        example: '2020-01-31'
      plan_end_date:
        type: string
        description: Plan End (Review) Date
        format: date
        example: '2020-03-24'
      plan_first_start_date:
        type: string
        description: Plans First start Date
        format: date
        example: '2020-03-24'
    additionalProperties: false
  get_plan_goals_response:
    properties:
      success:
        type: boolean
        description: Status of the request
        example: true
      result:
        description: Result of the request
        $ref: '#/definitions/get_plan_goals_response_data'
      errors:
        $ref: '#/definitions/errors'
        description: Array of string errors
    additionalProperties: false
    required:
      - success
  get_plan_goals_response_data:
    properties:
      is_pace_plan:
        type: boolean
        description: Is PACE plan status
        example: true
      participant_plan_id:
        type: integer
        description: Plan ID for which budget is required
        example: 100234
        format: int32
      about_participant:
        description: Details about participant
        $ref: '#/definitions/about_participant_data'
      plan_goals:
        description: List of plan goals
        $ref: '#/definitions/plan_goals_array'
      medium_to_long_term_goals:
        description: Medium to Long Term Life Goals
        $ref: '#/definitions/medium_to_long_term_goals_array'
      nominee:
        description: Nominee Details
        $ref: '#/definitions/nominee_array'
      my_supports:
        description: My supports Details
        $ref: '#/definitions/my_supports_array'
      goals:
        description: My supports Details
        $ref: '#/definitions/goals_array'
    additionalProperties: false
  about_participant_data:
    properties:
      living_arrangements:
        type: string
        description: Where I live and the people who support me
        example: 'CONSUMABLES: Living Arrangements'
      daily_life:
        type: string
        description: My daily life
        example: 'CONSUMABLES: This is my daily life'
      strengths:
        type: string
        description: Strengths
        example: Test strengths
      provided_by:
        type: string
        description: Provided By
        example: Plan nominee
    additionalProperties: false
  plan_goals_array:
    type: array
    items:
      $ref: '#/definitions/plan_goals_data'
  plan_goals_data:
    properties:
      short_goal_text:
        type: string
        description: Short term goal text
        example: simple
      short_goal_type:
        type: string
        description: Short term goal type
        example: CCR
      short_goal_items:
        description: List of short goal items
        $ref: '#/definitions/short_goal_items'
    additionalProperties: false
  short_goal_items:
    type: array
    items:
      $ref: '#/definitions/short_goal_item_data'
  short_goal_item_data:
    properties:
      short_how_achieve:
        type: string
        description: How will the participant achieve short term goal
        example: with categories all 1k, SBs and PayReqs
      short_how_support:
        type: string
        description: How will the participant be supported during short term goal
        example: with categories all 1k, SBs and PayReqs
    additionalProperties: false
  medium_to_long_term_goals_array:
    type: array
    items:
      $ref: '#/definitions/medium_to_long_term_goals_data'
  medium_to_long_term_goals_data:
    properties:
      long_goal_text:
        type: string
        description: Long term goal text
        example: complex
      long_goal_type:
        type: string
        description: Long term goal type
        example: SCC
      long_goal_items:
        description: List of long goal items
        $ref: '#/definitions/long_goal_items'
    additionalProperties: false
  long_goal_items:
    type: array
    items:
      $ref: '#/definitions/long_goal_item_data'
  long_goal_item_data:
    properties:
      long_how_achieve:
        type: string
        description: How will the participant achieve long term goal
        example: with categories all 1k, SBs and PayReqs
      long_how_support:
        type: string
        description: How will the participant be supported during long term goal
        example: with categories all 1k, SBs and PayReqs
    additionalProperties: false
  nominee_array:
    type: array
    items:
      $ref: '#/definitions/nominee_data'
  nominee_data:
    properties:
      nominee_name:
        type: string
        description: Nominee name
        example: Business  Admin04
      nominee_relationship_type:
        type: string
        description: Nominee relationship type
        example: ZPNM
    additionalProperties: false
  my_supports_array:
    type: array
    items:
      $ref: '#/definitions/my_supports_data'
  my_supports_data:
    properties:
      support_goal_type:
        type: string
        description: support goal Type
        example: MAI
      description:
        type: string
        description: Description
        example: 'CONSUMABLES: MainStream Adjustment'
    additionalProperties: false
  goals_array:
    type: array
    items:
      $ref: '#/definitions/goals_data'
  goals_data:
    properties:
      goal_created:
        type: string
        description: support goal Type
        example: MAI
      how_reach:
        type: string
        description: How to reach goal
        example: how to reach goal
      goal_description:
        type: string
        description: Goal Description
        example: goal description
    additionalProperties: false
  errors:
    description: A set of errors
    type: array
    items:
      type: string
      example: error
  http_error:
    description: A single HTTP response
    properties:
      http_code:
        type: string
        example: 400
        description: HTTP status code
      http_message:
        type: string
        example: Bad Request
        description: HTTP Message
      more_information:
        type: string
        example: One or more required API parameters are missing.
        description: Additional information
    additionalProperties: false
tags: []
