• Non ci sono risultati.

How to Make Your Own Database:Programming a Simple Procedure Log 17

N/A
N/A
Protected

Academic year: 2022

Condividi "How to Make Your Own Database:Programming a Simple Procedure Log 17"

Copied!
30
0
0

Testo completo

(1)

Don’t Pay for a Handheld Database: Build Your Own!

Building a Procedure Tracking Log

Physicians often have to keep a record of all the clinical procedures they perform on patients. Most often they do it to get paid for their work—and then lose the bits of paper between hospital and office. Or maybe residents have to prove to their professors that they are actually learning skills—and then can’t remember at the end of a busy rotation what they did, or when.

Or a physician in practice might have to cough up a log every year to keep renewing hospital privileges, and not have any idea how to go back over 365 days to get the information together. Wouldn’t it be much easier to tap that information into a handheld on the spot in a few seconds?

In Chapter 11 we reviewed database software products that you can use on a handheld computer for everything from your family’s shoe sizes to tracking patients. Using the information we provided there, you should be able to pick an inexpensive software product suitable for building your own custom databases.

In this chapter we show you how to build and maintain your own data- bases using a clinical procedure log as an example. Forget about paying a software engineer: you can make databases like this yourself (for free) while in the dentist’s chair, to keep your mind off the drill.

In this chapter we explain how to build a simple procedure log using HanDBase (www.handbase.com). Then we’ll show you one way to convert this flat file design to a relational design and explain how to link the HanD- Base database to more powerful desktop database software products. A great thing about HanDBase is that you can use its databases on either Palm OS or Pocket PC handhelds! Finally, we’ll show you how to build a similar procedure log database within Microsoft Access using Pendragon Forms.

17

How to Make Your Own Database:

Programming a Simple Procedure Log

James M. Thompson and Scott M. Strayer

387

(2)

Most users will be content with this type of user-friendly database soft- ware. If you have a program like the ones described in Chapter 11 and run into a problem, talk to the company that made the product, because often they can provide programming expertise to find a solution with little-known features in their products. For very complex handheld database projects, you might want to consult a programmer who may use one of the heavy- weight products mentioned in Chapter 11, or perhaps even hire a pro- grammer to build your project in a low-level computer language like C++.

Key Points

1. You can build a simple procedure log database on your handheld in a few minutes.

2. You can share a HanDBase database with both Palm OS and Pocket PC users.

3. You can make the procedure log database more useful by modifying it with more complex features as you learn about them, like building in relationships between two or more tables.

Build Your Own

This is the “Do It Yourself” age, when everybody can roll their own—what- ever. It is very easy to build your own database design. We’ll show you the details later in this chapter, but here is a basic overview of the process.

The simplest database merely is a table comprising one or more fields that store data in records. To make a simple database you first make a table. To make a table you create and label fields, and then you define the type of data each field will hold, for example, date, text, time, or integer, depend- ing on the feature set in the product you own. Then you enter data into the fields to create records. To make a simple relational database you build two or more tables, and then link certain fields in the tables together.

For Palm users, during the HotSync process a copy of the database struc- ture moves from the handheld to the desktop, together with any data that might have been added to the table(s). At very least the desktop copy simply sits on the desktop’s hard drive as a backup in case something goes wrong with the copy on the handheld. In the default setup, this backup copy typically resides in the C:\palm\yourpalm\backup folder, where “Yourpalm”

is the folder name assigned to your handheld device.

For Pocket PC users, the ActiveSync process automatically backs up database programs, but “Files” needs to be set to “synchronize” in the ActiveSync settings (see the ActiveSync documentation for more details on this). HanDBase also creates a backup copy in the desktop files location on your hard drive if you have the synchronization software configured correctly.

(3)

All but the very simplest database products come with a companion desktop program that allows you to open the desktop copy of the database to add, delete, or edit records on the desktop, or even to modify the data- base structure. Products that support two-way synchronization load the changed data back onto the handheld the next time you synchronize the computer and handheld. HanDBase comes with a desktop companion that can do all this and more.

Key Points

1. The simplest database is a table composed of fields that store data in records.

2. To make a simple database you build a table, select the types of fields you want, and give them names.

3. To use the database, you simply enter data into the fields.

4. To make a database relational, you simply build two tables and link them together through a common field.

5. During HotSync, Palm databases are automatically backed up to your desktop computer.

6. During ActiveSync, Pocket PC databases are also backed up on your desktop computer.

7. Handheld database products come with a companion desktop utility that allows you to change the database design or edit database contents right on your desktop.

The Lazy Way to Get a Database: Download a Model from the Internet

Chances are that someone has already made a handheld database similar to your project. Do a search with an engine such as www.google.com to find the many Web sites that have database archives suitable for your product, or check out the product’s home page. If you find a model that will run with your software, then download and modify it to suit your needs.

HANDS-ON EXERCISE 17.1. HOW TO BUILD A SIMPLE PROCEDURE LOG USING HANDBASE

How many times have you pulled your shirts out of the dryer to find an illegible scrap of paper that was supposed to remind you about the lumbar puncture you did in the hospital a few nights ago? In fact, this has happened to you so many times that your reapplication for privileges might not get approved this year because you don’t have proof of your experience readily at hand. So instead of printing out a neat report in seconds, you have to take a day off from your clinic to plow through charts at the Medical Records Department. That’s expensive.

(4)

Well, we’ve got a great solution for you. Here are directions for building a simple one-table, flat file database design for logging procedures per- formed by a physician, using HanDBase as an example. Most of the other middleweight database products work in a similar way. In these examples, we use Palm screenshots, but the procedures and screens are nearly iden- tical for Pocket PC handhelds. Where there is a difference, it is noted.

Name the Database and Set up the Fields

Open HanDBase. Tap “New” to start building a new database. On Pocket PC’s, you will tap on the “Create a new database” button.

Give the database a unique name, like “Procedure Log” (Figure 17.1).

When you tap “OK” on the screen in Figure 17.1, HanDBase creates the new database, then shows you a screen where you can start naming and configuring the fields (Figure 17.2).

Tap on “Field 1” (circled in Figure 17.2) to open a screen where you can define the first field for your procedure log database table (Figure 17.3).

Create a Date Field

Give Field 1 the new name “Date” by highlighting or erasing the words

“Field 1” and writing “Date” (circled in Figure 17.4).

Tap on the “Field Type” drop-down list and select the field type “Date.”

When you do that, the screen changes to allow you to select more para-

Figure 17.1. Name the Procedure Log database (Palm). (Reprinted with permis- sion from DDH Software.)

Figure 17.2. “Edit Fields” screen for a new database. (Reprinted with permission from DDH Software.)

(5)

meters for a date field (Figure 17.5). Change the pixel width to 35 (circled).

The default width of 58 pixels for this field’s column will be too wide when you view the resulting screen to view record details. You might have to go back and adjust this setting later, to get the column widths right for each field. Trial and error works here. You can always go back and adjust the pixel width for any field later, if you don’t like the way a screen comes out.

You can also resize fields by just “dragging and dropping” them to the right width in the list view of HandBase.

Figure 17.3. Create the first field for the database (Palm). (Reprinted with permis- sion from DDH Software.)

Figure 17.4. Name the Date field (Palm).

(Reprinted with permission from DDH Software.)

Figure 17.5. Setting the date field parameters (Palm). (Reprinted with permis- sion from DDH Software.)

(6)

Tap the drop-down list “Behavior” to pick the way you want the program to choose a date by default (circled in Figure 17.5). “Date Record Added”

is convenient because it will automatically enter today’s date. However, you will still be able to pick different dates from a handy calendar screen when you tap the down arrow beside the field name “Date” in the record view (Figure 17-6a,b). The date picker screen is a little different on the Pocket PC version of HanDBase. You can pick other default behaviors for the Date field too, depending on your personal preferences.

Key Point

1. The different ways you can set up a Date field to pick dates is a good example of how you can build handy features into your database with only a few screen taps, making it very fast and easy to use the database during a busy clinic day.

Create a “Pop-Up List” Procedure Field

Tap on Field 2 and create a second field called “Procedure.” Make it a pop- up list for procedures. After you finish building the database structure, you can open the pop-up list to add all the procedures you can think of; here, I’ve added four (Figure 17.7). You can also add more on the fly while you use the database.

But, don’t forget that pop-up lists only allow you to enter 60 choices, so if your list of procedures is longer, then you need to consider a different Figure 17.6a. The date picker screen (Palm).

(Reprinted with permission from DDH Software.)

Figure 17.6b. The date picker screen (Pocket PC). (Reprinted with permission from DDH Software.)

(7)

solution. Later we’ll explain how to build a second table for the procedures and link it to this one.

Key Points

1. Pop-up fields only allow you to list up to 60 different items.

2. For longer lists you can use other solutions, such as building a second table for procedures and linking it to the procedure log—these pro- grammers think of everything!

Add Some More Fields, as Many as You Like

Carry on to build fields for data such as the following:

• Patient Name, text field

• Chart #, text field

• Price, floating field, two decimal places

• Multiplier, floating numeric field, one decimal place (modifies the base price for the procedure to account for increasing complexity)

• Extended price, calculated field (multiply price by multiplier)

• Physician, pop-up field

• Diagnosis, text field

• Notes, note field (for entering freehand descriptive information about the procedure)

• Age, integer field

Figure 17.7. Pop-up list of procedures (Palm). (Reprinted with permission from DDH Software.)

(8)

• Gender, text field

• Location, pop-up (place where the procedure is carried out)

You might want to enter fields for anything else you might need, like perhaps these:

• A pop-up field for anatomic side (left, right, or bilateral)

• ICD (International Classification of Diseases) code

• American Medical Association’s CPT (Current Procedural Terminology) code

HANDS-ON EXERCISE 17.2. TRY ENTERING A PROCEDURE TO THE LOG Give yourself due credit—you’ve just become a programmer! Now, try out your brand-new procedure log by entering that LP from last night.

Add a New Record

Open it and tap “New” to enter a record. There are too many fields in this database for one screen, so you need to page down or tap the down arrow icon to see the rest of the record (Figure 17.8a,b). The “tabs” function avail- able with the forms add-on available for HanDBase, and in other programs

Figure 17.8a. New Record view (Palm).

(Reprinted with permission from DDH Software.)

Figure 17.8b. New Record view (Pocket PC).

(Reprinted with permission from DDH Software.)

(9)

like Smart List to Go, allows you to group similar fields in tabs that make it a bit easier to move around a record.

Now tap on the blank line alongside the Name field heading. Write in the patient’s name. Carry on to fill in the data for the rest of the fields.

HANDS-ON EXERCISE 17.3. VIEWING SELECTED RECORD BY “FILTERING”

You finally get to sit down and eat lunch. Your pager goes off. It’s the hos- pital administrator’s secretary. She needs to know right now how many lumbar punctures you’ve done since January. “No problem,” you say as you whip out your handheld and open your new procedure log database. A few screen taps later, you’ve filtered the database to show a list showing exactly what she wants. You simply count the number of records on the screen and tell her. Back at the clinic after lunch you can print out the filtered data- base to give her a hard copy with all the details, if she needs that too.

After entering a few records, try customizing the way you see the data by filtering the database. Filters are a very powerful way to customize views of the records in your database. Simply select the appropriate fields to filter on, and enter appropriate parameters for each field. Here is an example, using HanDBase.

Open the database, then tap “Filters” (Palm), or “Action,” and then

“Filters” (Pocket PC).

• Tap in the first checkbox to enable “Filter 1” (Figure 17.9).

• Select “Procedure” from the drop-down list of fields.

• Tap on “Must Contain,” then “Lumbar” to filter the table for all the records containing the word lumbar.

Figure 17.9. Setting up a filter (Palm). (Reprinted with permission from DDH Software.)

(10)

Tap “OK,” and then you should see only the records with the word

“lumbar” in the Procedure field.

To remove the filter and see all the records in the database again, tap

“Filters” and uncheck the box for “Filter 1 Enabled.”

You can enable up to six filters on the Palm or Pocket PC versions of HanDBase to exploit logical relationships between fields, setting up more refined filter views. For example, your first filter could be lumbar punctures, and the second filter could be for only those performed in the current year.

HANDS-ON EXERCISE 17.4. UPGRADE THE HANDBASE PROCEDURE LOG DATABASE FROM A FLAT FILE TO A RELATIONAL DESIGN

Although many users are very content with simple single-table, flat file data- bases, it is easy to build simple relational databases, with a little extra time on the learning curve. So get out your Nikes and start climbing—the view is excellent.

Remember we told you that a pop-up list could hold only 60 items?

Perhaps the list of procedures you or your group performs is much longer.

In this exercise, we show you how to build a second table for the proce- dures and then link it to the first. That’s how you make a “relational” data- base.

A relational database basically consists of two or more tables linked by sharing one or more fields containing the same data. You might keep a list of patients in one table, then look up a patient’s name from another table.

Or you might want to put ICD and CPT codes in separate tables. Then you could look up the appropriate code by typing the diagnosis or procedure in plain English, and return the related alphanumeric code to the proce- dure log database.

Let’s use the HanDBase procedure log as an example.

First, build a second table containing a list of procedures and prices rel- evant to your practice, then link that list to the procedure log table. That way you don’t have to write in the procedure name each time you enter a new record, or remember the relevant fee. The linked field will bring up the procedure list table, then you can search for and tap on the appropriate record. HanDBase will import the appropriate information to the open record in your procedure log.

First: Build a Second Table Called “Procedure List”

Say you already have a defined list of procedures, complete with associated procedure code identifiers and fees. You wouldn’t want to laboriously look up and type all that information into each record in your procedure log.

Wouldn’t it be much nicer if you could look up the related procedure from the log electronically? That’s easy.

(11)

There are tables on the Internet that you can download which contain ICD and CPT codes. Some users have extracted the codes relevant to their practice, put them into HanDBase tables, and then linked to those for easy reference. A great example is the Family Practice Management journal’s annual list of 600 commonly used codes in primary care. The list can be downloaded from www.aafp.org/fpm/icd9.html. It can then be used as a stand-alone reference, or incorporated into the procedures log as described next.

If the file was in csv (comma separated variable) format, or if you could put it into that format, then you could import that csv file using the HanD- Base desktop companion. This would create a new table (call it “Proce- dures”), with three fields: “Procedure,” “Code,” and “Fee.” HotSync, and that new table should appear on your handheld.

But if you can’t import a prepared file, then simply build a new table called “Procedures” with those three text fields, then write in the data by hand. It shouldn’t take long to type in a list of the procedures that you would typically use in your practice.

Link the Procedure List Table to the Procedure Log Table

Now link the Procedure Log table to the Procedures table. Select the data- base, then tap the “Details” icon (Figure 17.10a) to bring up the screen shown in Figure 17.11. For Pocket PC users, open the database first, select

“File,” and then “DB Properties” (Figure 17.10b). Then tap the “Fields” icon to bring up the list of fields (this screen is the same on both the Palm and Pocket PC).

Change the field type for the field “Procedure” in the database table

“Procedure Log” to “DB Popup” (Figure 17.12). Point the field properties to the other database called “Procedures” by selecting the Other Field Name “Procedures” in that other database.

You also put the price for each procedure in the Procedures table. So change the properties for the price field to DB Popup too, and then point that field to Other Field #4 in the “Other DB” called Procedures. The screen should look like that shown on Figure 17.13.

Here is how the “DB Popup” field type works. Open the database, then open a new record. Tap on the little down arrow to the left of the field called Procedure. The Procedures table should pop up. Select the appropriate pro- cedure by tapping on that record. The program should return you to your Procedure Log record and insert the name of the procedure. Then do the same for the Price field: select the procedure, and when the program returns you to the log, it will insert the correct price in the Price field automatically.

A word of warning: you can use the “popup appends” feature to add more procedures to each procedure field in a single record. You might be tempted to use that feature if you do two procedures on a single patient at one visit.

However, it would make more sense to create a separate record for each

(12)

Figure 17.10b. Opening database properties on Pocket PC version. (Reprinted with per- mission from DDH Software.)

Figure 17.11. Tap the “Fields” icon to change the fields in the database (Palm). (Reprinted with permission from DDH Software.)

Figure 17.10a. Tap the “Details” icon to change the properties of a database (Palm). (Reprinted with permission from DDH Software.)

(13)

procedure. You have to be careful with the popup appends feature, because it can make the database more complicated and harder to use.

HanDBase Relational Features Are Potent But Limited

There are limits to the degree of relational functionality that you can build into handheld databases, especially with the middleweight-type products.

We decided not to go into all the technical details in this book, but be aware of two things. First: there are other relational features in the new version of HanDBase that we haven’t told you about. Check the user’s manual.

Second: expert programmers can exploit relational database designs to Figure 17.12. Linking the field

called Procedure in the Proce- dure Log database to the field called Procedure in the Proce- dures database (Palm).

(Reprinted with permission from DDH Software.)

Figure 17.13. Properties for the price field (Palm). (Reprinted with permission from DDH Software.)

(14)

huge advantage. If the standard features in your database software don’t seem to do the job, then you might want to consult a database software engineer when you are thinking about building a database for multiple users, such as all the residents and staff physicians in your department or clinic.

HANDS-ON EXERCISE 17.5. TRACKING ALL THE PHYSICIANS IN YOUR GROUP WITH LINK AND LINKED FIELDS

To demonstrate how the link fields work in HanDBase, change your think- ing about the way we have been using the Procedure Log. So far we assumed that the physicians doing the procedure would enter their own records of their procedures. They could filter the database by physician name to see all the procedures done by one physician. But say you already maintain a database of the residents in your program and would like the preceptors to log procedures done by residents that they are directly super- vising. Or, in a clinic setting, your billing clerk in the business office might want to track all the procedures for all the physicians in your group. If you want to do that, then just substitute “physician” for “resident” in the fol- lowing exercise.

The HanDBase “Link” and “Linked” fields in effect create a special rela- tionship between two database tables so that several records in one data- base, called the “child,” can be linked to one record in another, called the

“parent.” The parent database must have a Link field, and the child data- base must have a Linked field.

Create a parent database table called “Residents” and create a text field in that table called “Resident” (Figures 17.14–17.16). Create a “Link” field

Figure 17.14. Select the Residents database and tap the “Details” icon to bring up the screen in Figure 17.15 (Palm). (Reprinted with per- mission from DDH Software.)

Figure 17.15. Tap the “Fields” icon to bring up the screen in Figure 17.16 (Palm). (Reprinted with per- mission from DDH Software.)

(15)

called “Procedure Log,” and link it to a new field in the Procedure Log table called “Resident,” as shown by the circles in Figure 17.17. This Link field will return the name of the Resident from the Residents table to the Pro- cedure Log table when a record is viewed in the Procedure Log table. You can add other fields to the Residents table, such as “Year” and “Specialty.”

Now modify the properties of the Procedure Log table to create the new

“Resident” field. Specify Field Type “Linked,” pick the “Residents” table for “Other DB Name,” and point this field to Field #2 in the Residents table (Figure 17.18). This will link all the data in a record in the Procedure Log table to the “Procedure Log” link record field in the Residents table.

Or, put another way, tapping on the Procedure Log field in the Residents table will bring up all the procedures logged for that resident.

Figure 17.16. Select the field “Procedure Log” to change its properties (Palm).

(Reprinted with permission from DDH Software.)

Figure 17.17. Settings to create the linked

“Procedure Log” field in the “Residents” table (Palm). (Reprinted with permission from DDH Software.)

Figure 17.18. Creating the linked “Resident” field in the Procedure Log table (Palm). (Reprinted with permission from DDH Software.)

(16)

What you have done is establish a true one-to-many link between the parent table (Residents) and the child table (Procedure Log). When you open the Residents table and select a resident’s name, you will see a box called “Procedure Log” (Figure 17.19a,b), which represents the “Procedure Log” field in the Residents table. Tap on that box to bring up the Proce- dure Log table. You will see all the procedures logged so far for that resi- dent, and be given an opportunity to log a new record for that resident.

Conversely, when you enter a new procedure record the resident’s name is automatically entered into the Procedure Log table from the Residents table by the link feature (Figure 17.20a,b).

The “Relationships” field, new in HanDBase version 3.0, can also be used to make relationships between tables.

More sophisticated desktop database programs like Microsoft Access allow programmers to exploit relationships in much more rigorous and complex ways than are possible on handheld devices.

Key Points

1. A relational database made up of smaller databases is much more powerful and convenient than one big database table.

2. Relational databases are simply two or more tables linked together in some way.

3. Making a “relational” database sounds intimidating, but once you start up the shallow learning curve you’ll find it isn’t so bad after all.

Figure 17.19a. Record view in the Residents table. Tap on “Procedure Log” to see the list of the resident’s procedures (Palm). (Reprinted with permission from DDH Software.)

Figure 17.19b. Same screen on the Pocket PC version. (Reprinted with permission from DDH Software.)

(17)

HANDS-ON EXERCISE 17.6. WORKING WITH THE PROCEDURE LOG ON A DESKTOP COMPUTER

Option 1: The HanDBase Desktop Companion

A great feature of database products like HanDBase is that they come with a desktop program so you can open your handheld’s databases on your desktop computer. HanDBase’s desktop program even opens both Palm and Pocket PC HanDBase databases. Figure 17.21 shows what the proce- dure log looks like when I open it on my desktop computer with the HanD- Base program.

The relationship between the Procedure Log table and the Procedures table is preserved on the desktop, allowing you to do your work on the desktop or your handheld. In Figure 17.22, notice how I was able to open the Procedures table simply by clicking on the Procedure field in the “Edit Record” window.

Figure 17.20a. Record View in the Procedure Log table, showing the resident’s name from the Residents table (Palm). (Reprinted with permis- sion from DDH Software.)

Figure 17.20b. Same screen on the Pocket PC version. (Reprinted with permission from DDH Software.)

(18)

Figure 17.21. Procedure Log table on the desktop computer. (Reprinted with permission from DDH Software.)

Figure 17.22. Relational features between the Procedure Log and Residents tables are preserved on the desktop computer. (Reprinted with permission from DDH Software.)

(19)

Option 2: Linking HanDBase to Microsoft Access and Other Desktop Programs

The HanDBase desktop program might suffice for most tasks, but you might want to link your handheld database to a more powerful program such as Microsoft Access so that you can do things such as print out fancier reports or do more complex analyses. That isn’t too difficult. There are two ways to go: manually or automatically.

The manual way is to simply export the records from the Procedure Log table to a format that can be imported into a Microsoft Access database.

This kind of procedure works in a similar way for many other desktop data- base software products like Excel, FileMaker, and others, although details vary between products. Use the following steps to link HanDBase data with a Microsoft Access table:

1. Build a table in Microsoft Access to receive the records (this assumes that you know how to use Microsoft Access).

2. Open the HanDBase table in the HanDBase desktop program. Click

“File/Export” to see the window in Figure 17.23. Note that you can export to five different formats. Select “Comma Separated File” (.CSV).

Figure 17.23. Data export options on the desktop computer (HanDBase version 3). (Reprinted with permission from DDH Software.)

(20)

Press “OK.” Designate a file name in a folder on your computer to receive the data, and then click “Export Database.”

3. Now open the Access table and import the .CSV file.

It is just as easy to export data from Access to HanDBase manually the other way. Export from Access in CSV format, and then import the CSV file into HanDBase on the desktop computer.

The automatic way is to use an optional utility called HanDBase Sync Exchange for Access. With this add-on tool available on the DDH Software Web site, you can synchronize your data directly with Access from Hand- Base. After each HotSync or ActiveSync, changes made in Access, the HanDBase Desktop, and the handheld will all be synchronized together, even for multiple users.

Key Points

1. You can work with your handheld database on your desktop computer too.

2. You can open the database with a desktop program designed specifically for your handheld software product, or you can link your handheld database to a more powerful software database system from another company, like Microsoft Access.

HANDS-ON EXERCISE 17.7. BUILDING A PROCEDURE LOG WITH PEN- DRAGON FORMS FROM INSIDE MICROSOFT ACCESS

What Is Unique About Pendragon Forms?

So you’re sold on the idea of building a database for your clinic group so that your clinic’s business manager can track all the miscellaneous billings your docs generate on their rounds through the hospital and nursing homes.

And your clinic staff are familiar with Microsoft Access. You could build it with HanDBase and then create links to Access, but there is another option:

programs like Pendragon Forms (for Palm OS only) or Satellite Forms (available for Palm and Pocket PC). For the purposes of this hands-on exercise, we focus exclusively on Pendragon Forms.

Pendragon Forms is different from the middleweight database products like HanDBase, MobileDB, Smart List to Go, and JFile. In Pendragon Forms, you build the database from within Microsoft Access on a desktop computer. Pendragon Forms uses a special Microsoft Access database to build all the tables and forms within Access automatically; then, when you are finished creating your design, it freezes the database structure and uploads it to your handheld.

(21)

Once the design is loaded onto the handheld, you and your colleagues can collect and edit data on either their handheld or desktop computers.

But, on the desktop you are always working inside Microsoft Access. This allows your business staff to use the full range on Access’ powerful data- basing features to manage your billings.

Pendragon Forms’ “build-freeze-deploy” model is similar to the way some other handheld database products are designed to work with other major desktop database systems, like Sybase (Palm) and Oracle (Palm and Pocket PC). Those products similarly create handheld databases that are tightly integrated with the associated desktop database system, and then freeze the design before uploading it to handhelds.

Compared to the middleweight handheld products, Pendragon Forms has more options for field types, and allows you to write scripts for advanced field functions. It is more expensive than the middleweights, but it is more like them because it is cheaper and simpler to use than the other heavy- weights.

If you plan to use this product, consider obtaining The Official Pendragon Forms for Palm OS Starter Kit, by Sancho and Phillips.1

Can I Use All of Access’ Powerful Features on the Handheld?

When you build database forms for the handheld using Pendragon Forms, you cannot use the full range of Microsoft Access’ powerful databasing fea- tures on the handheld. This is partly because the handheld does not have the computing power of a desktop computer. But it also partly due to prac- tical programming considerations. You pay for what you get. You could develop a very sophisticated handheld database with low-level computing language like C++ that would mimic most advanced database procedures, or use a heavyweight database product, but then you’d have to hire spe- cialized software engineers to help you.

Pendragon Form’s developers found the right balance between advanced features and efficiency. You can learn quickly to develop quite advanced databases with Pendragon Forms, but you can also create quite simple, flat file databases in a few minutes. Here’s how to build a simple procedure log.

First Open the Pendragon Forms Manager

First find the icon shortcut that opens the Pendragon Forms Manager and click on that. This opens two specialized Microsoft Access database windows: the Pendragon Access database (FORMS32K.mdb if you use Access 2000), and the Forms Manager window (Figure 17.24). The buttons on the Forms Manager window give you access to the tools you need to design the forms and tables for your procedure log, or any other database you care to create.

(22)

Notice that the Forms Manager window does not show you all the stan- dard Microsoft Access database design tools. That is because Pendragon Forms takes care of those details for you when it builds the table and asso- ciated form. Not only do you not have to know a low-level language like C++ to build your procedure log, you don’t even need to know SQL or Microsoft’s midlevel methods for building tables and forms!

You will need to know some of those things, however, if you want to get the most from the tables Pendragon Forms builds for you. We’ll tell you more about that later.

Make the Procedure Log Form

Click on the “New” button under Form Functions to start building the form for your handheld. That opens a window Pendragon calls the “Form Designer.” Give the form a name like “Procedure Log,” make the first field a “Date Only” field type, and type the field name “Date” in the “Field” area, where the cursor is blinking (Figure 17.25).

Then Add More Fields to the Form

To add a second field to the form, click on the “+” button. Give that field a name and type. Continue on, perhaps adding these fields:

Patient Name, freeform text field Chart #, freeform text field Price, currency field Physician, pop-up field Diagnosis, text field

Figure 17.24. Pendragon Forms Manager window (Palm). (Reprinted with per- mission from Pendragon Software Corporation.)

(23)

Notes, text field Age, numeric field Gender, pop-up field

Location, pop-up (place where the procedure is carried out)

When you select the pop-up field type, the window changes to include a place where you can type in a list of physicians or locations (Figure 17.26).

Pendragon Forms has a lot of neat tricks like that.

Save the Form

After getting all the fields set up the way you want, then click on the open door icon. That brings up the “Save Changes” dialog (Figure 17.27). Click

“Yes.”

Freeze the Form and Send It to Your Handheld

After saving the form, you will be returned to the Pendragon Forms Manager window. Notice that the form has not yet been frozen for distrib- ution to your handheld. That’s easy to do, but first make sure that you are happy with your form design. The kinds of changes you can make to a frozen form are limited.

Figure 17.25. Pendragon form designer window, showing the date field and form name (Palm). (Reprinted with permission from Pendragon Software Corporation.)

(24)

Figure 17.26. The Pendragon Forms pop-up field (Palm). (Reprinted with per- mission from Pendragon Software Corporation.)

Figure 17.27. Saving the form design (Palm). (Reprinted with permission from Pendragon Software Corporation.)

(25)

A number of things happen when you freeze the form. Pendragon tools work behind the scenes to build a version of the form that will work on your Palm OS handheld, and then queues it up for installing to your hand- held at the next HotSync. And Pendragon’s Access macros go to work to build a Microsoft Access table in the database, mapping the fields in the Access table to the fields in the handheld version. That way the Pendragon Forms conduit can move data between the handheld and the desktop at every HotSync.

To freeze a form, select the form from the list and click on the “Proper- ties” button. That brings up the window shown in Figure 17.28. Click the button “Freeze Form design for distribution to PalmPilot and create database.”

Creating Calculated Fields with Pendragon Forms

Notice that we left out the “multiplier” and “extended price” fields that we used in the HanDBase example above. This doesn’t mean that Pendragon Forms does not allow calculated fields on the handheld: quite the opposite.

The “Advanced Field” properties button (Figure 17.29) in the Form Figure 17.28. Freezing the form design (Palm). (Reprinted with permission from Pendragon Software Corporation.)

Figure 17.29. Advanced Properties icon (Palm). (Reprinted with permission from Pendragon Software Corporation.)

(26)

Designer window allows users to write “Scripts” that enable very sophisti- cated calculations and can trigger other types of events. We won’t go into that here. Sancho and Phillips describe all these procedures quite clearly in their book.1

Converting the Procedure Log to a Relational Design Using Pendragon Forms

The pop-up field lists cannot be modified after you freeze the design and distribute it to your handheld. This brings up an important limitation of Pendragon Forms. You cannot send your new form to your handheld until after you “freeze” the design. So if you want to add new physicians or locations to the pop-up lists in those fields, then you need to redesign and redistribute the form, overwriting existing data sets on the handhelds.

A more flexible method would be to use lookup field types. That gets into relational database design, but using Pendragon Forms that’s no more dif- ficult than pushing fairly obvious buttons.

The process for making your procedure log relational rather than flat file, using Pendragon Forms, is similar in principle to the way we did it for the HanDBase example above, but of course the procedures are different.

Again we refer you to Sancho and Phillips,1although the program is so easy to use that it shouldn’t be hard to figure it out. In fact the procedures are so simple that you probably won’t even realize that you are building a rela- tional database, because Pendragon Forms keeps the messy details hidden away under the hood.

Try Using the Pendragon Forms Procedure Log Database on Your Handheld

Once the Procedure Log form has been “distributed” (installed) on your handheld, you can use it pretty much like the HanDBase database above.

In fact, the two look pretty similar on a handheld, although Pendragon Forms has some interesting and useful tricks for entering data to some of their fields that HanDBase doesn’t have.

1. Tap on the “Forms” icon to open Pendragon Forms on the handheld.

2. Select the form called “Procedure Log” by tapping once on its name.

Figure 17.30 shows the first screen you see when you launch Forms on your handheld. There is only one form listed. I called it “Procedure Log2.”

Select that form.

Figure 17.31 shows the “record view,” listing as many fields as will fit onto the handheld’s screen. To see more, if there are more, page down. Tap on

(27)

the field label in the left column to open the “field view,” or just enter data in the right column in this view.

Figure 17.32 shows the “field view” for the price field, and Figure 17.33 shows the physician pop-up field. There are similar handy field views for all the other fields.

Figure 17.30. List of forms on the handheld (Palm). (Reprinted with permission from Pendragon Software Corporation.)

Figure 17.31. Record view (Palm). (Reprinted with permission from Pendragon Software Corporation.)

Figure 17.32. Field view for the price currency field (Palm). (Reprinted with permission from Pendragon Software Corporation.)

Figure 17.33. Field view for the physician pop-up field (Palm). (Reprinted with permis- sion from Pendragon Software Corporation.)

(28)

Try Using the Pendragon Forms Procedure Log Database on Your Desktop Computer

After entering some records into the Procedure Log form on your hand- held, then HotSync your handheld to your desktop computer. The Pen- dragon Forms conduit will automatically move the data from the handheld to a table in the Pendragon Forms Microsoft Access database. Pendragon Forms automatically created that table when you froze the form design.

You can find out which table it is by checking the form’s properties in the Pendragon Forms Manager window. Expect to find a code number with a bizarre identifier something like “FORM_ID_212512643” (that’s what it was called on my computer). You can find that table in the list of tables in the window for the associated Pendragon Forms database. If you use Access 2000, then the database is called FORMS32K.mdb, and the associated window in Access is called “FORMS32K : Database.”

If you understand how to use Microsoft Access, then once you’ve got the name of the table you can build queries, reports, and forms based on that table to manipulate the data it contains. Or you can set up a routine to export the data to an external table. The details for these procedures are beyond the scope of this book, but there are many good books on the market to help you understand how to use Access.

Pendragon Forms comes with powerful features for linking data tables, or linking to external programs using ODBC (the Open Database Con- nectivity standard).

Using the Data in Programs Such as Excel and Word

Pendragon Forms makes it very easy to use the data in all kinds of other programs. The Forms Manager window has buttons for exporting data from the form directly to Excel, or to the ASCII text file format for importing into a word processor. Once the data is in Excel, you can export it easily to even more file formats.

Sharing the Procedure Log in a Group of Pendragon Forms Users

You can set up a group of people to share the Procedure Log this way:

1. List each person’s handheld user name in the list under the “Users”

button on the Pendragon Forms main window on the desktop computer (Figure 17.34).

2. When each member HotSyncs to that computer, he or she will get a copy of the Procedure Log form on his or her handheld.

3. Each physician uses the form to log his or her procedures.

4. Each time the group’s members HotSync again with that computer, their data flow into the related Microsoft Access table on the desktop com-

(29)

puter, accumulating there with logged procedures from everyone else’s handhelds. Special software tools are available from Pendragon Forms to allow users to synchronize with the main database from other com- puters over a network and the Internet.

More Users Cost You More Money

Pendragon Forms will interrupt you with a delightfully polite screen message when you attempt to add more users than your license allows. The message tactfully reminds you to contact Pendragon Forms about the cost of extending your license for larger groups. The message reminded me of an infinitely polite elderly grandmother, gently asking for another pillow in our hectic Emergency Department. Different database products handle this issue differently, and the industry’s procedures for licensing their software to groups seems to be continually evolving. So heads up on that one.

Figure 17.34. Adding more users to a group (Palm). (Reprinted with permission from Pendragon Software Corporation.)

(30)

Key Points

1. With Pendragon Forms (Palm) you build your database design on a desktop computer within Microsoft Access, not on your handheld.

2. Pendragon Forms (Palm) and Satellite Forms (for Palm and Pocket PC) help build databases integrated with Microsoft Access.

3. Pendragon Forms is an inexpensive example of a type of handheld data- base software where you build and freeze the database design within a desktop computer database system, then load the database onto hand- helds to collect data.

4. Some database software companies require you to buy group licenses if you intend to use your database on more than one handheld computer.

Summary

In this chapter, we gave you an overview of how handheld databases are constructed. Then we showed you how to use HanDBase to build a simple, one-table, flat file procedure log database. After that we showed you how to use the simple relational features in HanDBase to convert the procedure log to a relational design, and demonstrated the advantages of doing so. We explained some of the ways you can use your HanDBase procedure log on your desktop computer, including ways to link it to other more powerful desktop database software products. We also described how to share the database among several users. Finally, we showed you how to build a similar procedure log from within Microsoft Access using Pendragon Forms.

Reference

1. Sancho D, Phillips I. The Official Pendragon Forms for PalmOS Starter Kit.

New York: M & T Books, IDG Books Worldwide, 2000.

Riferimenti

Documenti correlati

For each beauty treatment purchased by a customer, the date on which it is given, the start and end time, the beautician performing the treatment and the social security number of

For each branch the database stores the list of its area manager over time with the corresponding period of time (start and end date). Please note that a branch can not have more

• Sale contracts for furnitures are characterized by a unique alphanumeric code, the client, the seller, the date on which the contract has been signed, the scheduled date for

Use user SYSTEM and the password you specified (during the Oracle Database Express Edition installation or with the docker run command).. Use a (connection) name

- To analyze the data correlation matrix associated with the analyzed dataset go back to the main process (click on button “Process”), temporarily disable the

It is possible to find this node in a join (specify the join conditions, as in the example image) or in filter operations on the attributes of a table (WHERE conditions)... -

• An access predicate indicates, in the case of a B + Tree index, that the data is selected based on a certain attribute by descending the tree hierarchy.

Performing a 10-fold Stratified Cross-Validation, what is the impact the maximal gain and maximal depth parameters on the average accuracy achieved by Decision Tree.. Report at least