FSCRPCWP ;SLC/STAFF-NOIS RPC Web Page ;7/23/98 13:07
;;1.1;NOIS;;Sep 06, 1998
;
LOADCALL(IN,OUT) ; from FSCRPX (RPCLoadWebCall)
N CALL,CNT,KEYWORDS,LINE,NUM,ONETWO,SUBJECT,ZERO
S CALL=+$G(^TMP("FSCRPC",$J,"INPUT",1))
S ZERO=$G(^FSCD("CALL",CALL,0))
I '$L(ZERO) Q
S ONETWO=$G(^FSCD("CALL",CALL,120))
S SUBJECT=$G(^FSCD("CALL",CALL,1))
S KEYWORDS=$G(^FSCD("CALL",CALL,1.5))
S ^TMP("FSCRPC",$J,"OUTPUT",1)=ZERO,^(2)=ONETWO,^(3)=SUBJECT,^(4)=KEYWORDS
S CNT=4
I $O(^FSCD("CALL",CALL,30,0)) D
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{DESC}}}"
.S NUM=0 F S NUM=$O(^FSCD("CALL",CALL,30,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D
..S CNT=CNT+1
..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}"
I $O(^FSCD("CALL",CALL,80,0)) D
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{RES}}}"
.S NUM=0 F S NUM=$O(^FSCD("CALL",CALL,80,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D
..S CNT=CNT+1
..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}"
Q
;
LOADWEB(IN,OUT) ; from FSCRPX (RPCLoadWeb)
N CNT,ID,KEYWORDS,LINE,NUM,ONETWO,SUBJECT,ZERO
S ID=+$G(^TMP("FSCRPC",$J,"INPUT",1))
S ZERO=$G(^FSCD("WEB",ID,0))
I '$L(ZERO) Q
S SUBJECT=$G(^FSCD("WEB",ID,1))
S ONETWO="",KEYWORDS=""
S ^TMP("FSCRPC",$J,"OUTPUT",1)=ZERO,^(2)=ONETWO,^(3)=SUBJECT,^(4)=KEYWORDS
S CNT=4
I $O(^FSCD("WEB",ID,2,0)) D
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{DESC}}}"
.S NUM=0 F S NUM=$O(^FSCD("WEB",ID,2,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D
..S CNT=CNT+1
..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}"
I $O(^FSCD("WEB",ID,3,0)) D
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{RES}}}"
.S NUM=0 F S NUM=$O(^FSCD("WEB",ID,3,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D
..S CNT=CNT+1
..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}"
Q
;
SAVEWEB(IN,OUT) ; from FSCRPX (RPCSaveWeb)
N CNT,ID,LINE,NEWPACK,NUM,PACKAGE,TITLE
K FIELDS,^TMP("FSC WP",$J)
S PACKAGE=+^TMP("FSCRPC",$J,"INPUT",1)
I $O(^FSCD("WEB","C",PACKAGE,0)) S NEWPACK=0
E S NEWPACK=1
S TITLE=^TMP("FSCRPC",$J,"INPUT",2)
S NOW=$$NOW^XLFDT()
L +^FSCD("WEB",0):20 I '$T Q
S ID=1+$P(^FSCD("WEB",0),U,3)
F Q:'$D(^FSCD("WEB",ID,0)) S ID=ID+1
S $P(^FSCD("WEB",0),U,3)=ID,$P(^(0),U,4)=$P(^(0),U,4)+1
S ^FSCD("WEB",ID,0)="P"_ID_U_PACKAGE_U_DUZ_U_NOW_U_DUZ_U_NOW
L -^FSCD("WEB",0)
S ^FSCD("WEB",ID,1)=TITLE
D PROCESS^FSCRPCNC(.FIELDS)
I $O(^TMP("FSC WP",$J,"DESC",0)) D
.K ^FSCD("WEB",ID,2)
.S (CNT,NUM)=0 F S NUM=$O(^TMP("FSC WP",$J,"DESC",NUM)) Q:NUM<1 S LINE=^(NUM) D
..S CNT=CNT+1
..S ^FSCD("WEB",ID,2,CNT,0)=LINE
.S ^FSCD("WEB",ID,2,0)="^^"_CNT_U_CNT_U_DT_U
I $O(^TMP("FSC WP",$J,"RES",0)) D
.K ^FSCD("WEB",ID,3)
.S (CNT,NUM)=0 F S NUM=$O(^TMP("FSC WP",$J,"RES",NUM)) Q:NUM<1 S LINE=^(NUM) D
..S CNT=CNT+1
..S ^FSCD("WEB",ID,3,CNT,0)=LINE
.S ^FSCD("WEB",ID,3,0)="^^"_CNT_U_CNT_U_DT_U
S DIK="^FSCD(""WEB"",",DA=ID
D IX1^DIK
K FIELDS,^TMP("FSC WP",$J)
SEND S CNT=0
I NEWPACK D MAIN^FSCRPCW1(.CNT)
D PACK^FSCRPCW2(PACK,.CNT)
D SOL^FSCRPCW3(ID,.CNT)
Q
;
WEBIEN(IN,OUT) ; from FSCRPXU (RPCWebIEN)
N LINE
S LINE=$G(^TMP("FSCRPC",$J,"INPUT",1))
S ^TMP("FSCRPC",$J,"OUTPUT",1)=$$IEN(LINE)
Q
;
IEN(URL) ; $$(url) -> valid web ien else -1
N AURL,BACK,FRONT,IEN
S ADDRESS=$P($G(^FSC("PARAM",1,1.8)),U,2)
I '$L(ADDRESS) Q -1
S AURL=""
I $L($P(URL,":",3,99)) D
.S FRONT=$P(URL,":",1,2),BACK=$P(URL,":",3,99),BACK=$P(BACK,"/",2,99)
.S AURL=FRONT_"/"_BACK
S IEN=+$P(URL,ADDRESS_"p",2)
I $D(^FSCD("WEB",IEN,0)) Q IEN
I $L(AURL) S IEN=+$P(AURL,ADDRESS_"p",2)
I $D(^FSCD("WEB",IEN,0)) Q IEN
Q -1
;
TEST ;
W $$IEN("http://152.131.1.116:80/nois/p22.htm")
Q
DELWEB(IN,OUT) ; from FSCRPXU (RPCDeleteWeb)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCRPCWP 3921 printed Dec 13, 2024@02:19:58 Page 2
FSCRPCWP ;SLC/STAFF-NOIS RPC Web Page ;7/23/98 13:07
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
LOADCALL(IN,OUT) ; from FSCRPX (RPCLoadWebCall)
+1 NEW CALL,CNT,KEYWORDS,LINE,NUM,ONETWO,SUBJECT,ZERO
+2 SET CALL=+$GET(^TMP("FSCRPC",$JOB,"INPUT",1))
+3 SET ZERO=$GET(^FSCD("CALL",CALL,0))
+4 IF '$LENGTH(ZERO)
QUIT
+5 SET ONETWO=$GET(^FSCD("CALL",CALL,120))
+6 SET SUBJECT=$GET(^FSCD("CALL",CALL,1))
+7 SET KEYWORDS=$GET(^FSCD("CALL",CALL,1.5))
+8 SET ^TMP("FSCRPC",$JOB,"OUTPUT",1)=ZERO
SET ^(2)=ONETWO
SET ^(3)=SUBJECT
SET ^(4)=KEYWORDS
+9 SET CNT=4
+10 IF $ORDER(^FSCD("CALL",CALL,30,0))
Begin DoDot:1
+11 SET CNT=CNT+1
+12 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{DESC}}}"
+13 SET NUM=0
FOR
SET NUM=$ORDER(^FSCD("CALL",CALL,30,NUM))
if NUM<1
QUIT
SET LINE=$GET(^(NUM,0))
Begin DoDot:2
+14 SET CNT=CNT+1
+15 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=LINE
End DoDot:2
+16 SET CNT=CNT+1
+17 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{}}}"
End DoDot:1
+18 IF $ORDER(^FSCD("CALL",CALL,80,0))
Begin DoDot:1
+19 SET CNT=CNT+1
+20 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{RES}}}"
+21 SET NUM=0
FOR
SET NUM=$ORDER(^FSCD("CALL",CALL,80,NUM))
if NUM<1
QUIT
SET LINE=$GET(^(NUM,0))
Begin DoDot:2
+22 SET CNT=CNT+1
+23 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=LINE
End DoDot:2
+24 SET CNT=CNT+1
+25 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{}}}"
End DoDot:1
+26 QUIT
+27 ;
LOADWEB(IN,OUT) ; from FSCRPX (RPCLoadWeb)
+1 NEW CNT,ID,KEYWORDS,LINE,NUM,ONETWO,SUBJECT,ZERO
+2 SET ID=+$GET(^TMP("FSCRPC",$JOB,"INPUT",1))
+3 SET ZERO=$GET(^FSCD("WEB",ID,0))
+4 IF '$LENGTH(ZERO)
QUIT
+5 SET SUBJECT=$GET(^FSCD("WEB",ID,1))
+6 SET ONETWO=""
SET KEYWORDS=""
+7 SET ^TMP("FSCRPC",$JOB,"OUTPUT",1)=ZERO
SET ^(2)=ONETWO
SET ^(3)=SUBJECT
SET ^(4)=KEYWORDS
+8 SET CNT=4
+9 IF $ORDER(^FSCD("WEB",ID,2,0))
Begin DoDot:1
+10 SET CNT=CNT+1
+11 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{DESC}}}"
+12 SET NUM=0
FOR
SET NUM=$ORDER(^FSCD("WEB",ID,2,NUM))
if NUM<1
QUIT
SET LINE=$GET(^(NUM,0))
Begin DoDot:2
+13 SET CNT=CNT+1
+14 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=LINE
End DoDot:2
+15 SET CNT=CNT+1
+16 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{}}}"
End DoDot:1
+17 IF $ORDER(^FSCD("WEB",ID,3,0))
Begin DoDot:1
+18 SET CNT=CNT+1
+19 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{RES}}}"
+20 SET NUM=0
FOR
SET NUM=$ORDER(^FSCD("WEB",ID,3,NUM))
if NUM<1
QUIT
SET LINE=$GET(^(NUM,0))
Begin DoDot:2
+21 SET CNT=CNT+1
+22 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=LINE
End DoDot:2
+23 SET CNT=CNT+1
+24 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)="{{{}}}"
End DoDot:1
+25 QUIT
+26 ;
SAVEWEB(IN,OUT) ; from FSCRPX (RPCSaveWeb)
+1 NEW CNT,ID,LINE,NEWPACK,NUM,PACKAGE,TITLE
+2 KILL FIELDS,^TMP("FSC WP",$JOB)
+3 SET PACKAGE=+^TMP("FSCRPC",$JOB,"INPUT",1)
+4 IF $ORDER(^FSCD("WEB","C",PACKAGE,0))
SET NEWPACK=0
+5 IF '$TEST
SET NEWPACK=1
+6 SET TITLE=^TMP("FSCRPC",$JOB,"INPUT",2)
+7 SET NOW=$$NOW^XLFDT()
+8 LOCK +^FSCD("WEB",0):20
IF '$TEST
QUIT
+9 SET ID=1+$PIECE(^FSCD("WEB",0),U,3)
+10 FOR
if '$DATA(^FSCD("WEB",ID,0))
QUIT
SET ID=ID+1
+11 SET $PIECE(^FSCD("WEB",0),U,3)=ID
SET $PIECE(^(0),U,4)=$PIECE(^(0),U,4)+1
+12 SET ^FSCD("WEB",ID,0)="P"_ID_U_PACKAGE_U_DUZ_U_NOW_U_DUZ_U_NOW
+13 LOCK -^FSCD("WEB",0)
+14 SET ^FSCD("WEB",ID,1)=TITLE
+15 DO PROCESS^FSCRPCNC(.FIELDS)
+16 IF $ORDER(^TMP("FSC WP",$JOB,"DESC",0))
Begin DoDot:1
+17 KILL ^FSCD("WEB",ID,2)
+18 SET (CNT,NUM)=0
FOR
SET NUM=$ORDER(^TMP("FSC WP",$JOB,"DESC",NUM))
if NUM<1
QUIT
SET LINE=^(NUM)
Begin DoDot:2
+19 SET CNT=CNT+1
+20 SET ^FSCD("WEB",ID,2,CNT,0)=LINE
End DoDot:2
+21 SET ^FSCD("WEB",ID,2,0)="^^"_CNT_U_CNT_U_DT_U
End DoDot:1
+22 IF $ORDER(^TMP("FSC WP",$JOB,"RES",0))
Begin DoDot:1
+23 KILL ^FSCD("WEB",ID,3)
+24 SET (CNT,NUM)=0
FOR
SET NUM=$ORDER(^TMP("FSC WP",$JOB,"RES",NUM))
if NUM<1
QUIT
SET LINE=^(NUM)
Begin DoDot:2
+25 SET CNT=CNT+1
+26 SET ^FSCD("WEB",ID,3,CNT,0)=LINE
End DoDot:2
+27 SET ^FSCD("WEB",ID,3,0)="^^"_CNT_U_CNT_U_DT_U
End DoDot:1
+28 SET DIK="^FSCD(""WEB"","
SET DA=ID
+29 DO IX1^DIK
+30 KILL FIELDS,^TMP("FSC WP",$JOB)
SEND SET CNT=0
+1 IF NEWPACK
DO MAIN^FSCRPCW1(.CNT)
+2 DO PACK^FSCRPCW2(PACK,.CNT)
+3 DO SOL^FSCRPCW3(ID,.CNT)
+4 QUIT
+5 ;
WEBIEN(IN,OUT) ; from FSCRPXU (RPCWebIEN)
+1 NEW LINE
+2 SET LINE=$GET(^TMP("FSCRPC",$JOB,"INPUT",1))
+3 SET ^TMP("FSCRPC",$JOB,"OUTPUT",1)=$$IEN(LINE)
+4 QUIT
+5 ;
IEN(URL) ; $$(url) -> valid web ien else -1
+1 NEW AURL,BACK,FRONT,IEN
+2 SET ADDRESS=$PIECE($GET(^FSC("PARAM",1,1.8)),U,2)
+3 IF '$LENGTH(ADDRESS)
QUIT -1
+4 SET AURL=""
+5 IF $LENGTH($PIECE(URL,":",3,99))
Begin DoDot:1
+6 SET FRONT=$PIECE(URL,":",1,2)
SET BACK=$PIECE(URL,":",3,99)
SET BACK=$PIECE(BACK,"/",2,99)
+7 SET AURL=FRONT_"/"_BACK
End DoDot:1
+8 SET IEN=+$PIECE(URL,ADDRESS_"p",2)
+9 IF $DATA(^FSCD("WEB",IEN,0))
QUIT IEN
+10 IF $LENGTH(AURL)
SET IEN=+$PIECE(AURL,ADDRESS_"p",2)
+11 IF $DATA(^FSCD("WEB",IEN,0))
QUIT IEN
+12 QUIT -1
+13 ;
TEST ;
+1 WRITE $$IEN("http://152.131.1.116:80/nois/p22.htm")
+2 QUIT
DELWEB(IN,OUT) ; from FSCRPXU (RPCDeleteWeb)
+1 QUIT