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

PSIVRQ.m

Go to the documentation of this file.
  1. PSIVRQ ;BIR/PR,MLM,MV-REPORT DRIVER ; 9/25/08 12:31pm
  1. ;;5.0; INPATIENT MEDICATIONS ;**196**;16 DEC 97;Build 13
  1. DTS ;Get start and stop dates for all reports
  1. I '$D(STSRPT),'$D(PSIVRC) S (Y,X2)=$S($D(^PS(50.8,1,.2)):^(.2),1:0) I Y X ^DD("DD") W !!,"The IV BACKGROUND JOB [PSJI BACKGROUND JOB] that compiles IV cost data",!,"was last successfully run on: ",Y
  1. I '$D(STSRPT),'$D(PSIVRC) S X1=DT D ^%DTC I X>1 W !!,$C(7),"**WARNING** that was <",X,"> days ago. PLEASE contact your site manager.",!?12,"Cost data is probably not accurate because of this."
  1. I '$D(STSRPT),$D(^PS(50.8,0)) F Z=0:0 S Z=$O(^PS(50.8,Z)) Q:'Z I $D(^(Z,2)) S DATA=$O(^PS(50.8,Z,2,0)) W !!,$C(7),$C(7),"The oldest cost data for room: ",$P($G(^PS(59.5,Z,0)),U)," goes back to: " S Y=DATA X ^DD("DD") W $S(Y'="":Y,1:"??")
  1. K BRIEF,SMO S %DT="AXE",%DT(0)="-T",%DT("A")="Enter Start Date: " W ! D ^%DT G:Y<0 K S I7=+Y
  1. S %DT("A")="Enter End Date: " W ! D ^%DT G:Y<0 K S I8=+Y
  1. I I8<I7 W !!,$C(7),$C(7),"End date must be GREATER than start date." G DTS
  1. ;
  1. Q:$D(STSRPT)
  1. RECOM ;Recompile IV cost data for date range
  1. I $D(PSIVRC) K PSIVRC G ^PSIVREC
  1. ;
  1. ;
  1. LS ;Ask for long or short report if user is running the drug cost report.
  1. ;Set variable BRIEF if a condensed report is requested
  1. K BRIEF,DIR
  1. I $D(PSIVPCR) S DIR(0)="SO^C:Condensed;R:Regular",DIR("A")="(R)egular or (C)ondensed",DIR("B")="Regular",DIR("?")="Enter ""R"" to include drug data, or ""C"" to list only the drug total per provider" D ^DIR K DIR S:X="C" BRIEF=1
  1. G:'$D(PSIVDCR) IV
  1. S DIR(0)="SO^C:Condensed;R:Regular",DIR("A")="(R)egular or (C)ondensed",DIR("B")="Regular",DIR("?")="Enter ""R"" to include ward data, or ""C"" to exclude ward data",DIR("??")="^S HELP=""CON"" D ^PSIVHLP2" D ^DIR K DIR
  1. ;PSJ*5*196
  1. I $TR(X,"c","C")["C" S BRIEF=1 K PQ
  1. G:X="^" K
  1. ;
  1. IV ;Ask user for IV room to run reports for.
  1. ;Only for the drug cost, ward cost, and provider cost reports.
  1. I $D(PSIVPAT)!($D(PSIVAMIS)) G ^PSIVRQ1
  1. S DIR(0)="P0^59.5",DIR("A")="Select IV room",DIR("B")="^ALL",DIR("?")="Enter the name of the IV room, or ^ALL for all IV rooms",DIR("??")="^S HELP=""IVR"" D ^PSIVHLP2" D ^DIR K DIR
  1. G:X="^" K I $P("^ALL",X)="" W $P("^ALL",X,2) S I4=0,I15="ALL IV ROOMS"
  1. E W $P(Y,X,2) S I4=+Y,I15="IV ROOM: "_$P(Y,U,2)
  1. G ^PSIVRQ1
  1. K ;Kill variables
  1. K %DT,%T,BRIEF,D,DATA,DFN,DIC,DIRUT,DUOUT,G,HELP,I1,I10,I11,I2,I3,I4,I5,I6,I7,I8,I9,I15,JJ,LCO,NU,POP,PQ,PSIVDCR,PSIVPAT,PSIVPCR,PSIVPCR
  1. K PSIVRC,PSIVWCR,Q,UCO,X,Y,PQ,SMO,VAERR,Y,Z,ZTSK D ENIVKV^PSGSETU S:$D(ZTQUEUED) ZTREQ="@"
  1. Q