Ornament WebSDK
This library provides easy access to Ornament API for external patient portals.
Table of contents
How to use
-
Register at Ornament Pro and copy your API key from account settings page here
-
Install the library with your package manager
npm i --save @ornament-health/lab-reports
// or
yarn add @ornament-health/lab-reports
Also you can add this script to your HTML file
<script src="https://unpkg.com/@ornament-health/lab-reports"></script>
And window.OrnamentSDK
will be available for usage.
- Import
OrnamentSDK
and initialize it withAPI key
that you obtained earlier
import OrnamentSDK from '@ornament-health/lab-reports';
interface Config {
apiKey: string;
}
OrnamentSDK.init(config);
Check out Config
docs here
- Now you are able to send lab reports for digitization using
send()
method:
OrnamentSDK.send({
email: 'my-patient@mail.com',
name: 'John Smith', // optional
age: 59, // optional
sex: 'M', // optional
urls: [
'https://some.site/my_lab_report_1.pdf',
'https://some.site/my_lab_report_2.pdf',
'https://some.site/my_lab_report_3.pdf',
]
});
// or uploading files directly:
OrnamentSDK.send({
email: 'my-patient@mail.com',
name: 'John Smith', // optional
age: 59, // optional
sex: 'M', // optional
files: [
blob1,
blob2,
]
});
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. name
, age
and sex
are optional params.
Full docs for send()
method here
Documentation
Full documentation can be accessed here