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

ECXSCX3.m

Go to the documentation of this file.
ECXSCX3 ;ALB/DHE- DSS Clinic & Stop Codes Validity Report 728.44 ;2/11/14  17:03
 ;;3.0;DSS EXTRACTS;**120,144,149,154**;Dec 22, 1997;Build 13
EN ;entry point from option
 ;
 N ZTDESC,ZTRTN,ZTSAVE,ZTSK,ZUSR,ZTDTH,POP,ECXPORT,CNT,NUM ;144
 W !!,"This report will display stop code information of the ACTIVE ",!,"clinics in the Clinics and Stop Code file (#728.44).  It will",!,"display stop codes that do not conform to the Business Rules for ",!,"Valid Stop Codes." ;144
 W !!,"**REMINDER - The CREATE option last ran on ",$S($D(^ECX(728.44,"C")):$$FMTE^XLFDT($O(^ECX(728.44,"C"," "),-1),2),1:"- No date on file"),"." ;154
 W !,"If the most recent clinic changes from the HOSPITAL LOCATION file #44",!,"are desired, run the CREATE option before running a report.**" ;154
 I '$D(^ECX(728.44)) W !,"DSS Clinic stop code file does not exist",!! R X:5 K X Q
 S ECXPORT=$$EXPORT^ECXUTL1 Q:ECXPORT=-1  I ECXPORT D  Q  ;144
 .K ^TMP($J,"ECXPORT") ;144
 .S ^TMP($J,"ECXPORT",0)="IEN^CLINIC NAME^STOP CODE^CREDIT STOP CODE^CHAR4 CODE^ERROR 1^ERROR 2^ERROR 3^WARNING" ;144,149,154
 .S CNT=1 ;144
 .D START ;144
 .D EXPDISP^ECXUTL1 ;144
 .K ECXERR,WARNING D ^ECXKILL ;144
 S %ZIS="Q" D ^%ZIS G:POP EXIT
 I $D(IO("Q")) D  Q
 .K ZTSAVE S ZTDESC="DSS Identify Invalid Stop and Credit Stop Codes",ZTRTN="START^ECXSCX3",ZTDTH=$H
 .D ^%ZTLOAD
 .D ^%ZISC,HOME^%ZIS
 .W !,$S($D(ZTSK):"REQUEST QUEUED!",1:"REQUEST CANCELLED!")
 D START
EXIT D ^%ZISC,HOME^%ZIS
 Q
START ; queued entry to print report
 U IO
 N CLIEN,CODE,ERR,QUIT,WRN,TOT,CODE1,CODE2,CODE3,CODE4,CODE5,CLNAME,DATE
 N I,INACT,Y,HEAD,NONAME,QFLG,LN,PG,DAT,REACT
 K WARNING,ECXERR,TYPE
 S QFLG=0,$P(LN,"-",80)="",PG=0
 S TOT=0,QUIT=""
 I '$G(ECXPORT) D HEAD ;144
 S CLIEN=0 F  S CLIEN=$O(^ECX(728.44,CLIEN)) Q:'CLIEN  D  Q:QUIT
 .Q:'$D(^ECX(728.44,CLIEN,0))
 .I $P($G(^SC(CLIEN,0)),U,3)'="C" Q  ;149 Don't include it on report if it's not a clinic
 .S DAT=$G(^SC(CLIEN,"I")),INACT=+DAT,REACT=$P(DAT,"^",2)
 .;S INACT=$P(^ECX(728.44,CLIEN,0),"^",10)
 .;I (INACT'>DT)&(INACT'="") Q
 .I INACT,('REACT),INACT'>DT Q
 .I INACT,INACT'>DT I REACT,DT<REACT Q
 .S CLNAME=$S($G(CLIEN)>0:$E($$GET1^DIQ(44,CLIEN,.01,"E"),1,30),1:NONAME)
 .K WARNING,ECXERR,TYPE,ERR,WRN
 .S DATE=DT
 .S CODE1=$P(^ECX(728.44,CLIEN,0),"^",2),TYPE="Stop Code" D STOP^ECXSTOP(CODE1,TYPE,CLIEN,DATE)
 .S CODE2=$P(^ECX(728.44,CLIEN,0),"^",3),TYPE="Credit Stop Code" D STOP^ECXSTOP(CODE2,TYPE,CLIEN,DATE)
 .;S CODE3=$P(^ECX(728.44,CLIEN,0),"^",4),TYPE="DSS Stop Code" D STOP^ECXSTOP(CODE3,TYPE,CLIEN,DATE) ;154
 .;S CODE4=$P(^ECX(728.44,CLIEN,0),"^",5),TYPE="DSS Credit Stop Code" D STOP^ECXSTOP(CODE4,TYPE,CLIEN,DATE) ;154
 .S CODE5=$P(^ECX(728.44,CLIEN,0),"^",8),TYPE="CHAR4 Code" D STOP^ECXSTOP(CODE5,TYPE,CLIEN,DATE) ;149 CVW
 .I $D(ECXERR)!($D(WARNING)) S TOT=TOT+1 D  Q:QUIT
 ..I (CODE5'="")&($$GET1^DIQ(728.441,CODE5,.01)'="") S CODE5=$$GET1^DIQ(728.441,CODE5,.01)
 ..I $G(ECXPORT) D  Q  ;144
 ...S ^TMP($J,"ECXPORT",CNT)=CLIEN_"^"_CLNAME_"^"_$G(CODE1)_"^"_$G(CODE2)_"^"_$G(CODE5)_"^" ;144 154
 ...S NUM=0 F I=1:1:3 S:NUM'="" NUM=$O(ECXERR(NUM)) S ^TMP($J,"ECXPORT",CNT)=^TMP($J,"ECXPORT",CNT)_$S(NUM'="":$G(ECXERR(NUM)),1:"")_"^" ;144
 ...S NUM=+$O(WARNING(0)) S ^TMP($J,"ECXPORT",CNT)=^TMP($J,"ECXPORT",CNT)_$G(WARNING(NUM)),CNT=CNT+1 ;144
 ..I $Y>(IOSL-5) D HEAD
 ..W !!,CLIEN,?13,CLNAME,?53,$G(CODE1),?63,$G(CODE2),?72,$G(CODE5) ;149,154
 ..I $D(ECXERR) W !,"ERRORS:" D
 ...S I=0 F  S I=$O(ECXERR(I)) Q:'I  D  Q:QUIT
 ....W !?6,ECXERR(I) D ADD
 ..I $D(WARNING) W !,"WARNINGS:" D
 ...S I=0 F  S I=$O(WARNING(I)) Q:'I  D  Q:QUIT
 ....W !?6,WARNING(I) D ADD
 Q:QUIT!($G(ECXPORT))  ;144
 ;
OUT ;
 I TOT'>0 W !!!?6,"NO PROBLEMS FOUND."
 E  W !!!,?10,TOT," PROBLEM CLINICS FOUND."
 W:$Y @IOF D ^%ZISC S ZTREQ="@"
 K QFLG,PG,LN,ECXERR,WARNING
 D ^ECXKILL
 Q
 ;
 W:$E(IOST,1,2)["C-"!(PG>1) @IOF S PG=PG+1
 W !,"CLINIC & STOP CODES VALIDITY REPORT",?71,"Page: ",PG
 W !!,"IEN#",?13,"CLINIC NAME",?53,"STOP",?63,"CREDIT",?72,"CHAR4" ;144,154 CVW
 W !?53,"CODE",?63,"STOP",?72,"CODE" ;144,149,154 CVW
 W !?63,"CODE" ;149,154 CVW
 W !,LN
 Q
 ;
PAUSE N DIR,DIRUT,X,Y
 F  Q:$Y>(IOSL-3)  W !
 S DIR(0)="E"
 D ^DIR
 I ('(+Y))!($D(DIRUT)) S QUIT=1
 Q
ADD I $E(IOST,1,2)="C-",($Y>(IOSL-5)) D
 . D PAUSE Q:QUIT
 . D HEAD
 I $E(IOST,1,2)'="C-",($Y>(IOSL-5)) D HEAD
 Q
 ;