The selector that you provided just needed .length
attached to it like this:
$("#medListLi").find('div[data-role=collapsible]').length
When using a jQuery selector adding .length to the end always returns the number of matched elements.
So the above will return 0 if there are no collapsibles 1 if there is one etc...
To use this in an if statment all you need to do is:
if ($("#medListLi").find('div[data-role=collapsible]').length > 0) {
// submit
} else {
// error (no collapsibles)
}