It held that information regarding an individual's medical condition and any related communications are protected from being divulged by the doctor to any third party without the patient's consent. This applied to any third party, but especially to police agencies or other forms of authority, such as Starfleet.
In Starfleet such confidentiality can be broken if a doctor is ordered to do so, but only if the security of the starship or Federation is at risk. Such was the case in 2371 when Kathryn Janeway ordered The Doctor to violate this confidentiality with regards to Samantha Wildman. (VOY: "Fury")
When Jonathan Archer asked Phlox how he'd finally convinced Hudak to have surgery for his condition, Phlox said he must be familiar with the concept of doctor-patient confidentiality, reminding him that he could always order the doctor to tell him. (ENT: "The Breach")
In 2372, when Tom Paris asked The Doctor why he was suddenly interested in romance, the latter dodged the question by saying he couldn't tell him, as it was a matter of doctor-patient confidentiality. (VOY: "Lifesigns")
When The Doctor told Seven of Nine that the captain is informed about Seven's medical needs, Seven reminded The Doctor that all members of this crew had the right to doctor-patient confidentiality. (VOY: "Imperfection") Some time later, Seven of Nine reminded The Doctor about this confidentiality again. (VOY: "Human Error")