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

ACMDXIT.m

Go to the documentation of this file.
ACMDXIT ; IHS/TUCSON/TMJ - DEFINE STANDARD INTERVENTIONS ;
 ;;2.0;ACM CASE MANAGEMENT SYSTEM;;JAN 10, 1996
 ;;X.X;
EN F  D EN1 Q:$D(ACMQUIT)
EXIT K ACM,ACMI,ACMX,ACMQUIT,ACMDXDA,ACMITDA,ACMMAX
 Q
EN1 ;EP;TO SELECT DIAGNOSIS
 K ACM
 W @IOF
 W !?20,"SELECT STANDARD INTERVENTIONS FOR DIAGNOSIS",!!
 S DIC="^ACM(44.1,",DIC(0)="AEMQ",DIC("A")="Diagnosis...........: "
 D ^DIC
 I +Y<1 S ACMQUIT="" Q
 S ACMDXDA=+Y
EN11 I '$D(^ACM(44.3,"AC",ACMDXDA)) D EN41 Q:'$D(^ACM(44.3,"AC",ACMDXDA))
 F  D EN2 Q:$D(ACMQUIT)
 K ACMQUIT
 Q
EN2 ;EP;ENTRY POINT
 W @IOF,!?10,"STANDARD INTERVENTIONS FOR ",$P(^ACM(44.1,ACMDXDA,0),U),!
 K ACM
 S (ACM,ACMI)=0
 F  S ACM=$O(^ACM(44.3,"AC",ACMDXDA,ACM)) Q:'ACM  I $D(^ACM(43.1,ACM,0)),$P(^(0),U)'="" S ACM($P(^(0),U))=$O(^ACM(44.3,"AC",ACMDXDA,ACM,0))_U_ACM,ACMI=ACMI+1
 S ACMMAX=ACMI,ACMI=ACMI\2+(ACMI#2)
 S ACMX=""
 F ACM=1:1 S ACMX=$O(ACM(ACMX)) Q:ACMX=""  D
 .S ACM(ACM)=ACMX_U_ACM(ACMX)
 .I $D(ACMPTNO),$D(ACMRG),$D(^ACM(43,"AC",ACMRG,ACMPTNO,$P(ACM(ACMX),U,2))) S ACM(ACM)="**"_ACM(ACM)
 .K ACM(ACMX)
 W !?5,"NO.",?10,"INTERVENTION",?45,"NO.",?50,"INTERVENTION",!?5,"---",?10,"-------------------------",?45,"---",?50,"-------------------------"
 F ACM=1:1:ACMI W ! W:$D(ACM(ACM)) ?5,ACM,?10,$P(ACM(ACM),U) W:$D(ACM(ACM+ACMI)) ?45,ACM+ACMI,?50,$P(ACM(ACM+ACMI),U)
 I $D(ACMPTNO) W !!?10,"'**' Indicates intervention already assigned to this patient."
EN3 S DIR(0)="SO^1:Add;2:Delete",DIR("A")="Which one"
 D DIR
 I Y=1 D EN4:'$D(ACMPTNO),EN6:$D(ACMPTNO) Q
 I Y=2 D EN5
 Q
EN4 F  D EN41 Q:$D(ACMQUIT)
 K ACMQUIT
 Q
EN41 S DIC="^ACM(43.1,",DIC(0)="AELMQ",DIC("A")="INTERVENTION..: "
 W !
 D DIC
 Q:$D(ACMQUIT)
 S ACMITDA=+Y
 I '$D(^ACM(44.3,"AC",ACMDXDA,ACMITDA)) S X=ACMDXDA,DIC="^ACM(44.3,",DIC(0)="L",DIC("DR")=".02////"_ACMITDA D FILE
 Q
EN5 W !
 S DIR(0)="LO^1:"_ACMMAX,DIR("A")="Which one(s)"
 D DIR
 Q:Y=""
 S ACMY=Y
 F ACMI=1:1 S ACM=$P(ACMY,",",ACMI) Q:ACM=""  D
 .I '$D(ACMPTNO),$D(ACM(ACM)),$P(ACM(ACM),U,2) S DIK="^ACM(44.3,",DA=$P(ACM(ACM),U,2) D ^DIK
 .I $D(ACMPTNO),$D(ACM(ACM)),$P(ACM(ACM),U,2) S DIK="^ACM(43,",DA=$P(ACM(ACM),U,3) I $D(^ACM(43,"AC",ACMRG,ACMPTNO,DA)) S DA=^(DA) D ^DIK
 Q
EN6 W !
 N ACMDIC,ACMY,ACMDR
 S DIR(0)="LO^1:"_ACMMAX,DIR("A")="Add which one(s)"
 D DIR
 Q:Y=""
 S ACMX=Y
 F ACMI=1:1 S ACM=$P(ACMX,",",ACMI) Q:ACM=""  I $D(ACMPTNO),$D(ACM(ACM)),$P(ACM(ACM),U,2) S ACMDIC=43,ACMY=$P(ACM(ACM),U,3) D
 .I '$D(^ACM(43,"AC",ACMRG,ACMPTNO,ACMY)) D DICN^ACMEP
 .I $D(^ACM(43,"AC",ACMRG,ACMPTNO,ACMY)) S DA=^(ACMY),ACMDR="2T;3T;1T;4T" W !!,"INTERVENTION: ",$P(ACM(ACM),U) D DIE^ACMEP
 Q
DIC D ^DIC S:+Y<1 ACMQUIT="" K DIC,DA,DD,DR,DINUM,D Q
DIK D ^DIK K DIK Q
DIR D ^DIR S:$D(DIRUT) ACMQUIT="" K DIR,DIRUT,DUOUT,DTOUT Q
FILE K DD,DO D FILE^DICN K DIC,DA,DD,DR,DINUM Q