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

APCLDM.m

Go to the documentation of this file.
APCLDM ; IHS/CMI/LAB -IHS -DIABETES QA REPORT ; 
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 S X="APCL DIABETES PROGRAM QA AUDIT",DIC="^APCLRPT(",DIC(0)="FM" D ^DIC I Y=-1 W !,*7,"DIABETES PROGRAM QA AUDIT REPORT NOT AVAILABLE" H 2 K DIC,X,Y Q
 S APCL1=+Y
 S X="APCL CUMULATIVE DIABETES QA" D ^DIC I Y=-1 S APCL2=0 K DIC,X,Y
 I Y>0 S APCL2=+Y K Y
 S DIC="^ACM(41.1,",DIC(0)="AEMQ",DIC("A")="Enter the Official Diabetes Register: " D ^DIC
 I Y=-1 S APCLDMRG="" W !,"NO Register Selected!!!  The CMS register will not be used in retrieving",!,"any data." G GO
 S APCLDMRG=+Y
GO ;EP - called from bdm
 K APCLPTS
 D START1^APCLASK(APCL1,APCL2) K APCL1,APCL2
 K APCLPTS,APCLDMRG,APCLCUML,APCLDOO
 Q
REC(DFN,APCLRTYP) ;EP - called to send back a visit record as
 NEW APCLX,APCLREC
 S APCLREC=""
 S APCLRTYP("IEN")=$O(^APCLRECD("B",APCLRTYP,0))
 I 'APCLRTYP("IEN") Q APCLREC
PROC ;
 S APCLX=0
 F  S APCLX=$O(^APCLRECD(APCLRTYP("IEN"),11,"AC",APCLX)) Q:APCLX'=+APCLX!(APCLREC=-1)  S APCL=$O(^APCLRECD(APCLRTYP("IEN"),11,"AC",APCLX,0))  D
 .S X="" X:$D(^APCLRECD(APCLRTYP("IEN"),11,APCL,11)) ^APCLRECD(APCLRTYP("IEN"),11,APCL,11)
 .I X["-1" S APCLREC=-1 Q
 .;I X="",$P(^APCLRECD(APCLRTYP("IEN"),11,APCL,0),U,5) S APCLREC=-1 Q
 .I X'[-1 S $E(APCLREC,$P(^APCLRECD(APCLRTYP("IEN"),11,APCL,0),U,2))=X
 Q APCLREC
WRITEF ;EP write flat file
 K ^TMP($J,"APCL EPI")
 Q:'$D(^TMP("APCLEPI",$J))
 ;load in epi definition to ^TMP($J,"APCL EPI"
 S (X,N)=0 F  S X=$O(^APCLRECD(4,13,X)) Q:X'=+X  S N=N+1,^TMP($J,"APCL EPI",N)=^APCLRECD(4,13,X,0)
 ;MOVE RECORDS TO ^TMP($J,"APCL EPI"
 S X=0 F  S X=$O(^TMP("APCLEPI",$J,X)) Q:X'=+X  S N=N+1,^TMP($J,"APCL EPI",N)=^TMP("APCLEPI",$J,X)
 S XBGL="TMP("_$J_",""APCL EPI"","
 S XBMED="F",XBFN=APCLFILE,XBTLE="SAVE OF DM AUDIT EPI INFO RECORDS GENERATED BY -"_$P(^VA(200,DUZ,0),U)
 S XBF=0,XBQ="N",XBFLT=1,XBE=$J
 D ^XBGSAVE
 ;check for error
 K ^TMP($J,"APCL EPI")
 K XBGL,XBMED,XBTLE,XBFN,XBF,XBQ,XBFLT
 Q