Schema Metatag Hospital
This project extends the Schema Metatag module to include 15 additional Schema.org Organization properties specifically for healthcare organizations. It adds fields for medical specialties, employees, services, and various identifiers to improve search engine visibility and data structure for healthcare websites.
Schema Hospital is a lightweight extension to the Schema Metatag module that adds 15 missing Schema.org Organization properties commonly needed by healthcare organizations but not included in the base schema_organization submodule.
Why Schema Hospital?
Healthcare organizations need comprehensive Schema.org markup to:
- Improve search engine visibility
- Enable rich snippets in search results
- Help patients find important information quickly
- Provide structured data for voice assistants and AI tools
While the schema_organization module provides 23 basic Organization properties, it's missing critical healthcare-specific fields like medical specialties, employee listings, service catalogs, and organizational identifiers.
What It Does
Schema Hospital adds 15 new fields to the existing schema_organization metatag group:
Basic Information:
- alternateName - Hospital abbreviations and alternate names
- legalName - Official registered legal entity name
- foundingDate - Organization establishment date
- email - Primary contact email address
- numberOfEmployees - Current employee count
Healthcare Relationships:
- employee - Links to staff/provider Person entities (multiple)
- availableService - Links to medical Service entities (multiple)
- medicalSpecialty - Medical specialties offered (multiple)
Organizational Identifiers:
- vatID - Value Added Tax identification
- leiCode - Legal Entity Identifier (20-character code)
- taxID - Tax/Fiscal identification (EIN in US)
- duns - Dun & Bradstreet number
- iso6523Code - ISO 6523 organization identifier
- naics - NAICS classification code (622110 for hospitals)
- globalLocationNumber - GS1 Global Location Number
All fields integrate into the existing schema_organization group and appear together in a single Schema.org Organization JSON-LD object on your homepage.
Key Features
✅ Seamless Integration - Extends existing schema_organization group, not a separate schema
✅ Token Support - All fields support token replacement (works great with Config Pages module)
✅ Multiple Values - Employee, service, and specialty fields support multiple entries
✅ Standards Compliant - All fields match official Schema.org specifications
✅ Well Tested - Comprehensive functional tests included
✅ Drupal 10 & 11 - Compatible with current and next-gen Drupal
Perfect For
- Hospital websites
- Medical clinic sites
- Physician practice websites
- Healthcare system sites
- Medical research organizations
- Any healthcare organization needing comprehensive Schema.org markup
Installation
composer require drupal/schema_hospital
drush en schema_hospital -y
drush crConfiguration
After installation:
1. Navigate to a metatag configuration page:
- Global: /admin/config/search/metatag/global
- Front page: /admin/config/search/metatag/front
- Content type: /admin/structure/types/manage/[type]/edit
2. Expand the "Schema.org Organization" section
3. Fill in the new Schema Hospital fields alongside existing schema_organization fields
4. Save and clear cache
### Using with Config Pages (Recommended)
For site-wide organization data management:
composer require drupal/config_pages
drush en config_pages -yCreate a config page type for organization schema, add fields matching the Schema.org properties, and use tokens in your metatag configuration:
[config_pages:organization_schema:field_org_alternate_name]
[config_pages:organization_schema:field_org_email]
[config_pages:organization_schema:field_org_num_employees]Example Output
When configured, your homepage will output JSON-LD like:
{
"@context": "https://schema.org",
"@type": "Hospital",
"name": "Saltmarsh Island Healthcare",
"alternateName": "SIH",
"legalName": "Saltmarsh Island Healthcare Corporation",
"url": "https://example.com",
"foundingDate": "1952-07-15",
"email": "[email protected]",
"numberOfEmployees": 150,
"employee": [
"https://example.com/providers/dr-jane-smith",
"https://example.com/providers/dr-john-doe"
],
"availableService": [
"https://example.com/services/emergency-care",
"https://example.com/services/primary-care"
],
"medicalSpecialty": [
"Emergency Medicine",
"Family Medicine"
],
"taxID": "01-2345678",
"naics": "622110"
}Validate with: