# Data Export Guide for AI Assistants

## ⚠️ Before you begin: sharing patient data with AI tools

This guide recommends using an AI assistant to help reformat your data export. Before pasting or uploading any patient information into **any** AI tool (ChatGPT, Gemini, Claude, Copilot, or otherwise), please consider:

- Patient records contain Protected Health Information (PHI) under HIPAA. Submitting PHI to a third-party AI tool is a disclosure to a third party. Many consumer/free tiers of AI products are **not** HIPAA-compliant and may log, retain, or use submitted data to train models unless you are on a business/enterprise plan with a signed Business Associate Agreement (BAA) in place.
- Before sharing real patient data with an AI assistant, confirm that:
  - You are using a business/enterprise plan of that AI tool, **and**
  - A BAA is in place between your practice and the AI vendor, if required under your organization's HIPAA compliance policies.
- If you're not sure your AI tool or plan meets these requirements, the safer path is to:
  1. Give the AI a small sample of **de-identified or fictitious** data so it can work out the column mapping/format, then
  2. Apply that same format yourself to the real file — without the AI ever seeing actual patient data.
- OptiMantra provides this guide as a convenience to help format your export. We are not a party to your use of any third-party AI service. It remains your practice's sole responsibility to ensure that any use of AI tools with patient data complies with HIPAA and all other applicable privacy and data protection laws.

---

**Purpose:** A patient/practice is moving data from their current EHR into OptiMantra. You (an AI assistant helping that provider — Claude, ChatGPT, Gemini, Copilot, whatever they use) are being asked to turn a raw export from their old system into CSV files for the migration.

This guide is deliberately loose on exact column names. **Match the concepts, not the labels.** The import tools on the receiving end already recognize many common synonyms for each field (e.g. `DOB`, `Date of Birth`, and `Patient DOB` are all treated the same way). If none of the examples below fit, use a clear, human-readable header and leave a note — a slightly-off column name is a much smaller problem than missing or fabricated data.

## Ground rules

1. **CSV with a header row.** One file per record type (patients, appointments, contacts, etc.) — don't combine record types in one file.
2. **UTF-8 encoding.** Old EHR exports are often Windows-1252/Latin-1 and carry mangled smart quotes, em-dashes, or accented characters — clean these up if you can, but don't guess at data to "fix" it.
3. **Never invent values.** If the source system doesn't have a field, leave the cell blank. Don't infer a middle name, guess a gender, or default a date to today's date.
4. **Preserve the legacy record ID** in an `Old ID` / `Legacy ID` / `Source ID` column wherever the source system has one, even if it means nothing to OptiMantra. It's the only reliable way to trace a record back to where it came from, dedupe on re-runs, and debug mismatches later.
5. **One row = one record.** Don't split a single patient/appointment/contact across multiple rows.
6. **Dates:** `MM/DD/YYYY` is safest. `YYYY-MM-DD` and Excel serial date numbers are also handled for patient data. Appointments need date **and** time — either combined (`03/15/2024 09:00`) or as separate date/time columns.
7. **Phone numbers:** plain digits or standard US formatting (`(555) 123-4567` or `555-123-4567`) — don't strip to digits-only unless that's all the source gives you.
8. **If a field doesn't map cleanly** (e.g. the old EHR has a single "Contact" field mixing a name, phone, and relationship), split it as best you can into the closest matching columns below and add a `Note` with the raw original text — don't discard the extra context.

---

## 1. Patient demographics

The core patient record. This is almost always the first file to migrate — appointments and contacts often reference the patient by ID, so patients should be imported first.

**Required for a new patient:** First Name, Last Name, Date of Birth. (Sex/Gender is also effectively required by the underlying import in most cases.)

**Categories of information wanted** (with example column names — synonyms are fine):

| Category | Example columns |
|---|---|
| Identity | `Old ID` (legacy record ID — see rule 4), `Patient First Name`, `Middle Name`, `Last Name`, `Preferred Name`, `DOB`, `SSN` |
| Demographics | `Sex`, `Gender`, `Race`, `Ethnicity`, `Pronoun`, `Age Group` (adult/pediatric) |
| Contact | `Email`, `Phone`, `Text Number`, `Secondary Phone`, `Preferred Contact Method` |
| Address | `Address`, `City`, `State`, `Zip` |
| Care team | `Primary Practitioner`, `Primary Care Provider`, `Referred By`, `Guardian` |
| Emergency contact | `Emergency Contact Phone`, `Emergency Contact Relation` |
| Status | `Relationship Status`, `Occupation Status`, `Inactive` (yes/no), `Portal Access` (yes/no) |
| Free text | `Note` — anything that doesn't fit a structured column goes here |
| Primary insurance | `Insurance` (plan/program name), `Insured ID Number`, `Insured Group Number`, `Insured Name`, `Insured Relationship` (self/spouse/child/other), `Insured DOB`, `Insured Gender`, `Insured Employer/School`, `Insured Address/City/State/Zip/Phone`, `Copayment`, `Coinsurance`, `Deductible` |
| Payer (insurance company) | `Payer Name`, `Payer ID`, `Payer Address/City/State/Zip` |
| Secondary insurance | same shape as primary, prefixed "Secondary" |
| Next of kin | `NOK Relationship`, `NOK First/Last Name`, `NOK Address/City/State/Zip`, `NOK Phone` |
| **Tags** | `Tags` — see below |

**Tags:** a comma-separated list of labels used for patient categorization/flagging (e.g. `VIP, Spanish Speaking, Balance Due`). List existing tags to add per patient; if the old EHR has an equivalent field (flags, categories, alerts, groups), map it here. Don't invent tag taxonomies — just carry over what the source system already tracks per patient. A separate `Delete Tags` column can remove tags but that's only relevant for re-imports, not a first migration.

**Updating vs. creating:** if you know the record already exists on the OptiMantra side (e.g. a re-run or partial migration), include its OptiMantra patient ID in an `ID` / `Patient ID` column — that runs the row as an update instead of creating a duplicate. For a first-time migration from another EHR, leave this blank and rely on `Old ID` for traceability instead.

---

## 2. Appointments

Historical or upcoming appointment records.

**Required:** start datetime, end datetime, title/reason, provider, patient, location, and a color/category. Provider, patient, and location are references to already-imported OptiMantra records — if you don't have OptiMantra's internal IDs yet (you usually won't, coming from another EHR), export provider name, patient identifying info (name + DOB, or the `Old ID` from the patient file), and location name instead, and note that a lookup step is needed before these can be loaded.

| Category | Example columns |
|---|---|
| Timing | `Start Date/Time`, `End Date/Time` (or separate `Date` + `Start Time` + `End Time`) |
| What | `Title` / `Reason for Visit`, `Appointment Type`, `Notes` |
| Who | `Provider` / `Practitioner`, `Patient` (name + DOB, or legacy patient ID) |
| Where | `Location` |
| Display | `Color` / `Category` — however the source system color-codes or categorizes visit types |

---

## 3. Contacts (referring providers, labs, insurance payers, vendors, pharmacies)

Non-patient entities the practice deals with.

| Category | Example columns |
|---|---|
| Identity | `Name` (first/last, or org name), `Contact Type` (insurance/payer, lab, clinic, vendor, pharmacy, other) |
| Contact info | `Email`, `Phone`, `Fax`, `Address`, `City`, `State`, `Zip` |
| Insurance-specific | `Payer ID`, `Insurance Type` (e.g. Medicare, Medicaid, Blue Cross/Blue Shield, federal, HMO, other) |

---

## 4. Services / fee schedule (practice configuration, not patient data)

Only relevant if the practice is also migrating its billable-service catalog (not typically something an EHR "exports" per patient — more of a practice settings migration).

| Category | Example columns |
|---|---|
| Identity | `Service Name`, `Description`, `Service Type`, `Category` |
| Billing | `Cost`, `Price`/`COGS`, `CPT Code(s)`, `NDC Code` (if a medication/supply-linked service) |
| Scheduling | `Duration`, `Buffer Time`, `Allow Overlap`, `Providers` (who can perform it), `Locations` |

---

## 5. Inventory / supplies (practice configuration, not patient data)

Only relevant if migrating a supply/product catalog.

| Category | Example columns |
|---|---|
| Identity | `Name`, `Type`/`Category`, `MPN`, `Barcode`, `Lot Number` |
| Commercial | `Cost`, `Price`, `Vendor`, `On Hand` (quantity), `Reorder Point`, `Expiration Date` |
| Notes | `Description`, free-text notes |

---

## What to hand back

For each record type you produce, give:
1. The CSV file itself.
2. A one-paragraph note on anything you had to guess, split awkwardly, drop, or couldn't map — this is the most important part. A human will do a final review before anything gets imported.

Don't attempt to submit, upload, or import the data yourself — these files are handed to a human who runs them through the practice's migration tooling.

---

## How to send us the files

*(This part is for the practice, not the AI — once the files above are ready, here's how to actually get them to us.)*

If you only have some small working data files in Excel or CSV, you can attach those directly to this ticket.

For larger/bulk files — such as the Uploadable Reference/Retention Data that gets uploaded to patient documents — those are usually too large to attach to a ticket. Share those with us via a shared drive such as Google Drive or Dropbox instead.

### Option 1: Share via Google Drive

1. Download your data from your current system.
2. Create a folder in Google Drive and upload your files:
   - Go to [drive.google.com](https://drive.google.com) and sign in.
   - Click the **+ New** button on the left side.
   - Select **New folder**.
   - Give it a name (like "OptiMantra Data Upload").
   - Open that folder by double-clicking it.
   - Click **+ New** again and select **File upload**.
   - Choose the data files you downloaded in step 1.
   - Wait for them to finish uploading (you'll see a checkmark when they're done).
3. Share the folder with us at **dave@optimantra.com**:
   - Right-click on the folder name.
   - Click **Share**.
   - Type in `dave@optimantra.com`.
   - Make sure the permission is set to **Viewer** (this keeps your files secure).
   - Click **Send**.

Here's a YouTube video showing that: https://www.youtube.com/watch?v=NrknRUCMN6w

### Option 2: Share via Dropbox secure link

1. Download your data from your current system.
2. Upload your files to a folder in Dropbox.
3. Create a secure shared link:
   - Right-click the folder.
   - Select **Share** → **Create a link**.
   - Click **Link settings** to add optional security:
     - **Set a password** — choose a strong password and share it with us in this ticket.
     - **Set expiration date** — set it to expire in 7–14 days.
   - Copy the link.
4. Add that link to this ticket.

---

## Document Retention Notice

Due to technical limitations, file size restrictions, unsupported formats, or platform constraints, we may not be able to upload or migrate every document, file, or record associated with your account. While we make reasonable efforts to transfer all available files, completeness of the upload is not guaranteed.

It remains the practice's sole responsibility to maintain its own copies of all patient records, clinical documentation, and related files in accordance with applicable federal and state data retention laws (including but not limited to HIPAA and any state-specific medical record retention requirements). Practices should verify that all critical documents have been successfully uploaded and retain independent backups before relying on this platform as a system of record.

If you notice any missing or incomplete files, please contact us so we can attempt to resolve the issue; however, the practice remains responsible for ensuring compliance with all recordkeeping obligations.
