Skip to content

Commit b34166b

Browse files
committed
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
1 parent 1130343 commit b34166b

5 files changed

Lines changed: 123 additions & 8 deletions

File tree

lua/ladle.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
-- mvh 20230809 Fixed default webroot for Linux
3939
-- mvh 20240107 Fixed HTTP 200 OK response
4040
-- mvh 20240924 Reset request after quit to avoid failure to restart
41+
-- mvh 20240928 Export md5
4142

4243
-----------------------------------------------------
4344

@@ -456,6 +457,7 @@ function luascript.genEnv(_Env, request, config, handleIt, client)
456457
Env.table=table
457458
Env.math=math
458459
Env.tempfile=tempfile
460+
Env.md5=md5
459461
Env.writefile=function(nam, dat) local f=io.open(nam, 'wb') f:write(dat) f:close() end
460462
Env.unlink=function(nam) os.remove(nam) end
461463
Env.JSON=require('json')
@@ -524,6 +526,8 @@ function dgatecgi.handler(request, client, config)
524526
Env.loadstring = loadstring
525527
Env.require = require
526528
Env.dofile = dofile
529+
Env.md5=md5
530+
527531

528532
-- conquest specific
529533
Env.get_amap = get_amap

webserver/htdocs/app/newweb/listimages.lua

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
-- 20200307 mvh Avoid query with '***'
99
-- 20201025 mvh Standardised header
1010
-- 20230625 mvh Made all links relative
11+
-- 20240928 mvh Added #UID hash with full UID tooltip
1112

1213
local query_pid = '';
1314
local query_pna = '';
@@ -207,6 +208,31 @@ table.altrowstable Caption {
207208
color: yellow;
208209
background: green;
209210
}
211+
/* Tooltip container */
212+
.tooltip {
213+
position: relative;
214+
display: inline-block;
215+
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
216+
}
217+
218+
/* Tooltip text */
219+
.tooltip .tooltiptext {
220+
visibility: hidden;
221+
background-color: black;
222+
color: #fff;
223+
text-align: center;
224+
padding: 5px 0;
225+
border-radius: 6px;
226+
227+
/* Position the tooltip text - see examples below! */
228+
position: absolute;
229+
z-index: 1;
230+
}
231+
232+
/* Show the tooltip text when you mouse over the tooltip container */
233+
.tooltip:hover .tooltiptext {
234+
visibility: visible;
235+
}
210236
</style>
211237
]]
212238
)
@@ -285,7 +311,7 @@ local pats=queryimagem_remote()
285311

286312
print("<table class='altrowstable' id='alternatecolor' RULES=ALL BORDER=1>");
287313
HTML("<Caption>List of images on local server (%s)</caption>", #pats);
288-
HTML("<TR><TD>Patient ID<TD>Image ID<TD>Date<TD>Image number<TD>Slice location<TD>Header<TD>Menu</TR>");
314+
HTML("<TR><TD>Patient ID<TD>#UID<TD>Image ID<TD>Date<TD>Image number<TD>Slice location<TD>Header<TD>Menu</TR>");
289315

290316
local studyviewer=gpps('webdefaults', 'studyviewer', '');
291317

@@ -318,7 +344,9 @@ for i=1,#pats do
318344
t = url_img..string.format("%s</A>",mc(pats[i].PatientID));
319345

320346
v = url_header.."Header</A>";
321-
s = string.format("<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s%s</TR>",t,mc(pats[i].ImageID),
347+
s = string.format("<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s%s</TR>",t,
348+
'<div class="tooltip">'..md5(pats[i].SOPInstanceUID):sub(1,5)..'<span class="tooltiptext">'..pats[i].SOPInstanceUID..'</span/div>',
349+
mc(pats[i].ImageID),
322350
mc(pats[i].ImageDate), mc(pats[i].InstanceNumber), mc(pats[i].SliceLocation), v,
323351
dropdown(i, string.gsub(pats[i].PatientID, ' ', '+')..'|||'..pats[i].SOPInstanceUID));
324352
print(s)

webserver/htdocs/app/newweb/listimageswiththumbs.lua

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
-- 20201025 mvh Standardised header
99
-- 20220827 mvh Made dgate extension more generic, allows deployment as app
1010
-- 20230625 mvh Made all links relative
11+
-- 20240928 mvh Added #UID hash with full UID tooltip
1112

1213
local query_pid = '';
1314
local query_pna = '';
@@ -189,6 +190,31 @@ table.altrowstable Caption {
189190
color: yellow;
190191
background: green;
191192
}
193+
/* Tooltip container */
194+
.tooltip {
195+
position: relative;
196+
display: inline-block;
197+
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
198+
}
199+
200+
/* Tooltip text */
201+
.tooltip .tooltiptext {
202+
visibility: hidden;
203+
background-color: black;
204+
color: #fff;
205+
text-align: center;
206+
padding: 5px 0;
207+
border-radius: 6px;
208+
209+
/* Position the tooltip text - see examples below! */
210+
position: absolute;
211+
z-index: 1;
212+
}
213+
214+
/* Show the tooltip text when you mouse over the tooltip container */
215+
.tooltip:hover .tooltiptext {
216+
visibility: visible;
217+
}
192218
</style>
193219
]]
194220
)
@@ -270,7 +296,7 @@ local b = #pats
270296

271297
HTML("<table class='altrowstable' id='alternatecolor' RULES=ALL BORDER=1>");
272298
HTML("<Caption>List of images with thumbnails on local server (%s out of %s)</caption>", b, a);
273-
HTML("<TR><TD>Patient ID<TD>Image ID<TD>Date<TD>Image number<TD>Slice location<TD>Icon</TR>");
299+
HTML("<TR><TD>Patient ID<TD>#UID<TD>Image ID<TD>Date<TD>Image number<TD>Slice location<TD>Icon</TR>");
274300

275301
for i=1,#pats do
276302
studyuid=pats[i].StudyInstanceUID;
@@ -311,7 +337,9 @@ for i=1,#pats do
311337
v = string.format("<IMG SRC=?%s&mode=slice&slice=%s:%s&size=%s&graphic=%s width='100%%' height='%s' alt='' title='Click to see header'></A>", '', string.gsub(pats[i].PatientID, ' ', '+'), mcoalesce(pats[i].SOPInstanceUID),iconsize, graphic, iconsize);
312338
v = url_header..v
313339

314-
s = string.format("<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s</TR>",t,mcoalesce(pats[i].ImageID), mcoalesce(pats[i].ImageDate),mcoalesce(pats[i].InstanceNumber), mcoalesce(pats[i].SliceLocation),v);
340+
s = string.format("<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s</TR>",t,
341+
'<div class="tooltip">'..md5(pats[i].SOPInstanceUID):sub(1,5)..'<span class="tooltiptext">'..pats[i].SOPInstanceUID..'</span/div>',
342+
mcoalesce(pats[i].ImageID), mcoalesce(pats[i].ImageDate),mcoalesce(pats[i].InstanceNumber), mcoalesce(pats[i].SliceLocation),v);
315343
sl2=sl
316344
print(s)
317345
end

webserver/htdocs/app/newweb/listseries.lua

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
-- 20220827 mvh Made dgate extension more generic, allows deployment as app
1414
-- 20220830 mvh Add serieslink to add e.g. wadoseriesviewer
1515
-- 20230625 mvh Made all links relative; enable default viewer link
16+
-- 20240928 mvh Added #UID hash with full UID tooltip
1617

1718
local query_pid = '';
1819
local query_pna = '';
@@ -201,6 +202,31 @@ table.altrowstable Caption {
201202
color: yellow;
202203
background: green;
203204
}
205+
/* Tooltip container */
206+
.tooltip {
207+
position: relative;
208+
display: inline-block;
209+
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
210+
}
211+
212+
/* Tooltip text */
213+
.tooltip .tooltiptext {
214+
visibility: hidden;
215+
background-color: black;
216+
color: #fff;
217+
text-align: center;
218+
padding: 5px 0;
219+
border-radius: 6px;
220+
221+
/* Position the tooltip text - see examples below! */
222+
position: absolute;
223+
z-index: 1;
224+
}
225+
226+
/* Show the tooltip text when you mouse over the tooltip container */
227+
.tooltip:hover .tooltiptext {
228+
visibility: visible;
229+
}
204230
</style>
205231
</head>
206232
<body BGCOLOR='CFDFCF'>
@@ -236,7 +262,7 @@ local linkheader=''
236262
if serieslink~='' then linkheader='<TD>' end
237263

238264
HTML("<Caption>List of series (%s) on local server</caption>", #pats);
239-
HTML("<TR><TD>Patient ID<TD>Name<TD>Series date<TD>Series time<TD>Series description<TD>Modality<TD>Thumbs<TD>Menu%s</TR>",linkheader);
265+
HTML("<TR><TD>Patient ID<TD>Name<TD>#UID<TD>Series date<TD>Series time<TD>Series description<TD>Modality<TD>Thumbs<TD>Menu%s</TR>",linkheader);
240266

241267
for i=1,#pats do
242268
local t = string.format("<A HREF=?%s&mode=listimages&key=%s&query=DICOMStudies.patientid+=+'%s'+and+DICOMSeries.seriesinst+=+'%s' title='Click to see images'>%s</A>", '', 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
249275
link = string.gsub(link, '{StudyInstanceUID}', pats[i].StudyInstanceUID)
250276
link = string.gsub(link, '{PatientID}', pats[i].PatientID)
251277

252-
s = string.format("<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s%s%s</TR>",t,mc(pats[i].PatientName),
278+
s = string.format("<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s%s%s</TR>",t,mc(pats[i].PatientName),
279+
'<div class="tooltip">'..md5(pats[i].SeriesInstanceUID):sub(1,5)..'<span class="tooltiptext">'..pats[i].SeriesInstanceUID..'</span/div>',
253280
mc(pats[i].SeriesDate),mc(pats[i].SeriesTime), mc(pats[i].SeriesDescription),mc(pats[i].Modality),v,
254281
dropdown(i, string.gsub(pats[i].PatientID, ' ', '+')..'||'..pats[i].SeriesInstanceUID),
255282
link);

webserver/htdocs/app/newweb/liststudies.lua

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
-- 20220830 mvh Add studylink to add e.g. ohif (example commented out)
1313
-- 20220905 mvh Fix display of ModalitiesInStudy
1414
-- 20230625 mvh Made all links relative; enable default ohif link
15+
-- 20240928 mvh Added #UID hash with full UID tooltip
1516

1617
local query_pid = '';
1718
local query_pna = '';
@@ -206,6 +207,31 @@ table.altrowstable Caption {
206207
color: yellow;
207208
background: green;
208209
}
210+
/* Tooltip container */
211+
.tooltip {
212+
position: relative;
213+
display: inline-block;
214+
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
215+
}
216+
217+
/* Tooltip text */
218+
.tooltip .tooltiptext {
219+
visibility: hidden;
220+
background-color: black;
221+
color: #fff;
222+
text-align: center;
223+
padding: 5px 0;
224+
border-radius: 6px;
225+
226+
/* Position the tooltip text - see examples below! */
227+
position: absolute;
228+
z-index: 1;
229+
}
230+
231+
/* Show the tooltip text when you mouse over the tooltip container */
232+
.tooltip:hover .tooltiptext {
233+
visibility: visible;
234+
}
209235
</style>
210236
</head>
211237
<body BGCOLOR='CFDFCF'>
@@ -249,7 +275,7 @@ end
249275
local linkheader=''
250276
if studylink~='' then linkheader='<TD>' end
251277

252-
HTML("<TR><TD>Patient ID<TD>Name<TD>Study Date<TD>Study description<TD>Study modality<TD>Menu%s</TR>", linkheader)
278+
HTML("<TR><TD>Patient ID<TD>Name<TD>#UID<TD>Study Date<TD>Study description<TD>Study modality<TD>Menu%s</TR>", linkheader)
253279

254280
for i=1,#pats do
255281
local t = string.format("<A HREF=?%s&mode=listseries&key=%s&query=DICOMStudies.patientid+=+'%s'+and+DICOMSeries.studyinsta+=+'%s' title='Click to see series'>%s</A>", '', 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
258284
link = string.gsub(link, '{StudyInstanceUID}', pats[i].StudyInstanceUID)
259285
link = string.gsub(link, '{PatientID}', pats[i].PatientID)
260286

261-
local s = string.format("<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s%s%s</TR>",t,mc(pats[i].PatientName),mc(pats[i].StudyDate),
287+
local s = string.format('<TR><TD>%s<TD>%s<TD>%s<TD>%s<TD>%s<TD>%s%s%s</TR>',t,mc(pats[i].PatientName),
288+
'<div class="tooltip">'..md5(pats[i].StudyInstanceUID):sub(1,5)..'<span class="tooltiptext">'..pats[i].StudyInstanceUID..'</span/div>',
289+
mc(pats[i].StudyDate),
262290
mc(pats[i].StudyDescription),mc(pats[i].ModalitiesInStudy),
263291
dropdown(i, string.gsub(pats[i].PatientID, ' ', '+')..'|'..pats[i].StudyInstanceUID),
264292
link

0 commit comments

Comments
 (0)