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

BDMPOST.m

Go to the documentation of this file.
BDMPOST ; cmi/anch/maw - POST INIT ROUTINE ; [ 08/23/2006  3:21 PM ]
 ;;2.0;DIABETES MANAGEMENT SYSTEM;**1**;AUG 11, 2006
 ;
ENV ;EP;
 ; The following line prevents the "Disable Options..." and "Move
 ; Routines..." questions from being asked during the install.
 F X="XPM1","XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
 ;I '$$INSTALLD("ACM*2.0*6") D SORRY(2)
 Q
EN D REGISTER
 Q
REGISTER ;CREATE QMAN REGISTER ENTRY
 Q:$D(^AMQQ(7,"B","REGISTER",52))&$D(^AMQQ(5,6,"B","CMS REGISTER"))&$D(^AMQQ(5,6,"B","REGISTER"))
 N J
 S Z="RTEXT"
 F J=1:1 S X=$T(@Z+J) Q:X["END"  D
 .S X=$P(X,";;",2)
 .S J=J+1
 .S Y=$T(RTEXT+J)
 .S Y=$P(Y,";;",2)
 .S @X=Y
 Q
ACM421 ;EP;TO CHECK RG MULTIPLE NODE OF THE CMS COMPLICATIONS LIST FILE
 ;AND ADD 2000 DIABETES AUDIT TO 'BDMMENU'
 N X,Y,Z
 S X=0
 F  S X=$O(^ACM(42.1,X)) Q:'X  D
 .I $D(^ACM(42.1,X,"RG",0)) S $P(^ACM(42.1,X,"RG",0),U)="",$P(^(0),U,2)="9002241.11P"
 S DA(1)=$O(^DIC(19,"B","BDMMENU",0))
 S X=$O(^DIC(19,"B","APCL M MAIN DM MENU",0))
 Q:'DA(1)!'X
 D:'$D(^DIC(19,DA(1),10,"B",X))
 .K DD,DO
 .S DIC="^DIC(19,DA(1),10,"
 .S DIC(0)="L"
 .S DIC("DR")="2////DA"
 .D FILE^DICN
 S DA=$O(^DIC(19,"B","BDM DIABETES AUDIT",0))
 Q:'DA
 S DA=$O(^DIC(19,DA(1),10,"B",DA,0))
 Q:'DA
 S DIK="^DIC(19,"_DA(1)_",10,"
 D ^DIK
 K DA,DIK,DIC,DR
 Q
P2 ;EP;
 I $G(^DIC(2160032,0))["DMS LETTERS" K ^DIC(2160032),^DD(2160032)
 D NEWOP
 D PP
 D COMP
 D DMLAB
P3 ;EP;
P4 ;EP;
 D NEWOP
P5 ;EP;
 D NEWOP
 D ^BDMBUL
 Q
 ;
P6 ;EP;
 F BDMX="BDM SELF MONITORING REPORT" D
 .S BDMY="SMR"
 .S X=$$ADD^XPDMENU("BDM REPORTS",BDMX,BDMY)
 ;
 ;
 ;NEW TAXONOMY MENU OPTION
 ;F BDMX="BDM TAXONOMY SETUP" D
 ;.S BDMY="TMS"
 ;.S X=$$ADD^XPDMENU("BDM REGISTER MAINTENANCE",BDMX,BDMY)
 ;
 F BDMX="APCL DM2005 DM AUDIT TAX CHECK" D
 .S BDMY="D5TC"
 .S X=$$ADD^XPDMENU("BDM TAXONOMY SETUP",BDMX,BDMY)
 ;
 F BDMX="APCL DM2005 AUDIT TAX UPDATE" D
 .S BDMY="D5TU"
 .S X=$$ADD^XPDMENU("BDM TAXONOMY SETUP",BDMX,BDMY)
 ;
 F BDMX="APCL DM2005 PREDIAB TAX CHECK" D
 .S BDMY="PDTC"
 .S X=$$ADD^XPDMENU("BDM TAXONOMY SETUP",BDMX,BDMY)
 ;
 F BDMX="APCL DM2005 PREDIAB TAX UPDATE" D
 .S BDMY="PDTU"
 .S X=$$ADD^XPDMENU("BDM TAXONOMY SETUP",BDMX,BDMY)
 ;
 ;
 ;S BDMNAME="BDM TAXONOMY SETUP"
 ;S BDMOPT=$O(^DIC(19,"B",BDMNAME,0)) Q:'BDMOPT
 ;S DIE="^DIC(19,",DA=BDMOPT,DR="15////@;20////@"
 ;D ^DIE K DIE,DR,DA
 ;
 ;D ^BDMBUL6
 ;
NEWOPT2 ;MODIFY MAIN MENU EXIT ACTION
 ;
 S BDMNAME="BDMMENU"
 S BDMOPT=$O(^DIC(19,"B",BDMNAME,0)) Q:'BDMOPT
 S DIE="^DIC(19,",DA=BDMOPT,DR="15////"_"D ^BDMKILL"
 D ^DIE K DIE,DR,DA
 Q
 ;
NEWOP ;ADD NEW OPTIONS
 F BDMX="BDM EDIT PCP" D
 .S BDMY="PCP"
 .S X=$$ADD^XPDMENU("BDM REGISTER MAINTENANCE",BDMX,BDMY)
 Q
DMLAB ;EP;TO UPDATE PRIMARY PROVIDER AND DM LAB VALUES
 S BDMX="DMS DIABETES LAB REPORT"
 I $D(^APCHSCTL("B",BDMX)) S BDMDA=$O(^APCHSCTL("B",BDMX,0))
 Q:'$G(BDMDA)
 D DMLAB^BDMFUTIL
 Q
PP ;EP;TO SYNCHRONIZE PRIMARY PROVIDER WITH FILE 9000001
 Q:$G(^DD(9000001,.14,0))'[200
 S BDMDA=0
 F  S BDMDA=$O(^ACM(41,BDMDA)) Q:'BDMDA  D
 .W "."
 .S PAT=$P(^ACM(41,BDMDA,0),U,2)
 .Q:'PAT
 .S PP=$P($G(^ACM(41,BDMDA,"DT")),U,15)
 .Q:'PP
 .S PPP=$P($G(^AUPNPAT(PAT,0)),U,14)
 .Q:'PPP
 .Q:PP=PPP
 .W "."
 .S DA=BDMDA
 .S DIE="^ACM(41,"
 .S DR="15////"_PPP
 .D DIE^BDMFDIC
 Q
COMP ;EP;TO ELIMINATE DUPLICATE COMPLICATIONS
 F BDMX="CVA (STROKE)","END STAGE RENAL DISEASE","FIXED PROTEINURIA","HIGH RISK FOOT","HYPERTENSION","LASER TX FOR RETINOPATHY","MAJOR AMPUTATION(S)","MINOR AMPUTATION(S)","RETINOPATHY" D
 .S (BDMY,BDMZ)=$O(^ACM(42.1,"B",BDMX,0))
 .Q:'BDMY
 .F  S BDMZ=$O(^ACM(42.1,"B",BDMX,BDMZ)) Q:'BDMZ  D
 ..S BDMDA=0
 ..F  S BDMDA=$O(^ACM(42,"B",BDMZ,BDMDA)) Q:'BDMDA  D
 ...S DA=BDMDA
 ...S DIE="^ACM(42,"
 ...S DR=".01///"_BDMY
 ...W "."
 ...D DIE^BDMFDIC
 ..S DA=BDMZ
 ..S DIK="^ACM(42.1,"
 ..W "."
 ..D DIK^BDMFDIC
 Q
RTEXT ;;
 ;;^AMQQ(5,6,0)
 ;;REGISTER^^^52^40^^^^P
 ;;^AMQQ(5,6,1,0)
 ;;^9009075.01^2^2
 ;;^AMQQ(5,6,1,1,0)
 ;;REGISTER
 ;;^AMQQ(5,6,1,2,0)
 ;;CMS REGISTER
 ;;^AMQQ(5,6,1,"B","CMS REGISTER",2)
 ;;
 ;;^AMQQ(5,6,1,"B","REGISTER",1)
 ;;
 ;;^AMQQ(5,"C","CMS REGISTER",6,2)
 ;;
 ;;^AMQQ(5,"C","REGISTER",6,1)
 ;;
 ;;^AMQQ(7,52,0)
 ;;REGISTER
 ;;^AMQQ(7,"B","REGISTER",52)
 ;;
 ;;END
 ;
INSTALLD(BDMSTAL) ;EP - Determine if patch BDMSTAL was installed, where
 ; BDMSTAL is the name of the INSTALL.  E.g "AG*6.0*11".
 NEW BDMY,DIC,X,Y
 S X=$P(BDMSTAL,"*",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(BDMSTAL,"*",2)
 D ^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",""PAH"",",X=$P(BDMSTAL,"*",3)
 D ^DIC
 S BDMY=Y
 D IMES
 Q $S(BDMY<1:0,1:1)
IMES ;
 D MES^XPDUTL($$CJ^XLFSTR("Patch """_BDMSTAL_""" 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
V2POST ;EP - called from post init of kids build
 NEW X
 S X=$O(^ACM(58.1,"B","Case Comments",0))
 I X S DA=X,DIE="^ACM(58.1,",DR=".11///@" D ^DIE K DIE,DA,DR
 S X=$O(^ACM(58.1,"B","Care Plan Comment",0))
 I X S DA=X,DIE="^ACM(58.1,",DR=".11///CP" D ^DIE K DIE,DA,DR
 S X=$O(^ACM(58.1,"B","Complication Comments",0))
 I X S DA=X,DIE="^ACM(58.1,",DR=".11///CMP" D ^DIE K DIE,DA,DR
 S X=$O(^ACM(58.1,"B","Complication Onset Dt",0))
 I X S DA=X,DIE="^ACM(58.1,",DR=".11///CMP" D ^DIE K DIE,DA,DR
 D ^BDMBUL
 Q