From b34166b2c3f43496bef6273c9c7a260c6d0e74be Mon Sep 17 00:00:00 2001 From: marcelvanherk Date: Sat, 28 Sep 2024 23:00:53 +0100 Subject: [PATCH] Extended newweb to show hash and tooltips of full UID in study..image tables -- mvh 20240928 Export md5 -- 20240928 mvh Added #UID hash with full UID tooltip --- lua/ladle.lua | 4 +++ webserver/htdocs/app/newweb/listimages.lua | 32 +++++++++++++++++-- .../app/newweb/listimageswiththumbs.lua | 32 +++++++++++++++++-- webserver/htdocs/app/newweb/listseries.lua | 31 ++++++++++++++++-- webserver/htdocs/app/newweb/liststudies.lua | 32 +++++++++++++++++-- 5 files changed, 123 insertions(+), 8 deletions(-) diff --git a/lua/ladle.lua b/lua/ladle.lua index 0170bba..888c0e6 100644 --- a/lua/ladle.lua +++ b/lua/ladle.lua @@ -38,6 +38,7 @@ -- mvh 20230809 Fixed default webroot for Linux -- mvh 20240107 Fixed HTTP 200 OK response -- mvh 20240924 Reset request after quit to avoid failure to restart +-- mvh 20240928 Export md5 ----------------------------------------------------- @@ -456,6 +457,7 @@ function luascript.genEnv(_Env, request, config, handleIt, client) Env.table=table Env.math=math Env.tempfile=tempfile + Env.md5=md5 Env.writefile=function(nam, dat) local f=io.open(nam, 'wb') f:write(dat) f:close() end Env.unlink=function(nam) os.remove(nam) end Env.JSON=require('json') @@ -524,6 +526,8 @@ function dgatecgi.handler(request, client, config) Env.loadstring = loadstring Env.require = require Env.dofile = dofile + Env.md5=md5 + -- conquest specific Env.get_amap = get_amap diff --git a/webserver/htdocs/app/newweb/listimages.lua b/webserver/htdocs/app/newweb/listimages.lua index cc6ff49..7a2b629 100644 --- a/webserver/htdocs/app/newweb/listimages.lua +++ b/webserver/htdocs/app/newweb/listimages.lua @@ -8,6 +8,7 @@ -- 20200307 mvh Avoid query with '***' -- 20201025 mvh Standardised header -- 20230625 mvh Made all links relative +-- 20240928 mvh Added #UID hash with full UID tooltip local query_pid = ''; local query_pna = ''; @@ -207,6 +208,31 @@ table.altrowstable Caption { color: yellow; background: green; } +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ +} + +/* Tooltip text */ +.tooltip .tooltiptext { + visibility: hidden; + background-color: black; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltiptext { + visibility: visible; +} ]] ) @@ -285,7 +311,7 @@ local pats=queryimagem_remote() print(""); HTML("", #pats); -HTML(""); +HTML(""); local studyviewer=gpps('webdefaults', 'studyviewer', ''); @@ -318,7 +344,9 @@ for i=1,#pats do t = url_img..string.format("%s",mc(pats[i].PatientID)); v = url_header.."Header"; - s = string.format("",t,mc(pats[i].ImageID), + s = string.format("",t, +'
'..md5(pats[i].SOPInstanceUID):sub(1,5)..''..pats[i].SOPInstanceUID..'', + mc(pats[i].ImageID), mc(pats[i].ImageDate), mc(pats[i].InstanceNumber), mc(pats[i].SliceLocation), v, dropdown(i, string.gsub(pats[i].PatientID, ' ', '+')..'|||'..pats[i].SOPInstanceUID)); print(s) diff --git a/webserver/htdocs/app/newweb/listimageswiththumbs.lua b/webserver/htdocs/app/newweb/listimageswiththumbs.lua index 1ff2722..d4f1a90 100644 --- a/webserver/htdocs/app/newweb/listimageswiththumbs.lua +++ b/webserver/htdocs/app/newweb/listimageswiththumbs.lua @@ -8,6 +8,7 @@ -- 20201025 mvh Standardised header -- 20220827 mvh Made dgate extension more generic, allows deployment as app -- 20230625 mvh Made all links relative +-- 20240928 mvh Added #UID hash with full UID tooltip local query_pid = ''; local query_pna = ''; @@ -189,6 +190,31 @@ table.altrowstable Caption { color: yellow; background: green; } +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ +} + +/* Tooltip text */ +.tooltip .tooltiptext { + visibility: hidden; + background-color: black; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltiptext { + visibility: visible; +} ]] ) @@ -270,7 +296,7 @@ local b = #pats HTML("
List of images on local server (%s)
Patient IDImage IDDateImage numberSlice locationHeaderMenu
Patient ID#UIDImage IDDateImage numberSlice locationHeaderMenu
%s%s%s%s%s%s%s
%s%s%s%s%s%s%s%s
"); HTML("", b, a); -HTML(""); +HTML(""); for i=1,#pats do studyuid=pats[i].StudyInstanceUID; @@ -311,7 +337,9 @@ for i=1,#pats do v = string.format("", '', string.gsub(pats[i].PatientID, ' ', '+'), mcoalesce(pats[i].SOPInstanceUID),iconsize, graphic, iconsize); v = url_header..v - s = string.format("",t,mcoalesce(pats[i].ImageID), mcoalesce(pats[i].ImageDate),mcoalesce(pats[i].InstanceNumber), mcoalesce(pats[i].SliceLocation),v); + s = string.format("",t, +'
'..md5(pats[i].SOPInstanceUID):sub(1,5)..''..pats[i].SOPInstanceUID..'', + mcoalesce(pats[i].ImageID), mcoalesce(pats[i].ImageDate),mcoalesce(pats[i].InstanceNumber), mcoalesce(pats[i].SliceLocation),v); sl2=sl print(s) end diff --git a/webserver/htdocs/app/newweb/listseries.lua b/webserver/htdocs/app/newweb/listseries.lua index 40ab2e4..eb9c13a 100644 --- a/webserver/htdocs/app/newweb/listseries.lua +++ b/webserver/htdocs/app/newweb/listseries.lua @@ -13,6 +13,7 @@ -- 20220827 mvh Made dgate extension more generic, allows deployment as app -- 20220830 mvh Add serieslink to add e.g. wadoseriesviewer -- 20230625 mvh Made all links relative; enable default viewer link +-- 20240928 mvh Added #UID hash with full UID tooltip local query_pid = ''; local query_pna = ''; @@ -201,6 +202,31 @@ table.altrowstable Caption { color: yellow; background: green; } +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ +} + +/* Tooltip text */ +.tooltip .tooltiptext { + visibility: hidden; + background-color: black; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltiptext { + visibility: visible; +} @@ -236,7 +262,7 @@ local linkheader='' if serieslink~='' then linkheader='
", #pats); -HTML("",linkheader); +HTML("",linkheader); for i=1,#pats do local t = string.format("%s", '', tostring(key or ''),string.gsub(pats[i].PatientID, ' ', '+'),mc(pats[i].SeriesInstanceUID),mc(pats[i].PatientID)) @@ -249,7 +275,8 @@ for i=1,#pats do link = string.gsub(link, '{StudyInstanceUID}', pats[i].StudyInstanceUID) link = string.gsub(link, '{PatientID}', pats[i].PatientID) - s = string.format("",t,mc(pats[i].PatientName), + s = string.format("",t,mc(pats[i].PatientName), +'
'..md5(pats[i].SeriesInstanceUID):sub(1,5)..''..pats[i].SeriesInstanceUID..'', mc(pats[i].SeriesDate),mc(pats[i].SeriesTime), mc(pats[i].SeriesDescription),mc(pats[i].Modality),v, dropdown(i, string.gsub(pats[i].PatientID, ' ', '+')..'||'..pats[i].SeriesInstanceUID), link); diff --git a/webserver/htdocs/app/newweb/liststudies.lua b/webserver/htdocs/app/newweb/liststudies.lua index 12c7c00..ec626d1 100644 --- a/webserver/htdocs/app/newweb/liststudies.lua +++ b/webserver/htdocs/app/newweb/liststudies.lua @@ -12,6 +12,7 @@ -- 20220830 mvh Add studylink to add e.g. ohif (example commented out) -- 20220905 mvh Fix display of ModalitiesInStudy -- 20230625 mvh Made all links relative; enable default ohif link +-- 20240928 mvh Added #UID hash with full UID tooltip local query_pid = ''; local query_pna = ''; @@ -206,6 +207,31 @@ table.altrowstable Caption { color: yellow; background: green; } +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ +} + +/* Tooltip text */ +.tooltip .tooltiptext { + visibility: hidden; + background-color: black; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltiptext { + visibility: visible; +} @@ -249,7 +275,7 @@ end local linkheader='' if studylink~='' then linkheader='
", linkheader) +HTML("", linkheader) for i=1,#pats do local t = string.format("%s", '', tostring(key or ''),string.gsub(pats[i].PatientID, ' ', '+'),mc(pats[i].StudyInstanceUID),mc(pats[i].PatientID)) @@ -258,7 +284,9 @@ for i=1,#pats do link = string.gsub(link, '{StudyInstanceUID}', pats[i].StudyInstanceUID) link = string.gsub(link, '{PatientID}', pats[i].PatientID) - local s = string.format("",t,mc(pats[i].PatientName),mc(pats[i].StudyDate), + local s = string.format('',t,mc(pats[i].PatientName), +'
'..md5(pats[i].StudyInstanceUID):sub(1,5)..''..pats[i].StudyInstanceUID..'', + mc(pats[i].StudyDate), mc(pats[i].StudyDescription),mc(pats[i].ModalitiesInStudy), dropdown(i, string.gsub(pats[i].PatientID, ' ', '+')..'|'..pats[i].StudyInstanceUID), link
List of images with thumbnails on local server (%s out of %s)
Patient IDImage IDDateImage numberSlice locationIcon
Patient ID#UIDImage IDDateImage numberSlice locationIcon
%s%s%s%s%s%s
%s%s%s%s%s%s%s
' end HTML("
List of series (%s) on local server
Patient IDNameSeries dateSeries timeSeries descriptionModalityThumbsMenu%s
Patient IDName#UIDSeries dateSeries timeSeries descriptionModalityThumbsMenu%s
%s%s%s%s%s%s%s%s%s
%s%s%s%s%s%s%s%s%s%s
' end -HTML("
Patient IDNameStudy DateStudy descriptionStudy modalityMenu%s
Patient IDName#UIDStudy DateStudy descriptionStudy modalityMenu%s
%s%s%s%s%s%s%s
%s%s%s%s%s%s%s%s