Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F118961857
getAnnotations.php
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
Mon, Jun 23, 08:23
Size
635 B
Mime Type
text/x-php
Expires
Wed, Jun 25, 08:23 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26937853
Attached To
R4897 i2b2-webclient
getAnnotations.php
View Options
<?php
//echo "Connecting ... <br>";
$conn
=
pg_connect
(
"host=localhost port=5432 dbname=i2b2 user=postgres password=admin"
);
if
(!
$conn
)
{
echo
"Error while connecting to the postgres database"
;
exit
;
}
// just get the first row (which already contain all the annotations' name)
$result
=
pg_query
(
$conn
,
"SELECT annotation_id FROM shrine_ont.genomic_annotations_metadata"
);
if
(!
$result
)
{
echo
"An error occurred.
\n
"
;
exit
;
}
// json format
$annotationNames
=
"["
;
while
(
$row
=
pg_fetch_row
(
$result
))
{
$annotationNames
.=
"
\"
$row[0]
\"
,"
;
}
// drop the last comma
echo
substr
(
$annotationNames
,
0
,
-
1
)
.
"]"
;
Event Timeline
Log In to Comment