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

AGERRAU1.m

Go to the documentation of this file.
AGERRAU1 ;IHS/OIT/NKD - EDIT CHECK ERROR AUDIT CAPTURE AND PRINT ROUTINE - CONTINUED; FEBRUARY 10, 2014
 ;;7.1;PATIENT REGISTRATION;**11**;AUG 25, 2005;Build 1
 ;IHS/OIT/NKD AG*7.1*11 DISPLAY ENTIRE CORRECTIVE ACTION FIELD
 ;NEW ROUTINE TO HANDLE OVERFLOW FROM AGERRAUD PER SAC
 ;
SUMMARY ;EP - NOW PRINT SUMMARY
 S ESCAPE=0
 S FAC=0
 F  S FAC=$O(^XTMP("AGERRAUD",$J,FAC)) Q:'FAC  D  Q:ESCAPE
 .S ERRTYPE=$O(^XTMP("AGERRAUD",$J,FAC,""))
 .;D PRTHDR,ALLHDR
 .S ERRTYPE="",ERROLD=""
 .F  S ERRTYPE=$O(^XTMP("AGERRAUD",$J,FAC,ERRTYPE)) Q:ERRTYPE=""  D  Q:ESCAPE
 ..I ERRTYPE'=ERROLD S ERROLD=ERRTYPE D PRTHDR,ALLHDR
 ..S ERRCODE=""
 ..F  S ERRCODE=$O(^XTMP("AGERRAUD",$J,FAC,ERRTYPE,ERRCODE)) Q:ERRCODE=""  D  Q:ESCAPE
 ...S NUMPT=$G(^XTMP("AGERRAUD",$J,FAC,ERRTYPE,ERRCODE))
 ...S ERRNODE=$G(^AGEDERRS(ERRCODE,0))
 ...S ERRDESCR=$P(ERRNODE,U,3)
 ...S X=ERRCODE
 ...S X="000"_X
 ...W !?0,$E(X,$L(X)-2,$L(X))
 ...W ?10,$E(ERRDESCR,1,54)
 ...W ?68,$J(NUMPT,8)
 ...;NOTE: HEADER IS 8 LINES
 ...I ($Y>(IOSL-4)!($Y=(IOSL-4))),(IOST[("C-")) W ! K DIR S DIR(0)="E" D:'ESCAPE ^DIR S ESCAPE=X=U Q:'$O(^XTMP("AGERRAUD",$J,FAC,ERRTYPE,ERRCODE))  D:'ESCAPE PRTHDR,ALLHDR Q
 ...I $Y>(IOSL-4)!($Y=(IOSL-4)) Q:'$O(^XTMP("AGERRAUD",$J,FAC,ERRTYPE,ERRCODE))  D PRTHDR,ALLHDR
 ..I (IOST[("C-")) W ! K DIR S DIR(0)="E" D ^DIR S ESCAPE=X=U Q
 D ^%ZISC
 Q
HDR ;EP
 W @IOF
 D CENTER("PATIENT REGISTRATION")
 W !!
 ;D CENTER($G(^DIC(4,DUZ(2),0),U))  ;NO IM FOUND DURING DEVLOPEMENT
 D CENTER($P($G(^DIC(4,DUZ(2),0)),U))  ;IHS/SD/TPF 3/30/2006 AG*7.1*2
 W !!
 D CENTER("ERROR / WARNING REPORT")
 Q
CENTER(X) ;EP -
 S CENTER=IOM/2
 W ?CENTER-($L(X)/2),X
 Q
ALLHDR ;EP
 W !,$S(ERRTYPE="E":"ERROR",1:"WARNING"),?63,"total # of"
 W !,"NUMBER",?15,"ERROR LIST",?63,"Patient w/Errors"
 W !,"------",?10,"---------------------------------------------",?63,"--------------"
 Q
DETHDR(ERRCODE) ;EP
 W !!
 S ERRNODE=$G(^AGEDERRS(ERRCODE,0))
 S ERRDESCR=$P(ERRNODE,U,3)
 S X=ERRCODE
 S X="000"_X
 W !?0,$E(X,$L(X)-2,$L(X))
 W ?4,$S(ERRTYPE="E":"ERROR",1:"WARNING")_":"
 W ?17,ERRDESCR
 W !?0,"CORRECTIVE ACTION:"
 ;IHS/OIT/NKD AG*7.1*11 DISPLAY ENTIRE CORRECTIVE ACTION FIELD - START NEW CODE
 ;D WRAP^AGUTILS($G(^AGEDERRS(ERRCODE,1,1,0)),20,"WC50")
 N AGCOR,AGCNT
 S AGCOR=$$GET1^DIQ(9009061.5,ERRCODE_",",501,,"AGCOR"),AGCOR="",AGCNT=0
 F  S AGCNT=$O(AGCOR(AGCNT)) Q:'AGCNT  S AGCOR=AGCOR_AGCOR(AGCNT)
 D WRAP^AGUTILS(AGCOR,20,"WC50")
 ;IHS/OIT/NKD AG*7.1*11 END NEW CODE
 W !,AGLINE("EQ")
 W !,?4,"Name",?22,"IHS #",?37,"FACILITY",?69,"DOB"
 W !,AGLINE("EQ")
 Q
PRTHDR ;EP
 W @IOF
 W !
 ;D CENTER($G(^DIC(4,FAC,0),U))  ;NO IM FOUND DURING DEVLOPEMENT
 D CENTER($P($G(^DIC(4,FAC,0)),U))  ;IHS/SD/TPF 3/30/2006 AG*7.1*2
 S PGNUM=PGNUM+1
 W ?69,"PAGE  ",PGNUM
 W !!
 D CENTER("Patient Registration Errors/Warnings")
 W !
 D CENTER("AUDIT "_$S(RPTTYPE="S":"SUMMARY",1:"DETAIL")_" REPORT")
 W !
 D CENTER(REPTIME)
 Q