Hospitals and insurance companies are quietly preparing for potential legal battles over President Donald Trump’s executive order calling for greater price transparency in health care.

The order, issued June 24, directs the Departments of Health and Human Services, Labor, and Treasury to develop new rules requiring that patients receive up-front information about how much their treatment will cost.

It’s unclear what shape the new rules will take, but it’s likely that the insurers and hospital systems will fight any efforts to force disclosure of confidential pricing deals struck between them. The network deals between health providers and insurers is...