OHI Value-Based Payments
 PreviousHome
4.7.1 Example : Provider ImportBook Index

4.8 Integration Examples

This section of the document lists examples for using the integration points.

Example: creating a Data File Set for Member Input Details and an Activity for importing these

This example demonstrates how to create a Data File Set with one Data File that contains Member Input Details and, subsequently, how to process the contents of the Data File in order to import the data into the system.

In order to achieve that, the following steps are performed:

  1. Create a Data File Set
  2. Create a Data File in the Data File Set
  3. Upload contents for the Data File
  4. Create and start an Activity for processing the contents of the Data File

The steps for this example are presented as a set of "curl" commands. Curl "is an open source command line tool and library for transferring data with URL syntax". See the curl website for more information on curl.

Assumptions:

Create a Data File Set

In this example the Data File Set with a Data File and the Data File contents is created using multiple commands. The first one creates the Data File Set metadata:

curl -H 'Content-Type: application/xml' -H 'Accept: application/xml' -X POST -d
'<dataFileSet code="DFS1" description="A member input detail Data File Set"/>'
http://localhost:8001/api/datafilesets

This should result in the following response:

<?xml version="1.0" encoding="UTF-8"?>
<dataFileSet code="DFS1" description="A member input detail Data File Set" locked="N">
   <links>
      <link href="/datafilesets/DFS1" rel="self" type="application/xml"/>
   </links>
</dataFileSet>
Create a Data File in the Data File Set

The second step is creation of the Data File metadata using the following command:

curl -H 'Content-Type: application/xml' -H 'Accept: application/xml' -X POST -d
'<dataFile code="DFS1_DF1" description="DFS1 DF"/>'
http://localhost:8001/api/datafilesets/DFS1

This should result in the following response:

<?xml version="1.0" encoding="UTF-8"?>
<dataFileSet code="DFS1" description="A member input detail Data File Set" locked="N">
   <links>
      <link href="/datafilesets/DFS1" rel="self" type="application/xml"/>
   </links>
   <dataFiles>
      <dataFile code="DFS1_DF1" description="DFS1 DF">
         <links>
            <link href="/datafilesets/DFS1/datafiles/DFS1_DF1/data" rel="file" type="text/xml"/>
         </links>
      </dataFile>
   </dataFiles>
</dataFileSet>
Upload contents for the Data File

When the Data File Set and the associated Data File metadata are defined the contents for the Data File can be uploaded. For that purpose the following example command can be used:

curl -H 'Content-Type:text/xml' -X POST -d
'<memberInputDetailsBatchRequest>
  <header flexCodeDefinitionCode="MEMBER_ENROLLMENT_SOURCE" transactionSourceCode="FL_PCP_GRADE_TRS"
          ipRequestCode="FL_DEMO_23_Q1" />
  <members>
    <member elementId="MEMBER1" referenceCode="MEMBER_REF01" memberCode="CAMPBELL"
            memberInputDetailTypeCode="D25_NW_MIDT" reversed="N">
      <memberInputDetails>
        <memberInputDetail brandCode="DEMONSTRATION_BRAND" startDate="2014-01-01" enrollmentDate="2014-01-01">
          <dynamicRecordTable name="D25_NW_DR_MIDT">
            <row indDeleted="N">
              <column name="cardiologist">Dr Webb</column>
              <column name="memberResidenceState">MA</column>
            </row>
          </dynamicRecordTable>
        </memberInputDetail>
      </memberInputDetails>
    </member>
  </members>
</memberInputDetailsBatchRequest>'
http://localhost:8001/api/datafilesets/DFS1/datafiles/DFS1_DF1/data

Note that this message assumes that some specific system configuration is in place, e.g. the transaction source is set up, member input detail type D25_NW_MIDT is in place and so on.

The request should result in a response that is similar to the following:

<?xml version="1.0" encoding="UTF-8"?>
<dataFileSet code="DFS1" description="A member input detail Data File Set" locked="N">
   <links>
      <link href="/datafilesets/DFS1" rel="self" type="application/xml"/>
   </links>
   <dataFiles>
      <dataFile code="DFS1_DF1" contentLength="813" description="DFS1 DF" mimeType="text/xml">
         <links>
            <link href="/datafilesets/DFS1/datafiles/DFS1_DF1/data" rel="file" type="text/xml"/>
         </links>
      </dataFile>
   </dataFiles>
</dataFileSet>
Create and start an Activity for processing the contents of the Data File

Now that the Data File Set is in place, the file contents (i.e. the given Member Input Detail) can be imported into the system. For that purpose an activity has to be specified and started. The following sample command defines and activity for importing the contents of the file and immediately starts the activity:

curl -H 'Content-Type: application/xml' -H 'Accept: application/xml' -X POST -d
'<activity level="GL" code="MEMBER_INPUT_DETAIL_IMPORT" description="Import Member Input Detail"> 
  <parameters>
    <parameter name="dataFileSetCode" value="DFS1"/>
  </parameters>
</activity>'
http://localhost:8001/api/activities/start

This request should result in a response that is similar to the following:

<?xml version="1.0" encoding="UTF-8"?>
<activity level="GL" status="IN">
   <links>
      <link href="activities/102857045" mediaType="application/xml" rel="self"/>
   </links>
</activity>

Note that the status of the activity is "IN" or Initial. The client can use the link in the response to continue checking the activity's status.

 PreviousHome
4.7.1 Example : Provider Import