Evidence-based practice has become the cornerstone of high quality clinical care. However, producing evidence of sufficient quantity and quality is hampered by the high cost and complexity of conducting research, the numbers of clinicians and patients willing to participate in clinical trials. The Learning Healthcare System initiative creates routes for knowledge transfer between different parts of the health system, thereby increasing its research and learning capacity. This effort is closely aligned with initiatives such as CDISC that are working on standards for computational clinical trial definitions. Transform project builds upon existing state-of-the-art technologies for reusing clinical information routinely captured in Electronic Health Record systems, to facilitate conduct of clinical trials in primary care. This paper presents the modeling part of the Transform method for building such a Learning Healthcare System and addressing the integration of clinical trials into the routine clinical practice, thereby reducing cost and complexity of the task.