How to Migrate Data Using a Data File Set
Oracle Health Insurance applications support file based data migration operations. A file based dat migration is a three-step process:
-
Create the data file set using the Data File Sets API on the source environment.
-
Upload the file using the Data File Sets API on the target environment.
-
Process the file contents by initiating the proper activity type using the Activities API[1] [2] or through the User Interface pages.
This document offers an example of creating, loading and processing provider data through a data file.
Not all Oracle Health Insurance components support providers. |
Oracle Health Insurance Authorizations supports file based import of data for the following resources:
Example
This example gives a step-by-step explanation of how to load a data file with providers.
Step 1: Create a Data File Set With a Data File
Request Message
The POST
request to /datafilesets
creates a data file set with a data file.
{
"code": "UNIQUE_CODE_OF_DATA_FILE_SET_YIN",
"description": "Data file set containing 1 or more data files containing providers",
"dataFiles": [
{
"code": "UNIQUE_CODE_OF_DATA_FILE_YIN",
"description": "File containing provider data"
}
]
}
Response Message
Example of a Response Message for Posting a Datafile (click to open)
{
"code": "UNIQUE_CODE_OF_DATA_FILE_SET_YIN",
"description": "Data file set containing 1 or more data files containing providers",
"locked": false,
"links": [
{
"href": "{apiurl}/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN",
"rel": "self",
"httpMethod": "GET"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN",
"rel": "datafileset",
"httpMethod": "GET"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/zip",
"rel": "file",
"httpMethod": "POST"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/zip?deleteDataFiles=true",
"rel": "zip",
"httpMethod": "PUT"
}
],
"dataFiles": [
{
"code": "UNIQUE_CODE_OF_DATA_FILE_YIN",
"description": "File containing provider data",
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/datafiles/UNIQUE_CODE_OF_DATA_FILE_YIN/data",
"rel": "file",
"httpMethod": "POST"
}
]
}
]
}
Step 2: Upload Content
A GET
request on /datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/datafiles/UNIQUE_CODE_OF_DATA_FILE_YIN/data
shows that the datafile does not conatain any data yet.
{
"o:errorDetails": [
{
"o:errorCode": "DAT-IP-DAFI-010",
"title": "DAT-IP-DAFI-010: Data file "UNIQUE_CODE_OF_DATA_FILE_YIN" with data file set "UNIQUE_CODE_OF_DATA_FILE_SET_YIN" does not contain file data",
"o:errorPath": "$"
}
]
}
Send a POST
request to datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/datafiles/UNIQUE_CODE_OF_DATA_FILE_YIN/data
to add provider data to the data file.
We recommend uploading files with sizes under 20 MB. Larger files impact the stability of the system. |
Request Message
{
[
{
"code": "9200000060",
"flexCodeDefinitionCode": "US_PROVIDER",
"elementType": "organizationProvider",
"name": "Organization Provider 1",
"outputLanguageCode": "en",
"startDate": "2010-01-01",
"endDate": "2034-12-31"
}
]
}
The add content to data file request’s success response has the following structure:
Example of a Response Message for Posting Data to a Datafile (click to open)
{
"code": "UNIQUE_CODE_OF_DATA_FILE_SET_YIN",
"description": "Data file set containing 1 or more data files containing providers",
"locked": false,
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN",
"rel": "self",
"httpMethod": "GET"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN",
"rel": "datafileset",
"httpMethod": "GET"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/zip",
"rel": "file",
"httpMethod": "POST"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/zip?deleteDataFiles=true",
"rel": "zip",
"httpMethod": "PUT"
}
],
"dataFiles": [
{
"code": "UNIQUE_CODE_OF_DATA_FILE_YIN",
"contentLength": 303,
"description": "File containing provider data",
"mimeType": "application/json",
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/datafiles/UNIQUE_CODE_OF_DATA_FILE_YIN/data",
"rel": "file",
"httpMethod": "GET"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/datafiles/UNIQUE_CODE_OF_DATA_FILE_YIN/data",
"rel": "file",
"httpMethod": "POST"
}
]
}
]
}
Step 3: Initiate the Provider Import Activity Using Create Activity
Activities
Send a POST
request to activities
to create the activity.
{
"code": "PROVIDER_IMPORT",
"level": "GL",
"description": "Load Provider File",
"parameters": [
{
"name": "dataFileSetCode",
"value": "UNIQUE_CODE_OF_DATA_FILE_SET_YIN"
}
]
}
Response Message
The start activity response has an appropriate HTTP status code in the header and the following structure:
Example of a Response Message for Creating an Activity (click to open)
{
"status": "IN", (1)
"level": "GL",
"type": "PROVIDER_IMPORT",
"workId": "2720371809",
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809/start",
"rel": "action/startprocessing",
"httpMethod": "POST"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809/start",
"rel": "operator:start",
"httpMethod": "POST"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809",
"rel": "self",
"httpMethod": "GET"
}
]
}
1 | The activity has status Initial, meaning it has not started.
Using a POST request to activities/start would have started the activity immediately after creation.
See Activities. |
Step 4: Start Provider Import Activity
Send a POST
request to activities/2720371809/start
to start the import activity[3].
Response Message
The start activity response has an appropriate HTTP status code and location in the header and has the following structure:
Example of a Response Message for Starting an Activity (click to open)
{
"status": "IP", (1)
"level": "GL",
"type": "PROVIDER_IMPORT",
"workId": "2720371809",
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809",
"rel": "monitor",
"httpMethod": "GET"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809",
"rel": "self",
"httpMethod": "GET"
}
]
}
1 | The status is In Process |
Step 5: Get Status
Send a POST
request to activities/2720371809/search
to get the status of the activity.
Response Message
When the activity has not yet concluded, the response message is the following:
Example of a Response Message for Requesting the Status of an Activity (click to open)
{
"status": "IP",
"level": "GL",
"type": "PROVIDER_IMPORT",
"workId": "2720371809",
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809",
"rel": "monitor",
"httpMethod": "GET"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809",
"rel": "self",
"httpMethod": "GET"
}
]
}
When the activity has concluded with business errors the response message is the following:
Example of a Response Message for Requesting the Status of an Activity (click to open)
{
"status": "CB", (1)
"level": "GL",
"type": "PROVIDER_IMPORT",
"workId": "2720371809",
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/generic/activitymessages/search", (2)
"rel": "operator:messages",
"httpMethod": "POST",
"body": {
"resource": {
"q": "activity.id.eq(2720371809).or.(activity.rootActivityId.eq(2720371809))"
}
}
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809/recover", (3)
"rel": "operator:restart",
"httpMethod": "POST"
},
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/activities/2720371809",
"rel": "self",
"httpMethod": "GET"
}
]
}
1 | The activity has completed with a business error, the status is CB. |
2 | The response message offers a link to fetch the error messages for this activity and the activities it spawned.
Note that the link uses the POST request on the generic activitymessages API. |
3 | The response message offers a link to recover, that is restart, the activity. |
Step 6: Get Result Messages
Send a POST
request to /generic/activitymessages/search
to fetch the messages for this activity.
Note that this link is also part of the activity status response message.
The payload is
{ "resource": { "q": "activity.id.eq(2720371809).or.(activity.rootActivityId.eq(2720371809))" }
Example of a Response Message for Requesting the Messages for an Activity (click to open)
{
"offset": 0,
"count": 1,
"hasMore": false,
"limit": 50,
"items": [
{
"id": "251664830",
"objectVersionNumber": 1,
"value0": "PO0063_3_2_2_3_FEDE_001", (1)
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/generic/activitymessages/251664830",
"rel": "self"
}
],
"activity": {
"id": "2514367679",
"act_level": "PO",
"links": [
...
]
},
"message": {
"id": "96060",
"links": [
{
"href": "http://[hostName]:[portNumber]/[api-context-root]/generic/messages/96060", (2)
"rel": "canonical"
}
]
}
}
],
"links": [
...
]
}
1 | The value to replace the placeholder in the canonical message. |
2 | The response message offers a link to the canonical text of this message. |
Step 7: Get Response File
The GET
request message on http://[hostName]:[portNumber]/[api-context-root]/datafilesets/UNIQUE_CODE_OF_DATA_FILE_SET_YIN/datafiles/UNIQUE_CODE_OF_DATA_FILE_YIN/data
downloads the response file.
{
[
{
"code": "9200000060",
"flexCodeDefinitionCode": "US_PROVIDER",
"elementType": "organizationProvider",
"name": "Organization Provider 1",
"outputLanguageCode": "en",
"startDate": "2010-01-01",
"endDate": "2034-12-31"
}
]
}