Skip to main content

Importing a CSV File

Learn how to import multiple patients using a CSV file

Written by Aubree Dorr

The CSV import tool lets you quickly build patient profiles from data you export from your dispensing system or other patient management software.

Step-by-step instructions

  1. Export a file from the source you want to import. Save it with a .csv extension. Comma, pipe ( | ), tab and semicolon separated files are all supported.

  2. Log into DocStation and go to your Patient List.

  3. Click the import icon (file icon) at the top right of the patient list.

    • If you see a spinning-arrows icon instead, an earlier import is still processing or waiting for review. Hover over it to check the status, and wait for it to finish before starting a new import.

  4. Click Import CSV File.

  5. Drag your file into the upload box or click to browse for it. The file must be under 25 MB.

  6. If the file came from a dispensing system, choose it from the dropdown: PioneerRx, ComputerRx, QS/1, McKesson, Epic Willow Ambulatory, Cerner Eterby, Digital Rx, BestRx, TWRx or Rx30. If not, leave it set to "Not exported from a dispensing system."

  7. Click Continue.

  8. Map your columns. Each row shows a column from your file with an example value. Choose the DocStation field or fields it should go into.

    • DocStation maps what it can automatically. If you've imported before, it reuses your last successful mapping, but double-check the results.

    • Required fields are marked with an asterisk (*).

    • To skip a column, uncheck it in the Import? column.

    • One column can fill more than one field. For example, a "Full Name" column can be mapped to both First Name and Last Name, and a "City, State Zip" column to City, State and Zip Code. Each DocStation field can only be mapped once.

    • If you see Suggest mapping with AI, you can use it to suggest a mapping. It replaces your current selections, and nothing is saved until you click Looks good!

  9. Click Looks good! If the button is disabled, hover over it to see which required fields are still missing.

  10. Click Sounds good! You don't need to stay on the page.

Imports can take a while depending on file size and how many other imports are processing. Some imports are reviewed by the DocStation team before processing, and will show as "awaiting review." When the import finishes, the person who uploaded it gets an email saying the import is complete, complete with issues to review, or failed.

Reviewing import failures

If any rows didn't import, a red alert icon appears at the top of your Patient List. Hover over it and click View import failures to see the row numbers and the problem in each row. Only a sample of rows is shown for large files. Fix those rows in your file and upload them again. Click Dismiss to clear the alert once you're done.

  • If more than half of the rows in a file have formatting problems, the whole file is rejected and nothing is imported.

  • Otherwise, every valid row is imported and only the rows with problems are skipped.

Requirements for all import files

  • The file must have a .csv extension and be under 25 MB.

  • A header row is required. DocStation uses the column headers to suggest a mapping, and you can adjust it manually.

Required content

  • Patient: First Name, Last Name, Date of Birth, Gender and Pharmacy NPI

    • The Pharmacy NPI must be a valid 10-digit NPI that belongs to one of your locations in DocStation. Rows with an unknown NPI won't import.

  • Patient Address: optional, but if you include any part of it, you must include Address, City, State and Zip Code. Address Line 2 is optional.

    • An address is required if you intend to bill medical claims manually or bill to the DS BIN.

    • An address is required if you intend to add details to existing patient profiles. Without a matching address, the import tool will create a duplicate patient record.

Other information you can import

  • Contact: patient phone number

  • Medications: NDC or medication name, date prescribed, SIG, days supply, quantity, refills authorized, fill number, last filled date, and prescriber first/last name, NPI and phone

  • Coverage: RxBIN, PCN, Subscriber ID, Network Provider

  • Labs/Vitals: code (LOINC), value, unit, date, performed by

  • Conditions: description and onset date

  • Allergies: title, criticality, reaction, onset date

  • Immunizations: CVX code and date

  • Patient Tags

Required formats

We do our best to read your data as-is, but some fields need a specific format:

  • Dates: year-month-day or month-day-year, with dashes or slashes, e.g. 2024-03-07, 2024/3/7, 03-07-2024, 3/7/2024. Use a 4-digit year. Two-digit years like 3/7/24 won't import. A time after the date is ignored.

  • Gender: M, Male, F, Female, U, Unknown, O or Other

  • NDCs: 11 digits without dashes, or with dashes in a 5-4-2, 4-4-2, 5-3-2 or 5-4-1 format

    • NDCs are validated against the RxNorm library, maintained by the National Library of Medicine. If an NDC isn't found (common for DME, OTC and compounded items), also map a Medication Name column and the medication will be imported by name. Without a name, rows with unrecognized NDCs won't import.

    • If an NDC is a vaccine, it's imported as an immunization, so the row needs an Immunization Date or Medication Date Prescribed.

  • Phone numbers: one full phone number column, or three columns (area code, first 3 digits, last 4 digits). Don't map both.

  • Addresses: the street address must be in its own column. City, State and Zip can be separate columns or one combined "City, State Zip" column.

  • Tags: separate multiple tags with commas, e.g. Diabetes, MTM

  • Labs/Vitals: Performed By must be my-pharmacy, another-provider, patient or caregiver. The value must be a number or a ratio like 120/80. Lab date and Performed By are required with a lab code.

  • Allergies: criticality must be low, high or unable-to-assess. Allergy title, criticality and onset date are all required.

  • Conditions: description and onset date must be provided together.

  • Immunizations: a CVX code requires an immunization date. Don't include both an NDC and a CVX code in the same row.

Sample files

You can test the process by importing the file below into your DocStation account, then deleting the test patients it creates. This sample is also linked from the import window.

Column(s)

Rules / good test values

Patient First Name, Last Name, Gender, Date of Birth, Pharmacy NPI

Required on every row. Gender: M, Male, F, Female, U or O. Mix date formats to show them off: 1978-01-01, 01/02/1981, 6/20/1955.

Address, Address 2, City, State, Zip Code

Optional. If you fill any of Address, City, State or Zip, fill all four. Address 2 is optional (e.g. Apt 2). Use a 2-letter state. Leave one patient with no address to show it's optional.

Phone

Any 10-digit format, e.g. 612-555-0101 or (612) 555-0102.

Pharmacy NPI

Must be an NPI that belongs to a location in the org doing the test. The current file uses 1083899603.

Network Provider, Subscriber ID, RxBIN, PCN

Optional coverage details, e.g. Medicare / 111111111 / 004336 / MEDDADV.

NDC + medication columns

You can reuse the NDCs from the current file (e.g. 00071-0156-40). Add Last Filled Date on each medication row.

Medication Name

Use with a made-up NDC like 99999-0001-01 and a name such as Ketoprofen 10% Compounded Cream to show a medication imported by name. Leave it blank on the other rows.

Lab Code, Value, Unit, Date, Performed By

If Lab Code is filled, Date and Performed By are required. Codes: 4548-4 (A1c, 7.2, %), 55284-4 (BP, 132/84, mm[Hg]), 39156-5 (BMI), 29463-7 (weight). Unit must be under 10 characters. Performed By must be my-pharmacy, another-provider, patient or caregiver.

Condition Description, Condition Date

Fill both or neither, e.g. Type 2 diabetes mellitus / 3/15/2020.

Allergy Name, Criticality, Reaction, Date

Name, Criticality and Date are required together. Criticality must be low, high or unable-to-assess. Reaction is optional.

Vaccine CVX, Vaccine Date

Put each vaccine on its own row with NDC left blank. A row can't have both an NDC and a CVX code. These codes are active in the CDC vaccine table: 187 (Shingrix), 216 (PCV20), 150 (flu).

Tags

Separate multiple tags with commas in one cell, e.g. UCare 2025 - Non-adherence, UCare 2025 - SUPD.

Considerations and answers to FAQs

Existing DocStation patients

If a row matches a patient who's already in your organization, DocStation updates that patient's profile with the data in your file instead of creating a new patient. Patients are matched on First Name + Last Name + Date of Birth + Gender, ignoring capitalization and extra spaces. If more than one patient matches, the address is used to pick the right one.

Note: Patient IDs from your dispensing system aren't used for matching in CSV imports. Duplicate profiles usually come from differences in spelling, nicknames, date of birth or gender between files. Keep these consistent from file to file.

Tags: if you map a Patient Tags column, the patient's tags are updated to match the file. Tags added by an earlier CSV import that aren't in the new file are removed. Tags added manually in DocStation are never removed by an import. If you don't map a tags column, existing tags are left alone.

Medications and fills

If the import file has more than one line for the same medication, DocStation imports the lines in the order they appear in the file. So if a medication appears several times for a patient, the line closest to the bottom of the file is what shows on the patient profile.

DocStation also combines medication data, so separate fills and separate strengths appear as a single record on the patient profile.

Unmatched columns in the import file

DocStation discards unmatched columns and columns that are completely empty. Data in those columns won't show on the patient profile.

Have more questions? Reach out to the DocStation team via Chat or at support@docstation.co!

Did this answer your question?