A medical device comprising a pressure generating means adapted to deliver a liquid, a sensor adapted to measure a flow resistance, and an implantable member comprising a porous membrane which reversibly changes its porosity subject to changes in glucose concentration occurring in the solution surrounding the implantable member. The medical device may also be used for drug administration.