health-cloud-apis

Use this skill when working with Health Cloud APIs: querying healthcare-specific SObjects (CarePlan, ClinicalEncounter, HealthCondition) via standard SObject API, using the FHIR R4-aligned Healthcare API, handling FHIR bundle limits, and understanding API authentication differences between the two layers. NOT for generic REST API development or standard Salesforce SObject API patterns unrelated to Health Cloud clinical objects.

Best use case

health-cloud-apis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use this skill when working with Health Cloud APIs: querying healthcare-specific SObjects (CarePlan, ClinicalEncounter, HealthCondition) via standard SObject API, using the FHIR R4-aligned Healthcare API, handling FHIR bundle limits, and understanding API authentication differences between the two layers. NOT for generic REST API development or standard Salesforce SObject API patterns unrelated to Health Cloud clinical objects.

Teams using health-cloud-apis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/health-cloud-apis/SKILL.md --create-dirs "https://raw.githubusercontent.com/PranavNagrecha/AwesomeSalesforceSkills/main/skills/apex/health-cloud-apis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/health-cloud-apis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How health-cloud-apis Compares

Feature / Agenthealth-cloud-apisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use this skill when working with Health Cloud APIs: querying healthcare-specific SObjects (CarePlan, ClinicalEncounter, HealthCondition) via standard SObject API, using the FHIR R4-aligned Healthcare API, handling FHIR bundle limits, and understanding API authentication differences between the two layers. NOT for generic REST API development or standard Salesforce SObject API patterns unrelated to Health Cloud clinical objects.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Health Cloud APIs

Use this skill when working with Health Cloud APIs: querying healthcare-specific SObjects via the standard SObject REST/SOAP API, using the FHIR R4-aligned Healthcare API for FHIR operations, handling FHIR bundle constraints, and understanding authentication and endpoint differences between the two API layers. This skill covers Health Cloud-specific API patterns. It does NOT cover generic REST API development, standard Salesforce SObject API patterns for non-Health Cloud objects, or platform API integration architecture.

---

## Before Starting

Gather this context before working on anything in this domain:

- Confirm the FHIR-Aligned Clinical Data Model org preference is enabled in Setup > FHIR R4 Support Settings. FHIR R4-aligned objects are unavailable for API operations until this is enabled.
- Identify whether the operation requires the **standard SObject API** (for clinical SObjects like CarePlan, ClinicalEncounter, HealthCondition using standard REST/SOQL/SOAP patterns) or the **FHIR Healthcare API** (for FHIR R4-conformant operations using FHIR bundle structures).
- For FHIR Healthcare API calls: confirm the Connected App is configured with the `healthcare` OAuth scope (in addition to the standard `api` scope). FHIR Healthcare API rejects requests with only the standard `api` scope.
- Understand the FHIR bundle limits: maximum 30 entries per bundle, maximum 10 read/search operations per bundle. Failed dependent entries return HTTP 424 (Failed Dependency) rather than the individual entry error code.

---

## Core Concepts

### Two Distinct API Layers

Health Cloud exposes two API layers:

1. **Standard SObject API** — Healthcare-specific SObjects (CarePlan, ClinicalEncounter, HealthCondition, PatientImmunization, etc.) available via API v51.0+ are accessible through all standard Salesforce API mechanisms: REST, SOAP, Bulk API, SOQL. These are platform-standard objects with no special authentication or endpoint requirements. Access requires the HealthCloudICM permission set.

2. **FHIR R4-aligned Healthcare API** — A separate API layer that exposes seven FHIR R4 modules (Patient, Condition, Observation, etc.) via a dedicated FHIR endpoint. This API requires:
   - A different base URL: `/services/data/vXX.0/healthcare/fhir/R4/` instead of `/services/data/vXX.0/sobjects/`
   - The `healthcare` OAuth scope in addition to standard scopes
   - FHIR R4-aligned Clinical Data Model enabled in Setup

These two layers are not interchangeable. Using the standard SObject endpoint for FHIR operations or the FHIR endpoint for standard SOQL queries will fail.

### FHIR Bundle Limits

FHIR Healthcare API bundle requests have specific limits:
- **Maximum 30 entries per bundle** — bundles with more than 30 entries are rejected
- **Maximum 10 read/search operations per bundle** — bundles mixing reads/writes are limited to 10 read/search entries
- **HTTP 424 for dependent entry failures** — if a bundle entry fails and a later entry depends on it (via fullUrl reference), the dependent entry returns HTTP 424 (Failed Dependency) rather than propagating the original error code

These limits require chunking logic for bulk clinical data operations.

### FHIR vs. SObject Authentication

| Auth Requirement | Standard SObject API | FHIR Healthcare API |
|---|---|---|
| OAuth scope | `api` | `api` + `healthcare` |
| Base URL | `/services/data/vXX.0/sobjects/` | `/services/data/vXX.0/healthcare/fhir/R4/` |
| Access required | HealthCloudICM perm set | HealthCloudICM perm set + FHIR R4 perm |
| Experience Cloud | Standard EC user | FHIR R4 for Experience Cloud perm set |

---

## Common Patterns

### Querying Clinical SObjects via Standard REST API

**When to use:** Reading or writing clinical data (CarePlan goals, patient conditions, clinical encounters) using standard REST API patterns from an external integration.

**How it works:**
1. Use the standard REST SObject endpoint: `GET /services/data/v60.0/sobjects/HealthCondition/{id}`
2. For SOQL: `GET /services/data/v60.0/query?q=SELECT+Id,ConditionSeverity+FROM+HealthCondition+WHERE+PatientId='{patientId}'`
3. Ensure the integration user has the HealthCloudICM permission set assigned.
4. Use API v51.0 or later for all Health Cloud healthcare-specific objects.

**Why not the alternative:** The FHIR Healthcare API is needed for FHIR-conformant operations but adds complexity (bundle structures, special scopes, different error handling). For internal integrations that do not need FHIR R4 compliance, the standard SObject API is simpler and more performant.

### FHIR Bundle Read with Error Handling

**When to use:** Reading a patient's clinical data set via the FHIR Healthcare API in a FHIR-conformant response structure.

**How it works:**
1. Make a GET request to `/services/data/v60.0/healthcare/fhir/R4/Patient/{patientId}/$everything`
2. The response is a FHIR Bundle with up to 30 entries.
3. Check each bundle entry's `response.status` field. Failed entries have status 4xx or 5xx.
4. Dependent entries that reference a failed entry have `response.status = "424 Failed Dependency"`.
5. Process each entry independently and implement retry logic for 424 entries after fixing the root cause.

---

## Decision Guidance

| Situation | API Layer | Reason |
|---|---|---|
| SOQL query on clinical objects | Standard SObject API | Simpler, supports all SOQL features |
| FHIR-conformant read/write for interoperability | FHIR Healthcare API | Required for FHIR R4 compliance |
| Bulk load of clinical data | Standard Bulk API | Better throughput than FHIR bundle limits |
| External FHIR server reading Salesforce data | FHIR Healthcare API | Provides FHIR R4 bundle responses |
| Integration requires FHIR $everything operation | FHIR Healthcare API | Only available in FHIR layer |

---

## Recommended Workflow

1. **Confirm FHIR R4 prerequisites** — enable FHIR R4 Support Settings if not already done. Identify target API layer (standard SObject vs. FHIR Healthcare API) based on interoperability requirements.
2. **Configure Connected App** — for FHIR Healthcare API: add `healthcare` OAuth scope to the Connected App. For standard SObject API: standard `api` scope is sufficient.
3. **Assign required permission sets** — HealthCloudICM for all API users accessing clinical objects. FHIR R4 for Experience Cloud perm set if portal users need FHIR access.
4. **Implement bundle chunking** — for FHIR Healthcare API batch operations, implement request chunking at a maximum of 30 entries per bundle and 10 read/search operations per bundle.
5. **Handle HTTP 424 errors** — implement dependent entry error detection: identify which bundle entry failed and process dependent entries separately after fixing the root failure.
6. **Test with representative data volume** — FHIR bundle limits become apparent only at production data volumes. Test with real bundle sizes before go-live.

---

## Review Checklist

- [ ] FHIR R4 Support Settings enabled (if using FHIR Healthcare API)
- [ ] Connected App has `healthcare` OAuth scope (if using FHIR Healthcare API)
- [ ] HealthCloudICM permission set assigned to all API users
- [ ] Bundle size chunking implemented (max 30 entries, max 10 reads per bundle)
- [ ] HTTP 424 dependent entry error handling implemented
- [ ] API version is v51.0+ for all Health Cloud SObjects

---

## Salesforce-Specific Gotchas

1. **FHIR Healthcare API and standard SObject API use different base URLs** — Calls to healthcare-specific objects via the standard SObject endpoint return the object data as plain SObject JSON. FHIR Healthcare API calls require the `/healthcare/fhir/R4/` path and return FHIR bundle structures. Using the wrong endpoint returns unexpected response formats, not an error.

2. **FHIR bundle failures use HTTP 424 for dependent entries** — When a bundle entry fails, all subsequent entries that reference the failed entry via fullUrl return HTTP 424 rather than the original error code. Code that checks only for 2xx/4xx status may misinterpret 424 as a different error. Always check for 424 specifically and trace back to the root failed entry.

3. **`healthcare` OAuth scope required for FHIR Healthcare API** — A Connected App with only the standard `api` scope cannot call the FHIR Healthcare API endpoints. The request returns a 403 Forbidden. Add the `healthcare` scope explicitly to the Connected App configuration.

---

## Output Artifacts

| Artifact | Description |
|---|---|
| API endpoint selection matrix | Table mapping clinical operations to the correct API layer (SObject vs. FHIR) |
| Connected App configuration | OAuth scope requirements for each API layer |
| Bundle chunking implementation | Logic for splitting operations into correctly-sized FHIR bundles |
| Error handling pattern | HTTP 424 detection and dependent entry retry pattern |

---

## Related Skills

- apex/fhir-integration-patterns — FHIR R4 integration patterns including CDS Hooks and SMART on FHIR
- admin/clinical-data-requirements — FHIR R4 object activation and data model requirements
- admin/health-cloud-data-model — Health Cloud object reference

Related Skills

security-health-check

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when running, interpreting, or acting on Salesforce Security Health Check results — reading the score, understanding risk categories, evaluating specific settings, creating or importing a custom baseline, querying the Tooling API programmatically, or planning remediation from findings. Triggers: 'security health check score', 'health check failing settings', 'custom baseline', 'remediate health check findings', 'fix risk'. NOT for org hardening implementation, permission model design, or broad baseline config beyond what Health Check directly measures.

experience-cloud-security

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when configuring access controls, sharing, or site security for authenticated or guest Experience Cloud (community) users: external OWD, Sharing Sets, Share Groups, CSP, clickjack protection, guest user record access. NOT for internal sharing model configuration (use sharing-and-visibility).

headless-experience-cloud

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when building custom frontends (React, Vue, mobile, static sites) that consume Salesforce CMS content via the Connect REST API headless delivery endpoint. Triggers: 'headless Salesforce CMS', 'deliver CMS content to external frontend', 'React app Salesforce content API', 'custom frontend Experience Cloud data', 'CMS delivery channel API'. NOT for standard Experience Builder site development. NOT for CMS Connect (3rd-party CMS federation into Experience Builder). NOT for Experience Cloud LWC components rendered inside a site.

experience-cloud-search-customization

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring or extending search on an Experience Cloud site — covering Search Manager scope configuration, LWR vs Aura search component selection, federated search setup, guest user search access, and custom search result components. NOT for SOSL/SOQL query development. NOT for internal Salesforce global search or Einstein Search for agents.

experience-cloud-multi-idp-sso

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring multiple identity providers (OIDC and/or SAML) on a single Experience Cloud site or across tenant-specific portals in the same org — covering auth provider registration, Start SSO URL routing, Federation ID mapping, RegistrationHandler implementation, and simultaneous SP+IdP topology. Trigger keywords: multiple identity providers Experience Cloud, multi-tenant SSO community portal, vendor and citizen portal same site, OIDC SAML both on login page, tenant-specific login routing community. NOT for internal Salesforce employee SSO configuration. NOT for single auth provider setups — see experience-cloud-authentication for basic SSO.

experience-cloud-lwc-components

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when building custom LWC components for Experience Cloud (Experience Builder sites, LWR portals, Aura-based communities). Covers community context imports, guest user Apex access patterns, navigation API differences between LWR and Aura, and JS-meta.xml target configuration for Experience Builder exposure. NOT for internal LWC components deployed to Lightning App Builder or standard record pages (see lwc/lwc-development). NOT for Aura community components. Trigger keywords: build LWC for Experience Cloud, custom component community portal LWC, guest user LWC component, community context import salesforce, lightningCommunity target, @salesforce/community, guest Apex.

experience-cloud-authentication

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when building custom login pages, social SSO flows, self-registration flows, or passwordless OTP login for Experience Cloud (community) sites. Trigger keywords: custom login page Experience Cloud, social SSO community portal, passwordless login Experience Cloud, self-registration custom flow, headless authentication community, auth provider OIDC SAML site. NOT for internal SSO configuration (use identity/sso skills). NOT for standard username/password authentication with no customization.

experience-cloud-api-access

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring or troubleshooting API access for Experience Cloud external users and guest users: guest user Apex data access, Customer Community Plus or Partner Community REST/SOAP API access, external user OAuth scopes, and sharing enforcement on API responses. Trigger keywords: Experience Cloud API access external user, community user REST API, guest user API limits, Customer Community API permissions, external user OAuth. NOT for internal Salesforce API authentication, non-community OAuth flows, or internal user API security.

net-zero-cloud-setup

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring Salesforce Net Zero Cloud — including Scope 1/2/3 emission source modeling via the StnryAssetCrbnFtprnt / VehicleAssetCrbnFtprnt / Scope3CrbnFtprnt object families, emission factor library setup (EmssnFctr / EmssnFctrSet), DPE-driven carbon calculation jobs, supplier engagement scoring, and CSRD / ESRS / TCFD disclosure pack mapping. Triggers on: Net Zero Cloud setup, Sustainability Cloud carbon accounting, Scope 1 2 3 emissions Salesforce, emission factor library, supplier engagement Net Zero, ESG disclosure pack mapping. NOT for ESG content scoring (use Marketing Cloud), NOT for general financial reporting (use Accounting Subledger), NOT for energy-only utility billing (use Energy & Utilities Cloud).

manufacturing-cloud-setup

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring Salesforce Manufacturing Cloud — including Sales Agreement setup, Account-Based Forecasting (ABF) recalc jobs, run-rate management, Rebate Management programs, channel inventory tracking via Channel Revenue Management, and Group Membership / OrderItem-to-SalesAgreement reconciliation. Triggers on: Manufacturing Cloud setup, Sales Agreement Salesforce, account-based forecast recalculation, run rate manufacturing, rebate program setup, channel revenue management. NOT for general Sales Cloud opportunity-to-order flow (use standard Opportunity / Order), NOT for Field Service install-base management (use FSL skills), NOT for Automotive Cloud dealer modeling (use automotive-cloud-setup).

data-cloud-zero-copy-federation

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring or troubleshooting Data Cloud Zero Copy / Lakehouse Federation against Snowflake, Databricks, BigQuery, or Redshift — including external Data Lake Object setup, query semantics through federation, refresh and cache behavior, and choosing federation versus physical ingestion. Triggers on: Data Cloud federated DLO setup, query latency against external warehouse, Snowflake/Databricks/BigQuery integration with Data Cloud, federation vs ingestion decision. NOT for physical Ingestion API streaming/bulk patterns (use data-cloud-integration-strategy), not for CRM Analytics external connectors (use analytics-external-data), not for outbound Data Cloud activation to external systems (use data-cloud-activation-development).

data-cloud-query-api

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when querying unified profile data, calculated insights, or Data Lake Objects from Data Cloud using ANSI SQL via the Query V2 or Query Connect APIs. Triggers on: SQL queries against Data Cloud, querying unified individuals, querying DMOs via API, paginating large Data Cloud result sets. NOT for SOQL queries against standard Salesforce objects, not for Data Cloud segment filtering in the UI, not for vector/semantic search (use data-cloud-vector-search-dev).