Covered by this topic
MIE File Import is a tool for importing and storing a set of files (an archive) in an MIE system (i.e., Enterprise Health or WebChart) as a document. A document is then associated with a chart in an MIE system. A chart is simply a way to collect different information on one topic, just like a physical patient chart would contain a variety of information on an individual patient.
The MIE File Import tool imports and stores a variety of files types in the MIE File System, including:
- Plain text
- Rich text formatted (RTF)
- Unspecified binary The imported files could contain data about a chart, as well. Examples of imported data include:
- Images of insurance cards
- Patient photos
- Physician or nurse notes
- Past medical histories
- Continuity of Care Documents (CCDs)
- Clinical Document Architecture documents (CDAs)
- Email correspondence pertaining to a patient Along with the files that are imported into the MIE File System, a discrete document record is created, in order to associate the file with the correct chart in the MIE system. Some of the discrete data that is stored for the files as a document include:
- Service date
- Service location
- Document type (i.e., what kind of data does the document have)
Due to the typical size of these types of archives, this import is not currently available to clients without assistance from MIE. The general process is as follows:
- Client generates a CSV file containing a single row of metadata for each file to be imported.
- Client creates an archive of files corresponding to the CSV metadata. For some legacy systems like Medgate, BLOBs may be stored in a database that will need to be extracted to disk as individual files and added to an archive.
- Client sends MIE the CSV file and an archive of the files to be uploaded.
- MIE runs the import process. This is a command-line script that runs on the same system where the data is located, and it needs access to the client’s DB.
- MIE informs client when the import process is completed; a status (success or error) of each row of the CSV is available via a system report in the client’s MIE system.
The following characters are used to generate a CSV for data import:
- Delimiter - In order of preference, a comma (,) or pipe (|) is acceptable.
- Quote Character - Use a quote (") to surround fields that contain the delimiter or contain newlines.
- Escape Character - Use a quote (") to escape a quote within quoted fields. E.g. “This quoted field ““contains”” quotes” See also: Data Migration File Format Standard
- Patient ID - Specifies the patient’s chart in which the document will be stored.
- Patient ID Type - See the Patient ID Types section .
- Document Type - The document type code is required and must be uppercase. Maximum 10 characters length. Document types label and group documents, and they may be customized for each MIE system, so the code required in the CSV is system-dependent. Document types are managed in the Document Types editor of the Control Panel . Chart tabs in the MIE system display only associated/specified document types.
- Interface Name - A unique identifier from a foreign system (such as an interface) that the document came from. Maximum 100 characters length.
- External ID - An external identifier for this document. Maximum 128 characters length.
- File Name - The relative path of the file.
- Storage Type - See the Supported Storage Types section. It is highly recommended to include this data. Without this field, the tool will do its best to determine the contents.
- Encounter ID - Links a specific encounter (patient visit) to the document.
- Encounter ID Type - See the Encounter ID Types section.
- User ID - Identifies the MIE system user who entered the document into the system.
- User ID Type - See the User ID Types section.
- Origin ID - The author of the document.
- Origin ID Type - See the User ID Types section.
- Service Location - The location code for the document’s service location. These are stored in the Locations Manager of the Control Panel .
- Origin Date - Date the document initially created. Defaults to an empty date if none is provided.
- Enter Date - Date the document was entered into the MIE system. Defaults to the current date if none is provided.
- Revision Date - Date the document was revised. Defaults to the current date if none is provided.
- Service Date - Date service related to the document was performed. Defaults to an empty date if none is provided.
- Subject - The document subject that appears on the document header in the MIE system. Maximum 255 characters length.
- Comments - The complete text narrative for the corresponding document.
- File Extension - Suffix from the file name that indicates file type.
Listed below are the file/storage types that are supported by this tool. Use the values from the Storage Type column.
|Storage Type||Description||File Extension|
|1||Plain text file||txt|
|2||Rich Text Format document||rtf|
|4||HyperText Markup Language document||html or htm|
|6||Microsoft Word document||doc or docx|
|7||Tagged Image File Format (TIFF)||tif or tiff|
|8||JPEG Image||jpg or jpeg|
|9||Generic binary file. Used for unrecognized or unsupported file types.||bin|
|14||Preformatted text file (displays text as-is with newlines)||txt|
|17||Portable Document Format (PDF)|
|18||Microsoft Excel spreadsheet||xls or xlsx|
|27||Extensible Markup Language document||xml|
Patient ID types specify the patient chart. Although more patient ID types are planned, there is only one currently available.
- part: - Set this to the partition name of the patient. Enter the MR# into Patient ID.
Encounter ID types specify the linked encounter.
- id:encounter_id - Encounter ID points directly to the encounter’s ID.
- id:encounter_ext_id - Encounter ID is the encounter’s external ID.
User ID types specify the user.
- id:username - Look up a user ID by username.
- id:email - Look up a user ID by email.
- part: - Look up a user ID with a self-relation to the patient specified. Set this to the partition name of the patient. Enter the MR# into Author/Origin ID.
Here are a couple of files containing both the required and optional fields defined above. A few example rows are pre-populated to give an idea of what is expected.
MIE File Import CSV Specification & Template
File Import Upload Template
Use the system report to see the results of the import. Records from the CSV file are displayed along with a status and description for each. If a document was created, the last columns will contain links to the document and chart. Totals for each status are displayed at the bottom of the page.
There are a couple problems that could cause files and images not to display properly in the chart. Here are some possible solutions that may be checked:
- Find the file in the archive that was provided to MIE and try to open it with a viewer on your computer. It is possible that a legacy image, Word document, or whatever the file is may have been corrupt in the legacy system and no one noticed. If you either cannot extract the file from the archive sent to MIE or cannot view it on your computer, then the file is bad and will not display in WC .
- If the file is not corrupt, double-check what kind of file it is and make sure the Storage Type provided in the CSV matches the file type on disk. We have seen several Rich Text Files (RTFs) labelled as Word Documents (DOCs) (and vice versa) and various images being mislabeled, as well. Many times Word or Image viewers will actually scan the first few bytes of the file to see what kind of file type it is before rendering it. WC relies on the Storage Type provided in the CSV to specify the file type. If the Storage Type provided in the CSV is not correct, the file will not render properly in WC . To try to determine the file type, open the file with a text editor and view the raw contents of the file. A text editor will help determine plain-text ASCII files (like RTF, HTML, XML, and a few others). If the file contents are binary, then you may need to use a special tool to determine the file type.
A description is stored for each error that occurs. Check the following sections for tips on how to address each individual error.
No patient was found in the system. Without an existing chart, there is no place to store a document. If the chart exists but is not being found, check the contents of Patient ID and Patient ID Type and make the needed corrections. See Patient ID Types .
This error means that the program was unable to locate the file on disk. This could mean a few things:
- The path containing the files provided to the program was incorrect. Double-check that the correct path was provided and used.
- The contents of the CSV file for the File Name field may be incorrect. Ensure that Unicode characters in File Name have been extracted correctly.
- The filenames on disk may not match the contents of File Name in the CSV file. Ensure that files with Unicode characters are named appropriately.
Empty files, or files with zero (0) bytes, contain no data and will automatically be rejected without creating a document. Check the directory listing for file sizes. If the file appears to have a file size greater than zero bytes, double-check the Storage Type provided for the record. If an image is uploaded, but the CSV file specifies a PDF Storage Type, the system will reject the file without creating a document.