Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64356854
i2b2.service.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 26, 08:27
Size
1 KB
Mime Type
text/x-java
Expires
Tue, May 28, 08:27 (2 d)
Engine
blob
Format
Raw Data
Handle
17888957
Attached To
R2664 SHRINE MedCo Fork
i2b2.service.js
View Options
import
*
as
_
from
'ramda'
;
import
{
Container
}
from
'./container'
;
export
class
I2B2Service
{
constructor
(
context
=
window
)
{
//private
const
ctx
=
Container
.
of
(
context
);
const
prop
=
_
.
curry
((
el
,
c
)
=>
c
.
value
?
Container
.
of
(
_
.
prop
(
el
,
c
.
value
))
:
Container
.
of
(
null
));
const
i2b2
=
_
.
compose
(
prop
(
'i2b2'
),
prop
(
'window'
),
prop
(
'parent'
));
const
crc
=
_
.
compose
(
prop
(
'CRC'
),
i2b2
);
const
events
=
_
.
compose
(
prop
(
'events'
),
i2b2
);
const
shrine
=
_
.
compose
(
prop
(
'SHRINE'
),
i2b2
);
// -- @todo: makes assumption that i2b2 object conforms to predictable structure? -- //
this
.
onResize
=
f
=>
events
(
ctx
).
map
((
v
)
=>
v
.
changedZoomWindows
.
subscribe
(
f
));
this
.
onHistory
=
f
=>
crc
(
ctx
).
map
((
v
)
=>
v
.
ctrlr
.
history
.
events
.
onDataUpdate
.
subscribe
(
f
));
this
.
onQuery
=
f
=>
events
(
ctx
).
map
((
v
)
=>
v
.
afterQueryInit
.
subscribe
(
f
));
this
.
loadHistory
=
()
=>
crc
(
ctx
).
map
((
v
)
=>
v
.
view
.
history
.
doRefreshAll
());
this
.
loadQuery
=
id
=>
crc
(
ctx
).
map
((
v
)
=>
v
.
ctrlr
.
QT
.
doQueryLoad
(
id
));
this
.
errorDetail
=
d
=>
shrine
(
ctx
).
map
((
v
)
=>
v
.
plugin
.
errorDetail
(
d
));
}
}
Event Timeline
Log In to Comment