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

PSUOP6.m

Go to the documentation of this file.
  1. PSUOP6 ;BIR/REG - PSU PBM Outpatient Pharmacy Printer Output ;10 JUL 1999
  1. ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
  1. ;
  1. ;DBIA(s)
  1. ; Reference to file #59 supported by DBIA 2510
  1. ;
  1. ;PRINT CYCLE CONTROLLER FOR OUTPATIENT PHARMACY SUMMARY REPORT
  1. ;
  1. EP ;
  1. NEW PSUI,PSUH,PSUL,PSUM,PSUPGS
  1. D DT^DILF("E",PSUSDT,.EXTD)
  1. S PSURP("START")=EXTD(0)
  1. D DT^DILF("E",PSUEDT,.EXTD)
  1. S PSURP("END")=EXTD(0)
  1. U IO
  1. ;
  1. PRTSUMS ;
  1. ; Find first Division/Facility in the summary by division
  1. ; then DO the PRTALL routine
  1. S PSUOPSUB="PSUOP_"_PSUJOB
  1. I '$D(^XTMP(PSUOPSUB,"STATSUM")) D
  1. .S ^XTMP("PSU_"_PSUJOB,"PSUNONE2")=""
  1. .S ^XTMP(PSUOPSUB,"STATSUM",PSUSNDR,1)="Outpatient Statistical Data Summary for "_PSURP("START")_" through "_PSURP("END")
  1. .S ^XTMP(PSUOPSUB,"STATSUM",PSUSNDR,2)=" "
  1. .S ^XTMP(PSUOPSUB,"STATSUM",PSUSNDR,3)="No data to report"
  1. ;
  1. S PSUFACN=""
  1. ;VMP-IOFO BAY PINES;ELR;PSU*3.0*26
  1. NEW PSUFIRST
  1. F S PSUFACN=$O(^XTMP(PSUOPSUB,"STATSUM",PSUFACN)) Q:PSUFACN="" D PRTALL
  1. ;
  1. I '$D(^XTMP("PSU_"_PSUJOB,"CBAMIS")) D PRTAMIS ;Print OPAMIS SUMMARY
  1. ;
  1. D PULL^PSUCP
  1. F I=1:1:$L(PSUOPTS,",") S PSUMOD($P(PSUOPTS,",",I))=""
  1. ;
  1. ;Call Pt. Demographics summary report/No data when user selects
  1. ;(1)IV and (2)UD and (4)Rx
  1. ;(1)IV and (4)Rx
  1. ;(2)UD and (4)Rx
  1. I $D(PSUMOD(1))!$D(PSUMOD(2)) D IVSUM^PSUDEM0
  1. ;
  1. ;Call Pt. Demographics summary report/No data when user selects
  1. ;(4)IV alone.
  1. I '$D(PSUMOD(1))&'$D(PSUMOD(2)) D IVSUM^PSUDEM0
  1. ;
  1. ; Find the first Division/Facility in the summary by drug by division
  1. ; then DO the PRTDRUG routine
  1. Q:PSUSMRY ; 'summary only' was selected don't print 'by drug'
  1. S PSUFACN=""
  1. I '$D(^XTMP(PSUOPSUB,"DRUGSUM")) D
  1. .S ^XTMP(PSUOPSUB,"DRUGSUM",PSUSNDR,1)="Outpatient Statistical Data for "_PSURP("START")_" through "_PSURP("END")
  1. .S ^XTMP(PSUOPSUB,"DRUGSUM",PSUSNDR,2)=" Page"
  1. .S ^XTMP(PSUOPSUB,"DRUGSUM",PSUSNDR,3)="No data to report"
  1. F S PSUFACN=$O(^XTMP(PSUOPSUB,"DRUGSUM",PSUFACN)) Q:PSUFACN="" D PRTDRUG
  1. PRTSUMX ; EXIT PSUOP6
  1. W @IOF
  1. ;
  1. Q
  1. ;
  1. PRTALL ; Print the Drug summary of all drugs by Division/Facility
  1. S X=PSUFACN,DIC=59,DIC(0)="XM" D ^DIC ;**1
  1. S X=+Y S PSUDIVNM=$$VAL^PSUTL(59,X,.01)
  1. ;VMP OIFO BAY PINES;ELR;PSU*3.0*31
  1. I '$L(PSUDIVNM) S X=PSUFACN D DIVNM
  1. ;VMP-IOFO BAY PINES;ELR;PSU*3.0*26; REMOVE FORM FEED FIRST TIME THROUGH
  1. I $G(PSUFIRST) W @IOF
  1. S PSUFIRST=1
  1. F I=1:1:3 W !
  1. S PSUL=""
  1. F S PSUL=$O(^XTMP(PSUOPSUB,"STATSUM",PSUFACN,PSUL)) Q:PSUL="" D
  1. .W !,^XTMP(PSUOPSUB,"STATSUM",PSUFACN,PSUL)
  1. .I PSUL=1 W " for ",PSUDIVNM,!,?72,"Page: 1" ; will only ever be one page
  1. Q
  1. ;
  1. PRTDRUG ; Print the Drug summary by Drug by Division/Facility
  1. ; Set page number to 0
  1. S PSUPGS("PG")=0
  1. S X=PSUFACN,DIC=59,DIC(0)="XM" D ^DIC
  1. S X=+Y S PSUDIVNM=$$VAL^PSUTL(59,X,.01)
  1. ;VMP OIFO BAY PINES;ELR;PSU*3.0*31
  1. I '$L(PSUDIVNM) S X=PSUFACN D DIVNM
  1. D PGHDR ; Perform 1st page heading
  1. S PSUL=6 ; Report body starts at line 7
  1. F S PSUL=$O(^XTMP(PSUOPSUB,"DRUGSUM",PSUFACN,PSUL)) Q:PSUL="" D
  1. .I $Y+4>IOSL D PGHDR
  1. .W !,^XTMP(PSUOPSUB,"DRUGSUM",PSUFACN,PSUL)
  1. ;
  1. Q
  1. ;
  1. PRTAMIS ;Print Amis summary report
  1. ;
  1. U IO W @IOF
  1. S PSUPGS("PG")=1
  1. D PGHDR1
  1. S PSUL=3
  1. F S PSUL=$O(^XTMP("PSU_"_PSUJOB,"OPAMIS",PSUL)) Q:PSUL="" D
  1. .I LNCNT+4>IOSL D PGHDR1
  1. .W !,^XTMP("PSU_"_PSUJOB,"OPAMIS",PSUL)
  1. .S LNCNT=LNCNT+1
  1. Q
  1. ;
  1. PGHDR1 ;AMIS HEADER
  1. U IO W @IOF
  1. F I=1:1:3 W !
  1. F I=1:1:2 W ^XTMP("PSU_"_PSUJOB,"OPAMIS",I)
  1. W !!,?68,"Page: ",PSUPGS("PG")
  1. S PSUPGS("PG")=PSUPGS("PG")+1
  1. S LNCNT=3
  1. Q
  1. ;
  1. PGHDR ;Increment page number and Write Page Heading
  1. ; Writes header lines 1 & 2, then page number, then lines 3 through 6
  1. U IO W @IOF
  1. F I=1:1:3 W !
  1. W !,^XTMP(PSUOPSUB,"DRUGSUM",PSUFACN,1) ;Print 1st line
  1. W " for ",PSUDIVNM ; add division name
  1. S PSUPGS("PG")=PSUPGS("PG")+1
  1. W !,$P(^XTMP(PSUOPSUB,"DRUGSUM",PSUFACN,2),":",1),": ",PSUPGS("PG"),! ;Print page number
  1. F PSUH=3:1:6 W !,$G(^XTMP(PSUOPSUB,"DRUGSUM",PSUFACN,PSUH)) ;Print next 5 lines
  1. Q
  1. ;
  1. DIVNM ;S PSUDIVNM FROM FILE 40.8 IF NOT IN FILE 59
  1. S DIC=40.8,DIC(0)="X",D="C" D IX^DIC
  1. S X=+Y S PSUDIVNM=$$VAL^PSUTL(40.8,X,.01)
  1. Q