Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.psHealthShowButton ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create function "pears"."psHealthShowButton"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "SourceID" char(20),in "IDType" char(2) ) returns integer begin if "sourceid" is null then return 0 end if; /* IDType R = recipient, S = temp shift, P = temp shift plan C = carer, V = vacancy */ if not exists(select * from "wpkglobalswitchsetting" where "wpkglobalswitchid" = 'PSHealth' and "value" = 'Y') then return 0 end if; /* in case some silly person turns switch on without tables installed (check person only) */ if not exists(select * from "sys"."systable" where "table_name" = 'PSHealthPerson') then return 0 end if; case "IDType" when 'R' then if exists(select * from "pshealthperson" where "personid" = "sourceid" and "recipientflag" = 'R') then return 1 end if when 'C' then if exists(select * from "pshealthperson" where "personid" = "sourceid" and "recipientflag" = 'C') then return 1 end if when 'V' then if exists(select * from "pshealthvacancy" where "vacancyid" = "sourceid") then return 1 end if when 'S' then if exists(select * from "pshealthshift" where "tempshiftid" = "sourceid") then return 1 end if when 'P' then if exists(select * from "pshealthshift" where "tempshiftplanid" = "sourceid") then return 1 end if end case; return 0 end </code> database/functions/pears_pshealthshowbutton.txt Last modified: 2026/08/07 19:24by 127.0.0.1