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

FSCRPCUR.m

Go to the documentation of this file.
FSCRPCUR ;SLC/STAFF-NOIS RPC User Responses ;1/13/98  16:14
 ;;1.1;NOIS;;Sep 06, 1998
 ;
RESP(IN,OUT) ; from FSCRPX (RPCGetResponse)
 N CNT,LINE,NUM,RESP
 S RESP=+$G(^TMP("FSCRPC",$J,"INPUT",1))
 I 'RESP Q
 S CNT=0,NUM=0 F  S NUM=$O(^FSCD("RESPONSE",RESP,1,NUM)) Q:NUM<1  D
 .S CNT=CNT+1
 .S LINE=$G(^FSCD("RESPONSE",RESP,1,NUM,0))
 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
 Q
 ;
RESPS(IN,OUT) ; from FSCRPX (RPCGetResponses)
 N NUM,USER
 S USER=+$G(^TMP("FSCRPC",$J,"INPUT",1))
 I 'USER Q
 S NUM=0 F  S NUM=$O(^FSCD("RESPONSE","C",USER,NUM)) Q:NUM<1  D
 .S ^TMP("FSCRPC",$J,"OUTPUT",NUM)=NUM_U_$P($G(^FSCD("RESPONSE",NUM,0)),U)
 Q
 ;
DEL(IN,OUT) ; from FSCRPX (RPCDeleteResponse)
 N NUM
 S NUM=+$G(^TMP("FSCRPC",$J,"INPUT",1))
 I 'NUM Q
 D DEL^FSCUCD("^FSCD(""RESPONSE"",",NUM)
 Q
 ;
STORE(IN,OUT) ; from FSCRPX (RPCStoreResponse)
 N CNT,DA,DIK,NAME,NUM,OK,LINE
 S LINE=$G(^TMP("FSCRPC",$J,"INPUT",1))
 I '$L(LINE) Q
 S DA=+LINE,NAME=$P(LINE,U,2)
 I '$L(NAME) Q
 S NAME=$$UP^XLFSTR(NAME),NAME=$TR(NAME,";""^","~~~")
 I DA D
 .S ^FSCD("RESPONSE",DA,0)=NAME_U_DUZ
 .K ^FSCD("RESPONSE","B",DA)
 .K ^FSCD("RESPONSE",DA,1)
 E  D  I 'OK Q
 .S OK=1
 .L +^FSCD("RESPONSE",0):30 I '$T S OK=0 Q  ; *** needs ok
 .S DA=1+$P(^FSCD("RESPONSE",0),U,3)
 .F  Q:'$D(^FSCD("RESPONSE",DA,0))  S DA=DA+1
 .S $P(^FSCD("RESPONSE",0),U,3)=DA,$P(^(0),U,4)=$P(^(0),U,4)+1
 .S ^FSCD("RESPONSE",DA,0)=NAME_U_DUZ
 .L -^FSCD("RESPONSE",0)
 S DIK="^FSCD(""RESPONSE"","
 D IX1^DIK
 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 ^FSCD("RESPONSE",DA,1,CNT,0)=LINE
 S ^FSCD("RESPONSE",DA,1,0)="^^"_CNT_U_CNT_U_DT_U
 Q