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

PSAVERA2.m

Go to the documentation of this file.
  1. PSAVERA2 ;BHM/DB - Edit previously verified invoices #2;21DEC99
  1. ;;3.0;DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**21,49**; 10/24/97
  1. ;References to ^PSDRUG( are covered by IA #2095
  1. ;
  1. ASKDRUG ;Change drug
  1. S PSAGAIN=0,PSABEFOR=PSADRG,DIC(0)="AEQMZ",DIC="^PSDRUG(" D ^DIC K DIC
  1. I $G(DTOUT)!($G(DUOUT)) S PSAOUT=1 Q
  1. S PSADJFLD="D",PSAREA="",PSASUPP=0
  1. I +Y=-1 D Q:PSASUPP!(PSAOUT)
  1. .S PSAVER=1 D SUPPLY^PSANDF Q:PSAOUT I 'PSASUPP S PSAGAIN=1 Q
  1. .S PSA50IEN=0,PSADJ=PSAREA,PSAREA=""
  1. .D RECORD
  1. G:$G(PSAGAIN) ASKDRUG
  1. S (PSA50IEN,PSADJ,PSADRG)=+Y D RECORD,VERDISP^PSAUTL4
  1. I PSANDC'="",$O(^PSDRUG("C",PSANDC,PSA50IEN,0)) D
  1. .S PSASUB=+$O(^PSDRUG("C",PSANDC,PSA50IEN,0)),$P(^PSD(58.811,PSAIEN,1,PSAIEN1,2),"^",3)=PSASUB
  1. .I '+$P($G(^PSDRUG(PSA50IEN,1,PSASUB,0)),"^",7) D DUOU^PSAVER2 Q
  1. .I +$P($G(^PSDRUG(PSA50IEN,1,PSASUB,0)),"^",7),+$P($G(^PSDRUG(PSA50IEN,1,PSASUB,0)),"^",7)'=+$P($G(^PSDRUG(PSABEFOR,1,PSASUB,0)),"^",7) D DUOU^PSAVER2
  1. W !,"Decrementing balance of "_PSABAL_" from "_$P($G(^PSDRUG(PSADRG,0)),"^")
  1. W !,"Increasing balance of "_PSANEWD_" by "_PSABAL_"."
  1. Q
  1. W !!,"Note that if you change the drug on this line item, the balances will be",!,"updated."
  1. LOCATION ;Change pharmacy location
  1. W !,"If the location is changed, the balances will be decremented from the original",!,"location, the transaction file will record the proper changes.",!
  1. LST ;List all data associated with location/drug
  1. ;get data from 58.8 & 58.81
  1. ;Show allsysnonym data from drug file.
  1. RECORD ;Add adjusted data to DA Orders file
  1. K PSASUBB
  1. W !,"ok, we'll update the files now at RECORD"
  1. S PSABFR=0 F S PSABFR=$O(^PSDRUG(PSABEFOR,1,PSABFR)) Q:PSABFR=$G(PSASUB) Q:PSABFR'>0 S PSASUBB=PSABFR
  1. I $G(PSASUBB) S PREVDATA=$G(^PSDRUG(PSABEFOR,1,PSASUBB,0)) D
  1. .W !,"Will update old drug data with previous synonym data of : ",!,?20,PREVDATA
  1. I '$G(PSASUBB) W !,"Could not find previous sysnonym data, therefore the prices will remain as",!,"they are.",!