VistA-WorldVistAEHR/r/MEDICINE-MC/MCPOS02A.m

69 lines
2.0 KiB
Mathematica

MCPOS02A ;HIRMFO/DAD-NEW PERSON CONVERSION EXCEPTION REPORT ;6/6/96 14:48
;;2.3;Medicine;;09/13/1996
;
K %ZIS,IOP S %ZIS="Q",IOP=$G(^XTMP("MC","DEV")) I IOP="" K IOP
D ^%ZIS G:POP EXIT
I $D(IO("Q")) D G EXIT
. N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
. S ZTRTN="TASK^MCPOS02A"
. S ZTSAVE("^TMP(""MCPOS02"",$J,")=""
. S ZTDESC="Medicine New Person Conversion Exception Report"
. S ZTDTH=$H
. D ^%ZTLOAD
. Q
TASK ;
S (MCEXIT,MCFOUND)=0,MCPAGE=1,MCTODAY=$$FMTE^XLFDT($$DT^XLFDT)
K MCUNDL S $P(MCUNDL,"=",81)=""
U IO D HEADER
S MCFILE=0
F S MCFILE=$O(^TMP("MCPOS02",$J,MCFILE)) Q:MCFILE'>0!MCEXIT D
. I $P(^TMP("MCPOS02",$J,MCFILE),U,2)'>0 Q
. W !!,MCFILE
. S MCFLD=0
. F S MCFLD=$O(^TMP("MCPOS02",$J,MCFILE,MCFLD)) Q:MCFLD'>0!MCEXIT D
.. I $P(^TMP("MCPOS02",$J,MCFILE,MCFLD),U,2)'>0 Q
.. W ?8,MCFLD
.. S MCD0=0
.. F S MCD0=$O(^TMP("MCPOS02",$J,MCFILE,MCFLD,MCD0)) Q:MCD0'>0!MCEXIT D
... S MCDATA=^TMP("MCPOS02",$J,MCFILE,MCFLD,MCD0)
... S X=$P(MCDATA,U),MC6=$P(X,";"),MC6(0)=$P(X,";",2)
... S X=$P(MCDATA,U,2),MC16=$P(X,";"),MC16(0)=$P(X,";",2)
... S X=$P(MCDATA,U,3),MC200=$P(X,";"),MC200(0)=$P(X,";",2)
... S MCERROR=$P(MCDATA,U,4)
... D PRINT
... Q
.. Q
. Q
I 'MCFOUND W !!,"No exceptions found."
;
EXIT ;
D ^%ZISC
I '$D(XPDNM),$D(ZTQUEUED) S ZTREQ="@"
K %ZIS,DIR,DIRUT,DTOUT,DUOUT,MC16,MC200,MC6,MCD0,MCDATA,MCERROR,MCEXIT
K MCFILE,MCFLD,MCFOUND,MCPAGE,MCTODAY,MCUNDL,POP,X,Y,ZTDESC,ZTRTN
K ^TMP("MCPOS02",$J)
Q
;
PRINT ;
W ?14,MCD0
W ?25,MC6,?36,MC16,?47,MC200,?58,MCERROR
W !?15,MC6(0),?50,MC16(0),!!
I $Y>(IOSL-6) D PAUSE,HEADER
S MCFOUND=1
Q
PAUSE ;
I $E(IOST,1,2)="C-" D
. N DIR S DIR(0)="E" D ^DIR S MCEXIT=$S(Y'>0:1,1:0)
. Q
Q
;
HEADER ;
I MCEXIT Q
W:($E(IOST,1,2)="C-")!(MCPAGE>1) @IOF
W !?21,"Medicine New Person Exception Report",?68,MCTODAY
W !?68,"Page: ",MCPAGE S MCPAGE=MCPAGE+1
W !,"File",?8,"Field",?14,"IEN"
W ?25,"P==>6",?36,"P==>16",?47,"P==>200",?58,"Error Message"
W !?15,"Provider Name",?50,"Person Name",!,MCUNDL,!
Q