FSCEDC ;SLC/STAFF-NOIS List Edit Duplicate Close ;12/15/96 17:00
;;1.1;NOIS;;Sep 06, 1998
;
CLOSE(CALLNUM,OLDCALL,OLDV,STATUS) ; from FSCED
N CDATE,DA,DIE,DONE,DR,EDIT,FUNC,OK,OPER,TASK,TYPE
W !,"This call is copied from a call that was closed."
W !,"If you wish to edit or make a note on this call before proceeding"
W !,"to close this call, you may do so now."
S DONE=0 F D Q:DONE
.D EDIT(.EDIT) I EDIT="ACCEPT"!$D(DIRUT) S DONE=1 Q
.I EDIT="EDIT" D
..S DA=CALLNUM,DIE="^FSCD(""CALL"",",DR="1R;2.1R;2.2R;3;5R;6R;30;"
..L +^FSCD("CALL",CALLNUM):1 I '$T D SOMEONE^FSCLMPE1 Q
..D ^DIE
..L -^FSCD("CALL",CALLNUM)
..I $D(DTOUT) S DONE=1
.I EDIT="NOTE" D
..D DATA^FSCEN("ACTION",.OPER)
..I OPER="TIMEOUT" S DONE=1 Q
..I OPER="QUIT" Q
..I OPER="ACCEPT" D NOTE^FSCEF(CALLNUM,"ACTION")
I EDIT'="ACCEPT" S STATUS=1
Q:$D(DTOUT) Q:$D(DIRUT)
S TYPE="SUMMARY" M ^TMP("FSC TEXT",$J,TYPE)=^FSCD("CALL",OLDCALL,80)
S ^TMP("FSC TEXT",$J,TYPE)=+$P(^FSCD("CALL",OLDCALL,80,0),U,3)
S CDATE=$$CDATE^FSCEUD(DUZ) S:$P(CDATE,U)="P" CDATE=$P(CDATE,U,2) I $P(CDATE,U)="S" S CDATE=$$DATE^FSCU($P(CDATE,U,2))
I 'CDATE D CDATE^FSCECD(CALLNUM,.CDATE,.OK) I 'OK Q
S FUNC=+OLDV("FUNC"),TASK=+OLDV("TASK")
D COMPLETE^FSCEC(CALLNUM,TYPE,.CDATE,.FUNC,.TASK,.OPER)
I OPER'="ACCEPT" S STATUS=1 Q
D CLOSE^FSCEF(CALLNUM,TYPE,CDATE,FUNC,TASK)
Q
;
EDIT(EDIT) ;
N DIR,X,Y K DIR
S DIR(0)="SAMO^EDIT:EDIT;NOTE:NOTE;ACCEPT:ACCEPT",DIR("A")="(E)dit, make a (N)ote, or (A)ccept: ",DIR("B")="ACCEPT"
S DIR("?",1)="Enter EDIT to edit the call (this does not include the close data)."
S DIR("?",2)="Enter NOTE to add a note to the call."
S DIR("?",3)="Enter ACCEPT to proceed to closing the call."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
S EDIT=Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCEDC 1820 printed Dec 13, 2024@02:17:31 Page 2
FSCEDC ;SLC/STAFF-NOIS List Edit Duplicate Close ;12/15/96 17:00
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
CLOSE(CALLNUM,OLDCALL,OLDV,STATUS) ; from FSCED
+1 NEW CDATE,DA,DIE,DONE,DR,EDIT,FUNC,OK,OPER,TASK,TYPE
+2 WRITE !,"This call is copied from a call that was closed."
+3 WRITE !,"If you wish to edit or make a note on this call before proceeding"
+4 WRITE !,"to close this call, you may do so now."
+5 SET DONE=0
FOR
Begin DoDot:1
+6 DO EDIT(.EDIT)
IF EDIT="ACCEPT"!$DATA(DIRUT)
SET DONE=1
QUIT
+7 IF EDIT="EDIT"
Begin DoDot:2
+8 SET DA=CALLNUM
SET DIE="^FSCD(""CALL"","
SET DR="1R;2.1R;2.2R;3;5R;6R;30;"
+9 LOCK +^FSCD("CALL",CALLNUM):1
IF '$TEST
DO SOMEONE^FSCLMPE1
QUIT
+10 DO ^DIE
+11 LOCK -^FSCD("CALL",CALLNUM)
+12 IF $DATA(DTOUT)
SET DONE=1
End DoDot:2
+13 IF EDIT="NOTE"
Begin DoDot:2
+14 DO DATA^FSCEN("ACTION",.OPER)
+15 IF OPER="TIMEOUT"
SET DONE=1
QUIT
+16 IF OPER="QUIT"
QUIT
+17 IF OPER="ACCEPT"
DO NOTE^FSCEF(CALLNUM,"ACTION")
End DoDot:2
End DoDot:1
if DONE
QUIT
+18 IF EDIT'="ACCEPT"
SET STATUS=1
+19 if $DATA(DTOUT)
QUIT
if $DATA(DIRUT)
QUIT
+20 SET TYPE="SUMMARY"
MERGE ^TMP("FSC TEXT",$JOB,TYPE)=^FSCD("CALL",OLDCALL,80)
+21 SET ^TMP("FSC TEXT",$JOB,TYPE)=+$PIECE(^FSCD("CALL",OLDCALL,80,0),U,3)
+22 SET CDATE=$$CDATE^FSCEUD(DUZ)
if $PIECE(CDATE,U)="P"
SET CDATE=$PIECE(CDATE,U,2)
IF $PIECE(CDATE,U)="S"
SET CDATE=$$DATE^FSCU($PIECE(CDATE,U,2))
+23 IF 'CDATE
DO CDATE^FSCECD(CALLNUM,.CDATE,.OK)
IF 'OK
QUIT
+24 SET FUNC=+OLDV("FUNC")
SET TASK=+OLDV("TASK")
+25 DO COMPLETE^FSCEC(CALLNUM,TYPE,.CDATE,.FUNC,.TASK,.OPER)
+26 IF OPER'="ACCEPT"
SET STATUS=1
QUIT
+27 DO CLOSE^FSCEF(CALLNUM,TYPE,CDATE,FUNC,TASK)
+28 QUIT
+29 ;
EDIT(EDIT) ;
+1 NEW DIR,X,Y
KILL DIR
+2 SET DIR(0)="SAMO^EDIT:EDIT;NOTE:NOTE;ACCEPT:ACCEPT"
SET DIR("A")="(E)dit, make a (N)ote, or (A)ccept: "
SET DIR("B")="ACCEPT"
+3 SET DIR("?",1)="Enter EDIT to edit the call (this does not include the close data)."
+4 SET DIR("?",2)="Enter NOTE to add a note to the call."
+5 SET DIR("?",3)="Enter ACCEPT to proceed to closing the call."
+6 SET DIR("?")="^D HELP^FSCU(.DIR)"
+7 SET DIR("??")="FSC U1 NOIS"
+8 DO ^DIR
KILL DIR
+9 SET EDIT=Y
+10 QUIT