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

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

initial load of WorldVistAEHR

File size: 2.4 KB
RevLine 
[613]1DG53P604 ;BAY/JAT - Patient File Updat; 6/7/04 7:13pm ; 8/7/04 7:51pm
2 ;;5.3;Registration;**604**;Aug 13,1993
3 ;
4REPORT ;
5 N X1,X2
6 K ^XTMP("DG53P604",$J)
7 S X1=DT,X2=90 D C^%DTC
8 S ^XTMP("DG53P604",$J,0)=X_"^"_DT_"^Patient file iens w/decimals"
9 I $$DEVICE() D ENTER
10 Q
11 ;
12ENTER ;
13 D READ
14 D ^%ZISC
15 I $D(ZTQUEUED) S ZTREQ="@"
16 Q
17DEVICE() ;
18 ;Description: allows the user to select a device.
19 ;
20 ;Output:
21 ; Function Value - Returns 0 if the user decides not to print or to
22 ; queue the report, 1 otherwise.
23 ;
24 N OK,IOP,POP,%ZIS
25 S OK=1
26 S %ZIS="MQ"
27 D ^%ZIS
28 S:POP OK=0
29 D:OK&$D(IO("Q"))
30 .N ZTRTN,ZTDESC,ZTSKM,ZTREQ,ZTSTOP
31 .S ZTRTN="ENTER^DG53P604",ZTDESC="Patient file iens w/decimals"
32 .D ^%ZTLOAD
33 .W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
34 .D HOME^%ZIS
35 .S OK=0
36 Q OK
37 ;
38READ ;
39 ;
40 N DFN,COUNT,DGSSN,DGWHEN,DGDTCARE
41 S (COUNT,DFN)=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 DFN'["." Q
48 .I $D(^DPT(DFN,0)) D
49 ..S DGSSN=$P($G(^DPT(DFN,0)),U,9)
50 ..S DGWHEN=$P($G(^DPT(DFN,0)),U,16)
51 ..S DGDTCARE=$P($G(^DPT(DFN,1010.15)),U)
52 ..S COUNT=COUNT+1
53 ..S ^XTMP("DG53P604",$J,DFN)=DGSSN_"^"_DGWHEN_"^"_DGDTCARE
54 ;
55 D PRINT
56 Q
57 ;
58PRINT ;
59 U IO
60 N DGDDT,DGQUIT,DGPG
61 S DGDDT=$$FMTE^XLFDT($$NOW^XLFDT,"D")
62 S (DGQUIT,DGPG)=0
63 D HEAD
64 I '$G(COUNT) D Q
65 .W !!!,?20,"*** No records to report ***"
66 W !!,"*** COUNT OF PATIENT RECORDS:",COUNT," ***",!!
67 S DFN=0
68 F S DFN=$O(^XTMP("DG53P604",$J,DFN)) Q:'DFN D Q:DGQUIT
69 .I $Y>(IOSL-4) D HEAD
70 .S DGSSN=$P($G(^XTMP("DG53P604",$J,DFN)),U)
71 .S DGWHEN=$P($G(^XTMP("DG53P604",$J,DFN)),U,2)
72 .S DGWHEN=$$FMTE^XLFDT(DGWHEN,"D")
73 .S DGDTCARE=$P($G(^XTMP("DG53P604",$J,DFN)),U,3)
74 .S DGDTCARE=$$FMTE^XLFDT(DGDTCARE,"D")
75 .W ?2,DFN,?20,DGSSN,?37,DGWHEN,?56,DGDTCARE,!
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*604 Patient File iens w/decimals",?70,"Page:",$J(DGPG,5),! K X S $P(X,"-",81)="" W X,!
88 W !
89 W !,?2,"DFN",?23,"SSN",?37,"Date Record Created",?58,"Most Recent Care Date",!
90 S $P(X,"-",81)="" W X,!
91 Q
Note: See TracBrowser for help on using the repository browser.