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 an analyte responsive porous membrane which reversibly changes its porosity subject to changes in analyte concentration occurring in the solution surrounding the implantable member. The analyte may in particular be glucose. The medical device may also be used for drug administration.