Introduction:
In this blog post, I will demonstrate how to connect Cloud Integration with Document AI. As a use case, let’s consider a scenario where a hospital registers a new patient, and the patient submits their previous prescription records. Using Document AI, we can extract relevant details such as past illnesses, allergies, and the patient’s blood group.
Document AI:
Step 1. As a pre-requisite, run a booster to activate Document AI in a trial account. Reference link: Use Trial to Set Up Account for SAP Document AI and Get Service Key
Step 2. Create a custom schema as shown below.
Step 3. Upload sample prescriptions. Here, I have uploaded two prescriptions of a patient (merged into a single PDF). Please note that all the data is fictitious.
Step 4. Verify the extraction results, if required edit and then confirm.
For this example we get confidence percentage is 51%-80%. Please note, instant learning based on feedback is available on premium edition. Reference link: Instant Learning (Premium Edition)
Cloud Integration:
For the demo, I will send the PDF to Cloud Integration using an API testing tool. Cloud Integration will then forward it to Document AI, extract the results.
The list of Document AI’s APIs can be viewed using Swagger UI. The URL for swagger can be constructed from the Service key in the format: <tenantuiurl><swagger>
To call the Document AI API to post documents, use the below API.
The content modifier is used to set the options as below.
The groovy script is used to create the multipart/form-data format. The endpoint for the 1st call is <tenantuiurl><swagger>document/jobs
The response structure of the 1st call is shown below:
Retrieve the id and use the looping processing call option to get the extraction result once the job is completed.
Use the endpoint for 2nd call to get the extraction result:<tenantuiurl><swagger>document/jobs/<id>
The groovy script is used to retrieve the field values where the confidence level is more than 60%, and format the response.
Test the iFlow endpoint using API testing tool (as shown below).
Please note that all the data are fictitious.
Conclusion:
This blog post demonstrates a prototype that integrates Document AI for real life use cases along with Cloud Integration.
Reference Link: SAP Document AI
Introduction:In this blog post, I will demonstrate how to connect Cloud Integration with Document AI. As a use case, let’s consider a scenario where a hospital registers a new patient, and the patient submits their previous prescription records. Using Document AI, we can extract relevant details such as past illnesses, allergies, and the patient’s blood group.Document AI:Step 1. As a pre-requisite, run a booster to activate Document AI in a trial account. Reference link: Use Trial to Set Up Account for SAP Document AI and Get Service KeyStep 2. Create a custom schema as shown below.Step 3. Upload sample prescriptions. Here, I have uploaded two prescriptions of a patient (merged into a single PDF). Please note that all the data is fictitious.Step 4. Verify the extraction results, if required edit and then confirm.For this example we get confidence percentage is 51%-80%. Please note, instant learning based on feedback is available on premium edition. Reference link: Instant Learning (Premium Edition)Cloud Integration:For the demo, I will send the PDF to Cloud Integration using an API testing tool. Cloud Integration will then forward it to Document AI, extract the results. The list of Document AI’s APIs can be viewed using Swagger UI. The URL for swagger can be constructed from the Service key in the format: <tenantuiurl><swagger>To call the Document AI API to post documents, use the below API.The content modifier is used to set the options as below.The groovy script is used to create the multipart/form-data format. The endpoint for the 1st call is <tenantuiurl><swagger>document/jobsThe response structure of the 1st call is shown below:Retrieve the id and use the looping processing call option to get the extraction result once the job is completed.Use the endpoint for 2nd call to get the extraction result:<tenantuiurl><swagger>document/jobs/<id>The groovy script is used to retrieve the field values where the confidence level is more than 60%, and format the response.Test the iFlow endpoint using API testing tool (as shown below).Please note that all the data are fictitious.Conclusion:This blog post demonstrates a prototype that integrates Document AI for real life use cases along with Cloud Integration. Reference Link: SAP Document AI Read More Technology Blog Posts by Members articles
#SAP
#SAPTechnologyblog