Medical Form Template Library
12 results found
Featured Forms
Other Forms
' + message + '
');
};
var renderTableTemplates = function(data, specialties, searchText) {
if (!data) {
displayError('We couldn\'t process the receieved data. Try again in a few seconds.');
} else {
for (var i = 0; i < categories.length; i++) {
var category = categories[i];
var categoryPagination = data[category + '_pagination'];
var categoryPaginationData = {
category: category,
current_page: categoryPagination.current_page,
prev_page: Math.max(categoryPagination.current_page - 1, 1),
last_page: categoryPagination.total_pages,
next_page: Math.min(categoryPagination.current_page+1, categoryPagination.total_pages),
}
var categoryPaginationScript = $('#' + category + '-pagination');
categoryPaginationScript.html('');
categoryPaginationScript.append(template_pagination(categoryPaginationData));
var selectorForm = $('#' + category + '-forms');
if (data[category + '_match']) {
selectorForm.html('');
$.each(data[category + '_templates'], function(i, match) {
selectorForm.append(template_table_row(match));
});
} else if (!specialties && !searchText) {
selectorForm.html(template_table_no_results({
message: "There aren't any " + category + " medical forms right now."
}));
} else {
selectorForm.html(template_table_no_results({
message: "We couldn't find any " + category + " forms that match the given filter/search criteria."
}));
}
}
}
};
var display_preview_modal = function(template_id, form_title, sharing_url, has_copy, elem, event) {
if (template_id in templatePreviews) {
var data = templatePreviews[template_id];
var num_columns = 2;
var table_row_parts = [];
data.map(function(field) {
if (table_row_parts[field.row] === undefined) {
table_row_parts[field.row] = [];
}
var field_cell = $("