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

AZXAPTR.m

Go to the documentation of this file.
AZXAPTR ; IHS/PHXAO/TMJ - PT RECORD ;
 ;;2.0;RELEASE OF INFORMATION;;FEB 21, 2002
 ;
 ;
START ;Get Patient
 S AZXAPAT=""
 D GETPAT
 I AZXAPAT="" W !!,"No PATIENT Selected!" D EOJ Q
 D GETDIS
 D EOJ
 Q
 ;
GETPAT ;Get Patient Name
 S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 S AZXAPAT=+Y
 Q
 ;
GETDIS ;Get this Patient's Disclosure Records
 ;
 Q:'AZXAPAT
 S AZXACT=0
 D HEADER
 S AZXAIEN="" F  S AZXAIEN=$O(^AZXAREC("E",AZXAPAT,AZXAIEN)) Q:AZXAIEN'=+AZXAIEN  D
 . S AZXACT=AZXACT+1
 . S AZXADN=$P($G(^AZXAREC(AZXAIEN,0)),U,2)
 . S AZXADT=$P($G(^AZXAREC(AZXAIEN,0)),U)
 . S AZXADTP=$$FMTE^XLFDT(AZXADT,"2P")
 . S AZXAPTY=$P($G(^AZXAREC(AZXAIEN,0)),U,6)
 . S AZXAPTYP=$P($G(^AZXAREQ(AZXAPTY,0)),U)
 . S AZXATYP=$P($G(^AZXAREC(AZXAIEN,0)),U,4)
 . S AZXAST=$P($G(^AZXAREC(AZXAIEN,0)),U,8)
 . W ?5,AZXACT_")",?12,AZXADN,?23,AZXADTP,?37,AZXAPTYP,?62,AZXATYP,?73,AZXAST,!
 I AZXACT=0 W !,?5,"**NO DISCLOSURE RECORDS TO PRINT FOR THIS PATIENT**",!
 ;
 Q
PRINT ;Print the Disclosure Records
 ;
 ;
 Q
 ;
 W !!,?5,"CUMMULATIVE DISCLOSURE RECORDS FOR: "_$P($G(^DPT(AZXAPAT,0)),U),!
 W ?5,"DISPLAY DATE: "_$$FMTE^XLFDT(DT,"1P")
 ;W !!,?5,"PT NAME",?40,"DISCLOSURE #",?55,"DISC DT",!!
 W !!,?3,"Number",?12,"DISC #",?23,"DT REC'D",?37,"REQUESTING PARTY",?60,"TYPE",?70,"STATUS",!
 W ?3,"____________________________________________________________________________",!
 Q
EOJ ;End of Job
 K %,%DT,%X,%Y
 K AZXAPAT,AZXADIS,AZXACT,AZXADN,AZXADT,AZXADTP,AZXAIEN,AZXAPTY,AZXAPTYP,AZXATYP,AZXAST
 D KILL^AUPNPAT
 Q