Page MenuHomec4science

getAnnotationValues.php
No OneTemporary

File Metadata

Created
Sun, Feb 2, 06:01

getAnnotationValues.php

<?php
$conn = pg_connect("host=localhost port=5432 dbname=i2b2 user=shrine_ont password=demouser");
if (!$conn) {
echo "Error while connecting to the postgres database";
exit;
}
// get the row which contains all the values of the passed annotation
$query = "SELECT annotation_values FROM shrine_ont.genomic_annotations_metadata WHERE annotation_id='". $_GET["annotation_name"] . "'";
$result = pg_query($conn, $query);
if (!$result) {
echo "An error occurred.\n";
exit;
}
// just tell to which annotation these values correspond (in case of concurrent requests there may be inconsistencies)
echo $_GET["annotation_name"] . "$%$";
while ($row = pg_fetch_row($result)) {
echo "$row[0]";
}

Event Timeline