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

BMCMOD.m

Go to the documentation of this file.
BMCMOD ; IHS/PHXAO/TMJ - MODIFY A REFERRAL 1 OF 2 ;           [ 08/22/2006  11:07 AM ]
 ;;4.0;REFERRED CARE INFO SYSTEM;**2,3,6,8,9,12**;JAN 09, 2006;Build 101
 ;
 ;IHS/ITSC/FCJ ADDED OPTION TO REDISPLAY PAT REF'S
 ;   NEW OPTION TO SEND BULLETIN;DATE/USER STAMPED ADDING COMMENTS
 ;   FOR BUS OFF, DSCH NOTES AND MED HX;BUS OFF OPT CHGD TO REQUEST
 ;   COMMENTS ONLY;TEST OF 7 & 9 TO ALLOW EDIT FROM MENU FOR BOC & CASE
 ;   COM;MOD CHS ELIG EDIT FOR BUS OFF COM ; ADDED MENU OPTION
 ;4.0 IHS/OIT/FCJ ADDED 0 TO FILTER AND PRNT REVIEWER
 ; This option allows the user to select and modify referrals.
 ;4.0*2 8.22.06 IHS.OIT.FCJ NO LONGER ALLOW EDIT OF PHY NOTES
 ;BMC*4.0*3 10.1.2007 IHS/ITSC/FCJ ADDED OPT 16 ALERT TO PHYS
 ;BMC*4.0*12 IHS/OIT/FCJ CHANGED TEMPLATES FOR CALL IN TYPE
 ;
 ; See ^BMCVDOC for system wide variables set by main menu
 ;
START ;
 D:'$D(BMCPARM) PARMCHK^BMC
 F  D MAIN Q:BMCQ  D HDR^BMC
 D EOJ
 Q
MAIN ;
 S BMCQ=0,BMCMODE="M"
 D REFERRAL ;          get referral record to modify
 Q:BMCQ
 S BMCDOS=$$AVDOS^BMCRLU(BMCRIEN,"N") S:+BMCDOS<1 BMCDOS=$P(^BMCREF(BMCRIEN,0),U)   ;BMC*4.0*9
 ;BMC*4.0*6 IHS.OIT.FCJ COMBINED LINES FOR MENU OPTION CALLS
 ;I $G(BMCDTYPE)=7 D 7 Q
 ;I $G(BMCDTYPE)=9 D 9 Q
 ;I $G(BMCDTYPE)=10 D 10 Q
 D GETSNO^BMCADD3      ;BMC*4.0*8
 I $G(BMCDTYPE) D @BMCDTYPE Q
 I BMCCHSE=1 D CHS
 Q:BMCCHSE=1
 F  D TYPE Q:BMCQ  ;   modify referral
 D PCCL
 I BMCDTYPE=13 S BMCQ=0
 Q
REFERRAL ; GET REFERRAL TO MODIFY
 I BMCCLOSE=1 D SCREEN Q
 I BMCCLOSE="" D GETREF Q
 I BMCCHSE=1 D GETREF Q
GETREF ;Screens out closed Referrals
 S BMCRTY=0 I BMCCHSE=1 S BMCRTY=2
 S BMCQ=1
 W !
 S DIC="^BMCREF(",DIC("S")="I $$FILTER^BMCFLTR(0,BMCCURFY,BMCRTY)",DIC(0)="AEMQ",DIC("A")="Select RCIS REFERRAL by Patient or by Referral Date or #: "
 D DIC^BMCFMC
 Q:Y<1
 S BMCRIEN=+Y
 S BMCQ=0
 Q
 ;
SCREEN ;Display ONLY CLOSED Referrals
 S BMCQ=1
 W !
 S DIC="^BMCREF(",DIC("S")="I $$FILTER^BMCFLTR(1,BMCCURFY,0)",DIC(0)="AEMQ",DIC("A")="Select RCIS REFERRAL by Patient or by Referral Date or #: "
 D DIC^BMCFMC
 Q:Y<1
 S BMCRIEN=+Y
 S BMCQ=0
 Q
 ;
CHS ;Enter CHS Data with Screenman
 S DDSFILE=90001,DA=BMCRIEN,DR=$S(BMCRIO="I":"[BMC CHS ADD]",1:"[BMC CHS ADD]"),DDSPARM="C"
 D DDS^BMCFMC
 I BMCRIO="I" D  D:+Y>0 DENR^BMCCHSE
 .S DIR("A")="Do you wish to EDIT Denial Reasons",DIR(0)="Y",DIR("B")="NO"   ;BMC*4.0*8 ADD DENIAL EDIT
 .D ^DIR K DIR
 Q
TYPE ; EP - Get type of data to edit
 S BMCQ=1,BMCDTYPE=""
 ;BMC*4.0*9 CHNG ICD9 TO ICD IN NXT LINE
 S DIR(0)="SO^0:QUIT;1:MINI MOD;2:ALL DATA;3:DATE/COUNTS;4:COSTS;5:ICD DX;6:CPT PROCEDURES;7:CASE REVIEW;8:PURPOSE/MED HX/OTHER DX INFO;9:BUSINESS OFFICE;10:DISCHARGE NOTES;11:ADD DOCUMENTATION;12:CHS ELIG FACTORS;13:OTHER REFERRALS"
 ;BMC*4.0*3 10.1.2007 IHS/ITSC/FCJ ADDED OPT 16 TO NXT LINE;4.0*8 7.10.13 IHS.OIT.FCJ ADDED OPT 17
 S DIR(0)=DIR(0)_";14:SEND GROUP MESSAGE;15:SEND MESSAGE TO PROVIDERS;16:SEND ALERT TO PROVIDERS;17:APPROVE REFERRAL"
 S DIR("A")="EDIT Which Data Type",DIR("B")="0" K DA D ^DIR K DIR
 Q:$D(DIRUT)
 Q:'Y
 S BMCDTYPE=+Y
 D @BMCDTYPE
 I BMCDTYPE=13 Q
 S BMCQ=0
 Q
 ;
MINIMOD ; REFERRAL MINI MODIFICATION FORM
1 ; LABEL FOR @DO
 ;BMC*4.0*12 IHS/OIT/FCJ ADDED TEST FOR CALLIN TYPE
 ;S DDSFILE=90001,DA=BMCRIEN,DR="[BMCX REFERRAL ADD]",DDSPARM="C"
 S DDSFILE=90001,DA=BMCRIEN,DR=$S($P($G(^BMCREF(BMCRIEN,1)),U,3)?1N.N:"[BMC REF ADD CALL-IN]",1:"[BMCX REFERRAL ADD]"),DDSPARM="C"
 D DDS^BMCFMC
 I BMCVREF D VREFP D:BMCRSTAT="A" VREF  ;BMC*4.0*8 CHECK FOR CHANGE OF SNOMED CD
 E  D SNO
 D 80
 S Y=BMCRIEN
 D ^BMCREF
 Q
ALLDATA ; MODIFY ALL REFERRAL DATA
2 ; LABEL FOR @DO
 S BMCTMP=BMCMODE,BMCMODE="E"
 ;BMC*4.0*12 IHS/OIT/FCJ ADDED TEST FOR CALLIN TYPE
 ;S DDSFILE=90001,DA=BMCRIEN,DR="[BMC REFERRAL MOD]",DDSPARM="C"
 S DDSFILE=90001,DA=BMCRIEN,DR=$S($P($G(^BMCREF(BMCRIEN,1)),U,3)?1N.N:"[BMC REF ADD CALL-IN]",1:"[BMC REFERRAL MOD]"),DDSPARM="C"
 D DDS^BMCFMC
 S Y=BMCRIEN
 D ^BMCREF ;              set standard variables from record
 F X=4,5,6,80 D @X Q:$D(DIRUT)  ; edit all other data
 I BMCVREF D VREFP D:BMCRSTAT="A" VREF  ;BMC*4.0*8 CHECK FOR CHANGE OF SNOMED CD
 E  D SNO
 S BMCMODE=BMCTMP
 Q
 ;
 S DDSFILE=90001,DA=BMCRIEN,DR="[BMC MODIFY COST INFORMATION]",DDSPARM="C"
 D DDS^BMCFMC
 Q
 ;
DATES ; MODIFY DATE FIELDS
3 ; LABEL FOR @DO
 S DDSFILE=90001,DA=BMCRIEN,DR=$S(BMCRIO="I":"[BMC MODIFY DATES (INPT)]",1:"[BMC MODIFY DATES (OUPT)]"),DDSPARM="C"
 D DDS^BMCFMC
 Q
 ;
COST ;MODIFY COST FIELDS
4 ; LABEL FOR @DO
 S DDSFILE=90001,DA=BMCRIEN,DR="[BMC MODIFY COST INFORMATION]",DDSPARM="C"
 D DDS^BMCFMC
 Q
 ;
DX ; EP - EDIT DIAGNOSES EDIT DIAGNOSES
5 ; LABEL FOR @DO
 S APCDOVRR=""
 S BMCV="DX",BMCTERM="Diagnoses",BMCATEMP="[BMC DIAGNOSIS ADD]",BMCG="^BMCDX(",BMCETEMP="[BMC DIAGNOSIS EDIT]"
 S BMCCTYP="DX"
 D ASK
 Q
 ;
PROC ; EP - EDIT PROCEDURES
6 ; LABEL FOR @DO
 S BMCV="PROC",BMCTERM="Procedures",BMCATEMP="[BMC PROCEDURE ADD]",BMCG="^BMCPX(",BMCETEMP="[BMC PROCEDURE EDIT]"
 S BMCCTYP="P"
 D ASK
 Q
 ;
COMMENTS ; EDIT COMMENTS CASE REVIEW
7 ; LABEL FOR @DO
 S BMCV="COM",BMCTERM="Case Review Comments",BMCATEMP="[BMC COMMENTS ADD]",BMCG="^BMCCOM(",BMCETEMP="[BMC COMMENTS EDIT]"
 S BMCCTYP="C"
 D ASK
 S DIE="^BMCREF(",DA=BMCRIEN,DR=".31" ;    get next review date
 D DIE^BMCFMC
 Q
 ;
PURPOSE ; EDIT PURPOSE OF REFERRAL
8 ; LABEL FOR @DO
 S DDSFILE=90001,DA=BMCRIEN,DR="[BMC MODIFY MEDICAL INFO]",DDSPARM="C"
 D DDS^BMCFMC
 ;IHS/ITSC/FCJ REMOVED BUSINESS, DISCHARGE, MED HX FROM
 ;SCREENMAN TEMPLATE WILL NOW ASK INDIVIDUALLY ADDED NXT 6 LNS
80 ;EP FROM 2ND REF AND FR MED HX MENU OPTION
 S BMCV="COM",BMCTERM="Medical HX/Findings Comments",BMCATEMP="[BMC COMMENTS ADD]",BMCG="^BMCCOM(",BMCETEMP="[BMC COMMENTS EDIT]"
 S BMCCTYP="M"
 D ASK
 Q:(BMCDTYPE=1)!(BMCDTYPE=8)!(BMCDTYPE=80)  ;BMC*4.0*6 4.22.2010 IHS.OIT.FCJ ADDED TEST FOR BMCDTYPE=80
 F X=10,9 D @X Q:$D(DIRUT)
 Q
 ;
BUSINESS ; EDIT BUSINESS OFFICE COMMENTS
9 ; LABEL FOR @DO
 ;IHS/ITSC/FCJ CHG TO ASK FOR ONLY BO COMMENTS
 S BMCV="COM",BMCTERM="Business Office Comment",BMCATEMP="[BMC COMMENTS ADD]",BMCG="^BMCCOM(",BMCETEMP="[BMC COMMENTS EDIT]"
 S BMCCTYP="B"
 D ASK
 Q
 ;
DSCHARGE ; EDIT DISCHARGE NOTES
10 ; LABEL FOR @DO
 ;IHS/ITSC/FCJ CHG TO ADD COMMENTS TO COMMENT FILE W/USER & DATE STAMP
 S BMCV="COM",BMCTERM="Discharge Notes Comments",BMCATEMP="[BMC COMMENTS ADD]",BMCG="^BMCCOM(",BMCETEMP="[BMC COMMENTS EDIT]"
 S BMCCTYP="D"
 D ASK
 S DIE="^BMCREF(",DA=BMCRIEN,DR=".18" ;    get ltr release date
 D DIE^BMCFMC
 Q
 ;
ADDLDOC ; EDIT LIST OF ADDITIONAL DOCUMENTATION TO BE INCLUDED WITH REFERRAL
11 ; LABEL FOR @DO
 S DDSFILE=90001,DA=BMCRIEN,DR="[BMC ADDITIONAL DOC]"
 D DDS^BMCFMC
 Q
FACTOR ;CHS ELIG FACTORS
12 ; LABEL FOR @DO
 S DDSFILE=90001,DA=BMCRIEN,DR="[BMC CHS ELIGIBILITY]",DDSPARM="C"
 D DDS^BMCFMC
 S BMCV="COM",BMCTERM="Business Office Comments",BMCATEMP="[BMC COMMENTS ADD]",BMCG="^BMCCOM(",BMCETEMP="[BMC COMMENTS EDIT]"
 S BMCCTYP="B"
 D ASK
 Q
REF ;IHS/ITSC/FCJ ADD 13TH OPTION TO ALLOW SELECTING OTHER REF FOR PATIENT
13 ;LABEL FOR @DO
 S DIC("B")=BMCREC("PAT NAME")
 Q
ALERT ;Mail Bulletin Alerts 
14 ;IHS/ITSC/FCJ ADD 14TH OPT TO ALLOW SENDING MAILMAN MESSAGE
 W @IOF
 ;I 'BMCCHSA,BMCRTYPE="C" D ER Q
 ;I 'BMCIHSA,BMCRTYPE="I" D ER Q
 ;I 'BMCOTHRA,BMCRTYPE="O" D ER Q
 ;I 'BMCHOUSA,BMCRTYPE="N" D ER Q
 ;I 'BMCCHSA,'BMCIHSA,'BMCOTHRA,'BMCHOUSA  D ER Q
 D ENMM^BMCMM
 Q
15 ;IHS/ITSC/FCJ ADD 15TH OPT TO ALLOW SENDING MAILMAN MESSAGE TO PRIM
 ;AND REF PROVIDER ONLY
 D ENMM^BMCMM
 Q
16 ;BMC*4.0*3 10.1.2007 IHS/ITSC/FCJ ADD 16TH OPT TO ALLOW TO PRIM AND REF PROVIDER ONLY
 S BMCPPRV=$P(^AUPNPAT(BMCDFN,0),U,14),BMCRPRV=$P(^BMCREF(BMCRIEN,0),U,6),BMCRHDR="Updated"
 S DIR(0)="Y",DIR("B")="Y",DIR("A")="Do you wish to send alert to the Referring Provider"
 W ! D ^DIR K DIR Q:$D(DUOUT)
 NEW XQA
 I Y>0 S XQA(BMCRPRV)=""
 ;TEST FOR PAT PRIM PROV
 I BMCPPRV'="",BMCPPRV'=BMCRPRV D
 .S DIR(0)="Y",DIR("B")="Y",DIR("A")="Patient's Primary Provider is different then the Referring Physician, do you want to send alert to the Primary Provider"
 .W ! D ^DIR K DIR Q:($D(DUOUT))!(Y=0)
 .S XQA(BMCPPRV)=""
 I $D(XQA) D PALRT1^BMCALERT
 Q
17 ;EP BMCMODS;BMC 4.0*8 5.8.13 IHS/OIT/FCJ ADDED OPTION TO UPDATE STATUS TO A1-APPROVED
 S BMCSTAT=""
 K DIR
 I $P(^BMCREF(BMCRIEN,0),U,15)'="A" D  Q
 .W !,"Referral status can only be changed from Active to Approved,",!?10,"Referral Status:  ",$$VAL^XBDIQ1(90001,BMCRIEN,.15)
 .D PAUSE^BMC
 W !!
 S DIR(0)="SOA^A:ACTIVE;A1:APPROVED",DIR("?")="Set to Approved if patient will receive referred services even if denied by CHS"
 S DIR("A")="Enter Referral Status: ACTIVE// "
 S DIR("A",1)="  Referral Status:  "_$$VAL^XBDIQ1(90001,BMCRIEN,.15)
 S DIR("A",2)=""
 S DIR("A",3)="Select A1 to Approve the Referral"
 S DIR("A",4)="          A     ACTIVE"
 S DIR("A",5)="          A1    APPROVAL"
 D ^DIR K DIR
 Q:X'="A1"
 S BMCSTAT=Y
 S DIE="^BMCREF(",DR=".15////"_BMCSTAT,DA=BMCRIEN
 D DIE^BMCFMC
 Q
ER W !,"Parameters have not been set up to send messages for this type of Referral." H 1
 Q
ASK ;EP
 S BMCDF=$S($G(BMCCLOSE):"A",1:"E")
 F  D ASK2 Q:BMCQ
 Q
 ;
ASK2 ;IHS/ITSC/FCJ MODIFED TO NOT ALLOW EDITING OR DELETING OF BO COMMENTS
 S BMCQ=1
 W:$D(IOF) @IOF
 ;4.0*2 8.22.06 IHS.OIT.FCJ NO LONGER ALLOW EDIT OF PHY NOTES
 I (BMCCTYP="B")!(BMCCTYP="M"),'$G(BMCSUP) W !!,"You may add a new "_BMCTERM,!
 E  W !!,"You may edit one of the existing "_BMCTERM_" or add a new one",!
 S BMCNONE=0
 D @("DISP"_BMCV_"^BMCMOD1")
 ;4.0*2 8.22.06 IHS.OIT.FCJ NO LONGER ALLOW EDIT OF PHY NOTES
 I (BMCCTYP="B")!(BMCCTYP="M"),'$G(BMCSUP) S BMCNONE=1
 ;add or edit one of above
 W !
 I BMCNONE S DIR(0)="S^A:ADD a new "_BMCTERM,BMCDF="Q" W:BMCCTYP'="B" !,"  No entries to edit",! I 1
 E  S DIR(0)="S^E:EDIT one of the above "_BMCTERM_";A:ADD a new "_BMCTERM_";D:DELETE one of the above "_BMCTERM
 S DIR(0)=DIR(0)_";Q:QUIT"
 ;S DIR("A")="Do you wish to",DIR("B")=$S(BMCDF="E":"Q",1:"A")  ;4.0 7.11.05 IHS/ITSC/FCJ ADDED TEST FOR MODE TO DEFAULT TO Q ON COMMENTS
 S DIR("A")="Do you wish to",DIR("B")=$S(BMCMODE="E":"Q",BMCDF="E":"Q",1:"A")
 D ^DIR K DIR
 Q:$D(DIRUT)
 Q:Y="Q"
 D @Y
 S:'$G(BMCCLOSE) BMCDF="Q"
 S BMCQ=0
 Q
 ;
E ;edit an existing XXX
 D @("DISP"_BMCV_"^BMCMOD1")
 W ! S DIR(0)="N^1:"_BMCC_":",DIR("A")="Which One do you wish to EDIT" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) Q
 Q:'Y
 S BMCC=+Y
 I '$D(BMCRDX(BMCC)) W !!,"Invalid choice." Q
 S DA=BMCRDX(BMCC),DIE=BMCG,DR=BMCETEMP
 D DIE^BMCFMC
 I $D(Y) W !!,"ERROR ENCOUNTERED IN EDITING A "_BMCTERM Q
 Q
 ;
A ;add a new XXX
 S BMCLOOK=1
 W !!,"Adding a NEW "_BMCTERM_"...",!
 I BMCV="COM" D COMMENTS^BMCADD1 Q
 I BMCV="DX" D ADDDX^BMCMOD1 Q    ;BMC*4.0*9 ADDED TO CALL LEXICON
 I BMCV="PROC" D ADDPX^BMCMOD1 Q    ;BMC*4.0*9 ADDED
 S DIE="^BMCREF(",DR=BMCATEMP,DA=BMCRIEN
 D DIE^BMCFMC
 I $D(Y) W !!,"NO "_BMCTERM_" ADDED!"
 K BMCLOOK
 Q
 ;
D ;delete XXX
 D @("DISP"_BMCV_"^BMCMOD1")
 S DIR(0)="N^1:"_BMCC_":",DIR("A")="Which One do you wish to DELETE" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) Q
 Q:'Y
 S BMCC=+Y
 I '$D(BMCRDX(BMCC)) W !!,"Invalid choice." Q
 ;
 S DIR(0)="Y",DIR("A")="Are you sure you want to delete this "_BMCTERM,DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q:$D(DIRUT)
 I 'Y W !,"Okay, not deleted." Q
 S DA=BMCRDX(BMCC),DIK=BMCG D DIK^BMCFMC W !,BMCTERM_" DELETED" Q
 Q
 ;
PCCL ; PCC LINK
 I $$VALI^XBDIQ1(90001,BMCRIEN,".15")="C1" D ^BMCPCCL
 Q
 ;
VREF ;EP FR BMCMODS;BMC*4.0*8 NEW MODULE TO UPDATE SNOMED IN V REF FILE
 Q:$P(^AUPNVREF(BMCVREF,0),U)=BMCSCOD
 S DIE="^AUPNVREF(",DA=BMCVREF,DR=".01///"_BMCSCOD_";1218////"_$$NOW^XLFDT
 D DIE^BMCFMC
 Q
VREFP ;BMC*4.0*8 NEW MODULE TO UPDATE PROV IN V REF FILE
 Q:$P(^AUPNVREF(BMCVREF,12),U,2)=$P(^BMCREF(BMCRIEN,0),U,6)
 S DIE="^AUPNVREF(",DA=BMCVREF,DR="1202////"_$P(^BMCREF(BMCRIEN,0),U,6)_";1218////"_$$NOW^XLFDT
 D DIE^BMCFMC
 K DIE,DR,X,DA
 Q
SNO ;EP FROM BMCMODS;BMC*4.0*9 NEW MODULE TO ADD SNOMED FOR SITES W/O PCC
 Q:BMCSCOD=$P($G(^BMCREF(BMCRIEN,22,1,0)),U)
 S DR=".01///"_BMCSCOD
 S DIE="^BMCREF("_BMCRIEN_",22,",DA=1
 D DIE^BMCFMC
 K DIE,DR,X,DA
 Q
 ;
EOJ ; END OF JOB
 K BMCRTY
 D ^BMCKILL
 D ^XBFMK
 Q