Skip to main content

Minimal Integration — Medical Mime via SFTP (Flat-File HL7) (CRM)

This document describes the minimal-scope EMR integration between Dazos CRM and Medical Mime, utilizing HL7 flat files exchanged via SFTP.

Updated over 2 months ago

Medical Mime only accepts or provides data through HL7 flat files over SFTP.

  • Your workflow requires pushing demographics and pulling discharge details for operational reporting.


Key Concepts

Concept

Description

No API

All communication uses HL7 flat files — no real-time API calls.

Transport Layer

Secure File Transfer Protocol (SFTP) is used for all data exchange. Credentials and keys must be managed securely.

Format

Files follow a minimal HL7-style structure (MSH, EVN, PID, PV1, IN1, NK1, ZRX, etc.).

Data Direction

CRM → Medical Mime: Patient demographics.
Medical Mime → CRM: Discharge details (date, type, destination).


Integration Workflow

🔄 Data Flow Overview

  1. CRM → Medical Mime (Push):

    • CRM exports HL7 flat files containing patient demographic data.

    • Files are uploaded securely to Medical Mime’s SFTP “inbound” directory.

  2. Medical Mime → CRM (Pull):

    • Medical Mime posts discharge-related HL7 files in its “outbound” directory.

    • CRM retrieves, parses, and updates corresponding patient records.

  3. Automation:

    • CRM recomputes Length of Stay = Discharge Date − Admission Date.

    • Updated discharge details are displayed in the patient UI.

Data Exchange Direction and Format

Direction

Data Exchanged

Format

Protocol

CRM → Medical Mime

Patient demographics

HL7 flat file

SFTP

Medical Mime → CRM

Discharge Date, Discharged To, and Discharge Type

HL7 flat file

SFTP


Supported Data Elements & HL7 Mapping

Below are the supported data fields divided by category.
These tables are based on the official mapping specification and HL7 segment definitions.


🧍‍♀️ Demographics

Category

Field

Medical Mime HL7 Segment/Field Equivalent (Flat File)

Notes

Demographics

First Name

PID-5 (Name)

Part of patient name.

Demographics

Middle Name

PID-5 (Name)

Part of patient name.

Demographics

Last Name

PID-5 (Name)

Part of patient name.

Demographics

Preferred Name

Not explicitly defined

Part of patient name.

Demographics

Date of Birth

PID-7 (Date/Time of Birth)

Format: MM/DD/YY.

Demographics

Gender

PID-8 (Administrative Sex)

Male / Female / Other.

Demographics

SSN

PID-19 (SSN Number)

Must be numeric.

Demographics

Marital Status

Not explicitly defined

Single / Married / Divorced.

Demographics

Race

Not explicitly defined (typically PID-10 in full HL7)

Captures patient’s self-identified race.


☎️ Contact

Category

Field

Medical Mime HL7 Segment/Field Equivalent (Flat File)

Notes

Contact

Client Cell Phone

PID-13 (Phone Number – Home)

Corresponds to Phone/Email field.

Contact

Client Email

PID-13 or PID-14 (Email / Business Contact)

Corresponds to Phone/Email field.

Contact

Client Address – Line 1

PID-11 (Patient Address)

Street address.

Contact

Client Address – Line 2

PID-11 (Patient Address)

Second address line.

Contact

Client City

PID-11 (Patient Address)

City.

Contact

Client State

PID-11 (Patient Address)

State.

Contact

Client Zip Code

PID-11 (Patient Address)

Zip / Postal code.

Contact

Client Work Phone

PID-14 (Phone Number – Business)

Optional field for business contact.


🏥 Admission / Intake / Encounter

Category

Field

Medical Mime HL7 Segment/Field Equivalent (Flat File)

Notes

Admission

Facility

PV1-3 (Assigned Patient Location / Facility)

Assigned facility or department.

Admission

Housing (Medical Mime Program)

ZRX (Treatment Program / Service)

ZRX segment defines treatment program or service.

Admission

Professional (Primary / Attending)

Not explicitly defined

Typically PV1-7 or PV1-8 in full HL7.

Admission

Professional (Referrer)

Not explicitly defined

Associated with Referrer field.

Admission

Expected Admission Date

PV1-44 (Admit Date / Time)

Expected admission time.

Admission

Expected Discharge Date

Not explicitly defined

Typically PV1-45 (Discharge Date / Time).

Admission

Referrer Date

Not explicitly defined

Not part of minimal HL7 dataset.


🚨 Emergency Contact

Category

Field

Medical Mime HL7 Segment/Field Equivalent (Flat File)

Notes

Emergency Contact

First Name

NK1-2 (Next of Kin / Contact Name)

Part of Next of Kin name.

Emergency Contact

Last Name

NK1-2 (Next of Kin / Contact Name)

Part of Next of Kin name.

Emergency Contact

Relationship

NK1-3 (Relationship)

Relationship type (spouse, guardian, etc.).

Emergency Contact

Phone

NK1-5 (Phone Number)

Contact phone number.

Emergency Contact

Address Line 1

NK1-4 (Address)

Primary street address.

Emergency Contact

Address Line 2

NK1-4 (Address)

Secondary address line.

Emergency Contact

City

NK1-4 (Address)

City of residence.

Emergency Contact

State

NK1-4 (Address)

State or province.

Emergency Contact

Zip Code

NK1-4 (Address)

Zip or postal code.


💳 Insurance Policy

Category

Field

Medical Mime HL7 Segment/Field Equivalent (Flat File)

Notes

Insurance Policy

Insurance Type

IN1-1 (Set ID)

Distinguishes Primary (1), Secondary (2), etc.

Insurance Policy

Insurance Provider Name

IN1-4 (Insurance Company Name)

Payer name.

Insurance Policy

Plan Type

Not explicitly defined

Could map to IN1-6 or IN1-16.

Insurance Policy

Provider Phone

IN1-17 (Insurance Company Phone Number)

Provider contact number.

Insurance Policy

Policy Number

IN1-36 (Policy Number)

Unique policy ID.

Insurance Policy

Group Number

IN1-8 (Group Number)

Employer or group plan.

Insurance Policy

RX Bin #

Not explicitly defined

May exist in Z-segment or IN2/IN3.

Insurance Policy

RX Group #

Not explicitly defined

May exist in Z-segment or IN2/IN3.

Insurance Policy

RX PCN #

Not explicitly defined

May exist in Z-segment or IN2/IN3.

Insurance Policy

RX Phone

Not explicitly defined

May appear in extended pharmacy fields.

Insurance Policy

Effective Date

IN1-12 (Policy Effective Date)

Coverage start date.

Insurance Policy

Expiration Date

IN1-13 (Policy Expiration Date)

Coverage end date.


👤 Policy Holder

Category

Field

Medical Mime HL7 Segment/Field Equivalent (Flat File)

Notes

Policy Holder

First Name

IN1-16 (Name of Insured)

Part of the insured’s name.

Policy Holder

Middle Name

IN1-16 (Name of Insured)

Part of the insured’s name.

Policy Holder

Last Name

IN1-16 (Name of Insured)

Part of the insured’s name.

Policy Holder

Date of Birth

IN2-2 (Date of Birth)

Policy holder’s DOB.

Policy Holder

Relationship to Patient

IN1-17 (Relationship to Insured)

Relationship type.

Policy Holder

Address Line 1

IN1-19 (Insured’s Address)

Primary address line.

Policy Holder

Address Line 2

IN1-19 (Insured’s Address)

Secondary address line.

Policy Holder

City

IN1-19 (Insured’s Address)

City.

Policy Holder

State

IN1-19 (Insured’s Address)

State.

Policy Holder

Zip Code

IN1-19 (Insured’s Address)

Postal code.

Policy Holder

Primary Phone

IN1-20 (Insured’s Phone Number)

Primary contact number.


🧭 Manual Mapping Setup

Purpose

Manual mapping ensures that CRM fields correctly correspond to Medical Mime’s HL7 data elements, enabling accurate patient demographic pushes and discharge data imports.

Steps to Perform Manual Mapping

  1. Log in to the CRM

    • Use your administrator credentials to sign in to the CRM.

  2. Navigate to EMR Settings

    • From the top menu, click the Settings (gear icon).

    • Then go to CRM Settings → Integration → EMR Settings.

  3. Select the Minimal Mime Module

    • Locate the Minimal Mime tab or module within EMR Settings.

    • This section specifically handles the SFTP-based integration with Medical Mime.

  4. Add or Edit Mapping Account

    • Click “Add Account” if you are setting this up for the first time.

    • Enter the SFTP credentials (Host, Port, Username, Password or SSH Key) provided by Medical Mime.

    • Click “Test Connection” to confirm that the connection to the Medical Mime SFTP server is successful.

  5. Access Field Mapping

    • Within the Minimal Mime configuration, click “Add EMR Entities Mapping” (or “Edit Mapping” if an account already exists).

    • This opens the Manual Mapping screen.

  6. Map CRM Fields to HL7 Fields

    • In the mapping screen, match each CRM field to its corresponding HL7 segment and field from Medical Mime.

      • For example:

        • First Name → PID-5

        • Date of Birth → PID-7

        • Gender → PID-8

        • Insurance Provider Name → IN1-4

    • Use the tables in this document as a reference for correct mapping.

  7. Save and Validate

    • Click Save Mapping once all fields are linked.

    • Test the mapping by creating a sample patient and confirming that the HL7 file exported via SFTP includes correct values in each field.

  8. Create Patient Record and Push to Medical Mime

  • Navigate to the Intake Opportunities module in CRM.

  • Enter data for all mandatory fields on the intake record.

  • Click the three-dot ellipsis (⋯) icon in the record header.

  • Select Create Patient in Medical Mime to push the data.

  • The CRM will generate an HL7 demographic file and transfer it via SFTP to Medical Mime.

  • A confirmation popup appears upon successful upload; you can also check logs to verify completion.

Expected Result

After completing manual mapping:

  • CRM successfully exports patient demographic data to Medical Mime using the correct HL7 fields.

  • Returned discharge data updates the proper CRM fields automatically.

  • The system log records each mapping validation.


⚙️ Acceptance Criteria

  • CRM exports HL7 demographic files via SFTP.

  • CRM ingests HL7 discharge files from Medical Mime via SFTP.

  • Patient records are updated with:

    • Discharge Date

    • Discharged To

    • Discharge Type

  • CRM computes Length of Stay = Discharge Date − Admission Date.

  • UI displays discharge details clearly.

  • Full logging and error handling (HL7 parsing, SFTP errors, missing data).

  • Integration validated using test HL7 samples.


🧾 Sample HL7 Excerpt

Minimal Integration with Medical Mime via SFTP (Flat File Exchange)" and indicates that it will show dummy data for the type of HL7 formatted data being pushed.

MSH|^~\&|CLIENTAPP|CLIENTFAC|MEDMIME|MMFAC|20251103064612||ADT^A04^ADT_A01|CTRLMSG|P|2.5
EVN|A04|20251103064612
PID|1||2115094^^^CLIENTFAC^MR||SIM^JHON^^^^^^L||19800212|M||^HL70005|137 Windsor Dr^^Pittsburgh^PA^15235^USA||1235776^PRN^[email protected]^PRN^NET...
PV1|1|O|^Recovery Wellness Center^01^MMFAC||||^^^^PA||||||||...
IN1|1||NovaSys Health|NovaSys Health|^^^^^USA|^WPN^PH||||||20251031...
ZRX|1|NovaSys Health|Robb|Jimm 9090|ser808||^WPN^PH|20251031|
NK1|Test Contact|^^HL70063||89856567^PRN^PH

(Use the complete HL7 block from the spec for end-to-end testing.)


📋 Logs, Monitoring & Auditing

  • Outbound Logs: record each file name, timestamp, SFTP response.

  • Inbound Logs: record parsed fields, patient match, updates, and errors.

  • Archive Policy: retain files for at least 30 days.

  • Alerts: trigger notifications for parse errors, failed transfers, or unmatched patients.


⚠️ Error Handling Guidelines

Scenario

Resolution

HL7 Parsing Failure

Move to error archive, alert support.

SFTP Connection Failure

Retry 3x with backoff, then pause and alert.

Missing/Unmatched Patient

Flag for manual review.

Duplicate File

Use message control IDs or file hash to prevent reprocessing.


Did this answer your question?