Hierarchy

  • OrnamentSDK

Constructors

Properties

apiKey?: string
baseUrl: string = API_BASE_URL
initialized: boolean = false
parallelUploads: number = 1
patients: ConnectedPatient[] = []

Methods

  • Parameters

    • url: string

      url to PDF file to download

    • onProgress: ((progress) => void)
        • (progress): void
        • Parameters

          • progress: number

          Returns void

    Returns Promise<Blob>

    Throws

    server error while downloading file

    Throws

    invalid file mime type or file size is too large

  • Parameters

    • email: string
    • age: number = 0
    • sex: Sex = 'U'
    • name: string = ...

    Returns Promise<string>

  • Initializes SDK with given Config. Call this method before using SDK

    Parameters

    • config: Config

      object with API key

    Returns Promise<void>

  • This method will send PDF files from provided links to the Ornament API.

    If user with given e-mail does not exist, it will be created and connected to your account. Digitized lab reports will be displayed in the Lab Reports section of the patient with given e-mail.

    For every url provided will be created a task. Method will return an array of length equal to urls.length where each item will be UploadResult corresponded to each url by index See UploadResult for more information

    Parameters

    Returns Promise<UploadResult[]>

    Throws

    InitializationError ServerError ForbiddenPatientError BadRequestError

    Example

    const result = await OrnamentSDK.send({
    email: '[email protected]',
    urls: [
    'https://example.com/my_lab_report_1.pdf',
    'https://example.com/my_lab_report_2.pdf',
    'https://example.com/my_lab_report_3.pdf',
    ],
    });

    * const result = await OrnamentSDK.send({
    email: '[email protected]',
    files: [
    blob1,
    blob2,
    ],
    });

    // result = [UploadResult<urls[0]>, UploadResult<urls[1]>, UploadResult<urls[2]>]
  • Parameters

    • pid: string
    • file: Blob
    • onProgress: ((progress) => void)
        • (progress): void
        • Parameters

          • progress: number

          Returns void

    Returns Promise<Imageset>

Generated using TypeDoc