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

FSCLMPEA.m

Go to the documentation of this file.
FSCLMPEA ;SLC/STAFF-NOIS List Manager Protocol Edit Association ;5/17/98  21:49
 ;;1.1;NOIS;;Sep 06, 1998
 ;
PRIMARY ; from FSCLMPE
 N CALLNUM,DIC,NUM,PRIMARY,PRIMNAME,TARGET,X,Y K DIC,Y
 S CALLNUM=$$CALL^FSCLMPE1(FSCCNT)
 S PRIMARY=+$P($G(^FSCD("CALL",CALLNUM,120)),U,24)
 S PRIMNAME=$P($G(^FSCD("CALL",PRIMARY,0)),U)
 W !,"The primary call for this call is currently "_PRIMNAME_"."
 I PRIMARY=CALLNUM,$O(^FSCD("CALL","APRIMARY",CALLNUM,0)) D
 .W !,"This call has the following secondary calls that will also be associated:"
 .S NUM=0 F  S NUM=$O(^FSCD("CALL","APRIMARY",CALLNUM,NUM)) Q:NUM<1  D
 ..S NAME=$P($G(^FSCD("CALL",NUM,0)),U) I $L(NAME) W !,NAME," ",$G(^(1))
 S DIC=7100,DIC(0)="AEMOQ",DIC("A")="Select call to associate with: "
 D ^DIC K DIC Q:Y<1
 D ASSOC(CALLNUM,+Y)
 D UPDATE^FSCEU(CALLNUM)
 Q
 ;
ASSOC(CALL1,CALL2) ; from FSCRPCD, FSCUCD
 N CALL,PRIM1,PRIM2,SEC1,SEC2,TYPE1,TYPE2
 S PRIM1=+$P($G(^FSCD("CALL",CALL1,120)),U,24),SEC1=+$P($G(^(120)),U,25)
 S PRIM2=+$P($G(^FSCD("CALL",CALL2,120)),U,24),SEC2=+$P($G(^(120)),U,25)
 I CALL1=CALL2,SEC1 D SETUP(CALL1,CALL2) Q
 I CALL1=CALL2 Q
 I PRIM1=PRIM2 Q
 I PRIM1=CALL2 Q
 S TYPE1=$S(SEC1:"C",$O(^FSCD("CALL","APRIMARY",CALL1,0)):"PC",1:"PN")
 S TYPE2=$S(SEC2:"C",$O(^FSCD("CALL","APRIMARY",CALL2,0)):"PC",1:"PN")
 I TYPE1="PN" D  Q
 .I TYPE2="C" D SETUP(CALL1,PRIM2) Q
 .I TYPE2="PN" D SETUP(CALL1,CALL2) Q
 .I TYPE2="PC" D SETUP(CALL1,CALL2) Q
 I TYPE1="PC" D  Q
 .I TYPE2="C" D  Q
 ..D SETUP(CALL1,PRIM2)
 ..S CALL=0 F  S CALL=$O(^FSCD("CALL","APRIMARY",CALL1,CALL)) Q:CALL<1  D
 ...D SETUP(CALL,PRIM1)
 .I TYPE2="PN" D
 ..D SETUP(CALL1,CALL2)
 ..S CALL=0 F  S CALL=$O(^FSCD("CALL","APRIMARY",CALL1,CALL)) Q:CALL<1  D
 ...D SETUP(CALL,CALL2)
 .I TYPE2="PC" D
 ..D SETUP(CALL1,CALL2)
 ..S CALL=0 F  S CALL=$O(^FSCD("CALL","APRIMARY",CALL1,CALL)) Q:CALL<1  D
 ...D SETUP(CALL,CALL2)
 I TYPE1="C" D  Q
 .I TYPE2="C" D SETUP(CALL1,PRIM2) Q
 .I TYPE2="PN" D SETUP(CALL1,CALL2) Q
 .I TYPE2="PC" D SETUP(CALL1,CALL2) Q
 Q
 ;
SETUP(CALL,PRIMARY) ; from FSCRPCD
 N DA,DIE,DR,LASTLINE,USERNAME,X,Y
 S USERNAME=$P($G(^VA(200,+$G(DUZ),0)),U)
 I '$L(USERNAME) S USERNAME="Purge Routine"
 S DA=CALL,DIE="^FSCD(""CALL"",",DR="101///`"_PRIMARY
 I CALL'=PRIMARY S DR=DR_";102///`"_PRIMARY
 E  S DR=DR_";102///@"
 D ^DIE
 S LASTLINE=1+$O(^FSCD("CALL",CALL,103,"A"),-1)
 S ^FSCD("CALL",CALL,103,LASTLINE,0)="Changed to "_$P($G(^FSCD("CALL",PRIMARY,0)),U)_" by "_USERNAME_" on "_$$FMTE^XLFDT($$NOW^XLFDT)
 S ^FSCD("CALL",CALL,103,0)="^^"_LASTLINE_U_LASTLINE_U_DT_U
 Q
 ;
CONVERT ;
 N DA,DIE,DR
 S DA=0 F  S DA=$O(^FSCD("CALL",DA)) Q:DA<1  D
 .S DIE="^FSCD(""CALL"",",DR="101///`"_DA_";102///@" D ^DIE W "."
 Q
 ;
COLLAPS ;
 N NUM
 K ^TMP("FSC COLLAPSE",$J)
 S NUM=0 F  S NUM=$O(^TMP("FSC CURRENT LIST",$J,NUM)) Q:NUM<1  D
 Q
 ;
EXPAND ;
 Q
 ;
EXPCALL(CALL) ;
 Q