How to Split a .csv File Into Smaller Cohorts

By default, group messages in Ocean can be sent to groups with a maximum size of 100 patients. If you have exported a .csv file from your EMR and it contains more than 100 patients, you will need to split the .csv file into multiple smaller files that contain 100 or less to upload into Ocean.

To split a .csv file, we recommend that you do not use Microsoft Excel, as this program can sometimes remove or alter aspects of the file's column structure. This will result in files incompatible with Ocean.

For Windows users, we recommend using a text editor such as Notepad++. For Apple users, we recommend Atom.

Note: Before following the steps below, please ensure that you have already obtained your master cohort file from your EMR.

Windows Apple

Step 1: Locate your Master .csv File

  • Locate the .csv file on your computer that you obtained from your EMR.
  • Right click on the .csv file, and select 'Edit with Notepad++'. This will open the file using Notepad++.

Step 2: Understanding your Master .csv File

  • After opening your file in Notepad++, you will see a header row (row 1) followed by rows of exported patients.
  • Along the left hand side of the window, you will see each row number.
  • The header row defines the order of the values separated by each comma. In this example, we can see that the order of the values in the header row is: "Last Name", "First Name", "PHN", "Birthdate", "Sex", "Home Phone", "Status".
  • Below the header row, each row represents a single patient record, with their respective information presented in the above sequence, separated by a single comma.

Step 3: Splitting Your Master .csv File

Creating a New File

  • In Notepad++, press 'File' and select 'New'. This will create a new file.
  • A new tab will automatically appear in your Notepad++ window.

Duplicating the Header Row

  • Return to your original master file tab by clicking on it.
  • Highlight the entire header row (row 1) and copy it by right-clicking and selecting 'Copy'.
  • Navigate to the new file that was created.
  • Paste the copied header row by right-clicking and pressing 'Paste'.
  • Ensure the header rows in both files are identical.

Step 4: Moving Patients from the Master File to New File

Selecting Patients from Master File

  • In your master file, locate row 102. This represents the 101st patient in your master file, since the header row (row 1) is accounted for in the total number of rows.
  • Highlight all patients from row 102 up to and including row 201 (this selects 100 individual patients), right click, and select 'Cut' to remove them from the file and copy them.

Pasting Patients to New File

  • Navigate to the new file which currently includes only a header row, place your cursor at the end of the header row (row 1), and press the 'Enter' or 'Return' key on your keyboard to add a new row (row 2) below the header.
  • Right-click on row 2, and select 'Paste' to transpose the 100 patients that you cut earlier into the new file below the header.
  • After pasting, scroll to the bottom of the new file and verify that there are 101 total rows. Row 1 should be the header row, followed by 100 additional rows of patients.
  • Save the new file by pressing 'File' and selecting 'Save As...'. Input a recognizable name for the file, and ensure you add the '.csv' file extension at the end of the name. This step ensures the file remains in the proper format.

Step 5: Create Multiple Cohort Files

  • Repeat Steps 3 and 4 above (i.e., Create a New File, Duplicate the Header Row, Select 100 Patients from the Master File, and Paste Patients into the New File) until your master file has been reduced to 100 patients total (101 total rows).
  • Ensure you save your cohort files (including your reduced master file) once complete.
  • When you have finished splitting your file, you can proceed with uploading the cohorts to Ocean for use with Group Messaging.

How do I delete a cohort?

Currently, there isn't a mechanism to "delete" a cohort group. As long as a patient from the cohort still exists in Ocean, the cohort group will persist as well. Patients can only be assigned to one cohort grouping at a time.

If the patient list is re-uploaded again but assigned a new cohort name, Ocean will see that these patient references already exist on the site, and simply move them into this newer cohort group that has been created. Once the old cohort group hits zero patients, it will disappear.

Patients are auto-purged from the portal if there are no pending actions assigned to them (please refer to How long are patient records (with PHI) kept in Ocean? for more details). Eventually, if all patients attached to a cohort are purged out of Ocean, the cohort group will disappear.