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

BRNRD.m

Go to the documentation of this file.
BRNRD ; IHS/PHXAO/TMJ -DISCLOSURE DISPLAY ;   [ 04/10/03  1:34 PM ]
 ;;2.0;RELEASE OF INFO SYSTEM;*1,4*;APR 10, 2003;Build 15
 ;IHS/OIT/LJF 03/06/2008 PATCH 1 Changed ;PEP to ;EP on line EP
 ;IHS/OIT/GAB PATCH 4 - Change to Description; April 2017
EP(BRNRIEN) ;EP
START ;Enter Point to Build Array
 Q:'$D(BRNRIEN)
 Q:'BRNRIEN
 Q:'$D(^BRNREC(BRNRIEN,0))
 K ^TMP("BRNRDSP",$J)
 D BUILD
 D EOJ
 Q
 ;
BUILD ; build array
 K BRNAR
 D TERM^VALM0
 S BRNRREC=^BRNREC(BRNRIEN,0)
 S Y=$P(BRNRREC,U,3) D ^AUPNPAT
 S BRNSTR="",BRNCTR=0
 S BRNH="Patient Name",BRNV=IOINHI_$E($P(^DPT($P(BRNRREC,U,3),0),U),1,20)_IOINORM D BUILD1
 S BRNH="Chart #",BRNV=IOINHI_$S($D(^AUPNPAT($P(BRNRREC,U,3),41,DUZ(2),0)):$P(^(0),U,2),1:"None")_IOINORM D BUILD1
 S BRNH="Date of Birth" S Y=AUPNDOB D DD^%DT S BRNV=Y D BUILD1
 S BRNH="Sex",BRNV=AUPNSEX D BUILD1
 S BRNSTR="" D SET
REFERRAL ;
 S BRNSTR="=============== "_IOINHI_"DISCLOSURE RECORD"_IOINORM_" ===============",X=(80-$L(BRNSTR)\2) D SET ;$J("",X)_BRNSTR D SET
 K BRNAR D ENP^XBDIQ1(90264,BRNRIEN,".01:.49","BRNAR(","E")
 S F=0 F  S F=$O(BRNAR(F)) Q:F'=+F  I BRNAR(F)]"" D
 .S BRNH=$P(^DD(90264,F,0),U)
 .S BRNV=BRNAR(F)
 .D BUILD1
 S BRNSTR="" D SET
 S BRNH="PURPOSE OF DISCLOSURE",BRNV=$$VAL^XBDIQ1(90264,BRNRIEN,.07) D BUILD1,SET
2 ;
 ;/IHS/OIT/GAB Patch #4 - changed below to Disclosure Description
 ;S BRNSTR="DISCLOSURE NOTES:" D SET
 S BRNSTR="DISCLOSURE DESCRIPTION:" D SET
 K BRNAR D ENP^XBDIQ1(90264,BRNRIEN,22,"BRNAR(","E")
 S F=0 F  S F=$O(BRNAR(22,F)) Q:F'=+F  S BRNSTR=BRNAR(22,F) D SET
 S BRNSTR="" D SET
AUTH ;display Receiving Parties, similiar to v file
 I '$D(^BRNREC(BRNRIEN,23)) G VFILES
 S BRNSTR="ROI RECEIVING PARTIES:" D SET
 K BRNAR D ENPM^XBDIQ1(90264.023,"BRNRIEN,0",".01:.04","BRNAR(")
 S (I,F)=0 F  S I=$O(BRNAR(I)) Q:I'=+I  S BRNSTR="" D SET S F=0 F  S F=$O(BRNAR(I,F)) Q:F'=+F  D
 .S BRNH=$P(^DD(90264.023,F,0),U)
 .S BRNV=BRNAR(I,F)
 .D BUILD1
 S BRNSTR="" D SET
VFILES ;set up array of all v file entries
 NEW DA,D0,DIC,DIQ,DR,DI
 S BRNVFLE=90264 F BRNVL=0:0 S BRNVFLE=$O(^DIC(BRNVFLE)) Q:BRNVFLE>90264.04!(BRNVFLE'=+BRNVFLE)  D VF2
 Q
 ;
VF2 ;
 S BRNVNM=$P(^DIC(BRNVFLE,0),U),BRNVDG=^DIC(BRNVFLE,0,"GL"),BRNVIGR=BRNVDG_"""AD"",BRNRIEN,BRNVDFN)",BRNVDFN=""
 F BRNVI=1:1 S BRNVDFN=$O(@BRNVIGR) Q:BRNVDFN=""  D VF3
 Q
 ;
VF3 ;
 I BRNVI<2 S BRNSTR="" D SET S BRNSTR="=============== "_IOINHI_BRNVNM_"s"_IOINORM_" ===============",X=(80-$L(BRNSTR)\2) D SET ;$J("",X)_BRNSTR D SET
 K BRNAR D ENP^XBDIQ1(BRNVFLE,BRNVDFN,".01:.019999;.04:999999","BRNAR(","E")
 S BRNSTR="" D SET
 S F=0 F  S F=$O(BRNAR(F)) Q:F'=+F  D
 .I $G(BRNAR(F))]"" D
 ..S BRNH=$P(^DD(BRNVFLE,F,0),U)
 ..S BRNV=BRNAR(F)
 ..D BUILD1
 .S G=0 F  S G=$O(BRNAR(F,G)) Q:G'=+G  I $G(BRNAR(F,G))]"" D
 ..S BRNSTR=BRNAR(F,G)
 ..D SET
 ..Q
 K G
 Q
BUILD1 ;
 S BRNSTR=$E(BRNH,1,25)_":",BRNSTR=$$SETSTR^VALM1(BRNV,BRNSTR,28,$L(BRNV))
 D SET
 Q
SET ;set array
 S BRNCTR=BRNCTR+1
 S ^TMP("BRNRDSP",$J,BRNCTR,0)=BRNSTR
 S BRNSTR=""
 Q
 ;
EOJ ;
 K BRNAR,BRNSTR,BRNCTR,BRNH,BRNRREC,BRNV,BRNVNM,BRNVDG,BRNVIGR,BRNVDFN
 K BRNVFLE,BRNVI,BRNVL
 Q