Ribera Healthcare Group: AI to improve patients’ lives
The Ribera healthcare group, a provider of public and private services since 1997, is one of the leading healthcare groups in Spain. The organization has more than 9,000 professionals distributed throughout Spain, Europe, and Latin America, whose objective is to work to improve the health and well-being of citizens.
At the hospital level, one of the most common surgical interventions is cataract surgery. Focused on this type of surgery, Plain Concepts and the Ribera healthcare group have worked together to generate a tool based on generative AI, called ALEX, capable of creating discharge reports based on previous information from the medical history.
ALEX, the new documentalist, facilitates the physician’s work and optimizes his time, improves the patient’s experience, since the patient has a complete, personalized, and understandable discharge report (without acronyms), and also enriches the coding and records of the care episode.
The project had to focus on validating and improving the generation of discharge reports in the ophthalmology area, specifically for cataract procedures, by applying generative AI. In addition, it aimed to enhance the report generation system through advanced techniques, dynamic retrieval of validated information, and fine-tuning of AI models.
On the other hand, one of the main challenges of the project was to ensure compliance with responsible AI principles, as sensitive medical data was being handled. It was therefore essential to guarantee security and privacy throughout the entire information lifecycle.



Ribera Salud’s innovation process
In the first phase, a PoC based on serverless technology was created, deploying the proposed base architecture focused on the modularization of functionality through encapsulation in independent functions. During this phase, promising results were achieved that demonstrated the power and usefulness of the solution applied to clinical cataract processes.
In the second phase, the PoC evolved into an MVP, focused on a scaling process in segregated execution environments with automated deployment mechanisms to enable continuous delivery of value without interruption. In addition, given the sensitive nature of the project, a thorough iterative validation process was followed during this phase to ensure that the generated outputs were consistent with the patient’s medical history originally written by the healthcare professional.
During this process, the most common errors were identified, the prompts were restructured through prompt engineering, and a 96% success rate was demonstrated in different sections of the report. The prompts were modified and refined to add intermediate decision sequences that atomize the tasks to be carried out by the AI, in order to reduce noise.
The next step has been to further validate the heterogeneity of the cases, with an advanced generation of already validated examples and training of the models to specialize them as AI agents in each category. Finally, a chain of reasoning has been established, which enables one to understand the successive decisions made by the AI agent and evaluate cases where the uncertainty in the expected output is higher.

“AI makes our administrative work much easier and is a help for what really matters to us, which is to improve the quality of life of patients. Reviewing and validating this discharge report with AI saves us from writing and transferring all the patient’s previous information to the document”.
César Azrak, Head of the Ophthalmology Department at the Hospital Universitario del Vinalopó
Technology
The incorporation of technologies that enable the dynamic retrieval of previously validated reports facilitates the flexible adaptation of the solution to different environments. Using resources such as Azure AI Search, the system can locate validated and syntactically similar documents, which serve as a basis for generating new reports by applying the technique known as dynamic few-shot learning. This strategy, combined with the use of models trained on specific extraction tasks, provides the solution with organic scalability without compromising reliability.
In addition, to ensure scalability, the solution relies on cloud resources such as:
Azure OpenAI Service – Azure Storage Account – Azure Container Instances – Azure DevOps – Azure Apps Insights – Azure CosmosDB – Azure Service Bus
Results
- Automation of the creation of reports in a natural and understandable language for the patient.
- Real transformation and optimization of processes.
- Significant reduction in the number and severity of errors in the reports generated, even in a scenario with a high variability of cases: 96% of the reports were of excellent quality, and only 4% required the physician to make modifications.
- Guaranteed consistency of outputs with respect to inputs in a context of complex and sensitive information.
- Enabling the chain of reasoning for the model to explain the reason for its results, as well as the sequence of steps.
- Ethical and secure AI model, protection of sensitive data throughout the process.
- Scalable project to other specialties and types of patients.
We are ready for new challenges
