Data integration APIs

We enhanced the composite datasource site import API to allow an integration to define a site's master profile ID.

Composite datasource site import API

With release 24.2.1, the composite datasource site import API allows a new “update_master_profile_id” attribute in the message body when the entityType sent in the message is “site”. If the entityType is anything other than site, and the message includes the new attribute, the message will error. If the entityType is site and the body message doesn’t include the new attribute, the API behaves as it did before this enhancement (i.e., create and/or update a site record).

As with previous behavior, each import record must include an ID value that serves as the unique key (i.e., unique row ID) and an investigator_id and institution_id. Note that the “update_master_profile_id” attribute can only be sent with a single message object in the request array, or the entire request will be rejected.

The follow scenarios have been enhanced when importing a site record with the "update_master_profile_id" attribute:

  • a unique ID and "update_master_profile_id" attribute not found in the datasource will result in a new site recorded and the master profile ID set to the value of the "update_master_profile_id" attribute
  • the unique ID and "update_master_profile_id" attribute are found in the datasource in the same site record will result in an update to the site record
  • the unique ID and "update_master_profile_id" attribute are found in the datasource but in different site records will result in an error and the site record will not be imported or updated. Since there is another site with the same master profile ID the request will fail since we cannot have duplicate IDs in the same datasource.
  • the unique ID is either new or existing in the datasource and "update_master_profile_id" attribute is not found in the datasource will result in the site record being reassigned to the new master profile ID specified in the "update_master_profile_id" attribute.

Note that if one import record in the request is invalid, then the import of all records in the request will be cancelled.

If the site record affected by the API request has any potential_matches affiliated with the record, the import will fail with a message directing you to resolve the potential match before attempting to update the master profile ID. Duplicate and potential_duplicate flags on the site record will not stop the API from proceeding with any master profile ID updates/changes.