Skip 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.

Medical Database Script Trouble

Featured Replies

  • Newbies

I am a medic at an overnight camp and am trying to create a database to track the camper's medication delivery and all their illnesses and injuries while at camp.

I am trying to create a script that will automatically, when executed, create records based on a record in one layout in another layout. I want to give it a date range and time of delivery range and have it generate each event (or time when pills are delivered). I attached my script, be kind, this is my first time making a script. Thanks for any and all your help!

If [ MedicationLine::Times ≠ "" and MedicationLine::StartDate ≠ "" and MedicationLine::EndDate ≠ "" and MedicationLine::StartTime ≠ ""

and MedicationLine::EndTime ≠ "" ]

Set Variable [ $medicationline; Value:MedicationLine::MedicationLineID ]

Set Variable [ $begindate; Value:Date ( 6 ; 15 ; 2008 ) ]

Set Variable [ $enddate; Value:Date ( Month ( MedicationLine::EndDate ) ; Day ( MedicationLine::EndDate ) ; Year

( MedicationLine::EndDate ) ) - $begindate ]

Set Variable [ $days; Value:Date ( Month ( MedicationLine::StartDate ) ; Day ( MedicationLine::StartDate ) ; Year

( MedicationLine::StartDate ) ) - $begindate ]

Set Variable [ $times; Value:MedicationLine::StartTime ]

Go to Layout [ “Pill Call” (Pill Call) ]

Loop

Loop

If [ MedicationLine::Times = $times ]

New Record/Request

Set Field [ Pill Call::MedicationLineFK; $medicationline ]

Set Field [ Pill Call::TimeFK; $times ]

Set Field [ Pill Call::DayFK; $days ]

End If

Set Variable [ $times; Value:MedicationLine::Times + 1 ]

Exit Loop If [ If ( $enddate = $days ; $times = MedicationLine::EndTime ; $times = 10 ) ]

End Loop

Exit Loop If [ $enddate = $days ]

Set Variable [ $days; Value:$days + 1 ]

Set Variable [ $times; Value:1 ]

End Loop

End If

pillcall_script.pdf

relationship_map.pdf

Edited by Guest
Added more database info and relationships

First of all, I recommend using the "Code" button, it does help make a long script more readable.

Your script has several problems. Let's start with this line:

Exit Loop If [ If ( $enddate = $days ; $times = MedicationLine::EndTime ; $times = 10 ) ]




The "Exit Loop If" step should contain a function that returns true(1) or false(0). If you want to require all 3 of the above equivalencies you'd write it like this:




Exit Loop If[ $enddate = $days AND $times = MedicationLine::EndTime AND $times = 10 ]

You didn't specify what result you are seeing and how it differs from your expected result. That would be helpful.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.