1. A biocompatible polymer having the formula, in which, R 1 -R 4 are independently a methacryl, acryl, styryl, acrylamido, methacrylamido, sulfovinyl, amido, ester, ethyl, or propyl; R 5 is a hydrocarbon chain, cycloaliphatic group, ester group, amide group, thiol, sulfone, carbonate, saccharide, PEG, or combination thereof; R 6 includes a zwitterion group, a linker being a chain of 2-12 carbon atoms, and an ester or amide attachment to the methacryl group; R 7 is a methyl, ethyl, or hydrogen group; n is in a range from about 0.005 to about 0.5; o is in a range from about 0.005 to about 0.4; p optionally included in a range from 0.005 to 0.25; q is in a range from about 0.005 to about 0.98; and r is optionally included in a range from about 0.005 to about 0.4.