Although there has been active research in data security and multimedia systems, which have wide applications in many fields, certain special problems in the field of medicine have not yet been solved. These problems include integration of data from different sources and provision of multiple levels of access control to protect the privacy of patients. We present a new method for data integration and security by mixing medical waveforms and images with encrypted patient identifiers and unencrypted associative data, such as acquisition parameters, diagnostic images, and notes and comments in textual, pictorial, and voice forms. We vary the sampling rate (or the sampling grid) of data according to their local smoothness. Then, redundant samples (or pixels) are eliminated and replaced by associative data which are labeled using a status string encoded based on the Huffman and run-length techniques. This method achieves both data compression and integration simultaneously.