OHI Value-Based Payments
 PreviousHomeNext 
4.4 Data File Set Integration PointBook Index4.4.3 Other Available Operations

4.4.2 Creating a data file set with multiple files in a single request

As an alternative to creating the data file set in the 'conversational' mode, the data file sets endpoint offers the client the ability to create a data file set with one or more data files, together with the file contents, in one request.
This feature requires the client to POST a so called multipart request message that contains the following parameters:

Multipart requests can be constructed with various technologies. The following is an example in HTML: 

In an HTML based UI the following sample form could be used to create a data file set with code as "myfileSet" and upload two files with code "fileCode1" and "fileCode2"  in one request:

<html>
  <form name="formtest" action="/filesets/multipart" method="POST" enctype="multipart/form-data">
    <input type="text" name="dataFileSetCode" value="myfileSet" />
    <input type="file" name="fileCode1" value="" />
    <input type="file" name="fileCode2" value="" />
    <input type="submit" value="Submit" />
  </form>
</html>

The system's response to this request will have the following structure:

<dataFileSet code='myfileSet'>
  <links>  
    <link rel='self' type='application/xml' href='/datafilesets/myfileSet'/>
  </links> 
  <dataFiles> 
    <datafile code='fileCode1'>
      <links>  
        <link rel='file' href='/datafilesets/myfileSet/datafiles/fileCode1/data'/>
      </links>  
    </datafile> 
    <datafile code='fileCode2'>
      <links>  
        <link rel='file' href='/datafilesets/myfileSet/datafiles/fileCode2/data'/>
      </links>  
    </datafile>
  </dataFiles>
</dataFileSet>

In case of failure the response will be as specified in the standard structure under "Indicating Failure" in Response Messages.

 PreviousHomeNext 
4.4 Data File Set Integration Point4.4.3 Other Available Operations