Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BJPC2P5

BJPC2P5.m

Go to the documentation of this file.
BJPC2P5 ; IHS/CMI/LAB - PCC Suite v1.0 patch 3 environment check ;   
 ;;2.0;IHS PCC SUITE;**5**;MAY 14, 2009
 ;
 ;
 ; The following line prevents the "Disable Options..." and "Move Routines..." questions from being asked during the install.
 I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
 F X="XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
 ;KERNEL
 I +$$VERSION^XPDUTL("XU")<8 D MES^XPDUTL($$CJ^XLFSTR("Version 8.0 of KERNEL is required.  Not installed",80)) D SORRY(2) I 1
 E  D MES^XPDUTL($$CJ^XLFSTR("Requires Kernel Version 8.0....Present.",80))
 ;FILEMAN
 I +$$VERSION^XPDUTL("DI")<22 D MES^XPDUTL($$CJ^XLFSTR("Version 22.0 of FILEMAN is required.  Not installed.",80)) D SORRY(2) I 1
 E  D MES^XPDUTL($$CJ^XLFSTR("Requires Fileman v22....Present.",80))
 ;BJPC
 I $$VERSION^XPDUTL("BJPC")'="2.0" D MES^XPDUTL($$CJ^XLFSTR("Version 2.0 of the IHS PCC SUITE (BJPC) is required.  Not installed",80)) D SORRY(2) I 1
 E  D MES^XPDUTL($$CJ^XLFSTR("Requires IHS PCC Suite (BJPC) Version 2.0....Present.",80))
 ;BJPC 2.0 PATCH 4
 I '$$INSTALLD("BJPC*2.0*4") D SORRY(2)
 I '$$INSTALLD("APCL*3.0*27") D SORRY(2)
 I '$$INSTALLD("AUPN*99.1*21") D SORRY(2)
 I '$$INSTALLD("AG*7.1*8") D SORRY(2)
 I '$$INSTALLD("HL*1.6*1006") D SORRY(2)
 ;
 Q
 ;
PRE ;
 S BJPCDA=$O(^APCHSCMP("B","MEASUREMENT PANELS (OUTPATIENT)",0))
 I BJPCDA S DA=BJPCDA,DR=".01///MEASUREMENT PANELS",DIE="^APCHSCMP(" D ^DIE K DA,DIE,DR
 S BJPCDA=$O(^APCHSCMP("B","PROBLEMS - INACTIVE/RESOLVED",0))
 I BJPCDA S DA=BJPCDA,DR=".01///PROBLEMS - INACTIVE;3///INACTIVE PROBLEMS",DIE="^APCHSCMP(" D ^DIE K DA,DIE,DR
 S DA=0 F  S DA=$O(^APCLVSTS(DA)) Q:DA'=+DA  S DIK="^APCLVSTS(" D ^DIK
 S DA=0 F  S DA=$O(^APCDTHFD(DA)) Q:DA'=+DA  S DIK="^APCDTHFD(" D ^DIK
 S DA=$O(^APCDTKW("B","PRO",0)) I DA S DIK="^APCDTKW(" D ^DIK
 K DA,DIK
 S DA=$O(^APCDTKW("B","MEAS",0))
 I DA S DIE="^APCDTKW(",DR=".07///0" D ^DIE K DA,DIE,DR
 D PRE^AMQQPOST
 Q
POST ;
 ;ADD EPI OPTIONS
 S X=$$ADD^XPDMENU("APCLMENU","APCS EPI PROGRAM HL7 EXPORTS","EPIX")
 I 'X W !,"Attempt to add APCS EPI PROGRAM HL7 EXPORTS option failed.." H 3
 S X=$$DELETE^XPDMENU("APCLMENU","APCL M MAIN DM MENU")
 S X=$$ADD^XPDMENU("APCLMENU","APCL TAXONOMY SETUP","TS")
 D LAB
 D HLO
 D ^APCS
 D POST^AMQQPOST
 D HF
HSHF ;
 ;now fix health summary types to add 3 categories if the tobacco one is in the health factor multiple
 S BJPCX=0 F  S BJPCX=$O(^APCHSCTL(BJPCX)) Q:BJPCX'=+BJPCX  D
 .Q:'$O(^APCHSCTL(BJPCX,7,0))  ;no health factor categories defined
 .;GET THE LAST ORDER NUMBER USED
 .S (X,BJPCL)="" F  S X=$O(^APCHSCTL(BJPCX,7,"B",X)) Q:X'=+X  S BJPCL=X
 .S (X,BJPCI)="" F  S X=$O(^APCHSCTL(BJPCX,7,X)) Q:X'=+X  S BJPCI=X
 .S BJPCY=0 F  S BJPCY=$O(^APCHSCTL(BJPCX,7,BJPCY)) Q:BJPCY'=+BJPCY  D
 ..S BJPCC=$P(^APCHSCTL(BJPCX,7,BJPCY,0),U,2)
 ..;don't bother if this is not TOBACCO
 ..Q:'BJPCC
 ..Q:$P($G(^AUTTHF(BJPCC,0)),U,1)'="TOBACCO"
 ..S BJPCO=$P(^APCHSCTL(BJPCX,7,BJPCY,0),U,1)
 ..;CHANGE THIS ONE TO TOBACCO (SMOKING)
 ..S X=$O(^AUTTHF("B","TOBACCO (SMOKING)",0))
 ..Q:'X
 ..S $P(^APCHSCTL(BJPCX,7,BJPCY,0),U,2)=X,$P(^APCHSCTL(BJPCX,7,BJPCY,0),U,3)="Tobacco Use (Smoking)"
 ..S BJPCYN=$P(^APCHSCTL(BJPCX,7,BJPCY,0),U,4)
 ..;NO INDEXES
 ..S BJPCN=BJPCO+1,BJPCIE=BJPCI+1 I $D(^APCHSCTL(BJPCX,7,"B",BJPCN)) S BJPCN=BJPCL+1
 ..S X=$O(^AUTTHF("B","TOBACCO (SMOKELESS - CHEWING/DIP)",0))
 ..I X D
 ...S ^APCHSCTL(BJPCX,7,BJPCIE,0)=BJPCN_U_X_U_"Tobacco Use (Smokeless)"_U_BJPCYN
 ...S ^APCHSCTL(BJPCX,7,"B",BJPCN,BJPCIE)=""
 ..S BJPCN=BJPCO+2,BJPCIE=BJPCI+2 I $D(^APCHSCTL(BJPCX,7,"B",BJPCN)) S BJPCN=BJPCL+2
 ..S X=$O(^AUTTHF("B","TOBACCO (EXPOSURE)",0))
 ..I X D
 ...S ^APCHSCTL(BJPCX,7,BJPCIE,0)=BJPCN_U_X_U_"Tobacco (Exposure)"_U_BJPCYN
 ...S ^APCHSCTL(BJPCX,7,"B",BJPCN,BJPCIE)=""
 Q
HF ;
 ;UPDATE HEALTH FACTOR TABLE AND V HEALTH FACTOR DATA
 ;inactivate category TOBACCO as it has been broken into 3 categories
 S DA=$O(^AUTTHF("B","TOBACCO",0))
 I DA,$P(^AUTTHF(DA,0),U,15)="" S DIE="^AUTTHF(",DR=".13///1;.15////"_DT D ^DIE K DA,DIE,DR
 ;add 3 new categories
 ;TOBACCO (SMOKING)
 I '$O(^AUTTHF("B","TOBACCO (SMOKING)",0)) D
 .S X="TOBACCO (SMOKING)",DIC="^AUTTHF(",DIC(0)="L",DIADD=1,DLAYGO=9999999.64,DIC("DR")=".1///C;.03///TOBACCO (SMOKING)" D FILE^DICN K DIADD,DLAYGO,DIC,X
 .I Y=-1 D MES^XPDUTL("Adding Health Factor Category TOBACCO (SMOKING) failed") Q
 ;TOBACCO (SMOKLESS - CHEWING DIP)
 I '$O(^AUTTHF("B","TOBACCO (SMOKELESS - CHEWING/DIP)",0)) D
 .S X="TOBACCO (SMOKELESS - CHEWING/DIP)",DIC="^AUTTHF(",DIC(0)="L",DIADD=1,DLAYGO=9999999.64,DIC("DR")=".1///C;.03///TOBACCO (SMOKELESS - CHEWING/DIP)" D FILE^DICN K DIADD,DLAYGO,DIC,X
 .I Y=-1 D MES^XPDUTL("Adding Health Factor Category TOBACCO (SMOKELESS - CHEWING/DIP) failed") Q
 ;TOBACCO (EXPOSURE)
 I '$O(^AUTTHF("B","TOBACCO (EXPOSURE)",0)) D
 .S X="TOBACCO (EXPOSURE)",DIC="^AUTTHF(",DIC(0)="L",DIADD=1,DLAYGO=9999999.64,DIC("DR")=".1///C;.03///TOBACCO (EXPOSURE)" D FILE^DICN K DIADD,DLAYGO,DIC,X
 .I Y=-1 D MES^XPDUTL("Adding Health Factor Category TOBACCO (EXPOSURE) failed") Q
 ;change names of 3 health factors
 ;CURRENT SMOKER - CURRENT SMOKER, STATUS UNKNOWN
 S DA=$O(^AUTTHF("B","CURRENT SMOKER",0))
 I DA S DIE="^AUTTHF(",DR=".01///CURRENT SMOKER, STATUS UNKNOWN" D ^DIE K DA,DIE,DR
 ;PREVIOUS SMOKER - PREVIOUS (FORMER) SMOKER
 S DA=$O(^AUTTHF("B","PREVIOUS SMOKER",0))
 I DA S DIE="^AUTTHF(",DR=".01///PREVIOUS (FORMER) SMOKER" D ^DIE K DA,DIE,DR
 ;PREVIOUS SMOKELESS - PREVIOUS (FORMER) SMOKELESS
 S DA=$O(^AUTTHF("B","PREVIOUS SMOKELESS",0))
 I DA S DIE="^AUTTHF(",DR=".01///PREVIOUS (FORMER) SMOKELESS" D ^DIE K DA,DIE,DR
 ;INACTIVATE 2 HEALTH FACTORS
 ;CURRENT SMOKER AND SMOKELESS
 S DA=$O(^AUTTHF("B","CURRENT SMOKER & SMOKELESS",0))
 I DA,$P(^AUTTHF(DA,0),U,15)="" S DIE="^AUTTHF(",DR=".13///1;.15////"_DT D ^DIE K DA,DIE,DR
 ;NEVER USED TOBACCO
 S DA=$O(^AUTTHF("B","NEVER USED TOBACCO",0))
 I DA,$P(^AUTTHF(DA,0),U,15)="" S DIE="^AUTTHF(",DR=".13///1;.15////"_DT D ^DIE K DA,DIE,DR
 ;ADD 6 NEW HEALTH FACTORS
 F BJPCX="CURRENT SMOKER, EVERY DAY","CURRENT SMOKER, SOME DAY","NEVER SMOKED","SMOKING STATUS UNKNOWN","SMOKELESS TOBACCO, STATUS UNKNOWN","NEVER USED SMOKELESS TOBACCO" D
 .Q:$D(^AUTTHF("B",BJPCX))
 .S X=BJPCX,DIC="^AUTTHF(",DIC(0)="L",DIADD=1,DLAYGO=9999999.64,DIC("DR")=".1///F" D FILE^DICN K DIC,X,DIADD,DLAYGO
 .I Y=-1 D MES^XPDUTL("Adding Health Factor "_BJPCX_" failed")
 ;UPDATE CATEGORY ON ALL NEW HEALTH FACTORS
 F BJPCX="NON-TOBACCO USER","CURRENT SMOKER, EVERY DAY","CURRENT SMOKER, SOME DAY","CURRENT SMOKER, STATUS UNKNOWN","CESSATION-SMOKER","PREVIOUS (FORMER) SMOKER","CEREMONIAL USE ONLY","NEVER SMOKED","SMOKING STATUS UNKNOWN" D
 .S DA=$O(^AUTTHF("B",BJPCX,0))
 .I 'DA D MES^XPDUTL("updating category for "_BJPCX_" failed.") Q
 .S DIE="^AUTTHF(",DR=".03///TOBACCO (SMOKING)" D ^DIE K DA,DR,DIE
 .I $D(Y) D MES^XPDUTL("Updating category for "_BJPCX_" failed.")
 F BJPCX="CURRENT SMOKELESS","CESSATION-SMOKELESS","PREVIOUS (FORMER) SMOKELESS","NEVER USED SMOKELESS TOBACCO","SMOKELESS TOBACCO, STATUS UNKNOWN" D
 .S DA=$O(^AUTTHF("B",BJPCX,0))
 .I 'DA D MES^XPDUTL("updating category for "_BJPCX_" failed.") Q
 .S DIE="^AUTTHF(",DR=".03///TOBACCO (SMOKELESS - CHEWING/DIP)" D ^DIE K DA,DR,DIE
 .I $D(Y) D MES^XPDUTL("Updating category for "_BJPCX_" failed.")
 F BJPCX="SMOKER IN HOME","SMOKE FREE HOME","EXPOSURE TO ENVIRONMENTAL TOBACCO SMOKE" D
 .S DA=$O(^AUTTHF("B",BJPCX,0))
 .I 'DA D MES^XPDUTL("updating category for "_BJPCX_" failed.") Q
 .S DIE="^AUTTHF(",DR=".03///TOBACCO (EXPOSURE)" D ^DIE K DA,DR,DIE
 .I $D(Y) D MES^XPDUTL("Updating category for "_BJPCX_" failed.")
HFDATA ;
 ;UPDATE V HEALTH FACTORS
 ;IF PATIENT HAS CURRENT SMOKER AND SMOKELESS THEN ADD CURRENT SMOKER, STATUS UNKNOWN AND CURRENT SMOKELESS
 ;IF PATIENT HAS NEVER USED TOBACCO THEN ADD NEVER SMOKED AND NEVER USED SMOKELESS TOBACCO
 ;IF PATIENT HAS NON-TOBACCO USER THEN ADD NEVER SMOKED AND NEVER USED SMOKELESS TOBACCO
 S BJPCDA=0 F  S BJPCDA=$O(^AUPNVHF(BJPCDA)) Q:BJPCDA'=+BJPCDA  D
 .I $$VAL^XBDIQ1(9000010.23,BJPCDA,.01)="CURRENT SMOKER & SMOKELESS" D  Q
 ..;add 2 new v health factors
 ..S BJPCNEW="CURRENT SMOKER, STATUS UNKNOWN"
 ..I '$$GOTHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW) D ADDHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW,BJPCDA)
 ..S BJPCNEW="CURRENT SMOKELESS"
 ..I '$$GOTHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW) D ADDHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW,BJPCDA)
 .I $$VAL^XBDIQ1(9000010.23,BJPCDA,.01)="NON-TOBACCO USER" D  Q
 ..;add 2 new v health factors
 ..S BJPCNEW="NEVER SMOKED"
 ..I '$$GOTHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW) D ADDHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW,BJPCDA)
 ..S BJPCNEW="NEVER USED SMOKELESS TOBACCO"
 ..I '$$GOTHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW) D ADDHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW,BJPCDA)
 .I $$VAL^XBDIQ1(9000010.23,BJPCDA,.01)="NEVER USED TOBACCO" D  Q
 ..;add 2 new v health factors
 ..S BJPCNEW="NEVER SMOKED"
 ..I '$$GOTHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW) D ADDHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW,BJPCDA)
 ..S BJPCNEW="NEVER USED SMOKELESS TOBACCO"
 ..I '$$GOTHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW) D ADDHF($P(^AUPNVHF(BJPCDA,0),U,3),BJPCNEW,BJPCDA)
CODE ;now update all HF Codes per Floyd's spreadsheet
 S BJPCX=0 F  S BJPCX=$O(^APCDTHFD(BJPCX)) Q:BJPCX'=+BJPCX  D
 .S BJPCHF=$P(^APCDTHFD(BJPCX,0),U,1)
 .S BJPCHFC=$P(^APCDTHFD(BJPCX,0),U,2)
 .S BJPCHFN=$P($G(^APCDTHFD(BJPCX,88)),U,1)
 .S DA=$O(^AUTTHF("B",BJPCHF,0))
 .Q:'DA
 .I DA S DIE="^AUTTHF(",DR=".02///"_BJPCHFC_";8801///"_BJPCHFN
 .D ^DIE
 .K DA,DIE,DR
 ;now add LOW HEALTH LITERACY READINESS TO LEARN PER Floyd
 Q:$D(^AUTTHF("C","F112"))  ;already there
 S BJPCC=$O(^AUTTHF("B","BARRIERS TO LEARNING",0))
 S X="LOW HEALTH LITERACY",DIC="^AUTTHF(",DIC(0)="L",DIADD=1,DLAYGO=9999999.64,DIC("DR")=".1///F;.03////"_BJPCC_";.02////F112" D FILE^DICN K DIC,X,DIADD,DLAYGO
 I Y=-1 D MES^XPDUTL("Adding Health Factor "_BJPCX_" failed")
 Q
GOTHF(VISIT,HF) ;is this hf already attached to this visit?
 NEW X,G
 S G=0
 S X=0 F  S X=$O(^AUPNVHF("AD",VISIT,X)) Q:X'=+X!(G)  I $D(^AUPNVHF(X,0)),$$VAL^XBDIQ1(9000010.23,X,.01)=BJPCNEW S G=1
 Q G
ADDHF(VISIT,HF,HFDA) ;add this v health factor to visit
 I '$G(VISIT) Q
 I '$D(^AUPNVSIT(VISIT,0)) Q
 ;SET UP ARRAY WITH SAME VALUES AS THE OTHER ENTRY
 N BJPCFDA,BJPCIENS,BJPCERRR,BJPCPIEN,DITC
 S DITC=1
 S BJPCIENS="+1,"
 S BJPCFDA(9000010.23,BJPCIENS,.01)=$O(^AUTTHF("B",HF,0))
 S BJPCFDA(9000010.23,BJPCIENS,.02)=$P(^AUPNVHF(HFDA,0),U,2)
 S BJPCFDA(9000010.23,BJPCIENS,.03)=VISIT
 I $P(^AUPNVHF(HFDA,0),U,4)]"" S BJPCFDA(9000010.23,BJPCIENS,.04)=$P(^AUPNVHF(HFDA,0),U,4)
 I $P(^AUPNVHF(HFDA,0),U,5)]"" S BJPCFDA(9000010.23,BJPCIENS,.05)=$P(^AUPNVHF(HFDA,0),U,5)
 I $P(^AUPNVHF(HFDA,0),U,6)]"" S BJPCFDA(9000010.23,BJPCIENS,.06)=$P(^AUPNVHF(HFDA,0),U,6)
 I $P($G(^AUPNVHF(HFDA,12)),U,1)]"" S BJPCFDA(9000010.23,BJPCIENS,1201)=$P($G(^AUPNVHF(HFDA,12)),U,1)
 I $P($G(^AUPNVHF(HFDA,12)),U,2)]"" S BJPCFDA(9000010.23,BJPCIENS,1202)=$P($G(^AUPNVHF(HFDA,12)),U,2)
 I $P($G(^AUPNVHF(HFDA,12)),U,3)]"" S BJPCFDA(9000010.23,BJPCIENS,1203)=$P($G(^AUPNVHF(HFDA,12)),U,3)
 I $P($G(^AUPNVHF(HFDA,12)),U,4)]"" S BJPCFDA(9000010.23,BJPCIENS,1204)=$P($G(^AUPNVHF(HFDA,12)),U,4)
 I $P($G(^AUPNVHF(HFDA,12)),U,8)]"" S BJPCFDA(9000010.23,BJPCIENS,1208)=$P($G(^AUPNVHF(HFDA,12)),U,8)
 I $P($G(^AUPNVHF(HFDA,12)),U,9)]"" S BJPCFDA(9000010.23,BJPCIENS,1209)=$P($G(^AUPNVHF(HFDA,12)),U,9)
 I $P($G(^AUPNVHF(HFDA,12)),U,10)]"" S BJPCFDA(9000010.23,BJPCIENS,1210)=$P($G(^AUPNVHF(HFDA,12)),U,10)
 I $P($G(^AUPNVHF(HFDA,12)),U,15)]"" S BJPCFDA(9000010.23,BJPCIENS,1215)=$P($G(^AUPNVHF(HFDA,12)),U,15)
 I $P($G(^AUPNVHF(HFDA,801)),U,1)]"" S BJPCFDA(9000010.23,BJPCIENS,80101)=$P($G(^AUPNVHF(HFDA,801)),U,1)
 I $P($G(^AUPNVHF(HFDA,801)),U,2)]"" S BJPCFDA(9000010.23,BJPCIENS,80102)=$P($G(^AUPNVHF(HFDA,801)),U,2)
 I $P($G(^AUPNVHF(HFDA,811)),U,1)]"" S BJPCFDA(9000010.23,BJPCIENS,81101)=$P($G(^AUPNVHF(HFDA,811)),U,1)
 I $P($G(^AUPNVHF(HFDA,812)),U,1)]"" S BJPCFDA(9000010.23,BJPCIENS,81201)=$P($G(^AUPNVHF(HFDA,812)),U,1)
 I $P($G(^AUPNVHF(HFDA,812)),U,2)]"" S BJPCFDA(9000010.23,BJPCIENS,81202)=$P($G(^AUPNVHF(HFDA,812)),U,2)
 I $P($G(^AUPNVHF(HFDA,812)),U,3)]"" S BJPCFDA(9000010.23,BJPCIENS,81203)=$P($G(^AUPNVHF(HFDA,812)),U,1)
 D UPDATE^DIE("","BJPCFDA","BJPCIENS","BJPCERRR(1)")
 I $D(BJPCERRR) D MES^XPDUTL("Error creating V Health Factor "_HF_" for visit ien "_VISIT_".") Q
 W "."
 Q
 ;
LAB ;EP
 S APCSX="SURVEILLANCE RAPID FLU TESTS" D LAB1
 ;D HLO
 Q
LAB1 ;
 S APCSDA=$O(^ATXLAB("B",APCSX,0))
 Q:APCSDA  ;taxonomy already exisits
 W !,"Creating ",APCSX," Taxonomy..."
 S X=APCSX,DIC="^ATXLAB(",DIC(0)="L",DIADD=1,DLAYGO=9002228 D ^DIC K DIC,DA,DIADD,DLAYGO,I
 I Y=-1 W !!,"ERROR IN CREATING ",APCSX," TAX" Q
 S APCSTX=+Y,$P(^ATXLAB(APCSTX,0),U,2)=APCSX,$P(^(0),U,5)=DUZ,$P(^(0),U,6)=DT,$P(^(0),U,8)="B",$P(^(0),U,9)=60
 S ^ATXLAB(APCSTX,21,0)="^9002228.02101PA^0^0"
 S DA=APCSTX,DIK="^ATXAX(" D IX1^DIK
 Q
 ;
HLO ;--register the app in HLO
 N FDA,FIENS,FERR,PCCI
 Q:$O(^HLD(779.2,"B","RPMS-ILI",0))
 S PCCI=$O(^DIC(9.4,"B","IHS PCC SUITE",0))
 Q:'PCCI
 S FIENS=""
 S FDA(779.2,"+1,",.01)="RPMS-ILI"
 S FDA(779.2,"+1,",2)=PCCI
 D UPDATE^DIE("","FDA","FIENS","FERR(1)")
 Q
INSTALLD(BJPCSTAL) ;EP - Determine if patch BJPCSTAL was installed, where
 ; APCLSTAL is the name of the INSTALL.  E.g "AG*6.0*11".
 ;
 NEW BJPCY,DIC,X,Y
 S X=$P(BJPCSTAL,"*",1)
 S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
 D IX^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",22,",X=$P(BJPCSTAL,"*",2)
 D ^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",""PAH"",",X=$P(BJPCSTAL,"*",3)
 D ^DIC
 S BJPCY=Y
 D IMES
 Q $S(BJPCY<1:0,1:1)
IMES ;
 D MES^XPDUTL($$CJ^XLFSTR("Patch """_BJPCSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
 Q
SORRY(X) ;
 KILL DIFQ
 I X=3 S XPDQUIT=2 Q
 S XPDQUIT=X
 W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
 Q