eLabSDK.Study
Functions
| Name | Description |
|---|---|
| getMeta() | Get the custom metadata fields for this study. |
This retrieves the array of custom metadata field values associated with the study.
Metadata fields are custom properties defined for the study type that store additional
information beyond the standard study fields (name, description, etc.). Returns an array
of metadata objects, each containing the field definition and its value. Use this to
access custom study properties for display, validation, or processing.
Events
| Name | Description |
|---|---|
| "onLoaded" | Use this to access class |
getMeta()
Get the custom metadata fields for this study.
This retrieves the array of custom metadata field values associated with the study.
Metadata fields are custom properties defined for the study type that store additional
information beyond the standard study fields (name, description, etc.). Returns an array
of metadata objects, each containing the field definition and its value. Use this to
access custom study properties for display, validation, or processing.
Kind: global function
Returns: Array.<Object> - Array of metadata objects containing custom field data
Example
// Get and display study metadata
var study = new eLabSDK.Study({
studyID: 123,
onLoaded: function() {
var metadata = this.getMeta();
console.log('Study has ' + metadata.length + ' custom fields');
metadata.forEach(function(field) {
console.log(field.name + ': ' + field.value);
});
}
});
Example
// Find specific metadata field
var study = new eLabSDK.Study({
studyID: 456,
onLoaded: function() {
var metadata = this.getMeta();
var budget = metadata.find(function(field) {
return field.name === 'Budget';
});
if (budget) {
console.log('Study budget: $' + budget.value);
}
}
});
Example
// Display metadata in UI
var study = new eLabSDK.Study({
studyID: 789,
onLoaded: function() {
var metadata = this.getMeta();
var $container = $('#studyMetadata');
metadata.forEach(function(field) {
$container.append('<div><strong>' + field.name + ':</strong> ' + field.value + '</div>');
});
}
});
"onLoaded"
Use this to access class
Kind: event emitted
Example
var ev = studyObject.onLoaded(function () {
alert('Study Loaded');
});
© 2023 eLabNext
Updated about 6 hours ago