The new query widgets to query patients by genetic variants comes with auto-complete autocomplete functionality. This functionality assists the users in selecting either rsIDs or gene names while querying. As the users types in, the auto complete autocomplete function looks up rsIDs or gene names beginning with the characters in real time. The list of matching strings is then returned and offered as suggestions from which the user can pick.
- The actual data stored in database, and
- A method to query the data from database and present it to the web-client.
A list of identifiers and gene names – that are present only in the dataset – needs to be stored in a backend i2b2 metadata table where the actual value will be located in the c_name field of the table. For the example given above to work the data in metadata table (metadata_genomics in our example) may look like following:
Sample scripts can be found inside the package in “Scripts for Sample Data” folder that loads auto-complete sample data in metadata_genomics table.
Method to query
In our example we have implemented a php method PHP script to query the auto-complete autocomplete data and present it to the query widgets as a user types in rs identifier or gene name.
The php PHP file may be placed on the web server inside the i2b2 web-client code webclient and configured to work in user’s your specific database environment or user may come up with their own auto-complete query process. Example php . Stubs are also provided to implement your own autocomplete.
Example PHP code can be found inside the package . To make the example autocomplete work, take the “genomicsAutoComplete.php” file from “Script for Genomic Autocomplete” folder inside the package and drop it inside local “i2b2-called 'genomicsAutoComplete.php' under the 'Script for Genomic Autocomplete' folder.webclient” folder on the webserver.