An Apple II Medical Database in 1981

In Spring 1981 I was finishing up my medical internship at a busy teaching hospital. Despite a crazy on-call schedule and chronic sleep deprivation, I had also managed to successfully complete a diploma course in computer science at a local college. I heard from a colleague that one of the hospital’s consultant physicians has been gifted an Apple II computer and was interested in using it to manage medical data. At the time, the idea of using a ‘personal computer’ in medicine was both novel and exciting.

In July 1981 we embarked on a six month project to design and implement an Apple II database system to manage information related to gastrointestinal (GI) endoscopy procedures performed at Mater Misericordiae University Hospital in Dublin, Ireland.

The hardware consisted of an Apple II Europlus with 48K of RAM, two 140K floppy disk drives, a 40 column monochrome display monitor and an Anadex DP-9501 dot matrix printer. The database system was named the Computerized Endoscopy Data Management System (CEDMS).

Initially we considered implementing CEDMS using an Apple II commercial database software package called the CCA Data Management System (Personal Software, 1980). However, following a detailed evaluation, it was clear that CCA was not suited to our needs and we instead chose to develop a custom database application written entirely in AppleSoft BASIC.

The CEDMS project had three major goals: (1) the database should support storage, retrieval and reporting of the core administrative and clinical data related to GI endoscopies performed at the hospital; (2) the system should be turnkey, easy to use and tolerant of user errors and (3) given that approximately 5000 GI endoscopy procedures were performed at the hospital each year at that time, we would need a storage model that could accommodate that volume of data using only 140K floppy disks. In 1981 a Corvus 10MB hard disk for the Apple II cost $5000 (approximately $17,000 today) and was beyond the project’s budget.

CEDMS Main Menu

The CEDMS database was implemented using the Random-Access Files feature of Apple II DOS. Each data file contained a set of sequentially numbered fixed-length records that could be directly accessed from BASIC using the record’s sequence number. To support searching, data file records were indexed using a b-tree of calculated keys. This design created a simple Indexed Sequential Access Model (ISAM) database. Though not a true relational database, the relational schema diagram below approximates the CEDMS database model.

CEDMS Database Schema

CEDMS used three linked databases: Patient, Referring Physician and Endoscopy. The Patient Database contained a record for each patient upon whom an endoscopic procedure was performed. Each Patient Record stored a person’s name, date of birth, gender, home address, hospital ID number and a list (record IDs) of the GI endoscopy procedures performed on that patient. The Endoscopy Database contained a record for each procedure performed including: type of endoscopy (e.g. Upper GI Endoscopy, Colonoscopy), the reasons for the endoscopy, prior radiology findings and the endoscopy findings (including histology).

As a hard disk was not within the project’s budget, we had to devise a method of storing and retrieving several thousand patient and endoscopy records using multiple 140K floppy disks. To achieve this goal we: (1) implemented sparse endoscopy records (see below) that allowed CEDMS to store approximately 1,000 endoscopy records per floppy disk and (2) implemented an algorithm that would prompt the user to insert the appropriate floppy disk from a set of disks storing patient and endoscopy records.

Sparse endoscopy records were implemented using Choice Tables. These were tables of numbered choices displayed on the screen (see example below). A user entering the endoscopy data would select one or more numbered choices from a set of tables and the database would store the selection and table number rather than the full text of each selected item. This significantly reduced the size of each stored endoscopy record as only the number(s) of the items selected were stored. Using two 8 bit bytes, it would be possible to store the 16 boolean values (selected=1, unselected=0) for each Choice Table.

CEDMS supported the creation and modification of new choice tables when designing a database. Multiple tables per database were supported with up to 16 selection items per table and support for multiple selections within a table. When retrieving data the stored Choice Table boolean values were used to retrieve and display the text associated with each selected item .

CEDMS Choice Table

As patient and endoscopy records would be stored across multiple floppy disks an automated method for prompting the user to insert the correct floppy disk was needed. To achieve this goal we created a set of pre-formatted floppy disks to store patient records based on the first letter of the patient’s last name. Rather than creating a set of 26 patient record disks ( ‘A’ to ‘Z’) we examined the 1981 Dublin telephone directory to approximate the statistical distribution of these last name first letters in the Irish population. This allowed us to create an extensible set of 9 floppy disks that could (in total) store approximately 5000 patient records per disk set, with each disk in the set assigned to one or more letters of the alphabet.

Automated prompting of the user to enter the floppy disk containing a specific endoscopy record was achieved by creating an extensible set of endoscopy data disks, each with a unique numeric identifier. When recording an endoscopy data record the disk identifier and endoscopy record number on that disk were automatically stored in the list of endoscopies linked to each patient record. CEDMS prompted the user to insert the correct data disk into the disk drive before reading or writing data. Each disk contained a unique identifier that prevented data being written to the wrong disk.

CEDMS Prompting for Data Disk

Retrieval and reporting were limited in CEDMS. The database could be queried by patient name and patient date of birth. Alternatively if a record ID was known it could be used to retrieve that record. There was also a sequential “Scan” option which allowed for partial information to be used to find one or more matching records. Once a a patient record was found the endoscopy records for that patient could be easily retrieved, viewed and printed.

CEDMS Retrieval Menu

In October 1981 we presented a paper on CEDMS at a scientific conference in London organized by the British Society of Gastroenterology. At this meeting presentations on related computer-based systems were also made by groups from Britain, New Zealand and the United States.

In January 1982, I started medical residency training in the United States, thus ending my role in the CEDMS project. However, work on the project continued after I left, particularly on the implementation of reporting functionality and migrating the system to a hard disk storage model.

In late 1982 CEDMS begin using a hard disk for data storage – a SyMBFile 5.25-inch Winchester Disk that came in 5MB and 10 MB configurations. The hard disk was partitioned into 12 volumes containing the CEDMS AppleSoft BASIC code and nine volumes that simulated the original set of the nine floppy-based Master Index groups that we had originally created to store patient data. The system code was modified to automatically read and write data to/from the hard disk instead of prompting the user to manually retrieve and insert the correct floppy disk. CEDMS later supported the ability to automatically format and print endoscopy reports for referring physicians.

In retrospect CEDMS was a simple standalone medical database system that reflected the limitations of the speed, memory and storage capacity of early personal computers. Other than basic patient and referring physician demographics there was no provision for the entry of textual or structured data. Searching and reporting functionality was limited and slow. However, the solution for storing several thousand endoscopy reports on a set of nine 143K floppy disks was inventive and effective, albeit with the downside of manual retrieval and insertion of disks by the operator.

CEDMS was one of the first attempts at creating a personal computer-based endoscopy data management system. Today computer systems play an important role in modern endoscopy practice by enabling efficient storage, processing, and retrieval of high-resolution images and videos captured during procedures. Modern systems facilitate integration of endoscopy data with electronic health records (EHRs), ensuring that patient data is securely stored and easily accessible for diagnostic and treatment planning. Advanced software tools analyze endoscopic images, supporting physicians with real-time insights and aiding in the early detection of abnormalities.

Restoring a 1982 Apple II Clone

In late 1982 I purchased my first ‘personal’ computer. Up to that point I had been using a variety of microcomputers and time sharing systems at school and work. My preferred home machine was an Apple II Plus computer but a fully equipped system was beyond my budget. Instead, I purchased a more affordable Franklin Ace 1000 with two 5.25 inch Lobo floppy disk drives, a disk drive controller card and a USI Pi3 amber monitor.

The Franklin Ace 1000 was an Apple II Plus clone, manufactured by Franklin Computer Corporation. The Ace 1000 came with 64K of RAM, a full upper/lowercase Keytronics auto-repeat keyboard and a big 65W power supply that contained a built-in cooling fan. Franklin copied the Apple II ROMs, so the Ace was compatible with almost all Apple II software and cards. However, it did not initially support Apple II color graphics. I later added a Videx 80 Column Display card, a Serial Interface card, a PKaso parallel printer interface card, and a C.ITOH 8510 printer.

Franklin Ace 1000 Advertisement

While the Franklin Ace 1000 could boot from an Apple DOS 3.3 startup disk, it shipped with a Franklin DOS disk containing a modified version of Apple DOS that supported lowercase commands and file names. This disk also included a Franklin Diagnostics program to test the Ace 1000 RAM, EPROMs, keyboard, disk drives and graphics modes. The disk also contained a FUD utility program (similar to the Apple II FID program) to handle common disk and file tasks. Using these Franklin programs is described in the Franklin Ace 1000 User Reference Manual. The appendix of this manual contains a listing of the differences between the Apple II and Franklin Ace 1000 ROMs. The Franklin Ace Dealer Service Manual contains additional detailed technical information about the Ace 1000 motherboard, disk drives, video monitor and hardware trouble shooting.

I sold my Franklin Ace 1000 in 1984 after purchasing an Apple Macintosh computer. However, I had fond memories of this first ‘personal computer’ and when I saw an Ace 1000 advertised as ‘not working’ a few years ago, I purchased it and stored it away until I had time to determine what was wrong. It turned out that the computer itself (though quite dirty) was fine. The problem was the keyboard.

The Franklin Ace 1000 Keytronic keyboard uses capacitive foam and foil switches. The foam degrades over time and the pads no longer make contact and have to be replaced. I was able to purchase replacement pads from TexElec. The removal and replacement process is tedious (and messy – as the foam disintegrates) but in the end I had a fully functional keyboard. There is a helpful repair video on this topic available at Adrian’s Digital Basement. I found a chip puller (to remove the key caps) and a dental scaler tool (to remove the pads) very useful.

Franklin Ace 1000 Keyboard after KeyCap Removal
Keyboard Foil and Foam Pads Exposed

Once the keyboard was functional, I removed the ICs, cleaned the motherboard and used DeoxIT on some of the more suspect connectors. The Franklin power supply (Astec 12180) uses RIFA capacitors, which should be replaced. If the power supply fan is noisy, it can also be replaced with a modern 12v 120mm fan.

Franklin Ace 1000 Motherboard and Power Supply

After a thorough cleaning and reassembly the Ace 1000 is fully functional. Now all I need to find is a USI Pi3 amber monitor.

Restored Franklin Ace 1000 System

In 1982 Apple successfully sued Franklin claiming copyright infringement of the Apple II ROM and the Apple II DOS operating system. The case established for the first time that code in ROM (Firmware) was protected by copyright, that machine readable code (not just source code) was protected and also that operating systems were covered by copyright. Franklin agreed to pay Apple $2.5 Million in damages. When Apple introduced the ProDOS operating system in October 1983, Franklin Ace owners discovered that Apple had added software which prevented ProDOS launching on non-Apple computers. However, software patches to defeat this protection system were soon available. Modern versions of ProDOS do not contain this restriction and do not require a patch.

So You Want an Apple II Computer?

You are thinking about acquiring a 40 year-old Apple II computer. Perhaps you are feeling nostalgic and wish to play fondly remembered games or you plan on getting back into BASIC programming. In my case I wanted to reconstruct the Apple II Pascal development environment I used in 1982. Having recently gone through the process of acquiring and setting up a functional Apple II system, I would like to share what I have learned.

There are two possibilities: (1) acquire an Apple II machine (2) use Apple II emulator software. Let’s consider the pros and cons of each option.

Hardware: Apple II Pascal will run on the Apple II+, Apple IIe, Apple IIc or an Apple IIgs (in Apple IIe emulation mode). There is also an Apple III version of Apple Pascal that is specific to that computer. I have used Apple II Pascal on both an Apple IIe and on a Franklin Ace 1000 (an Apple II+ clone). The Apple IIe, with 128K of RAM and 80-column text display, is a good option as the extra 64K of memory is supported by version 1.3 of Apple II Pascal, allowing for larger programs and slightly speedier operation. The IIe also has a more extensive keyboard than the Apple II Plus.

Buying a 40 year-old Apple II to run Apple II Pascal comes with caveats. You will need not just the computer but also two external disk drives, a disk drive controller card and a display monitor that supports 80-column text. This is a photo of the Platinum Apple IIe system that I assembled from various online sources.

The Apple IIe is a good choice for the first-time buyer. With almost six million units sold, there are still a lot of Apple IIe computers out there. Late model Apple IIe computers contain fewer components and are therefore less likely to experience hardware issues that the earlier Apple II or Apple II Plus computers. The Apple IIe Platinum is particularly desirable because of its built-in support for extended memory (128K of RAM), 80-column text display and larger keyboard. It retains compatibility with most of the hardware and software developed for earlier Apple II computers.

If the computer is an Apple II+ or compatible clone (e.g. my Franklin Ace 1000 shown here) you will also need an 80-column display card (such as the Videx Videoterm). On the Apple IIe, 80 column display support is provided by the auxiliary extended 80-column text card.

An additional caveat is that a 40 year-old computer is way past its expected lifespan and could manifest with a variety of hardware issues that you may need to address. Common issues include:

Apple II power supply units (PSU) degrade over time and may require replacement or rebuilding. A failing PSU can result in the computer not starting up or malfunctioning when additional cards are added. A more dramatic failure may occur when the RIFA capacitors in the PSU gently explode!

If you acquire an old Apple II, consider replacing the PSU before using it. ReActiveMicro sells an affordable and reliable replacement PSU kit and will also refurbish your existing Apple II PSU. A word of warning: the interior of a PSU contains high voltage components that can deliver fatal electrical shocks, even when unplugged. Never open an Apple II PSU case unless you know what you are doing!

Another common issue with 40 year-old Apple II computers is that electronic components (other than the PSU) such as integrated circuits (ICs), transistors, capacitors and resistors may fail. Again, this can result in the computer not starting up, failing to complete the boot process, experiencing intermittent crashes or manifesting display issues. Determining which components are faulty can be a complicated and time-consuming process.

Sometimes fixing component issues is as simple as reseating the ICs (turn the computer off, carefully remove the IC from its socket, clean the pins and carefully reinsert the IC). Beyond this you are into a (potentially fun) world of repair manuals, arcane knowledge and test equipment. If you are so inclined, there are a number of helpful online repair videos, such as Adrian’s Digital Basement and Chris Torrance’s Assembly Lines. There are also dedicated repair services, such as Joe’s Computer Museum.

Another potential issue to highlight is that Apple II disk drives and the 5.25″ disks they use also degrade over time and can be a source of failure. Apple 5.25 inch double-sided, double-density (DS/DD) floppy disks are now hard to find/buy – try here.

An alternative to 5.25 inch disks on the Apple IIe, IIc and IIgs are 3.5 inch disk drives. These drives use 800K disks, providing about five time the storage capacity of the standard Apple II 143K disks. On the Apple IIe a special disk drive controller is required to support 3.5 disk drives.

There are also a number of modern Apple II virtual disk drives designed to support both floppy disk emulation and hard disk emulation using compact flash cards or USB drives. ReActiveMicro sells the CFFA3000 card. The Booti card is a popular alternative, as is the Floppy EMU card. These virtual drives offer many advantages over physical disks: speed, storage capacity and reliability.

If you want to buy an Apple II computer, where do you find one and how much do they cost? I suggest starting with eBay. Sellers on eBay offer a constant stream of Apple II family computers for sale. In May 2023, a functioning Apple IIe with two disk drives (without a display monitor) cost in the $200-$350 price range. If you are lucky you may see a complete Apple IIe system for sale with a display monitor, usually at a higher price point. One advantage of eBay is that you have some protection if the item advertised is not what you receive.

Apple II composite display monitors that are capable of displaying 80-column text cost in the $150-$300 price range on eBay. Beware of high shipping costs, particularly if the system contains a monitor. An alternative source of Apple II display monitors is Apple Rescue of Denver.

Another possible source for Apple II computers is Facebook Marketplace where you may find an Apple II system for sale locally that you can could pick up and therefore save on delivery charges, while also avoiding possible equipment damage during shipping. Estate sales and used computer marts may also be fruitful areas for exploration.

Apple II Emulators: A considerably less expensive alternative to acquiring/buying/repairing a physical Apple II computer is to use an Apple II emulator. These are programs that run on modern computers and emulate an Apple II computer entirely in software. If you are a Macintosh user, I recommend Gerard Putter’s amazing Virtual ][ app which can emulate the Apple II, Apple II+ and Apple IIc computers – including 80-column displays, disk drives (including hard disks), printers and various cards. On the Microsoft Windows platform the most popular Apple II emulator is AppleWin. They are also a Web-based Apple II emulators, such as Apple IIJSe.

Virtual ][ running on a Macintosh (screen shot) is my preferred platform for Apple II Pascal development. It is a highly accurate emulation of the Apple II, II+, IIe and IIc. Look out for a future post on this topic.

An additional advantage of using an Apple II emulator is free access to thousands of Apple II disk images from sites such as Asimov and Internet Archive. Disk images are files contain the data from old Apple II disks. Emulators, such as Virtual ][, can use these disk image files in the same way that a real Apple II can use floppy disks. If you have a real Apple II computer, disk images can be converted to real floppy disks using ADT Pro software.

So which Apple II option: hardware or software? I chose both. I purchased an Apple IIe and a Franklin Ace 1000 (Apple II Plus clone) on eBay. Both required repairs (more on that in future posts). I also bought floppy disk drives, Apple II display monitors and various cards. I now have both a functional Apple II Plus clone and an Apple IIe as part of my Pascal development environment. I also use Virtual ][ on the Macintosh as my primary Apple II Pascal development platform, for reasons that I will discuss in future blog posting.

In this post I have not discussed the Apple IIc and Apple IIgs computers. This is, in part, because I have no personal experience with either computer. Fully functioning Apple IIc computers are harder to find and tend to be more expensive. The IIgs can run most Apple II software (including Apple II Pascal) in Apple IIe emulation mode but is fundamentally a different platform to the II Plus, IIe and IIc computers.