This will depend upon the style you use. Please recognize that when preparing a manuscript for submission many publishers will want the format to be 1, 2, 3, 4 while the final 'printed' version will be published as 1-4 after typesetting.
There are styles that will provide the in-text format that you want and someone else here can make specific suggestions. In the meantime, look through the options at: https://www.zotero.org/styles and also view the various Vancouver styles.
It looks like the AMA style guide does say to collapse ranges with a hyphen though. The AMA style in Zotero is set to collapse the references as required.
How did you insert the citations?
I inserted them through Zotero with the Add citation button
There are styles that will provide the in-text format that you want and someone else here can make specific suggestions. In the meantime, look through the options at:
https://www.zotero.org/styles
and also view the various Vancouver styles.
It sounds like you have inserted each items as a separate citation. You need to insert all of the items into the same citation window. See https://www.zotero.org/support/word_processor_plugin_usage#citations_with_multiple_cited_items