Schema for Hospital API Settings

From APISettings.schema.yaml (hospital/APISettings.schema)

---
$id: https://skeleton.botmd.io/hospital/APISettings.schema
$schema: http://json-schema.org/draft-07/schema#

title: API Settings
description: >-
  `Hospital.api_settings` stores the credentials and information required to communicate with Hospital API (via the `HospitalAPI` class).
  This is not exposed to the frontend and is dependent on the hospital.

anyOf:
  - $ref: "#/definitions/NUHS"
  - $ref: "#/definitions/XLSX"
  - $ref: "#/definitions/Airtable"
  - $ref: "#/definitions/Google Sheet"
  - $ref: "#/definitions/Internal Users"
  - $ref: "#/definitions/Sync"
#end anyOf

definitions:
  NUHS:
    title: NUHS
    description: Settings for connecting to NUHS API. This is managed by GCTO.

    type: object
    additionalProperties: false
    required: [api_url, api_key]
    properties:
      api_url:
        title: URL
        description: URL for the API.
        type: string
        format: uri

      api_key:
        title: Key
        description: API key for authorization
        type: string
        minLength: 1

      internal_users:
        title: Internal Users
        description: Whether to include internal users.
        type: boolean
    #end properties
  #end NUGS

  XLSX:
    title: XLSX provider
    description: Settings to user xlsx file as API provider.

    type: object
    additionalProperties: false
    required: [xlsx_uri, xlsx_api_id_scheme]
    properties:
      xlsx_uri:
        title: URL
        description: URL for xlsx file
        type: string
        format: uri
      xlsx_sheet_nos:
        title: Sheet No
        description: Sheet number to parse
        type: array
        items:
          type: integer
      xlsx_api_id_scheme:
        title: API schema
        description: Schema of the API provider
        type: string
      internal_users:
        title: Internal Users
        description: Whether to include internal users.
        type: boolean
    #end properties
  #end XLSX

  Airtable:
    title: Airtable
    description: Settings for using any Airtable as a directory API.

    type: object
    additionalProperties: false
    required: [airtable_url, ii_column]
    properties:
      airtable_url:
        title: Airtable URL
        description: "`airtable://` URL."
        type: string
        pattern: '^airtable\:\/\/[a-zA-Z0-9]+\/.+$'

      ii_column:
        title: Identifiable Information Column
        description: "Airtable column name for identifiable information. Example: `Phone`, `E-mail`"
        type: string
        minLength: 1

      ii_type:
        title: Identifiable Information Type
        description: Type of identifiable information. Defaults to `phone`.

        enum: [phone, email]

      additional_tags:
        title: Additional Tags
        description: Additional tags that can be added to users authorized via this API.
        type: array
        minItems: 1
        items:
          type: string
          minLength: 1

      additional_settings:
        title: Additional Settings
        description: Additional settings that can be added to users authorized via this API.
        type: object
        additionalProperties: true
    #end properties
  #end Airtable

  Google Sheet:
    title: Google Sheet provider
    description: Settings for Google Sheet as API provider.

    type: object
    additionalProperties: false
    required: [google_sheet_uri, google_sheet_api_id_scheme, google_sheet_ii_type]
    properties:
      google_sheet_uri:
        title: URL
        description: URL for Google Sheet
        type: string
        format: uri
      google_sheet_api_id_scheme:
        title: API schema
        description: Schema of the API provider
        type: string
      google_sheet_ii_type:
        title: II Type
        description: Type of identifiable information. It can be set as `email` or `phone`
        type: string
      internal_users:
        title: Internal Users
        description: Whether to include internal users.
        type: boolean
    #end properties
  #end Google Sheet

  Internal Users:
    title: Internal Users
    description: Settings for the `InternalUsersAPI`.

    type: object
    additionalProperties: false
    required: []
    properties:
      airtable_url:
        title: Airtable URL
        description: "`airtable://` URL."
        type: string
        pattern: '^airtable\:\/\/[a-zA-Z0-9]+\/.+$'

      ii_column:
        title: Identifiable Information Column
        description: "Airtable column name for identifiable information. Example: `Phone`, `E-mail`"
        type: string
        minLength: 1

      ii_type:
        title: Identifiable Information Type
        description: Type of identifiable information. Defaults to `phone`.

        enum: [phone, email]

      additional_tags:
        title: Additional Tags
        description: Additional tags that can be added to users authorized via this API.
        $ref: "ProfileTags.schema"

      additional_settings:
        title: Additional Settings
        description: Additional settings that can be added to users authorized via this API.
        $ref: "ProfileSettings.schema"
    #end properties
  #end Internal Users

  Sync:
    title: Sync
    description: Sync user list
    type: object
    required: []
    additionalProperties: false
    properties:
      sync_hospital_profiles:
        title: Sync Hospital Profiles
        description: Sync hospital profiles using HospitalAPI. Enabling this flag will sync user's hospital profile with hospital API as well as log user out if user no longer found in the API.
        type: boolean

      sync_directory_profiles:
        title: Sync directory profiles
        description: Sync directory profiles using latest file in s3. Enabling this flag will add/update/expire directory profile based on the information in file.
        type: boolean

      sync_file_url:
        title: File URL
        description: URL for file. This file will be sync against directory profiles daily.
        type: string

      sync_s3_bucket_url:
        title: S3 Bucket URL
        description: URL for S3 Bucket. All the file uploaded from mastermind will be store in the s3 bucket. Lastest file in the bucket will be sync against directory profiles daily.
        type: string
#end definitions

[Main Page] [Schema Documentation] [Examples]