Guides · Updated 20 November 2026

AI and health data: building your own AI applications in compliance with data protection law

Health data may be used in AI applications once four things are settled: the legal basis for exactly this purpose, the route the data takes to the AI model, whether the application is a medical device or a high-risk AI system, and the traceability of every access. The safest approach is a split: a verified data foundation enforces consent, rights and logging, and the AI application accesses the data only through this layer.

This page provides professional guidance and does not replace legal advice. Always agree the legal basis, data protection impact assessment and classification under the MDR and the AI Act with your data protection officer and, where necessary, with your regulatory affairs department.

With AI, analyses, reports and small applications can now be built in days rather than months. In clinics, rehabilitation facilities and research groups, this has long been happening: a language model summarises patient histories, a team builds itself an overview for case reviews, a working group looks for patterns in longitudinal data. The question is rarely whether this works technically. The question is whether it is legally sound with health data. This guide shows what needs to be clarified, which architecture has proven itself and what to consider before you start.

Why AI with health data is subject to special rules

Under Art. 9 GDPR, health data is one of the special categories of personal data. Processing it is prohibited in principle unless one of the exceptions in Art. 9(2) applies. For AI applications, three particular aspects come on top:

  • New purposes: an AI analysis is often a different purpose from the treatment for which the data was collected. Purpose limitation and legal basis must be reassessed.
  • New recipients: many AI services run in a provider’s cloud, frequently outside the EU. Every input is then a transfer.
  • New rules: with the AI Act (Regulation (EU) 2024/1689), additional obligations apply to providers and deployers of AI systems, especially in healthcare.

In May 2024, the German Data Protection Conference (DSK) published guidance on “Artificial intelligence and data protection” (in German). It is a good starting point for the conversation with your data protection officer.

Which basis applies depends on what the AI is used for.

Use of the AITypical legal basisWhat to look out for
Support in ongoing treatment, e.g. a summary of the patient history for the professionalArt. 9(2)(h) GDPR with national lawDefine the purpose narrowly, professional secrecy, the decision remains with the professional
Additional analyses that go beyond treatmentArt. 9(2)(a) (explicit consent)Consent for exactly this purpose, withdrawal must reach the application
Quality assurance and research with your own care datain Germany Section 6 GDNG, otherwise point (j) with safeguards under Art. 89Pseudonymisation, protective measures, publication only in anonymised form
StudiesConsent following study information, or point (j)Study protocol, ethics approval, data management plan
Training your own modelA separate basis for training, independent of treatmentDocument the purpose, data minimisation, deletion and versioning of training data

A common mistake: the data was collected for treatment, but the AI analysis runs for quality reports or a research project. In that case, the original basis does not cover the new purpose. Clarify this before the application goes live.

If a system makes decisions about a person without human review, Art. 22 GDPR also applies. In medicine, the rule should therefore always be: the application shows, the professional decides.

Where the data flows: cloud AI, your own language model, data foundation

The second question is the route the data takes. Three architectures are found in practice.

Public AI serviceAI service under contract in the EU, or your own language modelAI via a data foundation
Where the health data is processedAt the provider, often outside the EUAt the contractual partner in the EU or in your own infrastructureIn the foundation; the AI receives only approved extracts
Data processing agreementUsually not available with consumer accountsYesYes, for the foundation and the AI service
Roles and rightsDo not apply; everything entered is visibleHave to be built into the application itselfApply to every AI connection, as to any other access
Consent and withdrawalNot taken into accountHave to be built into the application itselfEnforced by the foundation
LoggingAt the provider, not verifiable for youHas to be builtEvery access in the Audit Trail
Suitable forIdeas, texts, code without real patient dataOrganisations with their own AI infrastructureClinics, rehabilitation and research that want to start quickly and securely

A public AI service is usually not an option for health data. Anyone entering patient data transfers it to a third party. This requires a legal basis, a contract under Art. 28 GDPR, a basis for a third-country transfer under Art. 44 et seq. GDPR and, for doctors, therapists and other professionals bound by confidentiality, a solution for professional secrecy under Section 203 of the German Criminal Code (StGB).

A proven approach is to separate the two: the AI helps with building but does not see the raw data. It drafts an analysis, a dashboard or a query. The actual calculation then runs in the protected environment, traceable and repeatable.

A data foundation instead of direct access

Many self-built applications access a database or an export directly. In the process, the rules that apply in the source system are lost: an analysis suddenly sees data that the person using it should never see, and a withdrawal of consent does not get through.

A split into two layers is better:

  1. The foundation takes on the permanent obligations: connecting devices and systems, storing data with its origin, managing consent, enforcing roles and rights, logging access.
  2. The application builds on it: analysis, dashboard, voice assistant or your own model. It accesses the data only through a defined interface and inherits all the rules of the foundation.

This keeps the freedom to build, while the obligations sit where they are permanently fulfilled.

This is exactly the role the Datico® Life Hub takes on. It connects devices, wearables and clinical systems, stores every value with device, time and measurement type, manages consent via Double Opt-In, enforces Roles & Rights and logs every access in the Audit Trail. Hosting takes place in a separate database for each customer on servers in Germany or, on request, in your own infrastructure.

AI applications access the data via the MCP Server and the Smart API. Each AI connection has its own credentials, bound to a rights profile. In it, you define which people, groups, parameters and time periods may be queried. Access is read-only, encrypted and logged. You decide which language model you use, including one of your own in your infrastructure.

Pseudonymise, anonymise, minimise

For AI analyses, the principle of data minimisation applies in particular: the application receives only what it needs for its purpose.

  • Pseudonymise: name and identity are replaced by an identifier, and the key is held separately by authorised persons. The data remains personal data, but the risk falls considerably. For longitudinal analyses and research, this is usually the right approach.
  • Anonymise: only once a person can no longer be identified, even with reasonable effort, does the GDPR cease to apply. With detailed time series from wearables and devices, true anonymity is difficult to achieve, because the data histories themselves can be identifying.
  • Aggregate: for reporting and management, group values or scores are often enough. Individual values stay with the professionals who care for the person.

In the Datico® Life Hub, study data can be kept in pseudonymised form according to the study protocol. Via the rights profile of an AI connection, you control whether it receives individual values, scores or only aggregated data.

AI Act and medical devices: when it gets strict

Whether an AI application additionally falls under product law is determined by its intended purpose.

  • Medical device under the MDR: software intended for diagnosis, monitoring or treatment decisions for individual patients can be a medical device. Pure documentation, display and administration are assessed differently.
  • High-risk AI under the AI Act: if the software is a medical device that must be assessed by a notified body, the AI system is considered a high-risk system under Art. 6(1) AI Act. Obligations concerning risk management, data quality, documentation, logging and human oversight then apply in addition.
  • AI literacy: independently of this, organisations that use AI have had to ensure since February 2025 that their staff are adequately trained (Art. 4 AI Act).

According to the text of the regulation, the obligations for high-risk systems that are also medical devices apply from 2 August 2027. At the end of 2025, the EU proposed adjusting the deadlines for high-risk systems. Check the current status before your project starts.

A simple rule for practice: the application shows, the professional decides. Datico® is built accordingly as data-driven decision support. The Datico® Expert Assistant, too, only prepares next steps for approval and does not carry out anything automatically.

Data quality: AI is only as good as its data

Values from different devices have different formats, units and measurement methods. Resting heart rate from a sports watch is something different from resting heart rate from an ECG. An AI that does not know this draws the wrong conclusions. Three points determine quality:

  • Origin: for every value, it is clear which device it comes from and when and how it was measured.
  • Consistent terminology: the same measured variables have the same name and unit, even if they come from different devices. You can find out which standards Datico® uses for this on the Standards page.
  • History rather than snapshot: many questions can only be answered longitudinally. For this, data has to come together over months, accurately assigned to person and time.

How devices and systems are connected is described in the guide Connecting medical devices. For wearable data, the guide Using wearables in compliance with the GDPR also applies.

Checklist: introducing AI with health data

These points should be clarified and documented before you start.

  1. Define the purpose: what should the AI application achieve, and which data does it really need for this?
  2. Check the legal basis: Art. 6 and Art. 9(2) GDPR for exactly this purpose and, for research and quality assurance, also Section 6 GDNG.
  3. Clarify the classification: is the application a medical device or a high-risk AI system? Record the intended purpose in writing.
  4. Choose the architecture: where does the language model run, and who sees which data? No health data to services without a contract and a verified basis for third-country transfers.
  5. Conclude contracts: data processing agreements under Art. 28 GDPR with the platform, hosting and AI service; take professional secrecy under Section 203 StGB into account.
  6. Carry out a data protection impact assessment: for AI with health data, it is required as a rule (Art. 35 GDPR).
  7. Minimise data: pseudonymise where a link to the person is not needed; individual values only for the professional providing care.
  8. Enforce rights: roles and rights also apply to every AI connection.
  9. Connect consent: withdrawals must reach the AI application.
  10. Log: every access and every model version is traceable.
  11. Safeguard the human decision: results are suggestions, and the professional makes the decision.
  12. Train staff: build up and document AI literacy under Art. 4 AI Act.

If you would like to check how your own application can run on the Datico® Life Hub, talk to us in a personal initial consultation.

Frequently asked questions

Can I enter patient data into ChatGPT or another cloud AI service?

Only on a verified basis. Entering personal health data into a public AI service is a transfer to a third party, often outside the EU. For this, you need a legal basis under Art. 9 GDPR, a data processing agreement, a basis for the third-country transfer and, for professionals bound by confidentiality, a solution for professional secrecy. With consumer accounts lacking such contracts, these requirements are generally not met. It is unproblematic if the AI only helps with building and never sees real patient data.

Is pseudonymised health data unproblematic for AI?

No. Pseudonymised data remains personal data, and the GDPR continues to apply. Pseudonymisation does, however, reduce the risk considerably and is usually the method of choice for analysis and research. Data is only anonymous once a person can no longer be identified, even with reasonable effort. With detailed longitudinal data from wearables and devices, this is difficult to achieve.

Is my AI application a medical device?

That depends on its intended purpose. Software intended for diagnosis, monitoring or treatment decisions for individual patients can be a medical device under the MDR. Pure documentation, display and administration are assessed differently. If the software is a medical device that must be assessed by a notified body, it is additionally considered a high-risk AI system under the AI Act.

What does the AI Act require of clinics that only use AI?

Deployers have obligations too. Since February 2025, organisations that use AI must ensure their staff have sufficient AI literacy (Art. 4 AI Act). For high-risk AI systems, there are additional obligations concerning use in accordance with the instructions, human oversight, monitoring and retention of logs. For systems that are also medical devices, these obligations apply, as things stand, from August 2027.

May we use our treatment data to train our own AI model?

Training is a separate purpose and needs its own legal basis, such as consent or a statutory basis for research and quality assurance. In Germany, Section 6 of the German Health Data Use Act (GDNG) allows institutions, under certain conditions, to further process their own care data for quality assurance, patient safety and research. Clarify the basis before training, not afterwards.

How does an AI application access the data in the Datico® Life Hub?

Via the MCP Server and the Smart API. Each AI connection has its own credentials, bound to a rights profile. In it, you define which people, groups, parameters and time periods may be queried. Access is read-only, encrypted and logged in the Audit Trail. You decide which language model you use.

Related features

Markus Stadler, Managing Director
Markus Stadler Managing Director, Datico®

Let’s talk about your project.

“In 30 minutes we clarify what you want to achieve and which of your devices we will connect. Personally and without a sales loop.”

+49 8677 76794-0 info@datico.com