Abstract Background Poor determination and processing of actions at the primary care level are found to be associated with unstructured and cluttered electronic health records (EHRs). Physicians recommend that EHRs must highlight entities, such as action items, findings, follow-ups, and reasons for medication changes. There’s consensus around the success of large language models (LLMs) in detecting clinical and non-clinical entities in EHRs. However, end-to-end systems make limited efforts to go beyond entity and relationship detection to support clinical decision-making. Methods We propose a two-tier system that generates case-based comparative reports for entities highlighted by physicians in EHRs. First, we fine-tuned a custom Bidirectional Encoder Representations from Transformers (BERT) model that detects the required entities within the EHRs. Second, a clustering-based service generates a report comparing the detected entities of a specific EHR with other EHRs sharing the same conditions determined by the healthcare professional. Results The system leverages the MIMIC IV deidentified free-text clinical notes dataset. The first-tier successfully classified entities with a macro-score average range of [0.87 - 0.94]. For the second tier, preliminary simulations on a set of test samples were made to cluster the entities. The simulations leverage a custom statistical tests engine offering a suite of entity-type specific tests. The results of these tests are used to generate the case-based detected entities comparative report. Conclusions Highlighting clinical and non-clinical entities bridges the communication gap between primary and secondary care. Clustering these entities extends the capability of LLMs in clinical support decision systems by providing healthcare professionals with the ability to run comparative analyses between EHRs. The comparative analysis reports provide a factual comparison between a selected number of detected entities and their thresholds. Key messages • Clustering clinical and non-clinical entities extends the capacity of named entity recognition in clinical decision-making systems. • Ability to generate a comparative analysis report based on figures extracted from recognised entities in free-text electronic health records.