FSCLMPMS ;SLC/STAFF-NOIS List Manager Protocol Modify Save ;1/13/98 12:55
;;1.1;NOIS;;Sep 06, 1998
;
STUFF ; from FSCLMPM
; common update for editing
; not scoped
D QDESC^FSCLMPMQ(.NEWDEF,.QDESC)
D SAVE(.QDESC,.OK)
I 'OK Q
D STORE("",.DESC,.QDESC,.NEWDEF)
S FSCLNAME=$P(^FSC("LIST",FSCLNUM,0),U)
D ENTRY^FSCLMM,HEADER^FSCLMM
Q
;
SAVE(QDESC,OK) ;
N DIR,LINE,X,Y K DIR
W !,"The new definition will be:"
S LINE=0 F S LINE=$O(QDESC(LINE)) Q:LINE<1 W !,QDESC(LINE)
S DIR(0)="YAO",DIR("A")="Do you want to save this definition? ",DIR("B")="YES"
S DIR("?",1)="Enter YES to save this list definition."
S DIR("?",2)="Enter NO or '^' to exit without saving, '??' for more help."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I Y'=1 S OK=0 Q
S OK=1
Q
;
STORE(ZERO,DESC,QDESC,QDEF) ;
N CNT,DA,DIC,DIE,DR,LINE,LIST0,OK I $P(^FSC("LIST",FSCLNUM,0),U,3)="A" S FSCQEDIT=1
L +^FSC("LIST",FSCLNUM):30 I '$T D BAD^FSCLDS Q
I $L($G(ZERO)) D
.S DA=FSCLNUM,(DIC,DIE)=7107.1,DR="",LIST0=^FSC("LIST",FSCLNUM,0)
.I $P(ZERO,U)'=$P(LIST0,U) S DR=".01///"_$P(ZERO,U)
.I $P(ZERO,U,2)'=$P(LIST0,U,2) S DR=DR_";1///"_$P(ZERO,U,2)
.I $L(DR) D ^DIE
I $D(DESC) D
.K ^FSC("LIST",FSCLNUM,2)
.S (CNT,LINE)=0 F S LINE=$O(DESC(LINE)) Q:LINE<1 S CNT=CNT+1,^FSC("LIST",FSCLNUM,2,LINE,0)=DESC(LINE)
.S ^FSC("LIST",FSCLNUM,2,0)="^^"_CNT_U_CNT_U_DT_U
I $D(QDESC) D
.K ^FSC("LIST",FSCLNUM,3)
.S (CNT,LINE)=0 F S LINE=$O(QDESC(LINE)) Q:LINE<1 S CNT=CNT+1,^FSC("LIST",FSCLNUM,3,LINE,0)=QDESC(LINE)
.S ^FSC("LIST",FSCLNUM,3,0)="^^"_CNT_U_CNT_U_DT_U
I $D(QDEF) D
.K ^FSC("LIST",FSCLNUM,1)
.S (CNT,LINE)=0 F S LINE=$O(QDEF(LINE)) Q:LINE<1 S CNT=CNT+1,^FSC("LIST",FSCLNUM,1,LINE,0)=QDEF(LINE),^FSC("LIST",FSCLNUM,1,"B",LINE,LINE)=""
.S ^FSC("LIST",FSCLNUM,1,0)="^7107.11^"_CNT_U_CNT
L -^FSC("LIST",FSCLNUM)
L +^XTMP("FSC LIST DEF",FSCLNUM):20 I '$T D BAD^FSCLDS Q
D BUILD^FSCLDU(FSCLNUM,.OK) I 'OK D BAD^FSCLDS
L -^XTMP("FSC LIST DEF",FSCLNUM)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCLMPMS 2031 printed Dec 13, 2024@02:18:20 Page 2
FSCLMPMS ;SLC/STAFF-NOIS List Manager Protocol Modify Save ;1/13/98 12:55
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
STUFF ; from FSCLMPM
+1 ; common update for editing
+2 ; not scoped
+3 DO QDESC^FSCLMPMQ(.NEWDEF,.QDESC)
+4 DO SAVE(.QDESC,.OK)
+5 IF 'OK
QUIT
+6 DO STORE("",.DESC,.QDESC,.NEWDEF)
+7 SET FSCLNAME=$PIECE(^FSC("LIST",FSCLNUM,0),U)
+8 DO ENTRY^FSCLMM
DO HEADER^FSCLMM
+9 QUIT
+10 ;
SAVE(QDESC,OK) ;
+1 NEW DIR,LINE,X,Y
KILL DIR
+2 WRITE !,"The new definition will be:"
+3 SET LINE=0
FOR
SET LINE=$ORDER(QDESC(LINE))
if LINE<1
QUIT
WRITE !,QDESC(LINE)
+4 SET DIR(0)="YAO"
SET DIR("A")="Do you want to save this definition? "
SET DIR("B")="YES"
+5 SET DIR("?",1)="Enter YES to save this list definition."
+6 SET DIR("?",2)="Enter NO or '^' to exit without saving, '??' for more help."
+7 SET DIR("?")="^D HELP^FSCU(.DIR)"
+8 SET DIR("??")="FSC U1 NOIS"
+9 DO ^DIR
KILL DIR
+10 IF Y'=1
SET OK=0
QUIT
+11 SET OK=1
+12 QUIT
+13 ;
STORE(ZERO,DESC,QDESC,QDEF) ;
+1 NEW CNT,DA,DIC,DIE,DR,LINE,LIST0,OK
IF $PIECE(^FSC("LIST",FSCLNUM,0),U,3)="A"
SET FSCQEDIT=1
+2 LOCK +^FSC("LIST",FSCLNUM):30
IF '$TEST
DO BAD^FSCLDS
QUIT
+3 IF $LENGTH($GET(ZERO))
Begin DoDot:1
+4 SET DA=FSCLNUM
SET (DIC,DIE)=7107.1
SET DR=""
SET LIST0=^FSC("LIST",FSCLNUM,0)
+5 IF $PIECE(ZERO,U)'=$PIECE(LIST0,U)
SET DR=".01///"_$PIECE(ZERO,U)
+6 IF $PIECE(ZERO,U,2)'=$PIECE(LIST0,U,2)
SET DR=DR_";1///"_$PIECE(ZERO,U,2)
+7 IF $LENGTH(DR)
DO ^DIE
End DoDot:1
+8 IF $DATA(DESC)
Begin DoDot:1
+9 KILL ^FSC("LIST",FSCLNUM,2)
+10 SET (CNT,LINE)=0
FOR
SET LINE=$ORDER(DESC(LINE))
if LINE<1
QUIT
SET CNT=CNT+1
SET ^FSC("LIST",FSCLNUM,2,LINE,0)=DESC(LINE)
+11 SET ^FSC("LIST",FSCLNUM,2,0)="^^"_CNT_U_CNT_U_DT_U
End DoDot:1
+12 IF $DATA(QDESC)
Begin DoDot:1
+13 KILL ^FSC("LIST",FSCLNUM,3)
+14 SET (CNT,LINE)=0
FOR
SET LINE=$ORDER(QDESC(LINE))
if LINE<1
QUIT
SET CNT=CNT+1
SET ^FSC("LIST",FSCLNUM,3,LINE,0)=QDESC(LINE)
+15 SET ^FSC("LIST",FSCLNUM,3,0)="^^"_CNT_U_CNT_U_DT_U
End DoDot:1
+16 IF $DATA(QDEF)
Begin DoDot:1
+17 KILL ^FSC("LIST",FSCLNUM,1)
+18 SET (CNT,LINE)=0
FOR
SET LINE=$ORDER(QDEF(LINE))
if LINE<1
QUIT
SET CNT=CNT+1
SET ^FSC("LIST",FSCLNUM,1,LINE,0)=QDEF(LINE)
SET ^FSC("LIST",FSCLNUM,1,"B",LINE,LINE)=""
+19 SET ^FSC("LIST",FSCLNUM,1,0)="^7107.11^"_CNT_U_CNT
End DoDot:1
+20 LOCK -^FSC("LIST",FSCLNUM)
+21 LOCK +^XTMP("FSC LIST DEF",FSCLNUM):20
IF '$TEST
DO BAD^FSCLDS
QUIT
+22 DO BUILD^FSCLDU(FSCLNUM,.OK)
IF 'OK
DO BAD^FSCLDS
+23 LOCK -^XTMP("FSC LIST DEF",FSCLNUM)
+24 QUIT