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

PRCPRPCR.m

Go to the documentation of this file.
  1. PRCPRPCR ;WISC/RFJ-patient distribution costs ;11 Mar 94
  1. ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. D ^PRCPUSEL Q:'$G(PRCP("I"))
  1. I "PS"'[PRCP("DPTYPE") W !,"THIS REPORT SHOULD ONLY BE PRINTED BY THE PRIMARY AND SECONDARY INVENTORY POINTS." Q
  1. N DATEEND,DATESTRT,DISTRALL,END,PRCPFITM,PRCPOPCE,PRCPOPCS,PRCPPATE,PRCPPATS,PRCPSUMM,PRCPSURE,PRCPSURS,START,X,Y
  1. K X S X(1)="The Patient Distribution Cost Report will print all items distributed to patients for a selected time frame."
  1. D DISPLAY^PRCPUX2(40,79,.X)
  1. ;
  1. ; select the invpts distributing to the patient
  1. K ^TMP($J,"PRCPURS3")
  1. I PRCP("DPTYPE")="P" D
  1. . K X S X(1)="Besides displaying distributions from the "_PRCP("IN")_" inventory point, select other DISTRIBUTION POINTS to display or ALL" W ! D DISPLAY^PRCPUX2(2,40,.X)
  1. . D DISTRSEL^PRCPURS3(PRCP("I"))
  1. S ^TMP($J,"PRCPURS3","YES",PRCP("I"))=""
  1. ;
  1. ; summary only ?
  1. S PRCPSUMM=$$SUMMARY^PRCPURS0 I PRCPSUMM<0 D Q Q
  1. I PRCPSUMM S (PRCPOPCS,PRCPPATS,PRCPSURS)="",(PRCPOPCE,PRCPPATE,PRCPSURE)="z" G GETDATE
  1. ;
  1. ; select surgical specialty start, end with
  1. K X S X(1)="Select the range of surgery specialties to display. For example, start with NEUROSUR, end with NEUROSUR to print the surgery specialty NEUROSURGERY." W ! D DISPLAY^PRCPUX2(5,75,.X)
  1. D RANGE("SURGICAL SPECIALTY") I START="^" D Q Q
  1. S PRCPSURS=START,PRCPSURE=END
  1. ;
  1. ; select patient start, end with
  1. K X S X(1)="Select the range of patients to display. For example, start with SMITH, end with SMITH to print patients with last names of SMITH." W ! D DISPLAY^PRCPUX2(5,75,.X)
  1. D RANGE("PATIENT NAME") I START="^" D Q Q
  1. S PRCPPATS=START,PRCPPATE=END
  1. ;
  1. ; select opcode start, end with
  1. K X S X(1)="Select the range of principal procedure codes to display. For example, start with 00124, end with 00126 to print procedure codes including and between 00124 and 00126." W ! D DISPLAY^PRCPUX2(5,75,.X)
  1. D RANGE("PRINCIPAL PROCEDURE CODES") I START="^" D Q Q
  1. S PRCPOPCS=START,PRCPOPCE=END
  1. ;
  1. ; print items ?
  1. K X S X(1)="You have the option to break out the report by distributed items. If you select this option, the report will probably use a lot of paper to print." W ! D DISPLAY^PRCPUX2(5,75,.X)
  1. S XP="Do you want to list out the items distributed",XH="Enter YES to list out the items distributed to the patient."
  1. S PRCPFITM=$$YN^PRCPUYN(2) I 'PRCPFITM D Q Q
  1. ;
  1. GETDATE ; select date range
  1. K X S X(1)="Select the date range for displaying patient distribution costs" W ! D DISPLAY^PRCPUX2(2,40,.X)
  1. D DATESEL^PRCPURS2("") I '$G(DATESTRT) D Q Q
  1. W ! S %ZIS="Q" D ^%ZIS G:POP Q I $D(IO("Q")) D D ^%ZTLOAD K IO("Q"),ZTSK D Q Q
  1. . S ZTDESC="Patient Distribution Cost Report",ZTRTN="DQ^PRCPRPCR"
  1. . S ZTSAVE("PRCP*")="",ZTSAVE("D*")="",ZTSAVE("^TMP($J,""PRCPURS3"",")="",ZTSAVE("ZTREQ")="@"
  1. W !!,"<*> please wait <*>"
  1. DQ ; queue starts here
  1. N %,%I,AVERAGE,DA,DATA,DATE,DFN,DISTRNM,DISTRPT,INOUTPAT,ITEMDA,NOW,OPCODE,PAGE,PATNAME,PRCPFLAG,PRCPFTOT,SCREEN,SSN,SURGDATA,SURGEON,SURGSPEC,TOTCOST,VA,VADM,VAERR,X,Y
  1. D SORT^PRCPRPC1
  1. D PRINT^PRCPRPC2
  1. Q D ^%ZISC K ^TMP($J,"PRCPURS3"),^TMP($J,"PRCPRPCR"),^TMP($J,"PRCPRPCRT")
  1. Q
  1. ;
  1. ;
  1. RANGE(TYPE) ; start with end with for type
  1. ; return variables start and end
  1. N X
  1. K START,END
  1. F D Q:$D(START)
  1. . W !,"START with ",TYPE,": FIRST// " R X:DTIME I '$T!(X["^") S START="^" Q
  1. . I X["?" K X S X(1)="Select the starting "_TYPE_". If you select the default FIRST entry, NULL entries will be selected." D DISPLAY^PRCPUX2(5,75,.X) Q
  1. . S START=X
  1. I START="^" Q
  1. F D Q:$D(END)
  1. . W !," END with ",TYPE,": LAST// " R X:DTIME I '$T!(X["^") S END="^" Q
  1. . I X["?" K X S X(1)="Select the ending "_TYPE_". The ending "_TYPE_" should be the same or follow after the starting "_TYPE_"." D DISPLAY^PRCPUX2(5,75,.X) Q
  1. . I X="" S X="z"
  1. . I START]X K X S X(1)="Ending "_TYPE_" must follow starting "_TYPE_"." D DISPLAY^PRCPUX2(5,75,.X) Q
  1. . S END=X
  1. I END="^" S START="^"
  1. Q