FSCELS ;SLC/STAFF-NOIS Edit Log Setup ;8/30/97 17:03
;;1.1;NOIS;;Sep 06, 1998
;
NEW(SITE,CALLNUM) ; from FSCEL
N ASK,DA,DIE,DR,SITE0,STUFF
S SITE0=^FSC("SITE",SITE,0)
S DA=CALLNUM,DIE="^FSCD(""CALL"",",(ASK,DR,STUFF)=""
D STRING($$MOD(DUZ),.STUFF,.ASK)
D STRING($$SUBJECT(DUZ),.STUFF,.ASK)
S ASK=ASK_";30Problem Description"
D STRING($$CONTACT(SITE0,DUZ),.STUFF,.ASK)
D STRING($$PRIORITY(DUZ),.STUFF,.ASK)
D STRING($$SPEC(DUZ),.STUFF,.ASK)
I $$PATCH^FSCEUD(DUZ)="P" D STRING(";7T",.STUFF,.ASK)
I $$SUB^FSCEUD(DUZ)="P" D STRING(";S Y=$$SUB^FSCEU(DA);@1;3.2T;@2",.STUFF,.ASK)
I $$KEYWORDS^FSCEUD(DUZ)="P" D STRING(";1.5T",.STUFF,.ASK)
S DR=DR_STUFF_ASK I '$L(DR) Q
I $E(DR)=";" S DR=$E(DR,2,245)
L +^FSCD("CALL",CALLNUM):30 I '$T D SOMEONE^FSCLMPE1 Q
D ^DIE
L -^FSCD("CALL",CALLNUM)
D PICKUP^FSCES(CALLNUM)
Q
;
RECON(SITE,CALLNUM) ; from FSCEL
N ASK,DA,DIE,DR,SITE0,STUFF
S SITE0=^FSC("SITE",SITE,0)
S DA=CALLNUM,DIE="^FSCD(""CALL"",",(ASK,DR,STUFF)=""
D STRING($$CONTACT(SITE0,DUZ),.STUFF,.ASK)
S DR=DR_STUFF_ASK I '$L(DR) Q
I $E(DR)=";" S DR=$E(DR,2,245)
L +^FSCD("CALL",CALLNUM):30 I '$T D SOMEONE^FSCLMPE1 Q
D ^DIE
L -^FSCD("CALL",CALLNUM)
Q
;
CLOSE(CALLNUM,OK) ; from FSCEL, FSCLMPE1
N ASK,DA,DIE,DR,STUFF S OK=1
S DA=CALLNUM,DIE="^FSCD(""CALL"",",DR="81///`"_DUZ_";122///NOW",ASK=";80",STUFF=""
D STRING($$HOURS(DUZ),.STUFF,.ASK)
D STRING($$CDATE(DUZ),.STUFF,.ASK)
D STRING($$FUNC(DUZ),.STUFF,.ASK)
D STRING($$TASK(DUZ),.STUFF,.ASK)
S DR=DR_STUFF_ASK
L +^FSCD("CALL",CALLNUM):30 I '$T D SOMEONE^FSCLMPE1 Q
D ^DIE
L -^FSCD("CALL",CALLNUM)
I $D(DTOUT) S OK=0
Q
;
STRING(VALUE,STUFF,ASK) ; from FSCED
I VALUE["///" S STUFF=STUFF_VALUE Q
S ASK=ASK_VALUE
Q
;
PH(PERSON) ; $$(person) -> phone # from file 200
Q $P($G(^VA(200,PERSON,.13)),U,2)
;
MOD(USER) ; $$(user) -> preferred module default
N DEF,NUM,VALUE S DEF=";3T",VALUE=$$MOD^FSCEUD(USER)
I '$L($P(VALUE,U,2)) Q DEF
I $P(VALUE,U)="S" S NUM=+$O(^FSC("MOD","B",$P(VALUE,U,2),0)) I NUM Q DEF_"///`"_NUM
Q DEF_"//"_$P(VALUE,U,2)
;
SPEC(USER) ; $$(user) -> preferred specialist default
N DEF,VALUE S DEF=";5T",VALUE=$$SPEC^FSCEUD(USER)
I $P(VALUE,U)="I" Q ""
I '$L($P(VALUE,U,2)) Q DEF
I $P(VALUE,U)="S" I DUZ=$P(VALUE,U,2) Q DEF_"///`"_DUZ
Q DEF_"//"_$$VALUE^FSCGET($P(VALUE,U,2),7100,5)
;
SUBJECT(USER) ; $$(user) -> preferred subject default
N DEF,VALUE S DEF=";1T",VALUE=$$SUBJECT^FSCEUD(USER)
I '$L($P(VALUE,U,2)) Q DEF
I $P(VALUE,U)="S" Q DEF_"///"_$P(VALUE,U,2)
Q DEF_"//"_$P(VALUE,U,2)
;
CONTACT(SITE0,USER) ; $$(site zero node,user) -> preferred site contact default
N CONTACT,DEF,DEF1,PHONE
S DEF=";D CINFO^FSCELS(DA);2.1T;H .1;2.2T//^S X=$$CPHONE^FSCELS(DA)"
S CONTACT=$$CONTACT^FSCEUD(SITE0,USER)
I '$L($P(CONTACT,U,2)) Q DEF
S DEF1=";D CINFO^FSCELS(DA);2.1T//"_$P(CONTACT,U,2)_";H .1;2.2T//^S X=$$CPHONE^FSCELS(DA)"
S PHONE=$$PHONE^FSCEUD(SITE0,USER)
I '$L($P(PHONE,U,2)) Q DEF1
I $P(CONTACT,U)="S",$P(PHONE,U)="S" Q ";2.1T///`"_$P(SITE0,U,6)_";2.2T///"_$P(PHONE,U,2)
Q DEF1
;
CINFO(CALL) ;
N APINFO,IRMINFO,MOD,NOISINFO,SITE,SITEINFO
S SITE=$P($G(^FSCD("CALL",CALL,0)),U,5),MOD=$P($G(^(0)),U,8)
I 'SITE Q
S NOISINFO=$$NOISINFO^FSCLMPOC(SITE),IRMINFO=$$IRMINFO^FSCLMPOC(SITE),APINFO=$$APINFO^FSCLMPOC(SITE,MOD),SITEINFO=$$SITEINFO^FSCLMPOC(SITE)
W !!,"Location contact: ",$S($L(NOISINFO):NOISINFO,1:"unavailable")
I $L(SITEINFO) W !,SITEINFO
I $L(IRMINFO) W !,"IRM Chief: ",IRMINFO
I $L(APINFO) W !,"ADPAC: ",APINFO
Q
;
CPHONE(CALL) ; $$(call) -> phone # of contact
N CONTACT,PHONE
S CONTACT=+$P($G(^FSCD("CALL",CALL,0)),U,6)
I 'CONTACT Q ""
S PHONE=$P($G(^VA(200,CONTACT,.13)),U,2)
I '$L(PHONE),CONTACT=$P($G(^FSC("SITE",+$P(^FSCD("CALL",CALL,0),U,5),0)),U,6) S PHONE=$S($L($P($G(^(0)),U,7)):$P(^(0),U,7),1:$P($G(^(0)),U,8))
Q PHONE
;
PRIORITY(USER) ; $$(user) -> preferred edit
N DEF,NUM,VALUE S DEF=";6T",VALUE=$$PRIORITY^FSCEUD(USER)
I '$L($P(VALUE,U,2)) Q DEF
I $P(VALUE,U)="S" S NUM=+$O(^FSC("PRI","B",$P(VALUE,U,2),0)) I NUM Q DEF_"///`"_NUM
Q DEF_"//"_$P(VALUE,U,2)
;
HOURS(USER) ; $$(user) -> preferred hours default
Q ";83T"
;
CDATE(USER) ; $$(user) -> preferred close date default
Q ";82T//TODAY"
;
FUNC(USER) ; $$(user) -> preferred functional area default
Q ";8T//"_$$VALUE^FSCGET($P(^FSC("SPEC",DUZ,0),U,4),7105.2,4)
;
TASK(USER) ; $$(user) -> preferred task default
Q ";9T//PROBLEM RESOLUTION"
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCELS 4505 printed Dec 13, 2024@02:17:36 Page 2
FSCELS ;SLC/STAFF-NOIS Edit Log Setup ;8/30/97 17:03
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
NEW(SITE,CALLNUM) ; from FSCEL
+1 NEW ASK,DA,DIE,DR,SITE0,STUFF
+2 SET SITE0=^FSC("SITE",SITE,0)
+3 SET DA=CALLNUM
SET DIE="^FSCD(""CALL"","
SET (ASK,DR,STUFF)=""
+4 DO STRING($$MOD(DUZ),.STUFF,.ASK)
+5 DO STRING($$SUBJECT(DUZ),.STUFF,.ASK)
+6 SET ASK=ASK_";30Problem Description"
+7 DO STRING($$CONTACT(SITE0,DUZ),.STUFF,.ASK)
+8 DO STRING($$PRIORITY(DUZ),.STUFF,.ASK)
+9 DO STRING($$SPEC(DUZ),.STUFF,.ASK)
+10 IF $$PATCH^FSCEUD(DUZ)="P"
DO STRING(";7T",.STUFF,.ASK)
+11 IF $$SUB^FSCEUD(DUZ)="P"
DO STRING(";S Y=$$SUB^FSCEU(DA);@1;3.2T;@2",.STUFF,.ASK)
+12 IF $$KEYWORDS^FSCEUD(DUZ)="P"
DO STRING(";1.5T",.STUFF,.ASK)
+13 SET DR=DR_STUFF_ASK
IF '$LENGTH(DR)
QUIT
+14 IF $EXTRACT(DR)=";"
SET DR=$EXTRACT(DR,2,245)
+15 LOCK +^FSCD("CALL",CALLNUM):30
IF '$TEST
DO SOMEONE^FSCLMPE1
QUIT
+16 DO ^DIE
+17 LOCK -^FSCD("CALL",CALLNUM)
+18 DO PICKUP^FSCES(CALLNUM)
+19 QUIT
+20 ;
RECON(SITE,CALLNUM) ; from FSCEL
+1 NEW ASK,DA,DIE,DR,SITE0,STUFF
+2 SET SITE0=^FSC("SITE",SITE,0)
+3 SET DA=CALLNUM
SET DIE="^FSCD(""CALL"","
SET (ASK,DR,STUFF)=""
+4 DO STRING($$CONTACT(SITE0,DUZ),.STUFF,.ASK)
+5 SET DR=DR_STUFF_ASK
IF '$LENGTH(DR)
QUIT
+6 IF $EXTRACT(DR)=";"
SET DR=$EXTRACT(DR,2,245)
+7 LOCK +^FSCD("CALL",CALLNUM):30
IF '$TEST
DO SOMEONE^FSCLMPE1
QUIT
+8 DO ^DIE
+9 LOCK -^FSCD("CALL",CALLNUM)
+10 QUIT
+11 ;
CLOSE(CALLNUM,OK) ; from FSCEL, FSCLMPE1
+1 NEW ASK,DA,DIE,DR,STUFF
SET OK=1
+2 SET DA=CALLNUM
SET DIE="^FSCD(""CALL"","
SET DR="81///`"_DUZ_";122///NOW"
SET ASK=";80"
SET STUFF=""
+3 DO STRING($$HOURS(DUZ),.STUFF,.ASK)
+4 DO STRING($$CDATE(DUZ),.STUFF,.ASK)
+5 DO STRING($$FUNC(DUZ),.STUFF,.ASK)
+6 DO STRING($$TASK(DUZ),.STUFF,.ASK)
+7 SET DR=DR_STUFF_ASK
+8 LOCK +^FSCD("CALL",CALLNUM):30
IF '$TEST
DO SOMEONE^FSCLMPE1
QUIT
+9 DO ^DIE
+10 LOCK -^FSCD("CALL",CALLNUM)
+11 IF $DATA(DTOUT)
SET OK=0
+12 QUIT
+13 ;
STRING(VALUE,STUFF,ASK) ; from FSCED
+1 IF VALUE["///"
SET STUFF=STUFF_VALUE
QUIT
+2 SET ASK=ASK_VALUE
+3 QUIT
+4 ;
PH(PERSON) ; $$(person) -> phone # from file 200
+1 QUIT $PIECE($GET(^VA(200,PERSON,.13)),U,2)
+2 ;
MOD(USER) ; $$(user) -> preferred module default
+1 NEW DEF,NUM,VALUE
SET DEF=";3T"
SET VALUE=$$MOD^FSCEUD(USER)
+2 IF '$LENGTH($PIECE(VALUE,U,2))
QUIT DEF
+3 IF $PIECE(VALUE,U)="S"
SET NUM=+$ORDER(^FSC("MOD","B",$PIECE(VALUE,U,2),0))
IF NUM
QUIT DEF_"///`"_NUM
+4 QUIT DEF_"//"_$PIECE(VALUE,U,2)
+5 ;
SPEC(USER) ; $$(user) -> preferred specialist default
+1 NEW DEF,VALUE
SET DEF=";5T"
SET VALUE=$$SPEC^FSCEUD(USER)
+2 IF $PIECE(VALUE,U)="I"
QUIT ""
+3 IF '$LENGTH($PIECE(VALUE,U,2))
QUIT DEF
+4 IF $PIECE(VALUE,U)="S"
IF DUZ=$PIECE(VALUE,U,2)
QUIT DEF_"///`"_DUZ
+5 QUIT DEF_"//"_$$VALUE^FSCGET($PIECE(VALUE,U,2),7100,5)
+6 ;
SUBJECT(USER) ; $$(user) -> preferred subject default
+1 NEW DEF,VALUE
SET DEF=";1T"
SET VALUE=$$SUBJECT^FSCEUD(USER)
+2 IF '$LENGTH($PIECE(VALUE,U,2))
QUIT DEF
+3 IF $PIECE(VALUE,U)="S"
QUIT DEF_"///"_$PIECE(VALUE,U,2)
+4 QUIT DEF_"//"_$PIECE(VALUE,U,2)
+5 ;
CONTACT(SITE0,USER) ; $$(site zero node,user) -> preferred site contact default
+1 NEW CONTACT,DEF,DEF1,PHONE
+2 SET DEF=";D CINFO^FSCELS(DA);2.1T;H .1;2.2T//^S X=$$CPHONE^FSCELS(DA)"
+3 SET CONTACT=$$CONTACT^FSCEUD(SITE0,USER)
+4 IF '$LENGTH($PIECE(CONTACT,U,2))
QUIT DEF
+5 SET DEF1=";D CINFO^FSCELS(DA);2.1T//"_$PIECE(CONTACT,U,2)_";H .1;2.2T//^S X=$$CPHONE^FSCELS(DA)"
+6 SET PHONE=$$PHONE^FSCEUD(SITE0,USER)
+7 IF '$LENGTH($PIECE(PHONE,U,2))
QUIT DEF1
+8 IF $PIECE(CONTACT,U)="S"
IF $PIECE(PHONE,U)="S"
QUIT ";2.1T///`"_$PIECE(SITE0,U,6)_";2.2T///"_$PIECE(PHONE,U,2)
+9 QUIT DEF1
+10 ;
CINFO(CALL) ;
+1 NEW APINFO,IRMINFO,MOD,NOISINFO,SITE,SITEINFO
+2 SET SITE=$PIECE($GET(^FSCD("CALL",CALL,0)),U,5)
SET MOD=$PIECE($GET(^(0)),U,8)
+3 IF 'SITE
QUIT
+4 SET NOISINFO=$$NOISINFO^FSCLMPOC(SITE)
SET IRMINFO=$$IRMINFO^FSCLMPOC(SITE)
SET APINFO=$$APINFO^FSCLMPOC(SITE,MOD)
SET SITEINFO=$$SITEINFO^FSCLMPOC(SITE)
+5 WRITE !!,"Location contact: ",$SELECT($LENGTH(NOISINFO):NOISINFO,1:"unavailable")
+6 IF $LENGTH(SITEINFO)
WRITE !,SITEINFO
+7 IF $LENGTH(IRMINFO)
WRITE !,"IRM Chief: ",IRMINFO
+8 IF $LENGTH(APINFO)
WRITE !,"ADPAC: ",APINFO
+9 QUIT
+10 ;
CPHONE(CALL) ; $$(call) -> phone # of contact
+1 NEW CONTACT,PHONE
+2 SET CONTACT=+$PIECE($GET(^FSCD("CALL",CALL,0)),U,6)
+3 IF 'CONTACT
QUIT ""
+4 SET PHONE=$PIECE($GET(^VA(200,CONTACT,.13)),U,2)
+5 IF '$LENGTH(PHONE)
IF CONTACT=$PIECE($GET(^FSC("SITE",+$PIECE(^FSCD("CALL",CALL,0),U,5),0)),U,6)
SET PHONE=$SELECT($LENGTH($PIECE($GET(^(0)),U,7)):$PIECE(^(0),U,7),1:$PIECE($GET(^(0)),U,8))
+6 QUIT PHONE
+7 ;
PRIORITY(USER) ; $$(user) -> preferred edit
+1 NEW DEF,NUM,VALUE
SET DEF=";6T"
SET VALUE=$$PRIORITY^FSCEUD(USER)
+2 IF '$LENGTH($PIECE(VALUE,U,2))
QUIT DEF
+3 IF $PIECE(VALUE,U)="S"
SET NUM=+$ORDER(^FSC("PRI","B",$PIECE(VALUE,U,2),0))
IF NUM
QUIT DEF_"///`"_NUM
+4 QUIT DEF_"//"_$PIECE(VALUE,U,2)
+5 ;
HOURS(USER) ; $$(user) -> preferred hours default
+1 QUIT ";83T"
+2 ;
CDATE(USER) ; $$(user) -> preferred close date default
+1 QUIT ";82T//TODAY"
+2 ;
FUNC(USER) ; $$(user) -> preferred functional area default
+1 QUIT ";8T//"_$$VALUE^FSCGET($PIECE(^FSC("SPEC",DUZ,0),U,4),7105.2,4)
+2 ;
TASK(USER) ; $$(user) -> preferred task default
+1 QUIT ";9T//PROBLEM RESOLUTION"