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

BMCFDR3.m

Go to the documentation of this file.
BMCFDR3 ; IHS/PHXAO/TMJ - DRIVER TO RE-PRINT/EDIT/DELETE SECONDARY PROVIDER LETTER ;   
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
 ;IHS/ITSC/FCJ CHG VAR NAME AND ADDED VARS TO KILL
 ;
 ;This is the Main Driver Routine -
 ;RCIS REPORT OUTPUT DEFINITION - SECONDARY PROVIDER LETTER
 ;Calls PRINT ROUTINE BMCFPRN3
 ;After User Input of data - RCIS SECONDARY PROVIDER FILE
 ;is populated with data ^BMCPROV( Global
 ;
START ;
 S BMCCPRV="",BMCAPDT="",BMCAPUR=""
 W:$D(IOF) @IOF
 W "**********  REFERRAL FORM PRINT-SECONDARY PROVIDER  **********",!!
 W "This option will produce a hard copy computer generated",!,"-Existing Secondary Provider Letter",!
 W "You can also edit or delete an existing Secondary Provider Letter.",!!
 S BMCQUIT=0
 S BMCPROV=""
 S BMCCPRV="" ;Secondary Provider Name
 S BMCAPPDT="" ;Secondary Provider Appointment Date
 S BMCAPUR="" ;Secondary Provider Purpose of Appointment
 S BMCKIND=0 ; Determines if Type of Referral=IHS
GETREF ;get referral entry
 ;
 S DIR(0)="S^1:STANDARD;2:AHCCCS",DIR("A")="Enter Secondary Letter Type",DIR("B")="STANDARD",DIR("?")="Enter Letter Form Output Choice" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) G XIT
 S BMCHOICE=Y
 S BMCFTYPE=$S(BMCHOICE=1:5,BMCHOICE=2:7,1:5)
 ;
 W !! S BMCREF=""
 S DIC="^BMCPROV(",DIC(0)="AEMQ",DIC("A")="Select Secondary Letter by Patient Name or Date of Letter: " D ^DIC K DA,DIC
 G:Y=-1 XIT
 S BMCPROV=+Y
 Q:'BMCPROV
 I $D(^BMCTFORM(BMCFTYPE,11)) X ^BMCTFORM(BMCFTYPE,11) G:BMCQUIT GETREF
 S BMCREF=$P($G(^BMCPROV(BMCPROV,0)),U,3)
 Q:BMCREF=""
 I $P($G(^BMCREF(BMCREF,0)),U,4)="N" W !!,?10,"In-House Reerrals are not allowed with this Menu Option",!! G GETREF
 ;
GETLTR ;Select the desired Secondary Letter to edit - print - delete
 ;
 ;IHS Type
 I $P($G(^BMCREF(BMCREF,0)),U,4)="I" D
 . S BMCCPRV=$P($G(^BMCPROV(BMCPROV,0)),U,8)
 . Q:BMCCPRV=""
 . S BMCCPRVP=$P($G(^DIC(4,BMCCPRV,0)),U)
 . Q:BMCCPRVP=""
 . S BMCKIND=1
 ;
 ;CHS or Other Types
 I BMCKIND=1 G TYPE
 S BMCCPRV=$P($G(^BMCPROV(BMCPROV,0)),U,5) ; GET 2ND PROVIDER
 I BMCCPRV="" W !!,?10,"**Secondary Provider Data Missing on Letter**!!" Q
 S BMCCPRVP=$P($G(^AUTTVNDR(BMCCPRV,0)),U) ;GET ACTUAL PROVIDER NAME
 ;
TYPE ;Get Remaining Provider Data
 ;
 S BMCAPPDT=$P($G(^BMCPROV(BMCPROV,0)),U,6) ;GET EXPT APPT DT
 S BMCAPUR=$P($G(^BMCPROV(BMCPROV,0)),U,7) ;GET PURPOSE
ZIS ;
 W !! S XBRC="COMP^BMCFDR3",XBRP="PRINT^BMCFDR3",XBNS="BMC",XBRX="XIT^BMCFDR3"
 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,DIWF,DIWL,DIWR,DLAYGO,DO,DQ,DR,DTOUT,F,G,I,J,N,P,T,X,Y,Z
 K BMCPROUT,BMCN,BMCNUM,BMCAGE,BMCFIRST,BMCLAST,BMCLTYP,BMCDTIEN,BMCCPRV,BMCAPPDT,BMCAPUR,BMCDTIEN
 K BMCPROV,BMCAPDT,BMCQUIT,BMCCPRV,BMCCPRVP,BMCAPUR,BMCFTYPE,BMCREF,BMCDT,BMCAPPDT,BMCKIND,BMCHOICE,BMCTYPE
 K BMCCMT
 Q
COMP ;
 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
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