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

BMCRL.m

Go to the documentation of this file.
BMCRL ; IHS/PHXAO/TMJ - PCC REFERRAL GENERAL RETRIEVAL DRIVER ROUTINE ;   
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
 ;IHS/ITSC/FCJ ADD TST FOR DATE RANGE IN CANNED REPORT
 ;IHS/ITSC/FCJ ADDED REF TYPE, VAR BMCTYPR: PRIMARY, SECONDARY BOTH
 ;
START ; 
 K BMCQUIT ;--- this variable controls whether or not a user terminated input
TYPE ;--- get type of report (patient, date range or search template)
 S BMCPTVS="R"
 D INFORM^BMCRL01
 S (BMCPCNT,BMCPTCT)=0 ;BMCPTCT -- pt total for # of "V"isits
 K BMCTYPE ;--- just in case variable left around
 D PROCESS,XIT
 Q
PROCESS ;process lister
 K BMCCAND
 S DIR(0)="S^P:A Previously defined report;N:Create a New Report",DIR("A")="Which type of report do you wish to generate",DIR("B")="N" K DA D ^DIR K DIR
 I $D(DIRUT) D XIT Q
 I Y="P" S BMCCAND=1
 D ADD I $D(BMCQUIT) D DEL K BMCQUIT Q
 I '$D(BMCCAND) D RTYP Q:$D(DIRUT)  D PP1 Q
 D CAN I $D(DIRUT) K DIRUT,BMCR("CR") G TYPE
 D TITLE I $D(BMCQUIT) K BMCQUIT G TYPE
 D ZIS
 Q
RTYP ;EP;4.0 IHS/ITSC/FCJ ADDED NEXT SECTION FOR TYPE OF REFERRAL
 S DIR(0)="S^P:Primary Referrals;S:Secondary Referrals;B:Both"
 S DIR("A")="Include Which type of Referrals in the report",DIR("B")="B" K DA D ^DIR K DIR
 Q:$D(DIRUT)
 S BMCTYPR=Y
 Q
PP1 ;if patient, no prev defined report used
PP11 K ^BMCRTMP(BMCRPT,11) D SCREEN I $D(BMCQUIT) K BMCQUIT D DEL G TYPE
PP12 K ^BMCRTMP(BMCRPT,12) S BMCTCW=0 D COUNT I $D(BMCQUIT) K BMCQUIT G PP11
PP13 D TITLE I $D(BMCQUIT) K BMCQUIT G PP12
 D SAVE,ZIS
 Q
SCREEN ;
 S BMCCNTL="S" D ^BMCRL4
 Q
COUNT ;count only or detailed report
 D COUNT^BMCRL3
 Q
TITLE ;
 D TITLE^BMCRL3
 Q
SAVE ;
 D SAVE^BMCRL3
 Q
CAN ;TEST FOR DATE RANGE FIELDS ON CANNED REPORT AND PRIM/SEC REF
 D DTTST^BMCRL3
 Q
ZIS ;call to XBDBQUE
 K BMCOPT
 I 'BMCTCW S BMCTCW=IOM
 S BMCDONE=""
 D SHOW^BMCRLS,SHOWP^BMCRLS,SHOWR^BMCRLS
 D XIT1
 I BMCCTYP="D"!(BMCCTYP="S")!(BMCCTYP="N") D
 .W ! S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to",DIR("B")="P" K DA D ^DIR K DIR
 .I $D(DIRUT) S BMCQUIT="" Q
 .S BMCOPT=Y
 G:$G(BMCQUIT) SAVE
 I $G(BMCOPT)="B" D BROWSE,XIT Q
 S XBRP="^BMCRLP",XBRC="^BMCRL1",XBRX="XIT^BMCRL",XBNS="BMC"
 D ^XBDBQUE
 D XIT
 Q
DEL ;EP DELETE LOG ENTRY IF ONE EXISTS AND USER "^" OUT
 I $G(BMCRPT),$D(^BMCRTMP(BMCRPT,0)),'$P(^BMCRTMP(BMCRPT,0),U,2) S DIK="^BMCRTMP(",DA=BMCRPT D ^DIK K DIK,DA,DIC
 Q
ADD ;
 D ADD^BMCRL01
 Q
BROWSE ;
 S XBRP="VIEWR^XBLM(""^BMCRLP"")"
 S XBRC="^BMCRL1",XBRX="XIT^BMCRL",XBIOP=0 D ^XBDBQUE
 Q
XIT ;EP - CALLED FROM BMCRL
 K BMCBD,BMCBDD,BMCED,BMCEDD,BMCSD,BMCSORT,BMCSORV,BMCTCW,BMCRPT,BMCLHDR,BMCDISP,%H,BMCET,BMCLINE,BMCPRNM,BMCPRNT,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