TMGPSSDE ;TMG/kst/Custom version of PSSDEE ;03/25/06 ;;1.0;TMG-LIB;**1**;04/25/04 PSSDEE ;BIR/WRT-MASTER DRUG ENTER/EDIT ROUTINE ;01/21/00 ;;1.0;PHARMACY DATA MANAGEMENT;**3,5,15,16,20,22,28,32,34,33,38,57,47,68,61**;9/30/97 ;"***************************************************************** ;"* Custom version of code by Kevin Toppenberg, MD ;"* to allow customization of the code. ;"* ;"***************************************************************** ;"Reference to REACT1^PSNOUT supported by DBIA #2080 ;"Reference to $$UP^XLFSTR(X) supported by DBIA #10104 ;"Reference to $$PSJDF^PSNAPIS(P1,P3) supported by DBIA #2531 ; BEGIN set PSSFLAG=0 do ^PSSDEE2 ;"kill vars set PSSZ=1 F PSSXX=1:1 do quit:PSSFLAG . kill DA . do ASK ;" ask users all questions DONE do ^PSSDEE2 ;" kill vars kill PSSFLAG quit ; ;"================================================================= ASK W ! set DIC="^PSDRUG(" set DIC(0)="QEALMNTV" ;"query/echo/ask/learn=OK/multIndex/IntNumOK/T->searchAllIndexes/verify set DLAYGO=50 ;"force allowing adding record to file 50 set DIC("T")="" ;"present every match to the lookup value do ^DIC kill DIC if Y<0 set PSSFLAG=1 quit ; set (FLG1,FLG2,FLG3,FLG4,FLG5,FLG6,FLG7,FLAG,FLGKY,FLGOI)=0 kill ^TMP($J,"ADD") kill ^TMP($J,"SOL") ; set DA=+Y set DISPDRG=DA L +^PSDRUG(DISPDRG):0 if '$T W !,$C(7),"Another person is editing this one." quit set PSSHUIDG=1 set PSSNEW=$P(Y,"^",3) do USE do NOPE do COMMON do DEA do MF kill PSSHUIDG do DRG^PSSHUIDG(DISPDRG,PSSNEW) L -^PSDRUG(DISPDRG) kill FLG3,PSSNEW quit ; ;"================================================================= COMMON set DIE="^PSDRUG(" set DR="[PSSCOMMON]" do ^DIE quit:$data(Y)!($data(DTOUT)) W:'$data(Y) !,"PRICE PER DISPENSE UNIT: " S:'$data(^PSDRUG(DA,660)) $P(^PSDRUG(DA,660),"^",6)="" W:'$data(Y) $P(^PSDRUG(DA,660),"^",6) do DEA do CK do ASKND do OIKILL^PSSDEE1 do COMMON1 quit ; COMMON1 W !,"Just a reminder...you are editing ",$P(^PSDRUG(DISPDRG,0),"^"),"." set (PSSVVDA,DA)=DISPDRG do DOSN^PSSDOS set DA=PSSVVDA kill PSSVVDA do USE do APP do ORDITM^PSSDEE1 quit ; CK do DSPY^PSSDEE1 set FLGNDF=0 quit ; ASKND set %=-1 if $data(^XUSEC("PSNMGR",DUZ)) do . do MESSAGE^PSSDEE1 . W !!,"Do you wish to match/rematch to NATIONAL DRUG file" . set %=1 . S:FLGMTH=1 %=2 . do YN^DICN if %=0 W !,"If you answer ""yes"", you will attempt to match to NDF." G ASKND if %=2 kill X,Y quit if %<0 kill X,Y quit if %=1 do . do RSET^PSSDEE1 . do EN1^PSSUTIL(DISPDRG,1) . set X="PSNOUT" . X ^%ZOSF("TEST") . if do . . do REACT1^PSNOUT . . set DA=DISPDRG . . if $data(^PSDRUG(DA,"ND")),$P(^PSDRUG(DA,"ND"),"^",2)]"" do ONE quit ; ONE set PSNP=$G(^PSDRUG(DA,"I")) if PSNP,PSNP
1 if $data(^PSDRUG(DISPDRG,2)) DO . set PSSOR=$P(^PSDRUG(DISPDRG,2),"^",1) . if PSSOR]"" DO . . DO EN^PSSPOIDT(PSSOR) . . DO EN2^PSSHL1(PSSOR,"MUP") quit ; MFA if $P($G(^PS(59.7,1,80)),"^",2)>1 do . set PSSOR=$P(^PS(52.6,ENTRY,0),"^",11) . set PSSDD=$P(^PS(52.6,ENTRY,0),"^",2) . if PSSOR]"" do . . do EN^PSSPOIDT(PSSOR) . . do EN2^PSSHL1(PSSOR,"MUP") . . do MFDD quit ; MFS if $P($G(^PS(59.7,1,80)),"^",2)>1 do . set PSSOR=$P(^PS(52.7,ENTRY,0),"^",11) . set PSSDD=$P(^PS(52.7,ENTRY,0),"^",2) . if PSSOR]"" do . . do EN^PSSPOIDT(PSSOR) . . do EN2^PSSHL1(PSSOR,"MUP") . . do MFDD quit ; MFDD if $data(^PSDRUG(PSSDD,2)) do . set PSSOR=$P(^PSDRUG(PSSDD,2),"^",1) . if PSSOR]"" do . . do EN^PSSPOIDT(PSSOR) . . do EN2^PSSHL1(PSSOR,"MUP") quit ; OPEI if $data(^PSDRUG(DISPDRG,"ND")),$P(^PSDRUG(DISPDRG,"ND"),"^",10)]"" do . set DIE="^PSDRUG(" . set DR="28" . set DA=DISPDRG . do ^DIE quit ; DEA ; if $P($G(^PSDRUG(DISPDRG,3)),"^")=1,($P(^PSDRUG(DISPDRG,0),"^",3)[1!($P(^(0),"^",3)[2)) do DSH quit ; DSH W !!,"****************************************************************************" W !,"This entry contains a ""1"" or a ""2"" in the ""DEA, SPECIAL HDLG""",! w "field, therefore this item has been UNMARKED for CMOP transmission." W !,"****************************************************************************",! S $P(^PSDRUG(DISPDRG,3),"^")=0 kill ^PSDRUG("AQ",DISPDRG) set DA=DISPDRG N % do ^PSSREF quit