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

FSCLDS.m

Go to the documentation of this file.
FSCLDS ;SLC/STAFF-NOIS List Definition Save ;1/3/97  17:03
 ;;1.1;NOIS;;Sep 06, 1998
 ;
SAVE(FSCLNAME,FSCLNUM,OWNER,DESC,TYPE,NOTIFY) ; from FSCLD
 N CNT,DA,DIC,DIE,DLAYGO,DR,EXT,FCOND,FCV,LINE,NUM,OK,OP,OPER,QDESC,STEP,X,Y K DIC
 S OWNER=$G(OWNER) I 'OWNER S OWNER=DUZ
 I 'FSCLNUM D
 .S (DIC,DLAYGO)=7107.1,DIC(0)="L",X=FSCLNAME D ^DIC K DIC I '$P(Y,U,3) W !,"Not defined.",$C(7) H 2 Q
 .S FSCLNUM=+Y
 I 'FSCLNUM Q
 S DA=+FSCLNUM,DIE=7107.1,DR=$S(FSCLNAME'=$P(^FSC("LIST",FSCLNUM,0),U):".01///"_FSCLNAME_";",1:"")
 S DR=DR_"1///`"_OWNER_$S($D(TYPE):";2///"_TYPE,1:"")
 I $L($G(NOTIFY)) S DR=DR_";5///"_$P(NOTIFY,U)_";6///"_$P(NOTIFY,U,2)
 I TYPE="A" S DR=DR_";7///WEEKLY"
 L +^FSC("LIST",FSCLNUM):30 I '$T D BAD Q
 D ^DIE
 I $D(DESC) D
 .K ^FSC("LIST",FSCLNUM,2)
 .S CNT=0 F  S CNT=$O(DESC(CNT)) Q:CNT<1  S ^FSC("LIST",FSCLNUM,2,CNT,0)=DESC(CNT,0)
 .I $O(^FSC("LIST",FSCLNUM,2,0)) S ^(0)="^^"_CNT_U_CNT_U_DT_U
 I $G(TYPE)="S"!$D(^TMP("FSC DEFINE",$J)) D
 .K ^FSC("LIST",FSCLNUM,1),^(3)
 .I '($G(TYPE)="A"!($G(TYPE)="M")) Q
 .S (NUM,OP)=0 F  S OP=$O(^TMP("FSC DEFINE",$J,OP)) Q:OP<1  S OPER=$E(^(OP,0)) D
 ..Q:'$L(OPER)
 ..S STEP=0 F  S STEP=$O(^TMP("FSC DEFINE",$J,OP,STEP)) Q:STEP<1  D
 ...S FCOND=0 F  S FCOND=$O(^TMP("FSC DEFINE",$J,OP,STEP,FCOND))  Q:FCOND<1  S FCV=^(FCOND),EXT=$G(^(FCOND,1)) D
 ....S EXT=$S(EXT="and":"A",EXT="or":"O",1:"")
 ....S NUM=NUM+1,^FSC("LIST",FSCLNUM,1,NUM,0)=NUM_U_OPER_U_EXT_U_$P(FCV,U)_U_+$O(^FSC("COND","C",$P(FCV,U,2),0))_U_$P(FCV,U,3)
 ....S ^FSC("LIST",FSCLNUM,1,"B",NUM,NUM)=""
 ....S OPER=""
 .S ^FSC("LIST",FSCLNUM,1,0)="^7107.11^"_NUM_U_NUM
 .S (CNT,LINE)=0 F  S LINE=$O(^TMP("FSC DEFINE",$J,"DESC",LINE)) Q:LINE<1  S QDESC=^(LINE) D
 ..S CNT=CNT+1,^FSC("LIST",FSCLNUM,3,CNT,0)=QDESC
 .S ^FSC("LIST",FSCLNUM,3,0)="^^"_CNT_U_CNT_U_DT_U
 L -^FSC("LIST",FSCLNUM)
 L +^XTMP("FSC LIST DEF",FSCLNUM):20 I '$T D BAD Q
 E  D BUILD^FSCLDU(FSCLNUM,.OK) I 'OK D BAD
 L -^XTMP("FSC LIST DEF",FSCLNUM)
 I $D(VALMAR) D ENTRY^FSCLMM,HEADER^FSCLMM
 Q
 ;
BAD ; from FSCLMPMS, FSCLMPS
 W !,"This list appears to be defined incorrectly, please recheck.",!,$C(7)
 Q