VistA-WorldVistAEHR/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLSPAR.m

57 lines
2.1 KiB
Mathematica

SPNLSPAR ;ISC-SF/RAH SITE PARAMETERS EDIT ;4/12/96 09:52
V ;;2.0;Spinal Cord Dysfunction;**10**;01/02/1997
EN1 ; Entry for Changing all fields except Nat'l Registry.
S SPNLERR=""
D SETFACS I SPNLERR D ERRMSG G END
I '$D(^SPNL(154.91,1,0)) D SETDEFS I SPNLERR D ERRMSG G END
S DA=1,DR="[SPNL SCD SITE PARAMETERS]",DIE="^SPNL(154.91," D ^DIE K DIE,DA,DR
D END
Q
SETFACS ;
K SPNL
S DIC=4.3,DR=217,DA=1,DIQ(0)="EI",DIQ="SPNL" D EN^DIQ1 K DIC,DIQ,DA,DR
I '$D(SPNL(4.3,1,217,"E")) S SPNLERR="1^KERNEL SITE PARAMETER ERROR" G SETFEND
S SPNLFNAM=SPNL(4.3,1,217,"E")
S DIC=4,DA=SPNL(4.3,1,217,"I"),DR=99,DIQ(0)="EI",DIQ="SPNL" D EN^DIQ1 K DIC,DIQ,DR
I '$D(SPNL(4,DA,99,"E")) S SPNLERR="2^NO FACILITY NUM IN INSTITUTION FILE" G SETFEND
S SPNLFAC=+$E(SPNL(4,DA,99,"E"),1,3)
SETFEND ;
K SPNL
Q
SETDEFS ;
I '$D(SPNLFAC)!'$D(SPNLFNAM) D SETFACS
S DIC="^SPNL(154.91,",DIC(0)="LM",DLAYGO=154.91,X=SPNLFAC,DINUM=1 D ^DIC K DIC,DLAYGO,DINUM
I Y=-1 S SPNLERR="1 UNABLE TO CREATE SITE PARAMETER RECORD" D ERRMSG Q
S SPNLXREC=1000,SPNLXRUN=240,SPNLFREQ="1W"
S SPNLSEEN="180D",SPNLEXAM="180D"
S SPNLXMY="S.SPNN SCD MAIL RECEIVER@IPDB-CHICAGO.VA.GOV"
S DR=".01///^S X=SPNLFAC;4///^S X=SPNLSEEN;5///^S X=SPNLEXAM"
S DA=+Y,DIE="^SPNL(154.91," D ^DIE K DIE
I $D(Y) S SPNLERR="2 UNABLE TO ADD DEFAULT SITE PARMETER VALUES" D ERRMSG Q
Q
EN2 ; Entry for Changing only the National Registry Destination
I '$D(^SPNL(154.91,1,0)) D SETDEFS Q:SPNLERR
S DA=1,DR="[SPNL SCD NATIONAL REGISTRY]",DIE="^SPNL(154.91," D ^DIE K DIE
D END
Q
ERRMSG ;
I $D(ZTQUEUED) G ERR2
W !!,"SCD SITE PARAMETER FILE ERROR"
W !!,"ERROR IS: ",$S(SPNLERR="":"SPNLERR IS NULL",SPNLERR'="":SPNLERR)
Q
ERR2 ;
K X,% D NOW^%DTC S SPNLDT=%
S XMSUB="SCD SITE PARAMETER ERROR",XMY("G.SPNL SCD COORDINATOR")=""
S SPNLFAC=$P(^DIC(4,$P(^XMB(1,1,"XUS"),U,17),99),U,1),SPNLFAC=+$E(SPNLFAC,1,3)
S SPNLFNAM=$P(^DIC(4,$P(^XMB(1,1,"XUS"),U,17),0),U,1)
S SPNLTEXT(1)="H$ "_SPNLFAC_"^"_SPNLFNAM
S SPNLTEXT(2)="E$ "_SPNLDT_"^"_SPNLERR
S XMDUZ=.5,XMTEXT="SPNLTEXT("
S:'$D(DTIME) DTIME=300 D ^XMD
K XMDUZ,XMTEXT,XMSUB,XMY
Q
END ;
K SPNLDT,SPNLEXAM,SPNLFAC,SPNLFNAM,SPNLFREQ,SPNLSEEN
K SPNLTEXT,SPNLXMY,SPNLXREC,SPNLXRUN
Q