Import Data with the Data Exchange Web Service

An application can import data by constructing a message and posting the message to the Calyx RIM Data Exchange Web Service on the Calyx RIM server. The application can get the status of the transaction from the Data Exchange Web Service.

Constructing a Message

For each class that Data Exchange supports, you can easily identify the fields required for each type of message used to import data. See the Calyx RIM Data Exchange 7.0 Metadoc Document.

Posting a Message to the Data Exchange Web Service

The Data Exchange Web Service consumes text/xml posted to the Calyx RIM  7.0 server on the following path of the Calyx RIM context:

rest/dataexchange/process

Example 

In this example, Calyx RIM 7.0 is running on the server InSight6 on port 8080.

To send the message, you can use an application to post the message to the following path as text/xml:

http://InSight6:8080/InSight/rest/dataexchange/process

You receive a 200 OK response with a URL similar to:

http://InSight6:8080/InSight/rest/dataexchange/status/275003

Getting the Status of a Data Exchange Transaction from the Data Exchange Web Service

After you post a message to the Data Exchange Web Service as text/xml, you can paste the returned URL into a GET request. After you send this request, the Data Exchange Web Service returns the status of the transaction as application/xml on the following path of the InSight context:

rest/dataexchange/status/<transaction ID>

Example

In this example, you send a GET request containing the URL received in the example of posting a message:

http:// InSight6:8080/InSight/rest/dataexchange/status/275003

The Data Exchange Web Service returns the following transaction status message:

 <dataExchangeStatusMessage>        
         <received>2015-03-04T17:17:02.855-05:00</received>        
         <processed>2015-03-04T17:17:02.918-05:00</processed>        
         <parsemessages>                
                <errors>                      
                       <errorText>Unable to convert value for                        
                        field: countryId on                        
                        object: ID1</errorText>               
                </errors>                
                <errors>                      
                       <errorText>Unable to convert value for                        
                        field: healthAuthorities on                        
                        object: D1</errorText>
                </errors>                
                <errors>                      
                       <errorText>Health Authority is                       
                        required.</errorText>               
                </errors>        
         </parsemessages>         
         <storemessages>                
                <errors>
                       <errorText>Unable to ADD object with
                        id: ID1</errorText>                
                </errors>
         </storemessages> 
</dataExchangeStatusMessage>