This library provides easy access to Ornament API for external patient portals.
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.
OrnamentSDK
and initialize it with API key
that you obtained earlierimport OrnamentSDK from '@ornament-health/lab-reports';
interface Config {
apiKey: string;
}
OrnamentSDK.init(config);
Check out Config
docs here
send()
method:OrnamentSDK.send({
email: '[email protected]',
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: '[email protected]',
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
Full documentation can be accessed here
Generated using TypeDoc