Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSOSPMSP

PSOSPMSP.m

Go to the documentation of this file.
  1. PSOSPMSP ;BIRM/MFR - State Prescription Monitoring Program - State Parameters ;09/04/12
  1. ;;7.0;OUTPATIENT PHARMACY;**408,451,625,630,696,724**;DEC 1997;Build 3
  1. ;
  1. EN ; - Menu option entry point
  1. N PSOASVER,PSOINCNV,PSOREPFQ,PSOVMSLD,PSOUNXLD,PSOPFIX,PSOEXT,PSOFTPIP,PSOTXRTS,Y
  1. N PSOFTPUS,PSOFTPPN,PSOFTPDR,PSOTXMOD,PSOQUIT,DIC,DIR,DIRUT,DTOUT,DUOUT,LST,DELDIR
  1. N PSOZRVER,Z,PSOSNDPR,PSOZRDIV
  1. ;
  1. D FULL^VALM1 W !
  1. ;
  1. W ! K DIC S DIC("A")="Select STATE: ",DIC="^DIC(5,",DIC(0)="QOEAM"
  1. I $O(^PS(58.41,0)) S DIC("B")=$O(^PS(58.41,0))
  1. K STATEIEN D ^DIC I X=""!(X="^")!$D(DUOUT)!$D(DTOUT) G END
  1. K DIC("A") G:Y<0 EN S STATEIEN=+Y
  1. ;
  1. D DISPLAY(STATEIEN)
  1. ;
  1. ; Checking the Security Key PSO SPMP ADMIN for Editing the Parameters
  1. I '$D(^XUSEC("PSO SPMP ADMIN",DUZ)) D G EN
  1. . W !,"The security key PSO SPMP ADMIN is required for editing the Parameters." W $C(7)
  1. ;
  1. D LOAD(STATEIEN) S PSOQUIT=0
  1. ;
  1. ASAPVER ; - ASAP Version
  1. S X=$$ASAPVER^PSOSPMU2("A","R",0,PSOASVER,1,1) I X="^" G EXIT ;Zero Report adding "R"
  1. I X["^"!(X="@") G @$$GOTO(X,"ASAPVER")
  1. S PSOASVER=X D CHANGED(STATEIEN,"ASAPVER",PSOASVER)
  1. ;
  1. TRXRTS ; - Auto Transmit Returns (ASAP 1995 only)
  1. I PSOASVER'="1995" S PSOTXRTS="" G ZEROVER ;Zero Report changed from 'G INCNVET' to 'G ZEROVER'
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,12" S:$G(PSOTXRTS)'="" DIR("B")=$S(PSOTXRTS:"YES",1:"NO")
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"TRXRTS")
  1. S PSOTXRTS=Y D CHANGED(STATEIEN,"TRXRTS",PSOTXRTS)
  1. ;
  1. ZEROVER ; - Zero Report ASAP Version
  1. S X=$$ASAPVER^PSOSPMU2("A","Z",0,PSOZRVER,0,1) I X="^" G EXIT
  1. I X["^"!(X="@") G @$$GOTO(X,"ZEROVER")
  1. S PSOZRVER=X D CHANGED(STATEIEN,"ZEROVER",PSOZRVER)
  1. ;
  1. INCNVET ; Include Non-Veteran Patients
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,2" S DIR("B")=$S(+$G(PSOINCNV):"YES",1:"NO")
  1. D ^DIR I $D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"INCNVET")
  1. S PSOINCNV=Y D CHANGED(STATEIEN,"INCNVET",PSOINCNV)
  1. ;
  1. REPFRQ ; Reporting Frequency
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,3" S:$G(PSOREPFQ) DIR("B")=PSOREPFQ
  1. D ^DIR I $D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"REPFRQ")
  1. I Y'?1.2N W !,"Invalid Frequency"
  1. S PSOREPFQ=Y D CHANGED(STATEIEN,"REPFRQ",PSOREPFQ)
  1. ;
  1. VMSLDIR ; - Open VMS Local Directory
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,4" S:$G(PSOVMSLD)'="" DIR("B")=PSOVMSLD
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"VMSLDIR")
  1. S PSOVMSLD=Y D CHANGED(STATEIEN,"VMSLDIR",PSOVMSLD)
  1. ;
  1. UNXLDIR ; - Unix/Linux Local Directory
  1. K DIR,DIRUT,DTOUT,NEWDIR,PSOVER
  1. I '$G(DELDIR),$G(PSOUNXLD)="" S PSOUNXLD=$$LINUXDIR^PSOSPMU1()
  1. S DIR(0)="58.41,15" S:$G(PSOUNXLD)'="" DIR("B")=PSOUNXLD
  1. S DELDIR=0 D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) S:X="@" DELDIR=1 G @$$GOTO(X,"UNXLDIR")
  1. I $G(Y)'="",$E(Y,$L(X))'="/" S Y=Y_"/"
  1. S PSOUNXLD=Y D CHANGED(STATEIEN,"UNXLDIR",PSOUNXLD)
  1. ;
  1. S PSOVER=$$UP^XLFSTR($$VERSION^%ZOSV(1))
  1. I PSOUNXLD'="",$$OS^%ZOSV()="UNIX",(PSOVER["CACHE")!(PSOVER["IRIS") D ;PSO*7*630
  1. . I '$$DIREXIST^PSOSPMU1(PSOUNXLD) D
  1. . . W ! S DIR("A",1)="The directory above could not be found."
  1. . . S DIR("A",2)=""
  1. . . S DIR("A")="Would you like to create it now",DIR(0)="Y",DIR("B")="N"
  1. . . D ^DIR I $G(DTOUT)!$G(DUOUT)!'Y W ! Q
  1. . . D MAKEDIR^PSOSPMU1(PSOUNXLD) S NEWDIR=1 W !
  1. . I '$$DIREXIST^PSOSPMU1(PSOUNXLD) D
  1. . . W !!,"Warning: "_$S($G(NEWDIR):"The directory could not be created.",1:"The directory could not be found."),!,$C(7)
  1. ;
  1. FILEPFIX ; - File name Prefix
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,5" K DIR("B") S:$G(PSOPFIX)'="" DIR("B")=PSOPFIX
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"FILEPFIX")
  1. I Y[" " W ?40,"No spaces allowed.",$C(7) G FILEPFIX
  1. S PSOPFIX=Y D CHANGED(STATEIEN,"FILEPFIX",PSOPFIX)
  1. ;
  1. FILEEXT ; File Extension
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,6" S:$G(PSOEXT)'="" DIR("B")=PSOEXT
  1. D ^DIR I $D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"FILEEXT")
  1. S PSOEXT=Y D CHANGED(STATEIEN,"FILEEXT",PSOEXT)
  1. ;
  1. RENAME ; Rename File after upload?
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,17" S:$G(PSORENAM)'="" DIR("B")=$S(PSORENAM:"YES",1:"NO")
  1. D ^DIR I $D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"RENAME")
  1. S PSORENAM=Y D CHANGED(STATEIEN,"RENAME",PSORENAM)
  1. ;
  1. FTPIP ; - State Server FTP IP Address
  1. K DIR,DIRUT,DTOUT,PV
  1. S DIR(0)="58.41,7" S:$G(PSOFTPIP)'="" DIR("B")=PSOFTPIP
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"FTPIP")
  1. S PSOFTPIP=Y D CHANGED(STATEIEN,"FTPIP",PSOFTPIP)
  1. ;
  1. FTPUSER ; - State Server FTP Username
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,8" S:$G(PSOFTPUS)'="" DIR("B")=PSOFTPUS
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"FTPUSER")
  1. S PSOFTPUS=Y D CHANGED(STATEIEN,"FTPUSER",PSOFTPUS)
  1. ;
  1. FTPPORT ; - State Server FTP Password
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,9" S:$G(PSOFTPPN)'="" DIR("B")=PSOFTPPN
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"FTPPORT")
  1. S PSOFTPPN=Y D CHANGED(STATEIEN,"FTPPORT",PSOFTPPN)
  1. ;
  1. FTPDIR ; - State Server FTP Remote Directory
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,10" S:$G(PSOFTPDR)'="" DIR("B")=PSOFTPDR
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"FTPDIR")
  1. S PSOFTPDR=Y D CHANGED(STATEIEN,"FTPDIR",PSOFTPDR)
  1. ;
  1. TRXMODE ; - Transmission Mode (A - Automatic / M - Manual)
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,13",DIR("B")=PSOTXMOD
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"TRXMODE")
  1. S PSOTXMOD=Y D CHANGED(STATEIEN,"TRXMODE",PSOTXMOD)
  1. ;
  1. SNDPRMT ; - Send Export State Parameter
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,21",DIR("B")=PSOSNDPR
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"SNDPRMT")
  1. S PSOSNDPR=Y D CHANGED(STATEIEN,"SNDPRMT",PSOSNDPR)
  1. I PSOSNDPR>0 D
  1. . W !,"NOTE: You have selected a parameter that includes sending to state of patient"
  1. . W !,"delivery. Only states that have been setup in your SPMP state parameters"
  1. . W !,"will receive data. Enter a help desk ticket if you have questions"
  1. . W !,"or need assistance.",!
  1. . K DIR S DIR("A")="Enter <RETURN> to continue.",DIR(0)="FO",DIR("T")=DTIME D ^DIR
  1. ;
  1. ZERODIV ; - Zero Report MbM default division P696
  1. ;Display this parameter only if Send Export State Parameter = 2
  1. I $$GET1^DIQ(58.41,STATEIEN,21,"I")'=2 G EXIT
  1. K DIR,DIRUT,DTOUT
  1. S DIR(0)="58.41,22" S:$G(PSOZRDIV)'="" DIR("B")=PSOZRDIV ;P724
  1. D ^DIR I X'="",$D(DIRUT)!$D(DTOUT) G @$$GOTO(X,"ZERODIV")
  1. S PSOZRDIV=Y D CHANGED(STATEIEN,"ZERODIV",PSOZRDIV)
  1. ;
  1. EXIT ; Exit
  1. ;
  1. END S VALMBCK="R" Q
  1. ;
  1. DISPLAY(STATE) ; - Displays the current Parameters
  1. N ZNODE,FNODE,F1NODE,X
  1. N ONENODE ;Zero Report node
  1. S ZNODE=$G(^PS(58.41,STATE,0)),FNODE=$G(^PS(58.41,STATE,"FILE")),F1NODE=$G(^PS(58.41,STATE,"FILE1"))
  1. S ONENODE=$G(^PS(58.41,STATE,1))
  1. W ! I ZNODE="" Q
  1. W !?5,"ASAP VERSION : ",$P(ZNODE,"^",2)
  1. I $P(ZNODE,"^",2)="1995" D
  1. . W !?5,"TRANSMIT RETURN TO STOCK : ",$S($P(ZNODE,"^",5):"YES",1:"NO")
  1. W !?5,"ZERO REPORT ASAP VERSION : ",$P(ONENODE,"^",1)
  1. W !?5,"INCLUDE NON-VETERAN PATIENTS: ",$S($P(ZNODE,"^",3):"YES",1:"NO")
  1. W !?5,"REPORTING FREQUENCY IN DAYS : ",$P(ZNODE,"^",4)
  1. W !?5,"OPEN VMS LOCAL DIRECTORY : ",$P(FNODE,"^",1)
  1. W !?5,"UNIX/LINUX LOCAL DIRECTORY : ",$P(F1NODE,"^",1)
  1. W !?5,"FILE NAME PREFIX : ",$P(FNODE,"^",2)
  1. W !?5,"FILE EXTENSION : ",$P(FNODE,"^",3)
  1. W !?5,"RENAME FILE AFTER UPLOAD : ",$S($P(ZNODE,"^",7):"YES",1:"NO")
  1. W !?5,"STATE SFTP SERVER IP ADDRESS: ",$P(FNODE,"^",4)
  1. W !?5,"STATE SFTP SERVER USERNAME : ",$P(FNODE,"^",5)
  1. W !?5,"STATE SFTP SERVER PORT # : ",$P(FNODE,"^",6)
  1. W !?5,"STATE SFTP SERVER DIRECTORY : ",$P(FNODE,"^",7)
  1. W !?5,"SFTP TRANSMISSION MODE : ",$$GET1^DIQ(58.41,STATE,13)
  1. W !?5,"SEND EXPORT STATE PARAMETER : ",$$GET1^DIQ(58.41,STATE,21)
  1. I $$GET1^DIQ(58.41,STATE,21,"I")=2 W !?5,"ZERO REPORT DEFAULT DIVISION: ",$$GET1^DIQ(59,$P(ONENODE,"^",2),.06)
  1. W !
  1. Q
  1. ;
  1. GOTO(INPUT,HOME) ; - Directed up-arrow
  1. ; Input: INPUT - User input (e.g., "@", "^STATE", etc...)
  1. ; HOME - Prompt where the user typed the input
  1. ;Output: $$GOTO - GoTo Prompt
  1. N GOTO,I,TAG,TRGT,OK2DEL
  1. I INPUT="@",HOME="ASAPVER",$D(^PS(58.41,STATEIEN)) D Q GOTO
  1. . W ! S DIR(0)="Y",DIR("B")="NO",DIR("A")="DELETE SPMP STATE PARAMETERS FOR "_$$GET1^DIQ(5,STATEIEN,.01)
  1. . D ^DIR I $D(DIRUT)!$D(DTOUT)!(Y=0) S GOTO=HOME W ! Q
  1. . N DIK,DA S DIK="^PS(58.41,",DA=STATEIEN D ^DIK S GOTO="EN"
  1. ;
  1. S OK2DEL="TRXRTS^FTPDIR^FILEPFIX^VMSLDIR^UNXLDIR^WINLDIR^FTPPORT^ZEROVER^ZERODIV"
  1. I INPUT="@",OK2DEL'[HOME D Q HOME
  1. . W " Cannot delete field",$C(7)
  1. I INPUT="@" D Q HOME
  1. . S:HOME="FTPDIR" PSOFTPDR="" S:HOME="FILEPFIX" PSOPFIX=""
  1. . S:HOME="VMSLDIR" PSOVMSLD="" S:HOME="UNXLDIR" PSOUNXLD=""
  1. . S:HOME="FTPPORT" PSOFTPPN="" S:HOME="ZEROVER" PSOZRVER=""
  1. . S:HOME="ZERODIV" PSOZRDIV=""
  1. . D SAVE(STATEIEN,HOME,"")
  1. ;
  1. I $P(INPUT,"^",2)="" S PSOQUIT=1 Q "EXIT"
  1. ;
  1. S TRGT=$$UP^XLFSTR($P(INPUT,"^",2))
  1. S TAG(1)="ASAP VERSION^ASAPVER"
  1. S:PSOASVER="1995" TAG(2)="TRANSMIT RETURN TO STOCK^TRXRTS"
  1. S TAG(3)="ZERO REPORT ASAP VERSION^ZEROVER" ;adding Zero Report Version and renumber
  1. S TAG(4)="INCLUDE NON-VETERAN PATIENTS^INCNVET"
  1. S TAG(5)="REPORTING FREQUENCY IN DAYS^REPFRQ"
  1. S TAG(6)="OPEN VMS LOCAL DIRECTORY^VMSLDIR"
  1. S TAG(7)="UNIX/LINUX LOCAL DIRECTORY^UNXLDIR"
  1. S TAG(8)="FILE NAME PREFIX^FILEPFIX"
  1. S TAG(9)="FILE EXTENSION^FILEEXT"
  1. S TAG(10)="RENAME FILE AFTER UPLOAD^RENAME"
  1. S TAG(11)="STATE SFTP SERVER IP ADDRESS^FTPIP"
  1. S TAG(12)="STATE SFTP SERVER USERNAME^FTPUSER"
  1. S TAG(13)="STATE SFTP SERVER PORT #^FTPPORT"
  1. S TAG(14)="STATE SFTP SERVER DIRECTORY^FTPDIR"
  1. S TAG(15)="SFTP TRANSMISSION MODE^TRXMODE"
  1. S TAG(16)="SEND EXPORT STATE PARAMETER^SNDPRMT"
  1. S:$$GET1^DIQ(58.41,STATE,21,"I")=2 TAG(17)="ZERO REPORT DEFAULT DIVISION^"_$$GET1^DIQ(59,ZERODIV,.06)
  1. ;
  1. S GOTO=HOME,I=""
  1. F S I=$O(TAG(I)) Q:'I S TAG=TAG(I) I $E($P(TAG,"^"),1,$L(TRGT))=TRGT S GOTO=$P(TAG,"^",2) Q
  1. ;
  1. Q GOTO
  1. ;
  1. LOAD(STATE) ; Loading Factory/Division/User preferences
  1. ;Input : STATE - Pointer to STATE file (#5)
  1. ;Output: PSOASVER - ASAP Version
  1. ; PSOTXRTS - Transmit Return To Stock fills
  1. ; PSOINCNV - Exclude Non-Veteran Patients
  1. ; PSOREPFQ - Reporting Frequency
  1. ; PSOVMSLD - Open VMS Local Directory
  1. ; PSOUNXLD - Unix/Linux Local Directory
  1. ; PSOPFIX - File Name Prefix
  1. ; PSOEXT - File Extension (.TXT or .DAT)
  1. ; PSORENAM - Rename File After Upload
  1. ; PSOZRVER - Send Zero Report
  1. ; PSOFTPIP - State Server FTP IP Address
  1. ; PSOFTPUS - State Server FTP Username
  1. ; PSOFTPPN - State Server FTP Password
  1. ; PSOFTPDR - State Server FTP Directory
  1. ; PSOTXMOD - Transmission Mode ('A' or 'M')
  1. ; PSOSNDPR - Send Export State Parameter
  1. ; PSOZRDIV - Zero Reporting Meds by Mail Division
  1. K PSOASVER,PSOINCNV,PSOREPFQ,PSOVMSLD,PSOUNXLD,PSOWINLD,PSOPFIX,PSOEXT,PSORENAM,PSOFTPIP,PSOFTPUS
  1. K PSOFTPPN,PSOFTPDR
  1. K PSOZRVER,PSOZRDIV
  1. ;
  1. N X,ZNODE,FNODE,F1NODE,LINE,ONENODE
  1. ;
  1. ; - Defaults
  1. S PSOASVER="4.2"
  1. S PSOTXRTS="0"
  1. S PSOINCNV=0
  1. S PSOREPFQ="1"
  1. S PSOVMSLD=""
  1. S PSOUNXLD=""
  1. S PSOPFIX=""
  1. S PSOEXT=".DAT"
  1. S PSORENAM="YES"
  1. S PSOZRVER=""
  1. S PSOZRDIV=""
  1. S PSOFTPIP=""
  1. S PSOFTPUS=""
  1. S PSOFTPPN=""
  1. S PSOFTPDR=""
  1. S PSOTXMOD="A"
  1. S PSOSNDPR="0"
  1. ;
  1. ; - State's parameters
  1. I $D(^PS(58.41,STATE,0)) D
  1. . S ZNODE=$G(^PS(58.41,STATE,0)) I $P(ZNODE,"^",1)'=STATE Q
  1. . S FNODE=$G(^PS(58.41,STATE,"FILE")),F1NODE=$G(^PS(58.41,STATE,"FILE1"))
  1. . S ONENODE=$G(^PS(58.41,STATE,1)) ;Zero Report node
  1. . S:$P(ZNODE,"^",2)'="" PSOASVER=$P(ZNODE,"^",2)
  1. . S:$P(ZNODE,"^",3)'="" PSOINCNV=$P(ZNODE,"^",3)
  1. . S:$P(ONENODE,"^",1)'="" PSOZRVER=$P(ONENODE,"^",1)
  1. . S:$P(ONENODE,"^",2)'="" PSOZRDIV=$$GET1^DIQ(59,$P(ONENODE,"^",2),.06)
  1. . S:$P(ZNODE,"^",4)'="" PSOREPFQ=$P(ZNODE,"^",4)
  1. . S:$P(ZNODE,"^",5)'="" PSOTXRTS=$P(ZNODE,"^",5)
  1. . S:$P(ZNODE,"^",6)'="" PSOTXMOD=$P(ZNODE,"^",6)
  1. . S:$P(ZNODE,"^",7)'="" PSORENAM=$P(ZNODE,"^",7)
  1. . S:$P(ZNODE,"^",8)'="" PSOSNDPR=$P(ZNODE,"^",8)
  1. . S:$P(FNODE,"^",1)'="" PSOVMSLD=$P(FNODE,"^",1)
  1. . S:$P(FNODE,"^",2)'="" PSOPFIX=$P(FNODE,"^",2)
  1. . S:$P(FNODE,"^",3)'="" PSOEXT=$P(FNODE,"^",3)
  1. . S:$P(FNODE,"^",4)'="" PSOFTPIP=$P(FNODE,"^",4)
  1. . S:$P(FNODE,"^",5)'="" PSOFTPUS=$P(FNODE,"^",5)
  1. . S:$P(FNODE,"^",6)'="" PSOFTPPN=$P(FNODE,"^",6)
  1. . S:$P(FNODE,"^",7)'="" PSOFTPDR=$P(FNODE,"^",7)
  1. . S:$P(F1NODE,"^",1)'="" PSOUNXLD=$P(F1NODE,"^",1)
  1. Q
  1. ;
  1. CHANGED(STATE,FIELD,VALUE) ; - If field was change Automatically Invokes SAVE
  1. ;Input : STATE - Pointer to STATE file (#5)
  1. ; FIELD - Field ID (Internal)
  1. ; VALUE - Field Value
  1. N CHANGED,ZNODE,FNODE,F1NODE,LINE
  1. ;
  1. S CHANGED=0
  1. ; - Saved Division's parameters
  1. S ZNODE=$G(^PS(58.41,STATE,0)),FNODE=$G(^PS(58.41,STATE,"FILE")),F1NODE=$G(^PS(58.41,STATE,"FILE1"))
  1. S ONENODE=$G(^PS(58.41,STATE,1)) ;Zero Report node
  1. ;
  1. I FIELD="ASAPVER",VALUE'=$P(ZNODE,"^",2) S CHANGED=1
  1. I FIELD="TRXRTS",VALUE'=$P(ZNODE,"^",5) S CHANGED=1
  1. I FIELD="ZEROVER",VALUE'=$P(ONENODE,"^",1) S CHANGED=1
  1. I FIELD="ZERODIV",VALUE'=$P(ONENODE,"^",2) S CHANGED=1
  1. I FIELD="INCNVET",VALUE'=$P(ZNODE,"^",3) S CHANGED=1
  1. I FIELD="VMSLDIR",VALUE'=$P(FNODE,"^",1) S CHANGED=1
  1. I FIELD="UNXLDIR",VALUE'=$P(F1NODE,"^",1) S CHANGED=1
  1. I FIELD="WINLDIR",VALUE'=$P(F1NODE,"^",2) S CHANGED=1
  1. I FIELD="REPFRQ",VALUE'=$P(ZNODE,"^",4) S CHANGED=1
  1. I FIELD="FILEPFIX",VALUE'=$P(FNODE,"^",2) S CHANGED=1
  1. I FIELD="FILEEXT",VALUE'=$P(FNODE,"^",3) S CHANGED=1
  1. I FIELD="RENAME",VALUE'=$P(ZNODE,"^",7) S CHANGED=1
  1. I FIELD="FTPIP",VALUE'=$P(FNODE,"^",4) S CHANGED=1
  1. I FIELD="FTPUSER",VALUE'=$P(FNODE,"^",5) S CHANGED=1
  1. I FIELD="FTPPORT",VALUE'=$P(FNODE,"^",6) S CHANGED=1
  1. I FIELD="FTPDIR",VALUE'=$P(FNODE,"^",7) S CHANGED=1
  1. I FIELD="TRXMODE",VALUE'=$P(ZNODE,"^",6) S CHANGED=1
  1. I FIELD="SNDPRMT",VALUE'=$P(ZNODE,"^",8) S CHANGED=1
  1. ;
  1. I CHANGED D SAVE(STATE,FIELD,$G(VALUE))
  1. Q
  1. ;
  1. SAVE(STATE,FIELD,VALUE) ; - Saves preferences by State
  1. ;Input : STATE - Pointer to STATE file (#5)
  1. ; FIELD - Field ID (Internal)
  1. ; VALUE - Field Value
  1. N DIE,DR,DA,LINE
  1. ;
  1. I '$D(^PS(58.41,STATE)) D
  1. . N %,DIC,DR,DA,X,DINUM,DLAYGO,DD,DO
  1. . S DIC="^PS(58.41,",(DINUM,X)=STATE,DIC(0)=""
  1. . K DD,DO D FILE^DICN K DD,DO
  1. ;
  1. I FIELD="ASAPVER" S DR="1///"_PSOASVER
  1. I FIELD="TRXRTS" S DR="12////"_PSOTXRTS
  1. I FIELD="ZEROVER" S DR="20///"_$S(PSOZRVER="":"@",1:PSOZRVER)
  1. I FIELD="ZERODIV" S DR="22////"_$S(PSOZRDIV="":"@",1:PSOZRDIV)
  1. I FIELD="INCNVET" S DR="2///"_PSOINCNV
  1. I FIELD="VMSLDIR" S DR="4////"_$S(PSOVMSLD="":"@",1:PSOVMSLD)
  1. I FIELD="UNXLDIR" S DR="15////"_$S(PSOUNXLD="":"@",1:PSOUNXLD)
  1. I FIELD="REPFRQ" S DR="3///"_PSOREPFQ
  1. I FIELD="FILEPFIX" S DR="5////"_$S(PSOPFIX="":"@",1:PSOPFIX)
  1. I FIELD="FILEEXT" S DR="6///"_PSOEXT
  1. I FIELD="RENAME" S DR="17///"_PSORENAM
  1. I FIELD="FTPIP" S DR="7///"_PSOFTPIP
  1. I FIELD="FTPUSER" S DR="8///"_PSOFTPUS
  1. I FIELD="FTPPORT" S DR="9////"_$S(PSOFTPPN="":"@",1:PSOFTPPN)
  1. I FIELD="FTPDIR" S DR="10////"_$S(PSOFTPDR="":"@",1:PSOFTPDR)
  1. I FIELD="TRXMODE" S DR="13////"_PSOTXMOD
  1. I FIELD="SNDPRMT" S DR="21////"_PSOSNDPR
  1. S DIE="^PS(58.41,",DA=STATE D ^DIE
  1. Q