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

BMCRD.m

Go to the documentation of this file.
BMCRD ; IHS/PHXAO/TMJ -VISIT DISPLAY ;        [ 08/29/2006  3:46 PM ]
 ;;4.0;REFERRED CARE INFO SYSTEM;**2,3,8,9,12**;JAN 09, 2006;Build 101
 ;IHS/ITSC/FCJ COMMENT OUT BO COM, DIS COM AND MED HX COM WILL BE
 ;     PRINTED from RCIS COMMENTS File, ALSO MODIFIED THE PRINT FOR
 ;     SEPARATION OF COMMENTS
 ;     ADDED OTHER DENIALS REASONS AND PROVIDERS Modules
 ;BMC*4.0 2/17/05 IHS/ITSC/FCJ ADDED N BMCCTYP
 ;     ADDED DISPLAY OF SUFFIX,REMOVED BOLD ON/OFF VARS
 ;BMC*4.0*2 8/21/06 IHS/OIT/FCJ CHG DISPLAY OF CHS INFO
 ;BMC*4.0*3 8.13.07 IHS.OIT.FCJ PRNT INS AUTH NO AND PRNT MED HX/BO COM FR SEC REF TO PRIM REF
 ;BMC*4.0*8 7.26.12 IHS.OIT.FCJ ADDED DISPLAYING OF DENIAL REASON OPTIONS
 ;BMC*4.0*9 ICD-10 CHANGE
 ;BMC*4.0*12 7.27.17 IHS.OIT.FCJ DISPLAY CALL IN INFO
 ;
EP(BMCRIEN) ;PEP Entry point to build lister array
START ;
 Q:'$D(BMCRIEN)
 Q:'BMCRIEN
 Q:'$D(^BMCREF(BMCRIEN,0))
 K ^TMP("BMCRDSP",$J)
 D BUILD
 D EOJ
 Q
 ;
BUILD ; build array
 K BMCAR N BMCCTYP ;BMC 2/17/05 IHS/ITSC/FCJ ADDED N BMCCTYP
 D TERM^VALM0
 S BMCRREC=^BMCREF(BMCRIEN,0)
 S Y=$P(BMCRREC,U,3) D ^AUPNPAT
 S BMCSTR="",BMCCTR=0
 S BMCH="Patient Name",BMCV=$E($P(^DPT($P(BMCRREC,U,3),0),U),1,20) D BUILD1
 S BMCH="Chart #",BMCV=$S($D(^AUPNPAT($P(BMCRREC,U,3),41,DUZ(2),0)):$P(^(0),U,2),1:"None") D BUILD1
 S BMCH="Date of Birth" S Y=AUPNDOB D DD^%DT S BMCV=Y D BUILD1
 S BMCH="Sex",BMCV=AUPNSEX D BUILD1
 S BMCSTR="" D SET
REFERRAL ;
 S BMCDOS=$$AVDOS^BMCRLU(BMCRIEN,"N")            ;BMC*4.0*9
 S BMCSTR="=============== REFERRAL RECORD ===============",X=(80-$L(BMCSTR)\2) D SET ;$J("",X)_BMCSTR D SET
 K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,".01:.49","BMCAR(","E")
 S F=0 F  S F=$O(BMCAR(F)) Q:F'=+F  I BMCAR(F)]"" D
 .S BMCH=$P(^DD(90001,F,0),U)
 .S BMCV=BMCAR(F)
 .I F=".02" S BMCV=BMCV_$P($G(^BMCREF(BMCRIEN,1)),U)   ;4.0 FCJ
 .D BUILD1
 ;BMC*4.0*3 8.13.07 IHS.OIT.FCJ ADDED NXT LINE
 I $$VAL^XBDIQ1(90001,BMCRIEN,1405)'="" S BMCH="Insurance Auth No",BMCV=$$VAL^XBDIQ1(90001,BMCRIEN,1405) D BUILD1,SET
 S BMCSTR="" D SET
 S BMCH="PURPOSE OF REFERRAL",BMCV=$$VAL^XBDIQ1(90001,BMCRIEN,1201) D BUILD1,SET
 S BMCH="NOTES TO SCHEDULER",BMCV=$$VAL^XBDIQ1(90001,BMCRIEN,1301) D BUILD1,SET
 ;BMC*4.0*12 DISPLAY CALL IN INFO
 I $$VAL^XBDIQ1(90001,BMCRIEN,103)'="" D
 .S BMCH="Call In Notification Date",BMCV=$$VAL^XBDIQ1(90001,BMCRIEN,103) D BUILD1
 .I $$VAL^XBDIQ1(90001,BMCRIEN,104)'="" S BMCH="Call In By",BMCV=$$VAL^XBDIQ1(90001,BMCRIEN,104) D BUILD1
 .D SET
11 ;11 node display
 ;K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,"1101:1139","BMCAR(","E")  ;BMC*4.0*8
 K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,"1101:1113;1115:1127","BMCAR(","E")
 S F=0 F  S F=$O(BMCAR(F)) Q:F'=+F  I BMCAR(F)]"" D
 .S BMCH=$P(^DD(90001,F,0),U)
 .S BMCV=BMCAR(F)
 .D BUILD1
 ;BMC*4.0*8 ADDED NEXT 6 LINES
 I $$VAL^XBDIQ1(90001,BMCRIEN,1128)'="" S BMCH="Denial Number",BMCV=$$VAL^XBDIQ1(90001,BMCRIEN,1128) D BUILD1
 K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,"1114;6120","BMCAR(","E")
 S F=0 F  S F=$O(BMCAR(F)) Q:F'=+F  I BMCAR(F)]"" D
 .S BMCH=$P(^DD(90001,F,0),U)
 .S BMCV=BMCAR(F)
 .D BUILD1
 ;S BMCSTR="" D SET
4300 ;OTHER DENIAL REASONS
 K BMCAR D ENPM^XBDIQ1(90001.43,"BMCRIEN,0",".01","BMCAR(")
 S (I,F)=0 F  S I=$O(BMCAR(I)) Q:I'=+I  S BMCSTR="" D SET S F=0 F  S F=$O(BMCAR(I,F)) Q:F'=+F  D
 .S BMCH=$P(^DD(90001.43,F,0),U)
 .S BMCV=BMCAR(I,F)
 .D BUILD1
 .;BMC*4.0*8 ADDED NEXT 2 LINES
 .S BMCV=$P(^BMCREF(BMCRIEN,43,I,0),U,2)
 .I BMCV'="" S BMCV=$P(^ACHSDENS($P(^BMCREF(BMCRIEN,43,I,0),U),20,BMCV,0),U),BMCH="CHS OTH DENIAL REASON OPT:" D BUILD1
 S BMCSTR="" D SET
4400 ;OTHER DENIAL PROVIDERS
 K BMCAR D ENPM^XBDIQ1(90001.44,"BMCRIEN,0",".01","BMCAR(")
 S (I,F)=0 F  S I=$O(BMCAR(I)) Q:I'=+I  S BMCSTR="" D SET S F=0 F  S F=$O(BMCAR(I,F)) Q:F'=+F  D
 .S BMCH=$P(^DD(90001.44,F,0),U)
 .S BMCV=BMCAR(I,F)
 .D BUILD1
 S BMCSTR="" D SET
 ;BMC*4.0*2 8/28/06 IHS.OIT.FCJ Added nxt section
6100 ;Display Appeal information in 61 Node
 K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,"6116:6119","BMCAR(","E")
 S F=0 F  S F=$O(BMCAR(F)) Q:F'=+F  I BMCAR(F)]"" D
 .S BMCH=$P(^DD(90001,F,0),U)
 .S BMCV=BMCAR(F)
 .D BUILD1
 S BMCSTR="" D SET
 ;BMC*4.0*2 8/28/06 IHS.OIT.FCJ End of Changes
14 ;14 Node Display-30 Day Alternate Resource Letter
 K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,"1401:1404","BMCAR(","E")
 S F=0 F  S F=$O(BMCAR(F)) Q:F'=+F  I BMCAR(F)]"" D
 .S BMCH=$P(^DD(90001,F,0),U)
 .S BMCV=BMCAR(F)
 .D BUILD1
 S BMCSTR="" D SET
 ;
15 ;15 Node Display-Alt Resource Ltr Documentation
 ;
 S BMCSTR="ALTERNATE RESOURCE LETTER:" D SET
 K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,1501,"BMCAR(","E")
 S F=0 F  S F=$O(BMCAR(1501,F)) Q:F'=+F  S BMCSTR=BMCAR(1501,F) D SET
 S BMCSTR="" D SET
1 ;
2 ;
61 ;CHS Eligibility Factors
 K BMCAR D ENP^XBDIQ1(90001,BMCRIEN,"6101:6115","BMCAR(","E")
 ;BMC*4.0*2 8/21/06 IHS/OIT/FCJ CHG DISPLAY OF CHS INFO
 ;S F=0 F  S F=$O(BMCAR(F)) Q:F'=+F  I BMCAR(F)]"" D
 F F=6101,6111,6112,6102,6105,6106,6103,6107,6108,6104,6109,6110,6113,6114,6115 I BMCAR(F)]"" D
 .S BMCH=$P(^DD(90001,F,0),U)
 .S BMCV=BMCAR(F)
 .D BUILD1
 S BMCSTR="" D SET
 ;
3 ;
LOCAL ;Local Category Display
 ;
 I '$D(^BMCREF(BMCRIEN,21)) G AUTH
 S BMCSTR="LOCAL CATEGORIES:" D SET
 K BMCAR D ENPM^XBDIQ1(90001.21,"BMCRIEN,0",".01","BMCAR(")
 S (I,F)=0 F  S I=$O(BMCAR(I)) Q:I'=+I  S BMCSTR="" D SET S F=0 F  S F=$O(BMCAR(I,F)) Q:F'=+F  D
 .S BMCH=$P(^DD(90001.21,F,0),U)
 .S BMCV=BMCAR(I,F)
 .D BUILD1
 S BMCSTR="" D SET
AUTH ;display authorizations, similiar to v file
 I '$D(^BMCREF(BMCRIEN,41)) G CHSASA
 S BMCSTR="CHS AUTHORIZATIONS:" D SET
 K BMCAR D ENPM^XBDIQ1(90001.41,"BMCRIEN,0",".01:.13","BMCAR(")
 S (I,F)=0 F  S I=$O(BMCAR(I)) Q:I'=+I  S BMCSTR="" D SET S F=0 F  S F=$O(BMCAR(I,F)) Q:F'=+F  D
 .S BMCH=$P(^DD(90001.41,F,0),U)
 .S BMCV=BMCAR(I,F)
 .D BUILD1
 S BMCSTR="" D SET
CHSASA ;
 S BMCSTR="CHS APPROVAL STATUS AUDIT LOG:" D SET
 K BMCAR D ENPM^XBDIQ1(90001.42,"BMCRIEN,0",".01:.05","BMCAR(")
 S (I,F)=0 F  S I=$O(BMCAR(I)) Q:I'=+I  S BMCSTR="" D SET S F=0 F  S F=$O(BMCAR(I,F)) Q:F'=+F  D
 .S BMCH=$P(^DD(90001.42,F,0),U)
 .S BMCV=BMCAR(I,F)
 .D BUILD1
 S BMCSTR="" D SET
VFILES ;set up array of all v file entries
 NEW DA,D0,DIC,DIQ,DR,DI
 S BMCVFLE=90001 F BMCVL=0:0 S BMCVFLE=$O(^DIC(BMCVFLE)) Q:BMCVFLE>90001.09!(BMCVFLE'=+BMCVFLE)  D VF2
 Q
 ;
VF2 ;
 I BMCVFLE="90001.04",$P($G(^BMCREF(BMCRIEN,1)),U)="" D SEC Q  ;4.0 FCJ
 S BMCVNM=$P(^DIC(BMCVFLE,0),U),BMCVDG=^DIC(BMCVFLE,0,"GL"),BMCVIGR=BMCVDG_"""AD"",BMCRIEN,BMCVDFN)",BMCVDFN=""
 I BMCVFLE="90001.03" F BMCCTYP="M","B","C","D","S" D
 .;S BMCVNM=$S(BMCCTYP="M":"Medical Hx Comment",BMCCTYP="B":"Business/CHS Comment",BMCCTYP="C":"Case Review Comment",BMCCTYP="D":"Discharge Comment",1:"")
 .S BMCVNM=$S(BMCCTYP="M":"Medical Hx Comment",BMCCTYP="C":"Case Review Comment",BMCCTYP="D":"Discharge Comment",1:"Business/CHS Comment")
 .S BMCVDFN="",BMCVI=1 F  S BMCVDFN=$O(@BMCVIGR) Q:BMCVDFN=""  D
 ..I $P(^BMCCOM(BMCVDFN,0),U,5)=BMCCTYP D VF3 S BMCVI=2
 E  F BMCVI=1:1 S BMCVDFN=$O(@BMCVIGR) Q:BMCVDFN=""  D VF3
 Q
 ;
VF3 ;
 I BMCVI<2 S BMCSTR="" D SET S BMCSTR="=============== "_BMCVNM_"s ===============",X=(80-$L(BMCSTR)\2) D SET
 K BMCAR D ENP^XBDIQ1(BMCVFLE,BMCVDFN,".01:.019999;.04:999999","BMCAR(","E")
 ;BMC*4.0*9 11-1-12 IHS/OIT/FCJ;NEW LINE FOR ICD-10 CHANGES
 I BMCVFLE="90001.01" D
 .D ENP^XBDIQ1(BMCVFLE,BMCVDFN,".01","BMCAR(","I")
 .S BMCAR(.01)=$P($$ICDDX^ICDEX(BMCAR(.01),BMCDOS,,"E"),U,2)_" - "_$E($P($$ICDDX^ICDEX(BMCAR(.01),BMCDOS,,"E"),U,4),1,50)
 S BMCSTR="" D SET
 S F=0 F  S F=$O(BMCAR(F)) Q:F'=+F  D
 .I $G(BMCAR(F))]"" D
 ..S BMCH=$P(^DD(BMCVFLE,F,0),U)
 ..S BMCV=BMCAR(F)
 ..Q:(BMCVFLE="90001.03")&(F=".05")
 ..D BUILD1
 .S G=0 F  S G=$O(BMCAR(F,G)) Q:G'=+G  I $G(BMCAR(F,G))]"" D
 ..S BMCSTR=BMCAR(F,G)
 ..D SET
 K G
 Q
SEC ;SEC REF INFO ;4.0 FCJ
 ;TEST FOR SECONDARY REF, IF EXIST SET VARS
 ;DATE INITIATE,BY WHO,PROVIDER,EXP APT DATE,PURPOSE,SUF AND NU OF VISITS LEFT
 S BMCRNUMB=$P(^BMCREF(BMCRIEN,0),U,2),BMCTMP=BMCVFLE
 Q:'$D(^BMCREF("S",BMCRNUMB))
 S BMCSTR="" D SET
 S BMCSTR="=============== Secondary Referrals ===============",X=(80-$L(BMCSTR)\2) D SET
 S BMCSUF=0
 W !,BMCRNUMB
 F  S BMCSUF=$O(^BMCREF("S",BMCRNUMB,BMCSUF)) Q:BMCSUF=""  D
 .S BMCSRIEN=0
 .S BMCSRIEN=$O(^BMCREF("S",BMCRNUMB,BMCSUF,BMCSRIEN)) Q:BMCSRIEN'?1N.N  D
 ..S BMCSTR="" D SET
 ..S BMCH="DATE INITIATED",BMCV=$$VAL^XBDIQ1(90001,BMCSRIEN,.01) D BUILD1
 ..S BMCH="USER",BMCV=$$VAL^XBDIQ1(90001,BMCSRIEN,.25) D BUILD1
 ..S BMCH="PROVIDER VENDOR",BMCV=$$VAL^XBDIQ1(90001,BMCSRIEN,.07) D BUILD1
 ..S BMCH="EXP APPT DATE",BMCV=$$VAL^XBDIQ1(90001,BMCSRIEN,1105) D BUILD1
 ..S BMCH="PURPOSE OF REFERRAL",BMCV=$$VAL^XBDIQ1(90001,BMCSRIEN,1201) D BUILD1
 ..S BMCH="SUFFIX",BMCV=$$VAL^XBDIQ1(90001,BMCSRIEN,101) D BUILD1
 ..S BMCH="OUTP VISITS LEFT",BMCV=$$VAL^XBDIQ1(90001,BMCSRIEN,1111) D BUILD1
 ..;BMC*4.0*3 12.13.07 IHS.OIT.FCJ ADDED PRINT MED HX/BO COM FOR SEC REF ON PRIM REF
 ..S BMCVFLE="90001.03"
 ..S BMCVNM=$P(^DIC(BMCVFLE,0),U),BMCVDG=^DIC(BMCVFLE,0,"GL"),BMCVIGR=BMCVDG_"""AD"",BMCSRIEN,BMCVDFN)"
 ..F BMCCTYP="M","S" D
 ...S BMCVDFN="",BMCVI=1
 ...S BMCVNM=$S(BMCCTYP="M":"Sec Ref-"_BMCSUF_" Medical Hx Comment",BMCCTYP="S":"Sec Ref-"_BMCSUF_" Business/CHS Comment",1:"")
 ...F  S BMCVDFN=$O(@BMCVIGR) Q:BMCVDFN=""  D
 ....I $P(^BMCCOM(BMCVDFN,0),U,5)=BMCCTYP D VF3 S BMCVI=2
 ..S BMCVFLE=BMCTMP
 Q
BUILD1 ;
 S BMCSTR=$E(BMCH,1,25)_":",BMCSTR=$$SETSTR^VALM1(BMCV,BMCSTR,28,$L(BMCV))
 D SET
 Q
SET ;set array
 S BMCCTR=BMCCTR+1
 S ^TMP("BMCRDSP",$J,BMCCTR,0)=BMCSTR
 S BMCSTR=""
 Q
 ;
EOJ ;
 K BMCAR,BMCSTR,BMCCTR,BMCH,BMCRREC,BMCV,BMCVNM,BMCVDG,BMCVIGR,BMCVDFN
 N BMCCTYP ;BMC 2/17/05 IHS/ITSC/FCJ ADDED N BMCCTYP
 Q