Reproducible, open, transparent, ethical Research when confronted to (patient) data anonymization : is it at all possible in practice?
Its totally normal practice for patient data to be allowed to be stored only on properly secured, regulated and monitored servers. 

In my field (genomics), databases exist where researchers can deposit anonymized patient data, that is not "publically" available, but can be accessed by users that can demonstrate that they have good reason to use the data, that their use falls within the consent agreement and have the IT systems in place to keep the data safe (see for e.g. dbGaP and EGA) by making an application to a data-protection committee. 

Code can be written in such a way that no patient data is in the code (loaded from secure locations, etc), so that the code can be shared.