swagger: '2.0'
info:
  title: ProviderServices-InboundDocuments-V1
  version: '1.0'
  description: <p>Welcome to the Documents to ACC API. This is a secondary interaction linked to a Claim. This allows software vendors to have one mechanism for Providers to submit various document types:</p>
    <ul>
      <li>Extension of treatment requests – ACC32</li>
      <li>Discharge and Operation reports</li>
      <li>Surgery requests and documentation</li>
      <li>Radiology reports</li>
      <li>High Tech Imaging</li>
      <li>Guided Injection requests</li>
      <li>Specialist / GP / Other treatment provider notes.</li>
    </ul>
host: provider.api-compliance.acc.co.nz
basePath: /api/v1
schemes:
  - https
securityDefinitions:
  apiKeyHeader:
    type: apiKey
    name: apikey
    in: header
security:
  - apiKeyHeader: []
paths:
  /documents:
    post:
      tags:
        - Upload Documents
      description: 
        <p>
        Allows software vendors to create a new service with ACC; the submission of selected documents (in PDF & up to a maximum of 20MB) through the addition of set metadata. The documents are a secondary interaction generally linked to a Claim or resulting invoice.
        </p>
        <p> 
        Discussion with your customers will determine which documents would add value and whether they wish to submit the documents at the same time as they submit a claim / invoice or later or both. The documents that can be submitted through this service will grow over time; the up to date list of options is published within the relevant Specification; Appendix 1.
        </p>
      operationId: uploaddocument
      summary: Upload Document
      responses:
        '202':
          description: Accepted
          schema:
            $ref: '#/definitions/SuccessResponse'
        '400':
          description: Bad request, invalid request
          schema:
            $ref: '#/definitions/Error'     
        '401':
          description: Unauthorised, authentication error
          schema:
            $ref: '#/definitions/Error'             
        '403':
          description: Forbidden, unauthorised error
          schema:
            $ref: '#/definitions/Error' 
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Error' 
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/Error'    
        '503':
          description: Service not available
          schema:
            $ref: '#/definitions/Error'   
      consumes:
      - multipart/form-data
      parameters:
      - name: ACC-CorrelationId
        in: header
        description: >-
          Unique UUID to track the incoming requests.
        type: string
        format: uuid
        required: true
      - in: formData    
        name: document
        description: Actual document (PDF) to be uploaded
        required: true
        type: file
      - in: formData    
        name: documentMetaData
        description: Metadata as JSON Object. This should contain the additional information about the patient and the event that caused the document to be uploaded. such as claim number, event date, reason, etc. 
          Format example can be <br><b>
          <pre>
            {<br>
            &#9;<font color='red'>"contentType":"", (Mandatory)</font><br>
            &#9;"fileCreationDateTime":"yyyyMMddHHmmss",<br>
            &#9;"runId":"",<br>
            &#9;"claimReferenceNumber":"",<br>
            &#9;"consultingProviderName":"",<br>
            &#9;"dateOfConsult":"DD-MM-YYYY",<br>
            &#9;"metaDataForContentType":"",<br>
            &#9;"assessmentType":"",<br>
            &#9;"bodySite":"",<br>
            &#9;"clientNHINumber":"",<br>
            &#9;"clientFirstName":"",<br>
            &#9;"clientLastName":"",<br>
            &#9;"clientDOB":"DD-MM-YYYY",<br>
            &#9;<font color='red'>"fileExtension":"", (Mandatory)</font><br>
          }</b>
          </pre>
        required: true
        type: string
                
tags: []
definitions:
 
 SuccessResponse:
  type: object
  properties:
    message:
      type: string
      description: success message
 Error:
   type: object
   properties:
     code:
       type: string
       description: Unique Code
     message:
       type: string
       description: Human Readable description of the error
     detail:
       type: string
       description: JSON Path or Technical description of the error    