CareSystemFieldMapping defines how fields from a source system map to Salesforce objects and fields. In Health Cloud and Life Sciences Cloud integrations, its role identifies how an external identifier is used for enrollment or remote-monitoring relationships.
This type stores mapping configuration, not patient, provider, device, or observation records. A mapping's presence does not mean it is active, and mappings that target the same Salesforce object can have different integration meanings.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The component's metadata identity, inherited from Metadata. It is distinct from the display name in masterLabel. |
masterLabel |
Required. The mapping's display name. |
role |
Required. Defines the integration purpose. Allowed values are Patient, ServiceProvider, RemoteMonitoringDevice, RemoteMonitoringPatient, and NotApplicable. Interpret it together with targetObject. |
targetObject |
The Salesforce object to which the external system field is mapped. The documented object choices depend on role. |
externalIdField |
The field identifier used by the mapping. Resolve its field association in the context of targetObject; its description has an ambiguity explained below. |
isActive |
Whether the mapping is active. Accepts true or false and defaults to false. |
isProtected |
An auto-generated value that currently has no effect on this type's behavior. It is not an access-control setting. |
The sourceSystem string identifies the system where the record originated.
Behavior and Constraints
Using this metadata type requires an org with a Health Cloud or Life Sciences Cloud license. The user must have the Health Cloud Foundation permission set for Health Cloud, or the Health Cloud Starter permission set for Life Sciences Cloud.
The documented combinations of role and targetObject are:
-
PatientwithAccount: The Enrollment API uses the value ofexternalIdFieldas the patient ID. -
ServiceProviderwithAccount: The Enrollment API uses the value ofexternalIdFieldas the provider ID. -
RemoteMonitoringDevicewithAsset: Identifies whichexternalIdFieldonAssetmaps to theDevicefield inCareObservation. -
RemoteMonitoringPatientwithAccount: Identifies whichexternalIdFieldonAccountmaps to theObservedSubjectfield inCareObservation. -
NotApplicablewithCareProgramorProduct: Indicates that no applicable role exists for the mapping.
These roles are not interchangeable simply because they share a target object. For example, Patient, ServiceProvider, and RemoteMonitoringPatient all use Account, but serve different integration purposes.
Check isActive independently of the mapping's existence. Its default is false. Do not use isProtected to determine whether users can access the mapping or whether it is protected from changes; that element currently has no behavioral effect.
Deployment and Retrieval
CareSystemFieldMapping components use the .careSystemFieldMapping suffix and reside in the careSystemFieldMappings folder. In package.xml, use CareSystemFieldMapping as the type name and the component's fullName as the member name.
Keep deployment identity separate from the display label. The example component has masterLabel set to Map1, while its package member is patient; the label is not the component's metadata identity.
When preparing a deployment, resolve targetObject and externalIdField together. The object association points to CustomObject metadata, and the field association points to CustomField metadata in that object's context. Also preserve the intended role and isActive values: having a component in the destination does not, by itself, establish that the mapping is active.
Relationships
The mapping connects an object and field definition to an integration role. Its role can also describe enrollment identifiers or links to fields on CareObservation; those integration meanings are separate from its metadata element references.
References
-
CustomField:externalIdField. -
CustomObject:targetObject.
Documentation Inconsistencies
The description of externalIdField calls it the ID of a field in the external system, but the role definitions associate it with a field on the Salesforce target object. The example uses AccountNumber with targetObject set to Account and role set to Patient.
Resolve the field association in the context of the selected target object. Do not confuse the configured field identifier with an individual patient or provider record ID.
Common Questions
Why is my CareSystemFieldMapping not active after deployment?
The component's presence does not establish activation. Check isActive, which defaults to false.
Which role should I use for an Account mapping?
Use Patient for an Enrollment API patient identifier, ServiceProvider for an Enrollment API provider identifier, or RemoteMonitoringPatient for the identifier mapped to CareObservation.ObservedSubject.
Is externalIdField a patient record ID?
Do not treat the configured field identifier as an individual record ID. Resolve it against targetObject. The example uses the field name AccountNumber on Account, although the element's description ambiguously refers to a field in the external system.
Does isProtected control access to the mapping?
No. It is auto-generated and currently has no behavioral effect. Access requires the applicable Health Cloud or Life Sciences Cloud license and permission set.
What name should I use in package.xml?
Use the component's fullName as the member name under CareSystemFieldMapping. Do not substitute its masterLabel, which is the display name.