This paper presents the privacy-aware data access control and medical documents sharing mechanism based on purpose for distributed XML medical databases. A privacy access policy for XML is a tree-like model, and a group of distributed XML medical databases corresponding to a group of distributed policy trees, so we should mine the integrated patterns to control private data access in sharing environments. Firstly, we should sequence the policy trees and mine the integrated patterns. Secondly, we calculate the privacy information using entropy to identify the integrated patterns with larger information. At last, we query distributed medical documents using integrated patterns, which shares as many as possible private data on condition of privacy constraints. The experiments show that based on different privacy demands for different applications, entropy calculation can be the basis of the choice for integrated pattern and access data reasonably without privacy disclosure.