Provider Services API

Mappings

Provider Services Mappings

SBC and DCR use separate mapping paths because data moves in opposite directions. SBC maps OneKey data into Salesforce, while DCR maps Salesforce changes into OneKey.

Data Change Request (DCR)

DCR pushes changes out to OneKey, so the Salesforce field is the source and the OneKey field is the target. This direction is the reverse of Provider Bulk Sync.

Everything below is the out-of-the-box mapping that ships with the connector. The mapping is metadata-driven and also includes explicit DataWeave logic for entity selection and field transformations: the field list lives in mapping.json, the in-scope entities live in objects.json, the mandatory-field rules live in schema.json, and the transformation logic lives in mapper.dwl, all under onekey-sys-impl/src/main/resources/mappingTemplates/validation/. To change what is mapped, add code-value translations, or apply per-country rules, see the Extend Connector guide; make those changes in the OneKey System API mapping layer, not in the application flows.

How the Mapping Works

A DCR is submitted as a request that carries an operation (create or update), an entityType (activity or workplace), and an entityData object holding the changed Salesforce entities. The System API resolves the mapping in three stages:

  1. Physical entity allow-list (objects.json). Six physical Salesforce entities are accepted out of the box. A request that includes any other entity is rejected with "Your request includes unsupported entities: {0}...".
Entity KeySalesforce Entity
ACCOUNTAccount
HCPHealthcareProvider
HCP_SPECIALTYHealthcareProviderSpecialty
CARE_SPECIALTYCareSpecialty
ADDRESSContactPointAddress
AFFILIATIONProviderAffiliation
  1. Field mapping (mapping.json via mapper.dwl). Each Salesforce field is matched (case-insensitively) to its OneKey target field and internal mapping field. Account fields resolve to either Individual (HCP) or Workplace (HCO) targets depending on whether the record has a LastName (Individual) or only a Name (Workplace). mapper.dwl then applies field-specific transformations (code-value translations, birth-date splitting, date reformatting) and appends OPERATION and ENTITY_TYPE.

  2. Schema validation (schema.json). Before the request is sent to OneKey, the mapped payload is validated against a JSON Schema (draft-07). Missing mandatory fields fail with "Missing required fields: {0}...". The mandatory set depends on the operation, the entity type, and the country (see Mandatory Fields).

DCR Entity Type Resolution

A DCR request must carry one of two entity types. The value controls the mapping branch and mandatory-field rules:

  • activity: required for every HCP-related DCR. The Provider Services API sets this value when the Account is a person account (IsPersonType).
  • workplace: required for every HCO-related DCR.

These are the only values allowed by the DCR schema.json. Use workplace, not workspace; workspace fails schema validation.

Affiliation eligibility is a separate check. An affiliation is submitted only when its AffiliationType is Hard (dcr.activityAffiliationType). DCRs for non-activity (non-Hard) affiliations are not supported by the MDM system; the connector fails them locally with "DCRs for non-activity type affiliations are not supported by the MDM system" without calling OneKey.

In the mapping tables that follow, the Mandatory column shows whether a field is required for an HCP (activity), an HCO (workplace), or both, and for which operation.

Null and Empty Value Handling

The DCR mapping pipeline uses the DataWeave output directive skipNullOn = "everywhere" (sometimes described as skipNull = "everywhere"). By default, null values are omitted from objects and arrays instead of being serialized into the OneKey request. Selected empty values are also omitted when mapper logic uses isEmpty or converts an unresolved value to null.

Examples:

  • If ContactPointAddress.Street resolves to null, the request omits ADD_STREET; it doesn't send "ADD_STREET": null.
  • If ProfessionalTitle has no matching code translation, mapper.dwl converts the unresolved result to null, so IND_HCP_TITLE is omitted.
  • If a DCR comment is empty after trimming, setVrSubmitRequestPayload.dwl doesn't add validation.requestComment.

skipNullOn doesn't remove every empty string by itself. Empty values are omitted only when the surrounding mapper explicitly tests isEmpty or normalizes the value to null.

If a OneKey contract requires an explicit null or empty value, update the mapping pipeline in this order:

  1. Confirm that the target OneKey field accepts the explicit value. Sending null where the contract doesn't allow it causes downstream validation failures.
  2. Update the output directive or field-specific condition in provider-services-impl/src/main/resources/dwl/dcr/submitSAPIRequest.dwl so the Process API preserves the value sent to the System API.
  3. Update onekey-sys-impl/src/main/resources/mappingTemplates/validation/mapper.dwl so the field mapping doesn't normalize or drop the value.
  4. Update onekey-sys-impl/src/main/resources/dwl/vr/setVrSubmitRequestPayload.dwl so the final OneKey payload includes the field.
  5. Test the Process-to-System request and the final System-to-OneKey payload for the affected country, operation, and entity type.

This behavior isn't controlled by a runtime property; changing it requires mapper-script changes at every stage that currently omits the value.

Account Mapping

Account fields map to OneKey Workplace (HCO) or Individual (HCP) targets. The SourceSystemIdentifier is the OneKey entity ID and is mandatory only on update (on create, OneKey generates it).

Salesforce FieldOneKey Target FieldMapping FieldTransformationMandatoryTransformation with Example
SourceSystemIdentifierworkplace.workplaceEidWKP_ONEKEY_IDDirect✅ HCO update"WFR123" → "WFR123"
SourceSystemIdentifierindividual.individualEidIND_ONEKEY_IDDirect✅ HCP update"IFR123" → "IFR123"
Nameworkplace.usualNameWKP_USUAL_NAMEDirect✅ HCO always; HCP non-US"City Hospital" → "City Hospital"
FirstNameindividual.firstNameIND_FIRST_NAMEDirect✅ HCP"John" → "John"
LastNameindividual.lastNameIND_LAST_NAMEDirect✅ HCP"Doe" → "Doe"
Phoneworkplace.telephoneWKP_PHONE_NUMBERDirect❌"5551234" → "5551234"
Faxworkplace.faxWKP_TELEPHONE_FAXDirect❌"5555678" → "5555678"
PersonBirthdateindividual.birthYearIND_BIRTH_DATE_YEARYear extracted from the date❌"1980-05-01" → "1980"
PersonBirthdateindividual.birthDayIND_BIRTH_DATE_DAYMonth-day extracted (--MM-dd)❌"1980-05-01" → "--05-01"
PersonGenderindividual.genderCodeIND_GENDERSalesforce value → OneKey code, Code "GEN"❌"Male" → "M", "Female" → "F"
PersonMobilePhoneindividual.mobilePhoneIND_TELEPHONE_MOBILEDirect❌"5559999" → "5559999"

A dedicated branch in mapper.dwl splits one PersonBirthdate value into two OneKey fields: IND_BIRTH_DATE_YEAR and IND_BIRTH_DATE_DAY.

HealthcareProvider Mapping

HealthcareProvider fields describe the provider's type, class, status, title, and bed count. Several are code-value translated per country.

Salesforce FieldOneKey Target FieldMapping FieldTransformationMandatoryTransformation with Example
Statusworkplace.statusCodeWKP_STATUS_CODESalesforce value → OneKey code, Code "STA"; result cast to Number❌"Active" → 3
Statusindividual.statusCodeIND_HCP_STATUS_CODESalesforce value → OneKey code, Code "STA"; result cast to Number❌"Inactive" → 9
ProviderTypeworkplace.typeCodeWKP_HCP_TYPE_CODESalesforce value → OneKey code, Code "TET"❌"Private Hospital" → "HPR"
ProviderTypeindividual.typeCodeIND_HCP_TYPE_CODESalesforce value → OneKey code, Code "TYP"✅ HCP"Physician" → "M", "Dentist" → "D"
ProviderClassworkplace.activityLocationCodeWKP_HCP_LOCATION_CODESalesforce value → OneKey code, Code "LEX"✅ HCO"Hospital" → "H", "Laboratory" → "L"
ProfessionalTitleindividual.titleCodeIND_HCP_TITLESalesforce value → OneKey code, Code "TIT" via referCodesMapping (codeValues file)❌"Psychologist" → "PS"
TotalLicensedBedsworkplace.numberOfBedsWKP_CU_UNIT_BED_NUMBERDirect❌120 → 120

CareSpecialty Mapping

CareSpecialty carries the specialty code, sent as IND_SP_CODE (HCP) or WKP_SP_CODE (HCO). For an HCP create, IND_SP_CODE is mandatory. A configurable per-request specialty limit exists (dataChange.submit.specialty.limit, default 3).

Salesforce FieldOneKey Target FieldMapping FieldTransformationMandatoryTransformation with Example
SpecialtyCodeworkplace.specialityWKP_SP_CODEDirect❌"UR" → "UR"
SpecialtyCodeindividual.specialityIND_SP_CODEDirect✅ HCP create"VI" → "VI"

Specialty data for DCR is carried by CareSpecialty.SpecialtyCode. HealthcareProviderSpecialty has no mapped fields. It exists in objects.json so the entity allow-list check passes because the connector reaches CareSpecialty through it.

ContactPointAddress Mapping

Address fields locate the provider. City and CountryCode are always mandatory, because OneKey uses the country to select the region and validate the request.

Salesforce FieldOneKey Target FieldMapping FieldTransformationMandatoryTransformation with Example
CountryCodeaddress.countryADD_COUNTRYDirect✅ always"US" → "US"
Cityaddress.cityADD_CITYDirect✅ always"GREENVILLE" → "GREENVILLE"
Streetaddress.longLabelADD_STREETDirect❌"Po Box 20128" → "Po Box 20128"
PostalCodeaddress.longPostalCodeADD_POSTALCODEDirect❌"27858 0128" → "27858 0128"

ProviderAffiliation Mapping

ProviderAffiliation maps to the OneKey activity (the HCP-to-HCO link). No affiliation field is individually mandatory, but only Hard affiliations are eligible for DCR (see DCR Entity Type Resolution).

Salesforce FieldOneKey Target FieldMapping FieldTransformationMandatoryTransformation with Example
SourceSystemIdentifieractivity.activityEidACT_AFFILIATION_IDDirect❌"ACT123" → "ACT123"
EffectiveStartDateactivity.startDateACT_START_DATEReformatted to yyyy-MM-dd'T'00:00:00Z❌"2026-01-15" → "2026-01-15T00:00:00Z"
EffectiveEndDateactivity.endDateACT_END_DATEReformatted to yyyy-MM-dd'T'00:00:00Z❌"2026-12-31" → "2026-12-31T00:00:00Z"
Roleactivity.roleACT_ROLESalesforce value → OneKey code, Code "TIH" via referCodesMapping (codeValues file)❌"Doctor" → "GMD"

Request Envelope Fields

Beyond the entity fields, the System API adds the request envelope from setVrSubmitRequestPayload.dwl:

Request FieldSourceNotes
isoCod2request countryCodeTwo-character ISO country code.
entityTyperequest entityTypeactivity (HCP) or workplace (HCO).
validation.clientRequestIdrequest requestIdThe Salesforce DCR record ID.
validation.requestDatecurrent timeyyyy-MM-dd'T'HH:mm:ss'Z'.
validation.requestProcessrequest operationcreate → "I", update → "U".
validation.processconfig dataChange.submit.processDefaults to "Q".
validation.requestCommentrequest commentOnly set when a comment is present.
validation.userrequest userOnly set when a user value is present on the request. The Provider Services app does not send user for DCR out of the box, so this field is absent by default.

Mandatory Fields

The System API validates mandatory fields against schema.json before calling OneKey. ADD_CITY and ADD_COUNTRY are always required. The rest depend on operation × entity type × country (US vs. non-US):

OperationEntity TypeCountryAdditional Mandatory Fields
createactivityUSIND_FIRST_NAME, IND_LAST_NAME, IND_HCP_TYPE_CODE, IND_SP_CODE
createactivitynon-USabove + WKP_USUAL_NAME
updateactivityUSIND_FIRST_NAME, IND_LAST_NAME, IND_ONEKEY_ID, IND_HCP_TYPE_CODE
updateactivitynon-USabove + WKP_USUAL_NAME
createworkplaceanyWKP_USUAL_NAME, WKP_HCP_LOCATION_CODE
updateworkplaceanyWKP_USUAL_NAME, WKP_ONEKEY_ID, WKP_HCP_LOCATION_CODE

Expressed in Salesforce terms:

EntityMandatory Fields
AccountFirstName, LastName (HCP); Name (HCO, and HCP non-US); SourceSystemIdentifier (on update)
HealthcareProviderProviderType (HCP); ProviderClass (HCO)
CareSpecialtySpecialtyCode (HCP create only)
ContactPointAddressCity, CountryCode (always)
ProviderAffiliationnothing mandatory

Managed Fields

For External DCR to fire correctly, these Salesforce fields must be configured as External Managed Fields in alignment with OneKey. A DCR is only generated when a managed field changes.

EntityFields
AccountFax, Name, PersonBirthdate, PersonGender, PersonMobilePhone, Phone
ContactPointAddressAddress, Name
HealthcareProviderName, ProfessionalTitle, ProviderClass, ProviderType, Status, TotalLicensedBeds
HealthcareProviderSpecialtyName, SpecialtyId
ProviderAffiliationEffectiveEndDate, EffectiveStartDate, Role

Picklist Values for Testing

To exercise the shipped mapping end-to-end, use Salesforce source values that appear in the base mapping.json and codeValues.json files. Confirm that each value is valid for the customer's country and OneKey contract before testing against OneKey.

EntityFieldSalesforce ValueOneKey Value
AccountPersonGenderMaleM
AccountPersonGenderFemaleF
HealthcareProvider (Individual)ProviderTypePhysicianM
HealthcareProvider (Individual)ProviderTypeAdministratorsA
HealthcareProvider (Individual)ProviderTypeDentistD
HealthcareProvider (Individual)ProfessionalTitlePsychologistPS
HealthcareProvider (Individual)ProfessionalTitleVeterinarianVD
HealthcareProvider (Individual)ProfessionalTitlePharmacistRP
HealthcareProvider (Workplace)ProviderTypePrivate HospitalHPR
HealthcareProvider (Workplace)ProviderTypeFunctional Reeducation CenterCRF
HealthcareProvider (Workplace)ProviderTypeProsthesis LaboratoryLPR
HealthcareProvider (Workplace)ProviderClassHospitalH
HealthcareProvider (Workplace)ProviderClassClinics and Health Care CenterK
HealthcareProvider (Workplace)ProviderClassLaboratoryL
ProviderAffiliationRoleDoctorGMD
ProviderAffiliationRolePharmacistPHC
ProviderAffiliationRoleAdministratorADR

CareSpecialty.SpecialtyCode is passed through directly rather than translated by the shipped mapping. Use a specialty code supported by the customer's OneKey contract.

Search Before Create (SBC)

SBC maps in the opposite direction: OneKey Individual, Workplace, and Activity data into the Life Sciences Cloud data model. It reuses the transformation approach used by Provider Bulk Sync.

For SBC request and response schemas, examples, errors, and field constraints, see the Provider Services API specification. For mapping changes, see Extend Connector.

To locate and extend the SBC mappings:

  1. Use mappingTemplates/search in the OneKey System API for fields returned by provider search. This controls the synchronous search result shape.
  2. Use mappingTemplates/download for the selected provider and related records written to Salesforce. This controls the data imported after selection.
  3. Keep SBC changes separate from mappingTemplates/validation, which is used only by DCR. This prevents an inbound mapping change from affecting outbound validation requests.
  4. Review the full OneKey-to-Salesforce field tables before changing either mapping path.

For the full OneKey → Salesforce field tables (Individual, Workplace, and Activity, including transformations, filters, and code-value translations), see the Data Mappings page in the OneKey System API documentation. The Provider Bulk Sync connector shares the same download mapping layer.

TypeApplication
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onOct 7, 2026
Asset overview
Industries CloudLife Sciences
Custom fields

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.6
1.0.3
1.0.2
1.0.1
1.0.0