source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DG53P621.m@ 724

Last change on this file since 724 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1DG53P621 ;BAY/JAT - Patient File reporting; 6/7/04 7:13pm ; 10/8/04 11:25am
2 ;;5.3;Registration;**621**;Aug 13,1993
3 ;
4REPORT ;
5 N X1,X2
6 K ^XTMP("DG53P621",$J)
7 S X1=DT,X2=90 D C^%DTC
8 S ^XTMP("DG53P621",$J,0)=X_"^"_DT_"^Abnormal SSNs"
9 I $$DEVICE() D ENTER
10 Q
11 ;
12ENTER ;
13 ;
14 D READFILE
15 D ^%ZISC
16 I $D(ZTQUEUED) S ZTREQ="@"
17 Q
18DEVICE() ;
19 ;Description: allows the user to select a device.
20 ;
21 ;Output:
22 ; Function Value - Returns 0 if the user decides not to print or to
23 ; queue the report, 1 otherwise.
24 ;
25 N OK,IOP,POP,%ZIS
26 S OK=1
27 S %ZIS="MQ"
28 D ^%ZIS
29 S:POP OK=0
30 D:OK&$D(IO("Q"))
31 .N ZTRTN,ZTDESC,ZTSKM,ZTREQ,ZTSTOP
32 .S ZTRTN="ENTER^DG53P621",ZTDESC="Report of abnormal SSNs"
33 .D ^%ZTLOAD
34 .W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
35 .D HOME^%ZIS
36 .S OK=0
37 Q OK
38 ;
39READFILE ;
40 N DFN,COUNT,DGZERO,DGSSN
41 S (DFN,COUNT)=0
42 F S DFN=$O(^DPT(DFN)) Q:'DFN D
43 .; merged record
44 .I $D(^DPT(DFN,-9)) Q
45 .; in process of being merged
46 .I $P($G(^DPT(DFN,0)),U)["MERGING INTO" Q
47 .I $D(^DPT(DFN,0)) D
48 ..S DGZERO=$G(^DPT(DFN,0))
49 ..I $E($P(DGZERO,U,1),1,2)="ZZ" Q
50 ..S DGSSN=$P(DGZERO,U,9)
51 ..I $L(DGSSN)>8 Q ; well-formed ssn, either standard or pseudo
52 ..D STORE
53 ;
54 W !,"Nbr records with abnormal SSN: "_COUNT
55 D PRINT
56 Q
57 ;
58STORE ;
59 S COUNT=COUNT+1
60 S ^XTMP("DG53P621",$J,DFN)=$E(DGZERO,1,55)
61 Q
62PRINT ;
63 U IO
64 N DGDDT,DGQUIT,DGPG
65 S DGDDT=$$FMTE^XLFDT($$NOW^XLFDT,"D")
66 S (DGQUIT,DGPG)=0
67 D HEAD
68 I '$G(COUNT) D Q
69 .W !!!,?20,"*** No records to report ***"
70 W !!,"*** COUNT OF BAD PATIENT RECORDS: ",COUNT," ***",!!
71 S DFN=0
72 F S DFN=$O(^XTMP("DG53P621",$J,DFN)) Q:'DFN D Q:DGQUIT
73 .I $Y>(IOSL-4) D HEAD
74 .S DGZERO=$G(^XTMP("DG53P621",$J,DFN))
75 .W ?2,DFN,?13,DGZERO,!
76 ;
77 I DGQUIT W:$D(ZTQUEUED) !!,"Report stopped at user's request" Q
78 I $G(DGPG)>0,$E(IOST)="C" K DIR S DIR(0)="E" D ^DIR K DIR S:+Y=0 DGQUIT=1
79 I $D(ZTQUEUED) S ZTREQ="@"
80 Q
81 ;
82HEAD ;
83 I $D(ZTQUEUED),$$S^%ZTLOAD S (ZTSTOP,DGQUIT)=1 Q
84 I $G(DGPG)>0,$E(IOST)="C" K DIR S DIR(0)="E" D ^DIR K DIR S:+Y=0 DGQUIT=1
85 Q:DGQUIT
86 S DGPG=$G(DGPG)+1
87 W @IOF,!,DGDDT,?15,"DG*5.3*621 List of abnormal SSNs",?70,"Page:",$J(DGPG,5),! K X S $P(X,"-",81)="" W X,!
88 W !
89 W !,?2,"DFN",?13,"ZERO NODE",!
90 S $P(X,"-",81)="" W X,!
91 Q
Note: See TracBrowser for help on using the repository browser.