Skip to content

Quickstart Tutorial for Mac Linux

Johnsd11 edited this page Jan 17, 2024 · 6 revisions

Before beginning this tutorial, please install DeepPhe-CR for Mac-Linux and Docker for Mac or Linux.

Step 1: Build dphe-stream-nginx and dphe-stream images

The first step after downloading, is to navigate to the downloaded folder in your terminal where you can find the docker-compose.yml:
run this command in your terminal.

docker-compose build --no-cache

Step 2:

This command spins up all the services (in the background as detached mode and leaves them running) defined in the docker-compose.yml and aggregates the output of each container.

Note: Make sure the port 8080 and 8181 are not already allocated, otherwise the containers would fail to start.

docker-compose up -d

Step 3: Download Postman

You can find the latest version of Postman for Mac here

Step 4: Interact with the DeepPhe REST API

You will have the following API base URL for the REST API container:

  • dphe-stream: http://localhost:8080/deepphe

Please remember that you'll need to send over the auth token (specified prior the docker build) in the Authorization header for each HTTP request:

Authorization: Bearer <token>

Note, if desired, replace the <token> with your custom token value, the default is AbCdEf123456. And if the auth token is missing from request or an invalid token being used, you'll get the HTTP 401 Unauthorized response.

Submit a document, do not cache information

REST API Value
HTTP method GET
Resource pattern http://localhost:8080/deepphe/summarizeDoc/doc/<docId>
HTTP Headers Content-Type: text/plain
Authorization: Bearer <token>
HTTP request body Text content of document
Response JSON object of resuting data

Submit a document, cache information for patient summary

The patient ID is not used in document processing but is required for future patient summarization.

REST API Value
HTTP method PUT
Resource pattern http://localhost:8080/deepphe/summarizePatientDoc/patient/<patientId>/doc/<docId>
HTTP Headers Content-Type: text/plain
Authorization: Bearer <token>
HTTP request body Text content of document
Response JSON object of simple message

You can also queue up the process by using the following call:

REST API Value
HTTP method PUT
Resource pattern http://localhost:8080/deepphe/queuePatientDoc/patient/<patientId>/doc/<docId>
HTTP headers Content-Type: text/plain
Authorization: Bearer <token>
HTTP request body Text content of document
Response JSON object of simple message

For this call, you will just get back a simple JSON message since the text processing is queued up, for example:

{'name': 'Document Queued', 'value': 'Added patientX patientX_doc1_RAD.txt to the Text Processing Queue.'}

Note: The document information cache is automatically cleaned every 15 minutes, removing any document information that has not been accessed within the last 60 minutes.

Summarize a patient

A patient summary can only be created using document information that was cached. This call doesn't require a request body.

REST API Value
HTTP method GET
Resource pattern http://localhost:8080/deepphe/summarizePatient/patient/<patientId>
HTTP headers Authorization: Bearer <token>
HTTP request body Text content of document
Response JSON object of simple message

Open the Pages section (above) to view all pages by title.

Introduction

Wiki Conventions

System Requirements

Installation
   Windows
   Mac/Linux

Tutorials
   Windows Quickstart Tutorial
   Mac Quickstart Tutorial

Licensing
Funding
Contact / Help

Clone this wiki locally