Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Search for/Exclude Identical Foreign Keys

Featured Replies

  • Newbies

Hi All,

I am working on a database solution for a clinical research project, and I've come up against a problem. I use one table for patient information, and a related table to store outcomes data for each operation. My goal is to perform a find in the operations table, but I need to exclude any records with duplicate foreign PT_ID keys contained in the found set (duplicates arise from patients who have had more than one procedure done, but for this project only one data set for each patient will be analyzed). I would greatly appreciate any insight on how to construct a script that accomplishes this.

-Ryan

There's a piece missing in this puzzle: if patient X has had two procedures, which one of the two will you choose? Also, you speak of creating a found set - but what will you do with it, once you have it? It sounds like you'd want to make the result a more permanent one.

  • Author
  • Newbies

There's a piece missing in this puzzle: if patient X has had two procedures, which one of the two will you choose? Also, you speak of creating a found set - but what will you do with it, once you have it? It sounds like you'd want to make the result a more permanent one.

Surgical device companies will come and ask for data related to their product. I usually go to the procedures table, perform a find for operations that utilized their device, and export the outcomes study results to excel. This time the requriement is a little different, and I need to send out data for every patient that has been operated on, but I can only include data for one of their operations. For those patients that have undergone multiple operations, it doesn't matter which operation is chosen, but I need one and only one for each patient. I guess I could arbitrarily include the most recent operation. The data gets exported to excel, and is then sent somewhere to have the data analyzed and published as part of a study where I will never see or here from it again. haha.

Thanks for the Help!

If this is for export only, sort the found set by PatientID and select the option "Group by:[PatientID]" when exporting. Only the first record in the group will be exported - so you can control which one it will be by subsorting by date.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.