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

WVUTL7.m

Go to the documentation of this file.
WVUTL7 ;HCIOFO/FT,JR - UTIL: HEADERS & TRAILERS ;05/25/2017  15:30
 ;;1.0;WOMEN'S HEALTH;**5,7,10,14,24**;Sep 30, 1998;Build 582
 ;;  Original routine created by IHS/ANMC/MWR
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  UTILITY: HEADERS AND TRAILERS.
 ;
 ; This routine uses the following IAs:
 ; #10060 - FILE 200 fields      (supported)
 ;
S(S) ;EP
 ;---> RETURN A VALUE OF SPACES EQUAL IN LENGTH TO THE NUMBER S.
 N I,SP S SP=$$REPEAT^XLFSTR(" ",80)
 Q $E(SP,1,$G(S))
 ;
TOPHEAD ;EP
 ;---> CODE TO SET VARIABLES FOR HEADER.
 N X,%
 D NOW^%DTC S WVNOW=$$SLDT1^WVUTL5(%)
 S WVLINE=$$REPEAT^XLFSTR("-",80)
 S WVPAGE=1
 S WVCRT=$S($E(IOST)="C":1,1:0)
 S WVCONFF="*********************** CONFIDENTIAL PATIENT INFORMATION "
 S WVCONFF=WVCONFF_"***********************"
 S WVTIMLN=$E(WVLINE,1,26)_" printed: "_WVNOW_" "_$E(WVLINE,1,27)
 Q
 ;
TOPHEAD1 ;EP
 ;---> CODE TO SET VARIABLES FOR HEADER.
 N X,%
 D NOW^%DTC S WVNOW=$$SLDT1^WVUTL5(%)
 S WVLINE=$$REPEAT^XLFSTR("-",80)
 S WVPAGE=$G(WVPAGE)+1
 S WVCRT=$S($E(IOST)="C":1,1:0)
 S WVCONFF="*********************** CONFIDENTIAL PATIENT INFORMATION "
 S WVCONFF=WVCONFF_"***********************"
 S WVTIMLN=$E(WVLINE,1,26)_" printed: "_WVNOW_" "_$E(WVLINE,1,27)
 Q
 ;
HEADER1 ;EP
 ;---> BROWSE/REPORT HEADER: MULTIPLE PATIENTS, MULTIPLE PROCEDURES.
 ;---> REQUIRED VARIABLES: WVBEGDT,WVCRT,WVENDDT,WVPAGE,WVTITLE,DUZ(2)
 ;---> OPTIONAL VARIABLE:  WVCONF (CONFIDENTIAL), WVSUBH (SUBHEADER).
 N X
 W:WVPAGE>1!WVCRT @IOF,!
 W:$D(WVCONF) WVCONFF,! W:'WVCRT WVTIMLN,!
 W !,WVTITLE W:'WVCRT ?70,"page: ",WVPAGE
 W !,$$RUNDT^WVUTL1A("C"),!
 W !,"Case Mgr: " D
 .I '$D(WVE) W "ALL" Q
 .I WVE W "ALL" Q
 .I '$D(WVCMGR) W "UNKNOWN" Q
 .I WVCMGR="" W "UNKNOWN" Q
 .N WVCMGRNM
 .S WVCMGRNM=$$GET1^DIQ(200,WVCMGR,.01,"E")
 .W $S(WVCMGRNM]"":WVCMGRNM,1:"UNKNOWN")
 W ?56,"For period: ",$$TXDT^WVUTL5(WVBEGDT)
 W !,"Facility: ",$$INSTTX^WVUTL6(DUZ(2))
 W ?64,"To: ",$$TXDT^WVUTL5(WVENDDT)
 W !,$$REPEAT^XLFSTR("=",80)
 I $D(WVSUBH) D @WVSUBH
 Q
 ;
HEADER2 ;EP
 ;---> PATIENT REPORT HEADER: ONE PATIENT, MULTIPLE PROCEDURES.
 ;---> REQUIRED VARIABLES: WVBEGDT,WVCRT,WVENDDT,WVPAGE,WVTITLE,DUZ(2)
 ;---> OPTIONAL VARIABLE:  WVCONF (CONFIDENTIAL), WVSUBH (SUBHEADER).
 N X
 D FAC^WVUTL1A
 W:WVPAGE>1!WVCRT @IOF,!
 W:$D(WVCONF) WVCONFF,! W:'WVCRT WVTIMLN,!
 W !,WVTITLE W:'WVCRT ?70,"page: ",WVPAGE
 W !,$$RUNDT^WVUTL1A("C")
 W !,"Patient Name: ",WVNAMAGE,?52,$$PNLAB^WVUTL5(),WVCHRT
 W !,"Case Manager: ",WVCMGR
 W ?50,"Facility: ",$E($$INSTTX^WVUTL6(DUZ(2)),1,19)
 W !,"Cx Tx Need  : ",WVCNEED
 W ?47,"Cx Facility: ",$G(WVJCFAC)
 W !,"PAP Regimen : ",WVPAPRG,?47,"Pr Provider: ",$G(WVJPCP)
 W !,"Br Tx Need  : ",WVBNEED
 W ?47,"Br Facility: ",$G(WVJBFAC)
 W !,"Hx of BR CA : ",$$GET1^DIQ(790,WVDFN,.23,"E")
 W !,"Elig Code   : ",$P($$ELIG^WVUTL9(WVDFN),U,2)
 W ?51,"Veteran: ",$$VET^WVUTL1A(WVDFN)
 W !,"MST         : ",$$MST^WVUTL1A(WVDFN)
 W ?55,"CST: ",$$CST^WVUTL1A(WVDFN)
 W !,"Maternity Care Coordinator: ",$$MCMGR^WVUTL1(WVDFN)
 W !,$$REPEAT^XLFSTR("=",49)
 W $S(WVEDC]""&(WVEDC'="UNKNOWN"):WVEDC_"======",1:"===============================")
 I $D(WVSUBH) D @WVSUBH
 Q
 ;
HEADER3 ;EP
 ;---> LAB LOG REPORT HEADER: MULTIPLE PATIENTS, MULTIPLE PROCEDURES.
 ;---> REQUIRED VARIABLES: WVBEGDT,WVCRT,WVENDDT,WVPAGE,WVTITLE,DUZ(2)
 ;---> OPTIONAL VARIABLE:  WVCONF (CONFIDENTIAL), WVSUBH (SUBHEADER).
 N X
 W:WVPAGE>1!WVCRT @IOF,!
 W:$D(WVCONF) WVCONFF,! W:'WVCRT WVTIMLN,!
 W !,WVTITLE W:'WVCRT ?70,"page: ",WVPAGE
 W !!,$$RUNDT^WVUTL1A("C")
 W !,"Facility: ",$$INSTTX^WVUTL6($S($G(WVFAC):WVFAC,1:DUZ(2)))
 W ?53,"From: ",$$SLDT2^WVUTL5(WVBEGDT)
 W " to ",$$SLDT2^WVUTL5(WVENDDT)
 W !,$$REPEAT^XLFSTR("=",80)
 I $D(WVSUBH) D @WVSUBH
 Q
 ;
HEADER4 ;EP
 ;---> PATIENT REPORT HEADER: ONE PATIENT, ONE PROCEDURE.
 ;---> REQUIRED VARIABLES: WVBEGDT,WVCRT,WVENDDT,WVPAGE,WVTITLE1,DUZ(2)
 ;---> OPTIONAL VARIABLE:  WVCONF (CONFIDENTIAL), WVSUBH (SUBHEADER).
 W:WVPAGE>1!WVCRT @IOF,!
 W WVCONFF W:'WVCRT !,WVTIMLN
 W !!,WVTITLE1,?70,"page: ",WVPAGE S WVPAGE=WVPAGE+1
HEADER41 ;EP
 ;---> CALLED BY WVPROC; BYPASSES FORMFEED, TITLE, ETC.
 N WVDES
 W !,$$RUNDT^WVUTL1A("C"),!
 W !,"Patient Name: ",WVNAMAGE,?53,$$PNLAB^WVUTL5(),WVCHRT
 W !,"Case Manager: ",WVCMGR
 W ?50,"Procedure: ",$E(WVPN,1,19)
 W !,"PAP Regimen : ",WVPAPRG
 W ?55,"Acc#: ",WVACCN
 W !,"Cx Tx Need  : ",WVCNEED
 W ?48,"Cx Facility: ",$$FACIL^WVUTL1A(WVDFN,"C")
 W !,"Br Tx Need  : ",WVBNEED
 W ?48,"Br Facility: ",$$FACIL^WVUTL1A(WVDFN,"B")
 W !,"Elig Code   : ",$P($$ELIG^WVUTL9(WVDFN),U,2)
 W ?52,"Veteran: ",$$VET^WVUTL1A(WVDFN)
 W !,"MST         : ",$$MST^WVUTL1A(WVDFN)
 W ?56,"CST: ",$$CST^WVUTL1A(WVDFN)
 W !,"Maternity Care Coordinator: ",$$MCMGR^WVUTL1(WVDFN)
 S WVDES=$$DES^WVUTL1(WVDFN)
 W !,$S(WVDES="YES":"*DES DAUGHTER*",1:"--------------")
 W $$REPEAT^XLFSTR("-",37)
 W $S(WVEDC]"":WVEDC_"----",1:"-----------------------------")
 Q
 ;
HEADER5 ;EP
 ;---> DELINQUENT NEEDS REPORT HEADER: MULTIPLE PATIENTS
 ;---> REQUIRED VARIABLES: WVBEGDT,WVCRT,WVENDDT,WVPAGE,WVTITLE,DUZ(2)
 ;---> OPTIONAL VARIABLE:  WVCONF (CONFIDENTIAL), WVSUBH (SUBHEADER).
 N X
 W:WVPAGE>1!WVCRT @IOF,!
 W:$D(WVCONF) WVCONFF,! W:'WVCRT WVTIMLN,!
 W !,WVTITLE W:'WVCRT ?70,"page: ",WVPAGE
 W !,"Case Mgr: " D
 .I '$D(WVE) W "ALL" Q
 .I WVE W "ALL" Q
 .I $G(WVMGR)']"" W "UNKNOWN" Q
 .N WVCMGRNM
 .S WVCMGRNM=$$GET1^DIQ(200,WVMGR,.01,"E")
 .W $S(WVCMGRNM]"":WVCMGRNM,1:"UNKNOWN")
 S Y=DT D DD^%DT W ?46,"Run Date: ",Y
 W !,"Facility: ",$$INSTTX^WVUTL6(WVFAC)
 W ?46,"Tx Needs Past Due as of ",$$SLDT2^WVUTL5(WVDDATE)
 W !,$$REPEAT^XLFSTR("=",80)
 I $D(WVSUBH) D @WVSUBH
 Q
 ;
HEADER6 ;EP
 ;---> PROGRAM SNAPSHOT HEADER: JUST TITLE AND FACILITY (NO PATIENTS)
 ;---> REQUIRED VARIABLES: WVCRT,WVTITLE,DUZ(2)
 N X
 W:WVPAGE>1!WVCRT @IOF,!
 W:'WVCRT !,WVTIMLN,!
 W !,WVTITLE W:'WVCRT ?70,"page: ",WVPAGE
 W !?3,$$RUNDT^WVUTL1A() I $D(WVJTOY) W ?60,"(",WVJTOY,")"
 W !,"   Note: This report includes all divisions"
 W " using this database."
 W !,$$REPEAT^XLFSTR("=",80)
 I $D(WVSUBH) D @WVSUBH
 Q
 ;
HEADER7 ;EP
 ;---> AUTOLOAD OF PATIENTS HEADER
 ;---> REQUIRED VARIABLES: WVCRT,WVTITLE,DUZ(2)
 N X
 W:WVPAGE>1!WVCRT @IOF,!
 W:$D(WVCONF) WVCONFF,! W:'WVCRT WVTIMLN,!
 W !,WVTITLE W:'WVCRT ?70,"page: ",WVPAGE S WVPAGE=WVPAGE+1
 W !!,$$RUNDT^WVUTL1A()
 W ?45,"Date Range: "_$$FMTE^XLFDT($G(WVJSDT),"2D")_"-"_$$FMTE^XLFDT($P($G(WVJEDT),".",1),"2D")
 W !,"Facility: ",$$INSTTX^WVUTL6(DUZ(2))
 W ?45,"Cutoff Age: ",WVAGE
 W !,$$REPEAT^XLFSTR("=",80)
 W !,?3,"NAME",?30,$$PNLB^WVUTL5(),?45,"DOB",?60,"STATUS"
 W !,WVLINE
 Q
 ;
HEADER8 ;EP
 ;---> SCREENING RATES REPORT HEADER: (NO PATIENTS)
 ;---> REQUIRED VARIABLES: WVCRT,WVTITLE,DUZ(2)
 N X
 W:WVPAGE>1!WVCRT @IOF,!
 W:'WVCRT !,WVTIMLN,!
 W !,WVTITLE W:'WVCRT ?70,"page: ",WVPAGE
 W !!?4,"For Age Range: ",$S(WVAGRG=1:"ALL",1:WVAGRG)
 W ?56,"For period: ",$$SLDT2^WVUTL5(WVBEGDT)
 S Y=DT D DD^%DT W !?4,"Run Date: ",Y
 W ?64,"To: ",$$SLDT2^WVUTL5(WVENDDT)
 W !,$$REPEAT^XLFSTR("=",80)
 W !?4,"(Note: This report includes all divisions using this database.)"
 W !?11,"Number of Active Patients: "_$G(WVTOT),!
 Q
 ;
ENDREP(X) ;EP
 ;---> END A REPORT, DO FORMFEED OR "Press <Return>" IF NECESSARY.
 ;---> REQUIRED VARIABLES: WVCRT=1 IF OUTPUT TO SCREEN
 ;--->                     WVPOP=1 IF ESCAPING
 ;---> OPTIONAL VARIABLE:  X=1 IF "End of Report" SHOULD NOT DISPLAY.
 ;
 S WVTITLE="-----  End of Report  -----"
 I '$G(X)&('WVPOP) D CENTERT^WVUTL5(.WVTITLE) W !,WVTITLE
 I WVCRT&('$D(IO("S")))&('WVPOP) D DIRZ^WVUTL3 W @IOF,!
 D ^%ZISC
 Q