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

ACHSIC3.m

Go to the documentation of this file.
ACHSIC3 ; IHS/ITSC/FCJ - REPORT FOR PO WITH ICD ERRORS AND CORRECTIONS;  
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**22,23**;JUN 11, 2001;Build 43
 ;FIRST VERSION WITH POSSIBLE ERRORS....
 ;
 ;
ST ;
 I '$D(^ACHSICD(DUZ(2),"D")) W !?5,"THERE ARE NOT ANY ICD ERRORS FOUND FOR THIS FACILITY" Q
 S ACHSIO=IO
 K X2,X3
 W !!,"REPORT FOR DOCUMENTS WITH 3 DIGIT ICD CODE ERRORS."
 W !,"This report is for FI processed PO's only. After the ICD file is processed"
 W !,"from the FI, this report will display the PO and ICD codes that were changed."
 ;
DEV ;
 S %=$$PB^ACHS
 I %=U!$D(DTOUT)!$D(DUOUT) D K Q
  ;ACHS*3.1*23 CHNG RTN TO ACHSIC3
 I %="B" D VIEWR^XBLM("PRINT^ACHSIC3"),EN^XBVK("VALM"),K Q
 S %ZIS="OPQ"
 D ^%ZIS
 I POP D HOME^%ZIS G K
 G:'$D(IO("Q")) PRINT
 K IO("Q")
 I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
 S ZTRTN="PRINT^ACHSDST",ZTIO="",ZTDESC=$P($T(TITLE),";",3),ACHSQIO=ION_";"_IOST_";"_IOM_";"_IOSL
 F ACHS="ACHSQIO","ACHSRPT" S ZTSAVE(ACHS)=""
 D ^%ZTLOAD
 G:'$D(ZTSK) DEV
K ;
 K ACHS,ACHSIO,ACHSQIO,ACHSBDT,ACHSEDT,ACHSRPT,ZTIO,ZTSK
 D ^%ZISC
 Q
 ;
PRINT ;EP - From TaskMan.
 ;
 D FC^ACHSUF
 I $D(ACHSERR),ACHSERR=1 K ZTSK G KILL
 D BRPT^ACHSFU
 D HDR
 S X3=0
A ; Main loop.
 S L=DUZ(2),L1=0,CT=0,ACHSQ=0
 F  S L1=$O(^ACHSICD(L,"D",L1)) Q:L1'?1N.N  D  Q:ACHSQ
 .S L2=0 F  S L2=$O(^ACHSICD(L,"D",L1,9,L2)) Q:L2'?1N.N  D  Q:ACHSQ
 ..S ICD2=$P(^ACHSICD(L,"D",L1,9,L2,0),U)
 ..S ICD3=$P(^ACHSICD(L,"D",L1,9,L2,0),U,3)
 ..S ACHSREC=^ACHSF(L,"D",L1,0),DA=L1
 ..D B
 G END
 ;
B ;
 S CT=CT+1
 S ACHSDOC1=$P(ACHSREC,U),ACHSVPTR=$P(ACHSREC,U,8),ACHSDOC2=$P(ACHSREC,U,14)
 G A:ACHSVPTR']"",A:'$D(^AUTTVNDR(ACHSVPTR,0)) S ACHSVNDR=$P(^(0),U)
 S ACHSDOC=ACHSDOC2_"-"_ACHSFC_"-"_ACHSDOC1
 K ACHSNAME
 S DFN=$P(ACHSREC,U,22) I +DFN>0,$D(^DPT(DFN,0)) S ACHSNAME=$P(^(0),U)
 I '$D(ACHSNAME) S ACHSNAME=$S($P(ACHSREC,U,2)=1:"* BLANKET",1:"* SPECIAL TRANS")
E ;
 S ACHSIDT=$P(ACHSREC,U,2)
 W $E(ACHSNAME,1,24),?25,$E(ACHSVNDR,1,26),?52,$E(ACHSIDT,4,7),$E(ACHSIDT,2,3)
 ;W !,ACHSDOC,?25,$P($$ICDDX^ICDCODE(ICD2),U,2),?52,$P($$ICDDX^ICDCODE(ICD3),U,2)  ;ACHS*3.1*23
 W !,ACHSDOC,?25,$P($$ICDDX^ICDEX(ICD2),U,2),?52,$P($$ICDDX^ICDEX(ICD3),U,2)  ;ACHS*3.1*23
 ;W ?80-$L(X),X
P3 ; Ask RTRN if EOP, do header, go main loop.
 W !!
 I $Y>ACHSBM D RTRN^ACHS S:$D(DUOUT)!$D(DTOUT) ACHSQ=1 Q:ACHSQ  D HDR
 Q
 ;
END ; Print totals, ask RTRN, write IOF.
 W @IOF
 W !!,"TOTAL UPDATES = ",CT,!
 D RTRN^ACHS
KILL ; Do ERPT, kill vars, quit.
 I $D(ZTQUEUED) K ACHSFC
 K ACHSDOC,ACHSDOC1,ACHSDOC2,ACHSBLNK,ACHSCNX,ACHSDOS,ACHSTYPE,ACHSVNDR,ACHSEIN,ACHSOPEN,ACHSNAME,ACHSSTS,ACHSTOS,ACHSTOTP,ACHSVPTR,AZUCHSCAN
 K CT,ACHSREC,ACHSQ,ACHSQUIT,DA,DFN,X2,X3
 Q
 ;
HDR ; Print report header.
 S ACHSPG=ACHSPG+1
 W @IOF,!!,ACHSUSR,?71,"Page",$J(ACHSPG,3),!,$$C^XBFUNC("***  CONTRACT HEALTH MANAGEMENT SYSTEM  ***",80),!!,ACHSLOC,!?24,"ICD 3 digit Purchase Order Report"
 I $D(ZTQUEUED) W ?77-$L(ZTSK),"(",ZTSK,")"
 W !,ACHSTIME,!!,"Patient Name",?25,"Provider of Service",?52,"Issue"
 W !,"Document number",?25,"DX CODE",?52,"NEW DX CODE",!,$$REPEAT^XLFSTR("=",79),!
 Q
 ;
TITLE ;;ICD UPDATED DOCUMENTS FROM ICD CODE ERROR