Is there a way to share a mental health diagnosis but shield myself from hurt or judgment? How can I do it without changing a relationship?

Is there a way to share a mental health diagnosis but shield myself from hurt or judgment? How can I do it without changing a relationship?