While I agree with Brian Borchers' answer that you cannot submit the same material to two different places, the example that you give in your question (e.g., the medical application vs. the algorithm) is a good examples of where "the same work" may create entirely distinct papers for the different communities.
In my experience with cross-disciplinary publication, it is typical for one of the papers to come first, and then the other to come later and cite the first. This can easily go in either direction across the two fields. To, illustrate, considering your example:
You might publish the medical application paper first, based on the main experimental results, and in this paper it would be inappropriate to go into a detailed exploration of the properties of the algorithm: validation of data resulting from its application is where that community's interest stops. Then you might later publish a paper for computer scientists that "zooms in" on the algorithm and explores it in detail.
Alternately, you might start by publishing the algorithm paper, laying out all of the theoretical foundations in detail (which will likely fill a conference paper quite tightly), but stopping before the experimental data, which the computer scientists are not in a position to peer-review in any case. Then the medical application paper can come afterward, citing the algorithm paper as an established fact in its methods.
The important things to make such cross-disciplinary publication clean and ethical are:
- Always explicitly cite and declare relationships between your work.
- Never try to squeeze "extra" publications out this way: your cross-disciplinary publication choices should instead be based on routing in-depth discussion of particular aspects of the work to the communities that can best review and appreciate it.