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

FSCRPCUF.m

Go to the documentation of this file.
FSCRPCUF ;SLC/STAFF-NOIS RPC User Formats ;1/13/98  16:13
 ;;1.1;NOIS;;Sep 06, 1998
 ;
DEL(IN,OUT) ; from FSCRPX (RPCDeleteFormat)
 N NUM
 S NUM=+$G(^TMP("FSCRPC",$J,"INPUT",1))
 I 'NUM Q
 D DEL^FSCUCD("^FSC(""FORMAT"",",NUM)
 Q
 ;
SETUP(IN,OUT) ; from FSCRPX (RPCSetupFormat)
 N CNT,DA,DIK,LINE,NAME,NUM,OK,TYPE
 S LINE=$G(^TMP("FSCRPC",$J,"INPUT",1))
 I '$L(LINE) Q
 S DA=+LINE,NAME=$P(LINE,U,2),TYPE=$P(LINE,U,3)
 I '$L(NAME) Q
 I '(TYPE="S"!(TYPE="F")) Q
 S NAME=$$UP^XLFSTR(NAME),NAME=$TR(NAME,";""^","~~~")
 I DA D
 .S ^FSC("FORMAT",DA,0)=NAME_U_TYPE_U_U_U_DUZ
 .K ^FSC("FORMAT","B",DA)
 .K ^FSC("FORMAT",DA,2)
 E  D  I 'OK Q
 .S OK=1
 .L +^FSC("FORMAT",0):30 I '$T S OK=0 Q
 .S DA=1+$P(^FSC("FORMAT",0),U,3)
 .F  Q:'$D(^FSC("FORMAT",DA,0))  S DA=DA+1
 .S $P(^FSC("FORMAT",0),U,3)=DA,$P(^(0),U,4)=$P(^(0),U,4)+1
 .S ^FSC("FORMAT",DA,0)=NAME_U_TYPE_U_U_U_DUZ
 .L -^FSC("FORMAT",0)
 S DIK="^FSC(""FORMAT"","
 S CNT=0,NUM=1 F  S NUM=$O(^TMP("FSCRPC",$J,"INPUT",NUM)) Q:NUM<1  S LINE=^(NUM) D
 .S CNT=CNT+1
 .S ^FSC("FORMAT",DA,2,CNT,0)=LINE
 S ^FSC("FORMAT",DA,2,0)="^7107.62P^"_CNT_U_CNT
 D IX1^DIK
 Q