{
  "openapi": "3.0.1",
  "info": {
    "title": "Standard Diagnostic Interface (SDI)",
    "description": "The SDI is a combination of a subset of ezyVet's API and the diagnostic provider's API that provides customers a consistent workflow experience.",
    "license": {
      "name": "ezyVet API license",
      "url": "https://www.ezyvet.com/private-api-terms-and-conditions"
    },
    "contact": {
      "email": "apisupport-ezyvet@idexx.com"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.ezyvet.com",
      "description": "ezyVet Production Environment"
    },
    {
      "url": "https://api.trial.ezyvet.com",
      "description": "ezyVet Trial Environment"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.ezyvet.com/v1/oauth/access_token",
            "scopes": {
              "read-diagnosticresult": "Read diagnostic result resources",
              "read-separation": "Read separation resources",
              "write-diagnosticresult": "Create and update diagnostic result resources"
            }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BadRequest"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InternalError"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not Found",
        "content": {
          "text/html": {
            "schema": {
              "$ref": "#/components/schemas/NotFound"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Too Many Requests",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TooManyRequests"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Unauthorized"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UnprocessableEntity"
            }
          }
        }
      }
    },
    "schemas": {
      "BadRequest": {
        "description": "Bad Request",
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "properties": {
                "id": {
                  "type": "string",
                  "example": "error_3YLvb0V7eXcHqgGauTjDy"
                },
                "status": {
                  "type": "string",
                  "example": "400"
                },
                "code": {
                  "type": "string",
                  "example": "100001"
                },
                "title": {
                  "type": "string",
                  "example": "The authorization grant type is not supported by the authorization server."
                },
                "detail": {
                  "type": "string",
                  "example": "The authorization grant type is not supported by the authorization server."
                }
              }
            }
          }
        }
      },
      "Breeds-Species": {
        "title": "Breeds & Species",
        "type": "object",
        "description": "A JSON object containing information related to breeds and species.",
        "properties": {
          "species": {
            "type": "array",
            "items": {
              "properties": {
                "code": {
                  "type": "string",
                  "description": "The code of the species.",
                  "example": "CANINE"
                },
                "name": {
                  "type": "string",
                  "description": "The name of the species.",
                  "example": "Canine"
                },
                "breeds": {
                  "type": "array",
                  "description": "A list of breeds associated to the species.",
                  "items": {
                    "properties": {
                      "code": {
                        "type": "string",
                        "description": "The code of the breed.",
                        "example": "LABRADOR_RETRIEVER"
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the breed.",
                        "example": "Labrador Retriever"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "CreateSDIDxRequest": {
        "type": "object",
        "properties": {
          "labreport": {
            "type": "object",
            "properties": {
              "Identification": {
                "$ref": "#/components/schemas/SDIDxRequest-Identification"
              },
              "AnimalDetails": {
                "$ref": "#/components/schemas/SDIDxRequest-AnimalDetails"
              },
              "LabRequests": {
                "$ref": "#/components/schemas/SDIDxRequest-LabRequest"
              }
            }
          }
        }
      },
      "CreateSDIDxResult": {
        "type": "object",
        "description": "A JSON object containing the lab report details.",
        "properties": {
          "labreport": {
            "type": "object",
            "properties": {
              "LabReport": {
                "type": "object",
                "properties": {
                  "Identification": {
                    "$ref": "#/components/schemas/CreateSDIDxResult-Identification"
                  },
                  "AnimalDetails": {
                    "$ref": "#/components/schemas/CreateSDIDxResult-AnimalDetails"
                  },
                  "LabResults": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "LabResult": {
                          "$ref": "#/components/schemas/CreateSDIDxResult-LabResult"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "Identification",
                  "AnimalDetails"
                ]
              }
            },
            "required": [
              "LabReport"
            ]
          }
        },
        "required": [
          "labreport"
        ]
      },
      "CreateSDIDxResult-AnimalDetails": {
        "type": "object",
        "properties": {
          "AnimalID": {
            "example": 1,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "AnimalName": {
            "type": "string",
            "example": "Mini"
          },
          "Breed": {
            "type": "string",
            "example": "Border Collie"
          },
          "Gender": {
            "type": "string",
            "example": "MN"
          },
          "Species": {
            "type": "string",
            "example": "Canine"
          },
          "DateOfBirth": {
            "type": "string",
            "example": "2011-03-07T00:00:00.000Z"
          }
        },
        "required": [
          "AnimalID"
        ]
      },
      "CreateSDIDxResult-Identification": {
        "type": "object",
        "properties": {
          "ReportType": {
            "type": "string",
            "example": "request"
          },
          "PracticeID": {
            "type": "string",
            "example": "0"
          },
          "PracticeRef": {
            "type": "string",
            "example": "NZ0-DR158"
          },
          "LaboratoryID": {
            "type": "string",
            "example": "200314"
          },
          "LaboratoryRef": {
            "type": "string",
            "example": "Panny Farm"
          },
          "PIMSName": {
            "type": "string",
            "example": "ezyVet"
          },
          "PIMSVersion": {
            "example": "21.80",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "OwnerName": {
            "type": "string",
            "example": "Sales, Cash"
          },
          "OwnerId": {
            "example": 2,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "VetName": {
            "type": "string",
            "example": "Team Star"
          },
          "VetID": {
            "example": 10,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "BillingType": {
            "type": "string",
            "example": "Practice"
          }
        },
        "required": [
          "PracticeRef"
        ]
      },
      "CreateSDIDxResult-LabResult": {
        "type": "object",
        "description": "A JSON object containing information regarding a lab result.",
        "properties": {
          "LabResultHeader": {
            "$ref": "#/components/schemas/CreateSDIDxResult-LabResult-Header"
          },
          "LabResultItems": {
            "type": "array",
            "items": {
              "properties": {
                "LabResultItem": {
                  "$ref": "#/components/schemas/CreateSDIDxResult-LabResult-Item"
                }
              }
            }
          },
          "attachment_list": {
            "type": "array",
            "items": {
              "properties": {
                "content_upload_method": {
                  "type": "string",
                  "example": "base64"
                },
                "content_type": {
                  "type": "string",
                  "example": "jpg"
                },
                "content_name": {
                  "type": "string",
                  "example": "four_pixels.jpg"
                },
                "content_binary": {
                  "type": "string",
                  "example": "/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABgESAAMAAAABAAEAAAMBAAUAAAABAAAAVgMDAAEAAAABAA AAEQAAEAAAABAQAAAFERAAQAAAABAAAOw1ESAAQAAAABAAAOwwAAAAAAAYagAACxj//bAEMAAgEBAgEBAgICAgICAgIDBQMDA wMgQEAwUHBgcHBwYHBwgJCwkICAoIBwcKDQoKCwwMDAwHCQ4PDQwOCwwMDP/bAEMBAgICAwMDBgMDBgwIBwgMDAwMDA wMwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDP/AABEIAAIAAgMBIgACEQEDEQH/ xAAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMo GRgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpO UlXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBA AAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SX xFZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4 ubw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AOT8XfBPwZJ4r1Rm8I+GGZruUknS4Mk7z/s0UUV+NR2P 0/96qf4n+bP//Z"
                }
              },
              "required": [
                "content_upload_method",
                "content_type",
                "content_name",
                "content_binary"
              ]
            }
          }
        },
        "required": [
          "LabResultHeader"
        ]
      },
      "CreateSDIDxResult-LabResult-Header": {
        "type": "object",
        "properties": {
          "TestCode": {
            "type": "string",
            "example": "CBC"
          },
          "TestName": {
            "type": "string",
            "example": "New SDI Result"
          },
          "TestType": {
            "type": "string",
            "example": "Bloodtest"
          },
          "ResultDate": {
            "type": "string",
            "example": "2012-12-15T12:12:12.000Z"
          },
          "ResultNotes": {
            "type": "string",
            "example": ""
          }
        },
        "required": [
          "TestCode",
          "ResultDate"
        ]
      },
      "CreateSDIDxResult-LabResult-Item": {
        "type": "object",
        "properties": {
          "AnalyteName": {
            "type": "string",
            "example": "Blood Level"
          },
          "Result": {
            "type": "string",
            "example": "50"
          },
          "Units": {
            "type": "string",
            "example": "p"
          },
          "LowRange": {
            "type": "number",
            "example": 1
          },
          "HighRange": {
            "type": "number",
            "example": 100
          },
          "PathologistName": {
            "type": "string",
            "example": "Sally"
          },
          "PathologistTitle": {
            "type": "string",
            "example": "Ms"
          },
          "Qualifier": {
            "type": "string",
            "example": "qualifier"
          },
          "Notes": {
            "type": "string",
            "example": "notes"
          }
        },
        "required": [
          "AnalyteName",
          "Result",
          "Units"
        ]
      },
      "CreateSDIResult": {
        "type": "object",
        "properties": {
          "message": {
            "type": "array",
            "items": {
              "properties": {
                "level": {
                  "type": "string",
                  "example": "info"
                },
                "text": {
                  "type": "string",
                  "example": "Inserted AU0-DR5. Specifics: ..."
                }
              }
            }
          }
        }
      },
      "DirectoryOfService": {
        "title": "Directory of Service",
        "type": "object",
        "properties": {
          "directoryofservice": {
            "type": "object",
            "description": "A JSON object containing information related to the directory of service.",
            "properties": {
              "Test": {
                "type": "array",
                "description": "An array of JSON objects that represent individual diagnostic tests.",
                "items": {
                  "properties": {
                    "Name": {
                      "type": "string",
                      "description": "The name of the test",
                      "example": "Complete Blood Count"
                    },
                    "Code": {
                      "type": "string",
                      "description": "The code of the test. (The Diagnostic Code)",
                      "example": "CBC"
                    },
                    "Replicate": {
                      "type": "string",
                      "description": "Flag for replication",
                      "example": "0"
                    },
                    "validFrom": {
                      "type": "string",
                      "description": "The date from which the test is valid.",
                      "example": "2012-12-13"
                    },
                    "ExcVAT": {
                      "type": "string",
                      "description": "Price of the Test Excluding VAT amount.",
                      "example": "50"
                    },
                    "Currency": {
                      "type": "string",
                      "description": "The currency of the Price (ExcVAT).",
                      "example": "USD"
                    },
                    "NonDiscountable": {
                      "type": "string",
                      "description": "True if non discountable, False otherwise.",
                      "example": "true"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "InternalError": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "error_5JBMuXC69QQoPpKDFoBow"
          },
          "status": {
            "type": "string",
            "example": "500"
          },
          "code": {
            "type": "string",
            "example": ""
          },
          "title": {
            "type": "string",
            "example": "An internal server error occurred"
          },
          "detail": {
            "type": "string",
            "example": "An error occured, please contact API support with the id, status and code provided with the response."
          }
        }
      },
      "NotFound": {
        "type": "string",
        "example": "No input file specified."
      },
      "PartnerAuthentication": {
        "properties": {
          "access_token": {
            "type": "string",
            "example": "CnKAVqSqp6UBq3Ei17e1UIj2U39UuOQI1i9Db3QT"
          },
          "token_type": {
            "type": "string",
            "example": "Bearer"
          }
        }
      },
      "SDIDxRequest-AnimalDetails": {
        "type": "object",
        "properties": {
          "AnimalID": {
            "example": 1,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "AnimalName": {
            "type": "string",
            "example": "Mini"
          },
          "Breed": {
            "type": "string",
            "example": "Border Collie"
          },
          "Gender": {
            "type": "string",
            "example": "MN"
          },
          "Species": {
            "type": "string",
            "example": "Canine"
          },
          "Weight": {
            "type": "string",
            "example": "1.0000"
          },
          "WeightUnit": {
            "type": "string",
            "example": "kg"
          },
          "Age": {
            "type": "string",
            "example": "6Y 5M 15D"
          },
          "DateOfBirth": {
            "type": "string",
            "example": "2011-03-07T00:00:00.000Z"
          },
          "AbbreviatedHistory": {
            "type": "string",
            "example": "Some History"
          },
          "AdditionalFields": {
            "$ref": "#/components/schemas/SDIDxRequest-AnimalDetails-AdditionalFields"
          }
        }
      },
      "SDIDxRequest-AnimalDetails-AdditionalFields": {
        "type": "object",
        "properties": {
          "AnimalCode": {
            "example": "100001",
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ]
          },
          "BreedCode": {
            "type": "string",
            "example": "BORDCOL"
          },
          "SpeciesCode": {
            "type": "string",
            "example": "C"
          },
          "ConsultCode": {
            "type": "string",
            "example": "300003"
          }
        }
      },
      "SDIDxRequest-Identification": {
        "type": "object",
        "properties": {
          "ReportType": {
            "type": "string",
            "example": "request"
          },
          "PracticeRef": {
            "type": "string",
            "example": "NZ0-DR158"
          },
          "PIMSName": {
            "type": "string",
            "example": "ezyVet"
          },
          "PIMSVersion": {
            "example": "21.80",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "OwnerName": {
            "type": "string",
            "example": "Sales, Cash"
          },
          "OwnerId": {
            "example": 2,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "VetName": {
            "type": "string",
            "example": "Team Star"
          },
          "VetID": {
            "example": 10,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          }
        }
      },
      "SDIDxRequest-LabRequest": {
        "type": "object",
        "properties": {
          "LabRequest": {
            "type": "array",
            "items": {
              "properties": {
                "TestCode": {
                  "type": "string",
                  "example": "AR1PE"
                },
                "RequestStatus": {
                  "type": "string",
                  "example": "request"
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "error_5JBMuXC69QQoPpKDFoBow"
          },
          "status": {
            "type": "string",
            "example": "429"
          },
          "code": {
            "type": "string",
            "example": ""
          },
          "title": {
            "type": "string",
            "example": "Too Many Requests"
          },
          "detail": {
            "type": "string",
            "example": "Too Many Requests"
          }
        }
      },
      "Unauthorized": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "properties": {
                "level": {
                  "type": "string",
                  "example": "error"
                },
                "type": {
                  "type": "string",
                  "example": "InvalidRequestException"
                },
                "text": {
                  "type": "string",
                  "example": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \\\"access token\\\" parameter."
                },
                "fields": {
                  "type": "array",
                  "example": [],
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "UnprocessableEntity": {
        "title": "Unprocessable Entity",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "error_5JBMuXC69QQoPpKDFoBow"
          },
          "status": {
            "type": "string",
            "example": "422"
          },
          "code": {
            "type": "string",
            "example": ""
          },
          "title": {
            "type": "string",
            "example": "Unprocessable Entity"
          },
          "detail": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        }
      },
      "UpdateSDIResult": {
        "type": "object",
        "properties": {
          "message": {
            "type": "array",
            "items": {
              "properties": {
                "level": {
                  "type": "string",
                  "example": "info"
                },
                "text": {
                  "type": "string",
                  "example": "Updated AU0-DR5. Specifics: ..."
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/accesstoken": {
      "servers": [
        {
          "url": "https://partnerurl.com"
        }
      ],
      "post": {
        "security": [],
        "operationId": "get-partner-token",
        "tags": [
          "Partner Authentication"
        ],
        "summary": "Get an access token from the partner",
        "description": "This endpoint must be implemented by the Partner. \n\nThis endpoint will allow ezyVet to authenticate and use the Partner's web services\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string",
                    "example": "partner-clinic"
                  },
                  "client_secret": {
                    "type": "string",
                    "example": "partner-secret"
                  },
                  "grant_type": {
                    "type": "string",
                    "example": "client_credentials"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns an access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerAuthentication"
                }
              }
            }
          },
          "400": {
            "description": "Error Message From Partner",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Cannot process this request."
                }
              }
            }
          }
        }
      }
    },
    "/v1/oauth/access_token": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Fetch a JWT bearer token",
        "operationId": "get-token",
        "servers": [
          {
            "url": "https://api.ezyvet.com",
            "description": "ezyVet production environment"
          },
          {
            "url": "https://api.trial.ezyvet.com",
            "description": "ezyVet trial environment"
          }
        ],
        "description": "Generates a valid access token, given client credentials. Access tokens have an 12-hour TTL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "partner_id": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "grant_type": {
                    "type": "string",
                    "default": "client_credentials"
                  },
                  "scope": {
                    "type": "string"
                  },
                  "site_uid": {
                    "type": "string"
                  }
                },
                "required": [
                  "partner_id",
                  "client_id",
                  "client_secret",
                  "grant_type",
                  "scope",
                  "site_uid"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A JSON object containing the access token details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": []
      }
    },
    "/v2/separation": {
      "get": {
        "summary": "Fetch a Separation list",
        "description": "Fetches a list containing Separations.\nSeparations are a complex part of the ezyVet API and is important to understand. \nPlease read [this document](/guides/understanding-separations) to ensure you have an adequate understanding.",
        "operationId": "get-separationv2",
        "tags": [
          "Separations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "The ID number used by the system to uniquely identify a [`Separation`](#get-separationv2)."
          },
          {
            "name": "uid",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The ID number used by the system to uniquely identify a [`Separation`](#get-separationv2) across all ezyVet sites."
          },
          {
            "name": "active",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "If **true**, the [`Separation`](#get-separationv2) is active and usable in ezyVet."
          },
          {
            "name": "created_at",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "The epoch time when the [`Separation`](#get-separationv2) was created."
          },
          {
            "name": "modified_at",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "The epoch time when the [`Separation`](#get-separationv2) was last modified."
          }
        ],
        "responses": {
          "200": {
            "description": "A list of separations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "items_page": {
                          "type": "string"
                        },
                        "items_page_total": {
                          "type": "string"
                        },
                        "items_page_size": {
                          "type": "string"
                        },
                        "items_total": {
                          "type": "string"
                        }
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "separation": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "number"
                              },
                              "uid": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "number"
                              },
                              "modified_at": {
                                "type": "number"
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "parent": {
                                "type": "number"
                              },
                              "child": {
                                "type": "number"
                              },
                              "separation_type": {
                                "type": "string"
                              },
                              "contact_id": {
                                "type": "number"
                              },
                              "contact_uid": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "bearerAuth": [
              "read-separation"
            ]
          }
        ]
      }
    },
    "/breedsandspecies": {
      "servers": [
        {
          "url": "https://partnerurl.com"
        }
      ],
      "get": {
        "operationId": "get-dx-breeds+species",
        "tags": [
          "Breeds & Species"
        ],
        "summary": "Get species and breeds",
        "description": "This endpoint must be implemented by the Partner. \n\nThis endpoint will allow ezyVet to get a list of animal species and breeds.\n",
        "responses": {
          "200": {
            "description": "Returns a list of species & breeds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Breeds-Species"
                }
              }
            }
          },
          "400": {
            "description": "Error Message From Partner",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Cannot process this request."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/diagnosticcodes": {
      "servers": [
        {
          "url": "https://partnerurl.com"
        }
      ],
      "get": {
        "operationId": "get-dx-dos",
        "tags": [
          "Directory of Service"
        ],
        "summary": "Get diagnostic codes",
        "description": "This endpoint must be implemented by the partner. \n\nThis endpoint will allow ezyVet to get a list of diagnostic codes.\n",
        "responses": {
          "200": {
            "description": "Returns a list of diagnostic codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryOfService"
                }
              }
            }
          },
          "400": {
            "description": "Error Message From Partner",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Cannot process this request."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/diagnosticrequest": {
      "servers": [
        {
          "url": "https://partnerurl.com"
        }
      ],
      "post": {
        "operationId": "send-partner-dx-request",
        "tags": [
          "Diagnostic Request"
        ],
        "summary": "Send a diagnostic request",
        "description": "This endpoint must be implemented by the partner. \n\nezyVet will push diagnostic requests as they are made/updated/disabled to the partner's diagnostic request endpoint. \nThe partner must acknowledge the POST request with a HTTP 200 OK once they have received the diagnostic request successfully AND have been able to parse the information correctly.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSDIDxRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "external_link": {
                      "type": "string",
                      "example": "https://www.clickdimensions.com/links/TestPDFfile.pdf",
                      "description": "A PDF from the Partner that relates to the diagnostic request"
                    },
                    "status": {
                      "type": "string",
                      "example": "OK"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error Message From Partner",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Cannot process this lab request."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/externalhotlink": {
      "servers": [
        {
          "url": "https://partner-url"
        }
      ],
      "get": {
        "operationId": "get-sdi-hotlink",
        "tags": [
          "External Link"
        ],
        "summary": "Get a partner portal link for a diagnostic result",
        "description": "This endpoint must be implemented by the partner. \n\nThis endpoint will allow ezyVet to open the partner's portal in a new browser tab. The page should relate to the diagnostic result.\n",
        "parameters": [
          {
            "name": "practice_ref",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The diagnostic request ID",
            "example": "US1324-DR158"
          },
          {
            "name": "client_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "The client_id that is set up in the SDI record and used for authentication. Represents the location's connection to the Partner",
            "example": "partner-clinic"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a link to a web page to the partner's portal that is related to the queried diagnostic result"
          },
          "400": {
            "description": "Error Message From Partner",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Cannot process this request."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/requisitionform": {
      "servers": [
        {
          "url": "https://partner-url"
        }
      ],
      "get": {
        "operationId": "get-requisition-form",
        "tags": [
          "Requisition Form"
        ],
        "summary": "Get a diagnostics requisition form as PDF",
        "description": "This endpoint must be implemented by the partner. \n\nThis endpoint will allow ezyVet to open and print a diagnostics requisition form as PDF that is then sent to the lab along with a specimen relating to the diagnostic request.\n",
        "parameters": [
          {
            "name": "practice_ref",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The diagnostic request ID",
            "example": "US1324-DR158"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a link to a printable diagnostics requisition form as PDF that is sent to the lab with a specimen."
          },
          "400": {
            "description": "Error Message From Partner",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Cannot process this request."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/standarddiagnostic/labReport": {
      "post": {
        "servers": [
          {
            "url": "https://integrations.ezyvet.com/call",
            "description": "ezyVet Production Environment"
          },
          {
            "url": "https://integrations.trial.ezyvet.com/call",
            "description": "ezyVet Trial Environment"
          }
        ],
        "security": [
          {
            "bearerAuth": [
              "read-diagnosticresult",
              "write-diagnosticresult"
            ]
          }
        ],
        "operationId": "create-dx-result",
        "tags": [
          "Diagnostic Result"
        ],
        "summary": "Make a diagnostic result",
        "description": "Creates a single diagnostic result that links to a diagnostic request. \n\nYou can also upload attachments together with the creation of a diagnostic result. This can be done by encoding the file using base64 and including it in the request.\n\nThe file types supported are JPG, PNG and PDF. The maximum file size is 5MB (before encoding).\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSDIDxResult"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSDIResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/standarddiagnostic/updateResult": {
      "patch": {
        "servers": [
          {
            "url": "https://integrations.ezyvet.com/call",
            "description": "ezyVet Production Environment"
          },
          {
            "url": "https://integrations.trial.ezyvet.com/call",
            "description": "ezyVet Trial Environment"
          }
        ],
        "security": [
          {
            "bearerAuth": [
              "read-diagnosticresult",
              "write-diagnosticresult"
            ]
          }
        ],
        "operationId": "update-dx-result",
        "tags": [
          "Diagnostic Result"
        ],
        "summary": "Update a diagnostic result",
        "description": "In order to update a diagnostic result, there must already be an existing diagnostic result with the same `PracticeRef`.\n\nYou can provide a list of values for both the `diagnostic_result_item_list` and `attachment_list` parameters per request. \nProviding empty lists for either of the parameters will not update the respective parameter in ezyVet to be empty as well (instead will leave it unchanged).\n",
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSDIDxResult"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSDIResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  }
}
