LabScanner is designed to read electronic text files that are typically available as downloaded reports from clinical laboratory information systems. These files should be made up of lines that contain patient identifying information, the test code or name, the date and time of sampling, the test result, and other data in each line. They should be sorted by patient and chronologically for each patient. If a patient has more than one test of interest, it doesn't matter whether the tests are mixed within the chonological list of results for that patient, or grouped separately into their own chronological lists, as long as each patient's data is sorted separately (Fig. 1).Alternatively, patient data can be entered directly into LabScanner (this is recommended only for limited amounts of data). Imported or directly-entered data can also be edited manually within LabScanner. Information on manual data entry and editing is provided further down on this page.
Fig 1. Example of a flat file report exported from a laboratory information system (anonymized). Data elements include patient name, hospital number, birth date, physician name, patient location, accession number, date and time of sample draw, test code, and result. Data is sorted by patient and chronologically by date and time of draw. The data format in the file for import may be "flat file" or "tab delimited." In the flat file example above, each data item starts at the same character location within each line and has a fixed length. For example, Patient Name starts at character 1 and is 25 characters long (unused characters are filled with blank space characters); birthdate starts at character 41 and is 8 characters long. To create a new format for flat file data entry, choose New Import Format from the File menu and Flat File from the popout menu that appears. A window similar to Figure 2, below, will appear. To enter or modify the locations of the flat file data elements type the number for the start character and length of each data element into the boxes in the columns on the left side of the window (elements not marked "required" may be omitted if desired, by leaving those boxes blank).
The right side of the window allows you to specify other important features of the file. The Date/Time Format boxes allow LabScanner to read times and dates correctly. The times and dates should be entered here in the same way they are presented in the data file. For example, if hours and minutes are separated by a colon, this form should be entered as "hh:mm" (no quotes). Date with a four-digit year and hyphen separators would be entered as "mm-dd-yyyy". If the year, month and day are presented in a different order in the data file, that should be entered correspondingly. If two-digit years are used in the data file, a cutoff value can be entered, below which the year will be assumed to be in the next century. If the data file begins with a few non-data (header) lines, you can use the box in the Filters section to indicate the number of lines to ignore before the data lines begin. Similarly, line lengths that are greater than or less than a specified number of characters can be ignored. Since data lines in a flat file will all contain the same number of characters (and data lines in a tab-delimited file will often contain at least a minimum number of characters), this setting may help avoid problems if the file contains embedded page headers/footers or other non-data lines. In addition, lines containing specific text strings can be ignored. Type the desired text into the box above the add/delete buttons and click the add button. Click an already-entered text string in the scrolling list and then the Delete button to remove strings. This feature may also be useful in ignoring non-data lines and also in ignoring data lines that are not useful in analysis, such as "pending" results. Note that tests with text results (including pending, etc.) can be used in analyses, if desired, by selectively replacing the text results with specific numerical values. This feature is discussed under Rule Management. Finally, patients with fewer than a specific number of events can be ignored, if desired. This setting can be useful in weeding out patients with only one or a few events from large data files when the analysis uses rules targeted to multi-event profiles. Unused features may be omitted by leaving those boxes blank. Finally, click the Update button to save the format.
Fig 2. Import Format: Flat file In tab-delimited files, the data elements (such as patient name or test result) are separated by tab characters and can vary in length. They are identified by their position in the sequence of data "items" in the line (e.g. physician name might be the fourth item in each line). To create an import format for tab-delimited files, choose New Import Format from the File menu and select Tab-delimited from the popout menu. A window similar Figure 2 above will appear with one column of boxes on the left for the position of each data item in the line (e.g., Patient name = 1, Hospital number = 2, etc.). As above, set the date and time formats and other features of the file as desired.
New data formats are saved into the InputFormats.fmt file in the same directory as the LabScanner program. This is an XML file internally, so it can be viewed and edited using text or XML editors, if desired. Once an import format is saved, its name appears on the popout menu next to Import Formats in the File Menu. You can edit, switch between, or delete existing import formats by choosing them from the popout and then clicking the desired button at the bottom of the window (see Figure 2). The currently active import format is marked with a check in the popout menu.
LabScanner is distributed with a demo format for reading the sample Pat_data file (a flat file). You will probably need to change those settings to read your own files. You can determine the location of data items in your file by opening it in a text editor such as SimpleText (Mac) or Notepad (Win) and counting characters. More capable freeware/shareware text editors are available for download from the net, such as Tex-Edit or BBedit Lite for Mac, and EditPlus among others for Windows, and you may find these useful for processing text files, especially large ones. You probably shouldn't use a word processor for counting characters or items unless you really know what you're doing, because these programs use characters like tab and carriage return in special ways for positioning text on the page, and the number of "non-displayed" characters in a line may not be readily apparent.
Once the import format settings are correct, you may choose Import Patient Data from the File Menu to load the desired file. After loading is complete, LabScanner will display a list of patients from the file. Note that Patient Archives created by the LabScanner program are independent of any particular import format, so you don't need to choose a format to load an archive.
Manual data entry and editing
Manual entry of patient data is most useful with individual patients of interest for graphical display, adding to patient archives, report printing or creating/saving graphs for presentations. Manual entry may also be useful for prototyping the response of data scanning rules to particular data patterns. For anything more than a few patients and tests, manual entry becomes laborious and importing patients as described above is a better approach.
Patient data can be entered manually by choosing Manual Entry/Editing... from the File Menu. A box will appear that will allow entry of patient demographics (upper left), the test code as specified in the rules (if there is no applicable rule, any representation for the test is OK), and test events (lower left, Fig. 3). Items with red titles are required. After entering each test, click Add Event at the lower left or press 'return' to add the test to the list of tests at the right. Additional tests can then be added. When tests are displayed in the list on the right, they can be selected with a mouse click and deleted using the Delete Event button at the lower left.
Fig 3. Manual data entry and editing Tests can be added to the list in any order and they will sort correctly by chronology. Dates should be typed month/day/year with non-numeric separators (any non number character is OK). Times can be typed as hours followed by minutes in 24 hr time, with or without a non-numeric separator between hours and minutes. For drugs that are drawn as peaks and troughs, Pk/Tr should correspond to the peak and trough codes specified in the appropriate rule. When the list of tests is complete, click Save Changes at the lower right to add the patient to the patient list. If no Patient List Window is open, a new one will be created and the patient added to it. If a patient list is displayed, the new patient will be added to the end of the list.
When a new patient/test is added, LabScanner attempts to match the test with an existing rule. If there is a rule that corresponds to the entered test code, the test will be matched with it and display/scanning of the test will use the specifications of the rule. If no rules are loaded or if there is no matching rule, the test code is used as a representation for the test in patient displays and the test is not processed during scanning for data patterns.
Existing patients can be edited by selecting them in the Patient List Window and choosing Manual Entry/Editing... from the File Menu. The Manual Entry window is displayed (Fig. 3) containing the patient's data. Any of the data can be edited and individual tests can be added or deleted. Test characteristics can be edited by clicking on a test, editing the features as desired, clicking Add Event to create a new entry and then deleting the old entry. If a patient in the data set has more than one test, the Manual Entry window will include all of the patient's tests on the popup (or dropdown) menu at the upper right (Fig. 3), with the menu set to the test that was chosen in the Patient List Window. Changing this menu will display the corresponding test results in the list below the menu. You can also choose New Test from this menu to add a new test series to a patient who already has one or more test series.
Because editing patient data could invalidate any previous scans for data patterns, saving an edited patient to a list that has been scanned clears the scan (equivalent to choosing 'Clear Scan' from the 'Scan' Menu). Just re-scan the list with the desired conditions. Patients and test series that are added cannot be deleted within a session. If you need to delete added patients, just re-load the original data file or archive all patients except the ones that should be deleted and then open the archive.
| Last modified: 3/6/01 | LabScanner Home | LabScanner Operation |