From 3b8987ecb16d29a6d9c0713ae23951b976cdab0c Mon Sep 17 00:00:00 2001 From: dannyrb Date: Sun, 28 Apr 2019 11:04:27 -0400 Subject: [PATCH] Embedded viewer deployment scenario --- docs/latest/deployment/index.md | 117 ++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/docs/latest/deployment/index.md b/docs/latest/deployment/index.md index 792855847..35be60ac7 100644 --- a/docs/latest/deployment/index.md +++ b/docs/latest/deployment/index.md @@ -9,6 +9,119 @@ your Viewer will display). Let's unpack that a little: ## Overview +The OHIF Viewer is a tool. It + +## Deployment Scenarios + +### Embedded Viewer + +The quickest and easiest way to get the OHIF Viewer up and running is to embed +it into an existing web application. + +
+ Embedded Viewer Diagram + embedded viewer diagram +
+ +1. Create a new web page or template that includes the following external + dependencies: + + + +
  1. Create a JS Object to hold the OHIF Viewer's configuration. Here are some + example values that would allow the viewer to hit our public PACS:
+ +```js +var props = { + routerBasename: '/', + rootUrl: 'https://lrjoo3znxm.codesandbox.io', + servers: { + dicomWeb: [ + { + name: 'DCM4CHEE', + wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado', + qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', + wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', + qidoSupportsIncludeField: true, + imageRendering: 'wadors', + thumbnailRendering: 'wadors', + requestOptions: { + requestFromBrowser: true, + }, + }, + ], + }, +} +``` + +
  1. + Render the viewer in the web page's target div +
+ +```js +// Made available by the `ohif-viewer` script included in step 1 +var Viewer = window.OHIFStandaloneViewer.App +var app = React.createElement(Viewer, props, null) + +ReactDOM.render(app, document.getElementById('ohif-viewer-target')) +``` + +#### Tips & Tricks + +> I'm having trouble getting this to work. Where can I go for help? + +First, check out this fully functional +[CodeSandbox](https://codesandbox.io/s/lrjoo3znxm) example. If you're still +having trouble, feel free to search or GitHub issues. Can't find anything +related your problem? Create a new one. + +> When I include bootstrap, other styles on my page no longer work correctly. +> What can I do? + +When we include `bootsrap` (and the other dependencies), they are added +globally. This has the potential of causing conflicts with other scripts and +styles on the page. To prevent this, `embed` the viewer in a new/empty web page. +Have that working? Good. Now `embed` that new page using an +[`