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

BMCFDR.m

Go to the documentation of this file.
BMCFDR ; IHS/PHXAO/TMJ - DRIVER TO PRINT REFERRAL FORM ;        [ 09/26/2006  3:57 PM ]
 ;;4.0;REFERRED CARE INFO SYSTEM;**2,3,5**;JAN 09, 2006;Build 101
 ;IHS/ITSC/FCJ ADD LINE TO TEST FOR CLOSING SLAVE DEVICE
 ;IHS/OIT/FCJ REMOVED CHSSTAT SECTION
 ;4.0*2 9.14.06 IHS.OIT.FCJ ADDED SECTION TO PRINT CONSULT LTR
 ;4.0*3 12.10.2007 IHS.OIT.FCJ ADDED EP LABEL TO ASKCON LINE
 ;4.0*5 3.29.2009 IHS.OIT.FCJ ROUTING SLIP WAS NOT PRINTING W/REF
START ;
 W:$D(IOF) @IOF
 W "**********  REFERRAL FORM PRINT  **********",!!
 W "This report will produce a hard copy computer generated referral letter.",!
 S BMCQUIT=0,BMCPCON=0
GETTYPE ;Get Type of Referral-Screen Out Secondary Provider Letter
 S BMCFTYPE=""
 S DIC="^BMCTFORM(",DIC(0)="AEMQ",DIC("S")="I $D(^(0)),$P(^(0),U)'[""SECOND"",$P(^(0),U)'[""ALT""",DIC("A")="Select Type of Letter to be printed: " D ^DIC K DA,DIC
 G:Y=-1 XIT
 S BMCFTYPE=+Y
 I ($P(Y,U,2)="STANDARD IHS REFERRAL LETTER")!($E($P(Y,U,2),1,7)="CALL-IN") S BMCPCON=1
GETREF ;get referral entry
 W !! S BMCREF=""
 S DIC="^BMCREF(",DIC(0)="AEMQ",DIC("A")="Select Referral by Patient Name, date of referral or referral #: "
 ;S DIC("S")="I $$FILTER^BMCFLTR(0,0,0)"
 S DIC("S")="I $$FILTER^BMCFLTR(3,0,0)"
 D ^DIC K DA,DIC
 G:Y=-1 XIT
 S BMCREF=+Y
 I $D(^BMCTFORM(BMCFTYPE,11)) X ^BMCTFORM(BMCFTYPE,11) G:BMCQUIT GETREF
 ;
ASKROUT ;Ask if Want to Print Routing Slip if Exists
 S BMCPROUT=0
 ;BMC*4.0*2 9.14.06 IHS.OIT.FCJ CHANGED G TO LINE REFERENCE
 ;G:'$D(^BMCREF(BMCREF,4))&('$D(^BMCREF(BMCREF,5))) ZIS
 I '$D(^BMCREF(BMCREF,4))&('$D(^BMCREF(BMCREF,5))) D ASKCON G ZIS
 ;
 W !!,?10,"**ROUTING SLIP INFORMATION IS ATTACHED TO THIS REFERRAL**"
 W !!
 S DIR(0)="Y",DIR("A")="Do you wish to also Print the Routing Slip NOW",DIR("?")="Enter Y for Yes or N for NO",DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G XIT
 ;BMC*4.0*2 9.14.06 IHS.OIT.FCJ CHANGED G TO LINE REFERENCE
 ;I Y=0 G ZIS
 S:Y'=0 BMCPROUT=1 D ASKCON G ZIS
 ;BMC*4.0*2 9.14.06 IHS.OIT.FCJ ADDED NXT SECTION TO PRINT CONSULT LTR
ASKCON ;EP;Ask to print consult
 Q:$G(BMCPCON)=0
 S BMCPCON=0 I $P($G(^BMCPARM(DUZ(2),4100)),U,8)="Y" D
 .W !!
 .S DIR(0)="Y",DIR("B")="Y"
 .S DIR("A")="Do you wish to also Print the Consult Letter NOW"
 .D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 .Q:Y=0  S BMCPCON=1
 Q
 ;BMC*4.0*2 9.14.06 IHS.OIT.FCJ END OF CHANGES
ZIS ;
 W !! S XBRC="COMP^BMCFDR",XBRP="PRINT^BMCFDR",XBNS="BMC",XBRX="XIT^BMCFDR"
 D ^XBDBQUE
 Q
 ;
PRINT ;EP
 X:$D(^BMCTFORM(BMCFTYPE,12)) ^BMCTFORM(BMCFTYPE,12)
 Q
XIT ;
 K BMCCAP,BMCCHSR,BMCDA,BMCFILE,BMCFTYPE,BMCIOM,BMCKPDA,BMCNODE,BMCPG,BMCQUIT,BMCR0,BMCREF,BMCRNS,BMCV,BMCWP,BMCX,BMCY,BMCI,BMCDFN,BMCCHSAS
 K A,C,D,D0,D1,DA,DD,DDSFILE,DI,DIADD,DIC,DICR,DIE,DIK,DINUM,DIPGM,DIQ,DIR,DIW,DIWI,DIWT,DIWTC,DIWX,DIWF,DIWL,DIWR,DLAYGO,DO,DQ,DR,DTOUT
 K F,G,I,J,N,P,T,X,Y,Z
 K BMCPCON,BMCPROUT,BMCN,BMCNI,BMCNUM,BMCVIEN
 K BMCCHSCT,BMCCMT,BMCRDATE,BMCREC,BMCRIEN,BMCRIO,BMCRNUMB,BMCRSTAT,BMCRTYPE,BMCVST,BMCVSTP
 I $D(IO("S")) S IOP="`"_IOS D ^%ZIS
 Q
COMP ;
 Q
CHSSTAT ;
 Q
WP ;EP - Entry point to print wp fields pass node in BMCWP
 ;PASS FILE IN BMCFILE, ENTRY IN BMCREF
 NEW G,P,BMCX
 K BMCWP
 K ^UTILITY($J,"W")
 S BMCX=0,P=0
 S G=$S($G(G)]"":G,1:^DIC(BMCFILE,0,"GL")),G=G_BMCDA_","_BMCNODE_",BMCX)"
 S DIWR=$S($G(BMCIOM):BMCIOM,1:IOM),DIWL=0 F  S BMCX=$O(@G) Q:BMCX'=+BMCX  D
 .S Y=$P(G,")")_",0)"
 .S X="" I $G(BMCCAP)]"",BMCX=1 S X=BMCCAP
 .S X=X_@Y D ^DIWP
 .Q
WPS ;EP
 S Z=0 F  S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:Z'=+Z  S P=P+1,BMCWP(P)=^UTILITY($J,"W",DIWL,Z,0)
 K DIWL,DIWR,DIWF,Z
 K ^UTILITY($J,"W"),BMCNODE,BMCFILE,BMCDA,G,BMCCOL,BMCCAP
 Q
AHCCCS ;EP
 W !!,$C(7),$C(7),"This letter must be printed on a printer capable of 132 character print.",!!
 Q