Skip to main content

Generate realistic healthcare test data in 6 languages (en, es, pt, zh, fr, de): 150+ diseases with correlated ICD-10 codes, medications, symptoms, and more

Project description

faker-healthcare-provider

Generate realistic, medically accurate, and correlated healthcare/medical test data in 6 languages: English, Spanish, Portuguese, Chinese, French, and German.

This provider generates correlated clinical data based on the World Health Organization (WHO) ICD-10 classification, ensuring that symptoms, medications, specialties, and diagnostic codes match the generated disease.

Installation

pip install faker-healthcare-provider

Quick Start

from faker import Faker
from faker_healthcare import HealthcareProvider

# English (default)
fake = Faker()
fake.add_provider(HealthcareProvider)

# Generate a complete patient scenario
scenario = fake.patient_scenario()
print(scenario)
# {
#   'disease': 'Type 2 Diabetes',
#   'icd10': 'E11.9',
#   'symptoms': ['Fatigue', 'Blurred Vision', 'Frequent Urination'],
#   'medications': ['Metformin', 'Insulin Glargine'],
#   'specialty': 'Endocrinology'
# }

# Or generate individual data
fake.disease()            # 'Essential Hypertension'
fake.diagnosis()          # 'Type 2 Diabetes (E11.9)'
fake.medical_specialty()  # 'Cardiology'

# Use a different language (Spanish, Portuguese, Chinese, French, German)
fake_es = Faker('es_ES')
fake_es.add_provider(HealthcareProvider)
fake_es.disease()         # 'Diabetes Tipo 2'
fake_es.diagnosis()       # 'Diabetes Tipo 2 (E11.9)'

💡 Tip: Run python showcase.py to see all available features and examples!

Usage

  • 🇺🇸 English (en_US) - Default
  • 🇪🇸 Spanish (es_ES)
  • 🇧🇷 Portuguese (pt_BR - Brazil)
  • 🇨🇳 Chinese (zh_CN - Simplified)
  • 🇫🇷 French (fr_FR)
  • 🇩🇪 German (de_DE)

Usage

Basic Usage (English)

from faker import Faker
from faker_healthcare import HealthcareProvider

fake = Faker()
fake.add_provider(HealthcareProvider)

fake.diagnosis()          # 'Type 2 Diabetes (E11.9)'
fake.disease()            # 'Essential Hypertension'
fake.icd10_code()         # 'I10'
fake.generic_drug()       # 'Metformin'
fake.medical_specialty()  # 'Cardiology'
fake.blood_type()         # 'O+'

Multi-Language Support

from faker import Faker
from faker_healthcare import HealthcareProvider

# Spanish
fake_es = Faker('es_ES')
fake_es.add_provider(HealthcareProvider)
fake_es.disease()  # 'Diabetes Tipo 2'

# Portuguese (Brazil)
fake_pt = Faker('pt_BR')
fake_pt.add_provider(HealthcareProvider)
fake_pt.disease()  # 'Diabetes Tipo 2'

# Chinese (Simplified)
fake_zh = Faker('zh_CN')
fake_zh.add_provider(HealthcareProvider)
fake_zh.disease()  # '2型糖尿病'

# French
fake_fr = Faker('fr_FR')
fake_fr.add_provider(HealthcareProvider)
fake_fr.disease()  # 'Diabète de Type 2'

# German
fake_de = Faker('de_DE')
fake_de.add_provider(HealthcareProvider)
fake_de.disease()  # 'Typ-2-Diabetes'

Available Methods

Method Example
diagnosis() Type 2 Diabetes (E11.9)
disease() Essential Hypertension, Asthma
icd10_code() E11.9, I10, J45.909
medical_specialty() Cardiology, Neurology
hospital_department() Emergency, ICU, Radiology
generic_drug() Metformin, Lisinopril
brand_drug() Lipitor, Prozac, Ozempic
symptom() Fever, Headache, Fatigue
blood_type() A+, O-, AB+
allergy() Penicillin, Peanuts
medical_procedure() MRI Scan, Blood Test
insurance_plan() PPO, HMO, Medicare
vital_sign() Blood Pressure, Heart Rate

Locale-Specific Features

Each locale includes:

  • Translated medical terminology (diseases, symptoms, procedures)
  • Locale-specific insurance systems:
    • 🇺🇸 US: Medicare, PPO, HMO
    • 🇪🇸 Spain: Sistema Nacional de Salud, Sanitas, Adeslas
    • 🇧🇷 Brazil: SUS, Unimed, Amil
    • 🇨🇳 China: 城镇职工基本医疗保险, 商业医疗保险
    • 🇫🇷 France: Sécurité Sociale, Mutuelle
    • 🇩🇪 Germany: GKV, PKV

Universal data (same across all languages):

  • ICD-10 codes (international standard)
  • Blood types (universal notation)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

faker_healthcare_provider-2.1.0.tar.gz (97.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

faker_healthcare_provider-2.1.0-py3-none-any.whl (101.8 kB view details)

Uploaded Python 3

File details

Details for the file faker_healthcare_provider-2.1.0.tar.gz.

File metadata

File hashes

Hashes for faker_healthcare_provider-2.1.0.tar.gz
Algorithm Hash digest
SHA256 84175703e9b18cca00879e0df91144cf3650f20ed96245bfeaf91ab165b43d49
MD5 8b3236f1e90f5191da0474ea78130705
BLAKE2b-256 238d5d421851eeef29293ef819815baa0e89d90f24fbfdedc404ef66af100e3e

See more details on using hashes here.

File details

Details for the file faker_healthcare_provider-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for faker_healthcare_provider-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdba884f5faad84a5e73b99ac5991fc2a085cff7f5f2864744dc579034844b11
MD5 366ce2b5feaea70231fd07af9df84f5c
BLAKE2b-256 f81545666eea0e96b1e3b05bdf8d0d053c7ca9b7ea9c7582a3b21e7c7273fed0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page