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

AMH30P4.m

Go to the documentation of this file.
AMH30P4 ; IHS/CMI/LAB - POST INIT BH ;   [ 01/02/05  3:20 PM ]
 ;;3.0;IHS BEHAVIORAL HEALTH;**4**;JAN 27, 2003
 ;
 ;LORI -SEND OUT LISTER ITEMS
ENV ;EP 
 I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
 F X="XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
 Q
 ;
PRE ;
 I $D(^DD(9002011.65,.24,0)) S AMHX=0 F  S AMHX=$O(^AMHPSUIC(AMHX)) Q:AMHX'=+AMHX  S DA=AMHX,DIE="^AMHPSUIC(",DR="9901///1" D ^DIE  ;DON'T CONVERT A SECOND TIME
 D ^XBFMK
 S DIK="^DD(9002011.55,",DA=.13,DA(1)=9002011.55 D ^DIK
 S DIK="^DD(9002011.51,",DA=.06,DA(1)=9002011.51 D ^DIK
 S DIK="^DD(9002011,",DA=.17,DA(1)=9002011 D ^DIK
 S DA=$O(^AMHTACT("B",32,0)) I DA S DIE="^AMHTACT(",DR=".02///CLINICAL SUPERVISION PROVIDED" D ^DIE K DIE,DA,DR
 S DA=$O(^AMHTACT("B",14,0)) I DA S DIE="^AMHTACT(",DR=".08///@" D ^DIE K DIE,DA,DR
 S DA=$O(^AMHTACT("B",32,0)) I DA S DIE="^AMHTACT(",DR=".03///A" D ^DIE K DIE,DA,DR
 S DA=$O(^AMHTACT("B",66,0)) I DA S DIE="^AMHTACT(",DR=".03///A" D ^DIE K DIE,DA,DR
 S DA=$O(^AMHTACT("B",47,0)) I DA S DIE="^AMHTACT(",DR=".09///@" D ^DIE K DIE,DA,DR
 S DA=$O(^AMHPROB("B",19,0))
 I DA S DIE="^AMHPROB(",DR=".02///PERSONALITY DISORDER" D ^DIE
 S DA=$O(^AMHPROBC("B",19,0))
 I DA S DIE="^AMHPROBC(",DR=".02///PERSONALITY DISORDER" D ^DIE
 D ^XBFMK
 S DA=$O(^AMHTSDRG("B","TYLENOL (ACETOMINOPHEN)",0))
 I DA S DIE="^AMHTSDRG(",DR=".01///TYLENOL (ACETAMINOPHEN)" D ^DIE K DA,DR,DIE
 S DA=$O(^AMHTSDRG("B","TRICYLCLIC ANTIDEPRESSANTS (TC",0))
 I DA S DIE="^AMHTSDRG(",DR=".01///TRICYCLIC ANTIDEPRESSANT (TCA)" D ^DIE
 S DA=$O(^AMHTSDRG("B","BARBITUATES",0))
 I DA S DIE="^AMHTSDRG(",DR=".01///BARBITURATES" D ^DIE K DA,DR,DIE
 D ^XBFMK
 S DA=$O(^AMHPROBC("B",9.1,0))
 I DA S DIE="^AMHPROBC(",DR=".03///PSYCHOSOCIAL PROBLEMS" D ^DIE
 S DA=$O(^AMHPROBC("B",9.2,0))
 I DA S DIE="^AMHPROBC(",DR=".03///PSYCHOSOCIAL PROBLEMS" D ^DIE
 S DA=$O(^AMHPROBC("B",21.1,0))
 I DA S DIE="^AMHPROBC(",DR=".03///PSYCHOSOCIAL PROBLEMS" D ^DIE
 S DA=$O(^AMHPROBC("B",37.1,0))
 I DA S DIE="^AMHPROBC(",DR=".03///PSYCHOSOCIAL PROBLEMS" D ^DIE
 S DA=$O(^AMHPROBC("B",29.2,0))
 I DA S DIE="^AMHPROBC(",DR=".03///SCREENING" D ^DIE
 S DA=$O(^AMHPROB("B",46.3,0))
 I DA,$D(^AMHPROBC("B",46.3)) S DIE="^AMHPROB(",DR=".03///46.3" D ^DIE
 S DA=0,AMHX=0 F  S AMHX=$O(^AMHPROB("B",780.59,AMHX)) Q:AMHX'=+AMHX  S DA=AMHX,DIE="^AMHPROB(",DR=".14///@" D ^DIE
 D ^XBFMK
 S X=0 F  S X=$O(^AMHTPLT(X)) Q:X'=+X  S $P(^AMHTPLT(X,0),U,2)=""
 F DA=1:1:200 S DIK="^AMHSORT(" D ^DIK
 F DA=1:1:50 S DIK="^AMHDTER(" D ^DIK
 F DA=1:1:10 S DIK="^AMHRECD(" D ^DIK
 F DA=1:1:500 S DIK="^AMHTPCAD(" D ^DIK
 ;STORE DRUG DATA FROM SUICIDE FORMS
 K ^XTMP("AMH30P4")
 S X=0 F  S X=$O(^AMHPSUIC(X)) Q:X'=+X  D
 .Q:$P($G(^AMHPSUIC(X,99)),U)  ;ALREADY CONVERTED
 .S Y=0 F  S Y=$O(^AMHPSUIC(X,11,Y)) Q:Y'=+Y  D
 ..S Z=0 F  S Z=$O(^AMHPSUIC(X,11,Y,11,Z)) Q:Z'=+Z  D
 ...S D=$P(^AMHPSUIC(X,11,Y,11,Z,0),U) I D S ^XTMP("AMH30P4","OVERDOSE DRUGS",X,Y,Z)=$P($G(^AMHTSDRG(D,0)),U)
 S X=0 F  S X=$O(^AMHPSUIC(X)) Q:X'=+X  D
 .Q:$P($G(^AMHPSUIC(X,99)),U)  ;ALREADY CONVERTED
 .S Y=0 F  S Y=$O(^AMHPSUIC(X,12,Y)) Q:Y'=+Y  D
 ..S Z=0 F  S Z=$O(^AMHPSUIC(X,12,Y,11,Z)) Q:Z'=+Z  D
 ...S D=$P(^AMHPSUIC(X,12,Y,11,Z,0),U) I D S ^XTMP("AMH30P4","SUBSTANCE DRUGS",X,Y,Z)=$P($G(^AMHTSDRG(D,0)),U)
 ...Q
 F DA=1:1:500 S DIK="^AMHTSDRG(" D ^DIK
 S DA=$O(^APCHSCTL("B","MENTAL HEALTH/SOCIAL SERVICES",0)) I DA S DIE="^APCHSCTL(",DR=".01///BEHAVIORAL HEALTH" D ^DIE
 S DA=$O(^AMHTACT("B",77,0)) I DA S DIE="^AMHTACT(",DR=".09///1" D ^DIE
 S DA=$O(^AMHTSSU("B","NON-PRESCRIBED OPIATES (E.G. H",0)) I DA S DIE="^AMHTSSU(",DR=".01///NON-PRESCRIBED OPIATES (HEROIN)" D ^DIE
 S DA=$O(^AMHTSDRG("B","NON-PRESCRIBED OPIATES (E.G. H",0)) I DA S DIE="^AMHTSDRG(",DR=".01///NON-PRESCRIBED OPIATES (HEROIN)" D ^DIE
 D ^XBFMK
 Q
POST ;EP
 S DIK="^AMHPSUIC(",DIK(1)=".21^AEX" D ENALL^DIK
 S X=0 F  S X=$O(^AMHREC(X)) Q:X'=+X  I $P($G(^AMHREC(X,14)),U)="U" S $P(^AMHREC(X,14),U)="UAS" W "."
 S X=$$ADD^XPDMENU("AMH M MANAGER UTILITIES","AMH BACKLOAD CDMIS DATA","BLCD")
 I 'X W "Attempt to add cdmis backload option failed.." H 3
 S X=$$ADD^XPDMENU("AMH M PATIENT LISTINGS","AMH RPT TIME IN GRP","TSG")
 I 'X W "Attempt to add time in group report option failed.." H 3
 S X=$$ADD^XPDMENU("AMH DE UPDATE TREATMENT PLANS","AMH TP LIST ALL TPS","ATP")
 I 'X W "Attempt to add all treatment plan report option failed.." H 3
 S X=$$ADD^XPDMENU("AMH M DATA ENTRY MENU","AMH GROUP ENTRY","GP",30)
 I 'X W "Attempt to add GROUP ENTRY option failed.." H 3
 ;convert suicide form data
 S DA=$O(^AMHTACT("B",47,0)) I DA S DIE="^AMHTACT(",DR=".09///@" D ^DIE K DIE,DA,DR
 D ^AMH30P4D
 D ^AMH30P4C
 K ^XTMP("AMH30P4")
 D ^XBFMK K DLAYGO,DIADD
 ;Q:$D(^APCDLINK("B","BEHAVIORAL HEALTH"))  ;already exists
 S DA=$O(^APCDLINK("B","BEHAVIORAL HEALTH",0))
 I 'DA K DD,DO S DIC="^APCDLINK(",DIC(0)="LE",DLAYGO=9001002,X="BEHAVIORAL HEALTH" D FILE^DICN K DLAYGO,DD,DIC,DO S DA=+Y
 S DR="1///S:$D(X) AMHX=X S X=""AMHPCCL"" X ^%ZOSF(""TEST"") S:$D(AMHX) X=AMHX K AMHX I $T D MRG^AMHPCCL"_";3///S:$D(X) AMHX=X S X=""AMHPCCL"" X ^%ZOSF(""TEST"") S:$D(AMHX) X=AMHX K AMHX I $T D DEL^AMHPCCL"
 S DIE="^APCDLINK("
 D ^DIE K DIE,DR,DA
 D ^AMH30P4B
 Q
 ;;
 ;
 ;;
 ;