Example of Update Waypoint Event Triggers
Description |
Event |
Condition |
|---|---|---|
| Arriving at patient pickup | Update Waypoint |
CASE WHEN (SELECT Intent FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'patient' AND (SELECT Arrive FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'unset' THEN 1 ELSE 0 END |
| Arriving at Specific Waypoint Regardless of Patient | Update Waypoint | CASE WHEN (SELECT Name FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'FILL IN LOCATION' AND (SELECT Arrive FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset'AND (SELECT Depart from RequestPlan WHERE ID= GetUpdatedWaypointID()) = 'unset' THEN 1 ELSE 0 END |
| Departing from a Specific Waypoint | Update Waypoint |
CASE WHEN (SELECT Name FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'FILL IN LOCATION' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 |
| Departing to an Unset Waypoint | Update Waypoint |
SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' AND (SELECT(Latitude = 0 OR Longitude = 0) FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex + 1 FROM RequestPlan WHERE ID = GetUpdatedWaypointID())) |
| Arrive at an Unset Waypoint | Update Waypoint |
(SELECT Arrive FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' AND (SELECT(Latitude = 0 OR Longitude = 0) FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) |
| Departing to a Patient Drop Off Location and a Specific Unit | Update Waypoint | CASE WHEN (SELECT name FROM requestplan WHERE id = GetUpdatedWaypointID()+1) = 'FILL IN LOCATION' and ReceiverUnit IN ('UNIT NAME', 'UNIT NAME') THEN CASE WHEN (SELECT intent FROM RequestPlan WHERE id = GetUpdatedWaypointID()) = 'patient' AND (SELECT depart FROM requestplan WHERE id = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 END ELSE 0 END |
| Is a helicopter and going to a location that is different that the Requestor or Receiver. | Update Waypoint |
CASE WHEN ishelicopter THEN CASE WHEN (SELECT group_concat(withTransferItem(ID, '(SELECT pick_up_name FROM TcEntryPlan)'), ', ') FROM transferItem) != Requestorname AND ((SELECT withTransferItem(ID, '(SELECT pick_up_name FROM TcEntryPlan)') != WithTransferItem(ID, 'Requestor') FROM transferItem) = 1 AND (SELECT Intent FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) + 1) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset') OR (SELECT withTransferItem(id, '(SELECT drop_off_name FROM TcEntryPlan)') != WithTransferItem(ID, 'Receiver') FROM transferItem) = 1 AND (SELECT Intent FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex FROM RequestPlan WHERE ID= GetUpdatedWaypointID()) + 1) = 'patientDropOff' AND(SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID())!= 'unset' THEN 1 ELSE 0 END ELSE 0 END |
| Departing from any location with the custom waypoint area being unset | Update Waypoint |
CASE WHEN(SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' AND GetWaypointStringByID('flight_following', GetUpdatedWaypointID()) = '' THEN 1 ELSE 0 END |
| When an asset is using a specific call sign and returning to a specific base name | Update Waypoint | CASE WHEN CallSign = 'Asset Call Sign' AND (SELECT name FROM requestplan WHERE routeindex = (SELECT routeindex FROM requestplan WHERE id = GetUpdatedWaypointID()) + 1) = 'Base Name' AND (SELECT ifnull(depart, 'unset') FROM requestplan WHERE id = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 END |
| This will be used with a delay. If an asset has not departed in x minutes from patient drop off (delay time in the trigger) than the Action will occur | Update Waypoint | case when (select intent from requestplan where id = GetUpdatedWaypointID()) = 'patientDropOff' and (select arrive from requestplan where id = GetUpdatedWaypointID()) != 'unset' and (select depart from requestplan where id = GetUpdatedWaypointID()) = 'unset' then 1 else 0 end |
| If the asset departs from the first waypoint during a certain hour of the day, the Action will occur | Update Waypoint |
CASE WHEN (SELECT INTENT FROM RequestPlan WHERE routeindex = (SELECT routeindex FROM RequestPlan WHERE id = GetUpdatedWaypointID()) + 1) = 'patient' AND (SELECT depart FROM RequestPlan WHERE ID= GetUpdatedWaypointID()) != 'unset' THEN strftime('%H','now','localtime') >= '07' AND strftime('%H','now','localtime') < '21' ELSE 0 END |
| Will fire when a patient is heading to a specific hospital (regardless of if the drop-off is a landing zone/airport etc..). | Update Waypoint |
CASE WHEN ReceiverName = 'hospital name' AND (SELECT COUNT(*) FROM transferitem) > 0 THEN CASE WHEN (SELECT Intent FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 END ELSE 0 END |
| With a specific call type and to a specific hospital name | Update Waypoint |
CASE WHEN (SELECT name FROM requestplan WHERE routeindex = (SELECT routeindex FROM requestplan WHERE id = GetUpdatedWaypointID())+1) = ‘hospital name’ AND calltype = 'Interfacility' AND (SELECT intent FROM RequestPlan WHERE routeindex = (SELECT routeindex FROM RequestPlan WHERE id = GetUpdatedWaypointID())+1) = 'patient' AND (SELECT depart FROM requestplan WHERE id = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 END |
| Fixed Wing asset going to a receiver with a patient | Update Waypoint |
CASE WHEN IsAirplane = 1 THEN CASE WHEN (SELECT Intent FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) + 1) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' OR(SELECT Intent FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 END ELSE 0 END
|
| Use with a delay, if at a fuel stop and have not depart in X minutes. Insert the time you would like for the alert to go as the delay | Update Waypoint | (SELECT Intent FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'fuel' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'unset' |
| Departing to first waypoint | Update Waypoint |
CASE WHEN (SELECT Intent FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) + 1) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' AND CallType = 'Air-MF' AND CallSubType IN ('On Scene', 'Interfacility', 'STAT TEAM', 'ICN TEAM', 'Fixed Wing', 'TransAM MED Transfer', 'Other-Pilot Training', 'Other-Ferry Reposition', 'Other-Demo', 'Other-Maintenance Flight') THEN 1 ELSE 0 END |
| On the way to patient pickup with more than one patient on the request | Update Waypoint |
CASE WHEN (SELECT Intent FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) + 1) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' AND (SELECT COUNT(*) FROM transferItem) > 1 THEN 1 ELSE 0 END |
| Departing towards patient pickup and is a fixed wing asset | Update Waypoint |
CASE WHEN IsAirplane = 1 THEN CASE WHEN (SELECT Intent FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) + 1) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 END ELSE 0 END |
| Departing on patient leg and is a fixed wing asset | Update Waypoint |
CASE WHEN IsAirplane = 1 THEN CASE WHEN(SELECT Intent FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' THEN 1 ELSE 0 END ELSE 0 END |
| Use with a delay - If a time stamp has been selected and an airplane has not left from the first waypoint than the trigger will fire | Update Waypoint |
CASE WHEN IsAirplane and (SELECT type FROM times WHERE ID = GetAddedTimeID()) = 'Mission Activated/Declined' AND (SELECT depart FROM RequestPlan WHERE RouteIndex = 0) = 'unset' THEN 1 ELSE 0 END |
| Departing from Patient Drop-off | Update Waypoint | case when (select intent from requestplan where id = GetUpdatedWaypointID()) = 'patientDropOff' and (select depart from requestplan where id = GetUpdatedWaypointID()) != 'unset' then 1 else 0 end |
| Difference from Patient Drop off from first waypoint, will trigger if it is more than 150 nm | Update Waypoint | with distances (distance, fromIndex) as (select DistanceNM( waypoint.latitude, waypoint.longitude, (select next.latitude from requestplan as next where next.RouteIndex = waypoint.routeindex+1), (select next.longitude from requestplan as next where next.RouteIndex = waypoint.routeindex+1)) , routeindex from requestplan as waypoint where waypoint.routeindex != (select max(routeindex) from requestplan)) select case when not ishelicopter then 0 else (select sum(distance) from distances where fromIndex < (select routeindex from requestplan where intent = 'patientDropOff')) > 150 end |
| Departing from Patient Pickup and weight is greater than 150 kg | Update Waypoint |
case when ((select count(*) from transferitem where cast(withtransferitem(transferitem.id, 'text(''weight'')') as int) > 150 and withTransferItem(transferitem.id, 'dropdown(''weightunit'')') = 'kg') > 0 and (SELECT Intent FROM RequestPlan WHERE RouteIndex = (SELECT RouteIndex FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) + 1) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' OR(SELECT Intent FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) = 'patient' AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset') |
| Departing from any waypoint | Update Waypoint |
Case when AND (SELECT Depart FROM RequestPlan WHERE ID = GetUpdatedWaypointID()) != 'unset' |
Example of OOS Event Advances 1%
This trigger event only works for ASSET Out of Service Reasons.
- CASE WHEN PercentDoneWithOos > 50 THEN 1 ELSE 0 END
Comments
0 comments
Please sign in to leave a comment.