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

AZXARD.m

Go to the documentation of this file.
AZXARD ; IHS/PHXAO/TMJ -DISCLOSURE DISPLAY ;
 ;;2.0;RELEASE OF INFORMATION;;FEB 21, 2002
 ;
EP(AZXARIEN) ;PEP
START ;
 Q:'$D(AZXARIEN)
 Q:'AZXARIEN
 Q:'$D(^AZXAREC(AZXARIEN,0))
 K ^TMP("AZXARDSP",$J)
 D BUILD
 D EOJ
 Q
 ;
BUILD ; build array
 K AZXAAR
 D TERM^VALM0
 S AZXARREC=^AZXAREC(AZXARIEN,0)
 S Y=$P(AZXARREC,U,3) D ^AUPNPAT
 S AZXASTR="",AZXACTR=0
 S AZXAH="Patient Name",AZXAV=IOINHI_$E($P(^DPT($P(AZXARREC,U,3),0),U),1,20)_IOINORM D BUILD1
 S AZXAH="Chart #",AZXAV=IOINHI_$S($D(^AUPNPAT($P(AZXARREC,U,3),41,DUZ(2),0)):$P(^(0),U,2),1:"None")_IOINORM D BUILD1
 S AZXAH="Date of Birth" S Y=AUPNDOB D DD^%DT S AZXAV=Y D BUILD1
 S AZXAH="Sex",AZXAV=AUPNSEX D BUILD1
 S AZXASTR="" D SET
REFERRAL ;
 S AZXASTR="=============== "_IOINHI_"DISCLOSURE RECORD"_IOINORM_" ===============",X=(80-$L(AZXASTR)\2) D SET ;$J("",X)_AZXASTR D SET
 K AZXAAR D ENP^XBDIQ1(1991075,AZXARIEN,".01:.49","AZXAAR(","E")
 S F=0 F  S F=$O(AZXAAR(F)) Q:F'=+F  I AZXAAR(F)]"" D
 .S AZXAH=$P(^DD(1991075,F,0),U)
 .S AZXAV=AZXAAR(F)
 .D BUILD1
 S AZXASTR="" D SET
 S AZXAH="PURPOSE OF DISCLOSURE",AZXAV=$$VAL^XBDIQ1(1991075,AZXARIEN,.07) D BUILD1,SET
2 ;
 S AZXASTR="DISCLOSURE NOTES:" D SET
 K AZXAAR D ENP^XBDIQ1(1991075,AZXARIEN,22,"AZXAAR(","E")
 S F=0 F  S F=$O(AZXAAR(22,F)) Q:F'=+F  S AZXASTR=AZXAAR(22,F) D SET
 S AZXASTR="" D SET
AUTH ;display Receiving Parties, similiar to v file
 I '$D(^AZXAREC(AZXARIEN,23)) G VFILES
 S AZXASTR="ROI RECEIVING PARTIES:" D SET
 K AZXAAR D ENPM^XBDIQ1(1991075.023,"AZXARIEN,0",".01:.04","AZXAAR(")
 S (I,F)=0 F  S I=$O(AZXAAR(I)) Q:I'=+I  S AZXASTR="" D SET S F=0 F  S F=$O(AZXAAR(I,F)) Q:F'=+F  D
 .S AZXAH=$P(^DD(1991075.023,F,0),U)
 .S AZXAV=AZXAAR(I,F)
 .D BUILD1
 S AZXASTR="" D SET
VFILES ;set up array of all v file entries
 NEW DA,D0,DIC,DIQ,DR,DI
 S AZXAVFLE=1991075 F AZXAVL=0:0 S AZXAVFLE=$O(^DIC(AZXAVFLE)) Q:AZXAVFLE>1991075.04!(AZXAVFLE'=+AZXAVFLE)  D VF2
 Q
 ;
VF2 ;
 S AZXAVNM=$P(^DIC(AZXAVFLE,0),U),AZXAVDG=^DIC(AZXAVFLE,0,"GL"),AZXAVIGR=AZXAVDG_"""AD"",AZXARIEN,AZXAVDFN)",AZXAVDFN=""
 F AZXAVI=1:1 S AZXAVDFN=$O(@AZXAVIGR) Q:AZXAVDFN=""  D VF3
 Q
 ;
VF3 ;
 I AZXAVI<2 S AZXASTR="" D SET S AZXASTR="=============== "_IOINHI_AZXAVNM_"s"_IOINORM_" ===============",X=(80-$L(AZXASTR)\2) D SET ;$J("",X)_AZXASTR D SET
 K AZXAAR D ENP^XBDIQ1(AZXAVFLE,AZXAVDFN,".01:.019999;.04:999999","AZXAAR(","E")
 S AZXASTR="" D SET
 S F=0 F  S F=$O(AZXAAR(F)) Q:F'=+F  D
 .I $G(AZXAAR(F))]"" D
 ..S AZXAH=$P(^DD(AZXAVFLE,F,0),U)
 ..S AZXAV=AZXAAR(F)
 ..D BUILD1
 .S G=0 F  S G=$O(AZXAAR(F,G)) Q:G'=+G  I $G(AZXAAR(F,G))]"" D
 ..S AZXASTR=AZXAAR(F,G)
 ..D SET
 ..Q
 K G
 Q
BUILD1 ;
 S AZXASTR=$E(AZXAH,1,25)_":",AZXASTR=$$SETSTR^VALM1(AZXAV,AZXASTR,28,$L(AZXAV))
 D SET
 Q
SET ;set array
 S AZXACTR=AZXACTR+1
 S ^TMP("AZXARDSP",$J,AZXACTR,0)=AZXASTR
 S AZXASTR=""
 Q
 ;
EOJ ;
 K AZXAAR,AZXASTR,AZXACTR,AZXAH,AZXARREC,AZXAV,AZXAVNM,AZXAVDG,AZXAVIGR,AZXAVDFN
 Q