Skip to content

Commit

Permalink
Completed the initial Worklist display on OHIF v2 against the lambda …
Browse files Browse the repository at this point in the history
…function.
  • Loading branch information
wayfarer3130 committed Jul 2, 2021
1 parent 8de5feb commit 1eb9c5e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 30 deletions.
7 changes: 6 additions & 1 deletion amplify/backend/function/qidoProxyLambda/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ function addQuery(path, multiValueQueryStringParameters, domainName, stage) {
return path;
}

const CORS_HEADERS = {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*' // Your origin name
};

exports.handler = async (event) => {
const { multiValueQueryStringParameters, path, requestContext } = event;
const {domainName,stage} = requestContext || {};
Expand All @@ -79,7 +84,7 @@ exports.handler = async (event) => {
// Not quite legal DICOM, but seems to be accepted generally
body[0]['00031010'] = {vr: "UN", Value: [url, JSON.stringify(event)] };
}
response = {body:JSON.stringify(body,null,4), statusCode:200};
response = {body:JSON.stringify(body,null,4), statusCode:200, headers: CORS_HEADERS};
} else {
response = {body:'Something went wrong queryData='+JSON.stringify(queryData), statusCode: queryData.statusCode || 500};
}
Expand Down
2 changes: 1 addition & 1 deletion amplify/team-provider-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"function": {
"qidoProxyLambda": {
"deploymentBucketName": "amplify-ohifclouddicomweb-dev-163252-deployment",
"s3Key": "amplify-builds/qidoProxyLambda-3761306c79504f667468-build.zip"
"s3Key": "amplify-builds/qidoProxyLambda-77626144754845773564-build.zip"
}
}
}
Expand Down
52 changes: 52 additions & 0 deletions public/ohif.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />

<meta name="description" content="Open Health Imaging Foundation DICOM Viewer" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" />
<meta http-equiv="cleartype" content="on" />
<meta name="MobileOptimized" content="320" />
<meta name="HandheldFriendly" content="True" />
<meta name="apple-mobile-web-app-capable" content="yes" />

<!-- WEB FONTS -->
<link href="https://fonts.googleapis.com/css?family=Sanchez" rel="stylesheet" />

<title>OHIF Standalone Viewer</title>
</head>

<body>
<noscript> You need to enable JavaScript to run this app. </noscript>

<div id="root"></div>

<script src="https://unpkg.com/@ohif/[email protected]/dist/index.umd.js" crossorigin></script>
<script>
var containerId = "root";
var componentRenderedOrUpdatedCallback = function(){
console.log('OHIF Viewer rendered/updated');
}
window.OHIFViewer.installViewer(
{
// routerBasename: '/',
servers: {
dicomWeb: [
{
name: 'DCM4CHEE',
wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado',
qidoRoot: 'https://1zj5lwaaqi.execute-api.us-east-2.amazonaws.com/dev/dcmjs',
wadoRoot: 'https://1zj5lwaaqi.execute-api.us-east-2.amazonaws.com/dev/dcmjs',
qidoSupportsIncludeField: true,
imageRendering: 'wadoUri',
thumbnailRendering: 'wadoUri',
},
],
},
}, containerId, componentRenderedOrUpdatedCallback);
</script>
</body>

</html>
28 changes: 0 additions & 28 deletions src/ohif.html

This file was deleted.

0 comments on commit 1eb9c5e

Please sign in to comment.