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

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

initial load of WorldVistAEHR

File size: 3.1 KB
RevLine 
[613]1DG53P641 ;BAY/JAT - Patient File Updat; 6/7/04 7:13pm ; 1/4/05 5:06pm
2 ;;5.3;Registration;**641**;Aug 13,1993
3 Q
4 ;
5CLEANUP ;This entry point will do the update.
6 ;
7 N DGENSKIP
8 S DGENSKIP=0
9 W !,"This is a one-time update of the Patient File."
10 W !,"It will set the 'ATEST' cross-reference as needed."
11 N X1,X2
12 K ^XTMP("DG53P641",$J)
13 S X1=DT,X2=90 D C^%DTC
14 S ^XTMP("DG53P641",$J,0)=X_"^"_DT_"^Patient File update"
15 I $$DEVICE() D ENTER
16 Q
17 ;
18REPORT ;This entry point was provided for testing, so that before
19 ;patient records are updated the site can have a list of
20 ;the DFN's that would be affected.
21 ;
22 ;Use this entry point to report on what the update would do.
23 ;No changes will be made to the database.
24 ;
25 N DGENSKIP
26 S DGENSKIP=1
27 W !,"This is a preliminary report by DFN of the Patient file"
28 W !,"records which would be affected by the update."
29 N X1,X2
30 K ^XTMP("DG53P641",$J)
31 S X1=DT,X2=90 D C^%DTC
32 S ^XTMP("DG53P641",$J,0)=X_"^"_DT_"^Patient File update"
33 I $$DEVICE() D ENTER
34 Q
35 ;
36ENTER ;
37 ;
38 D UPDATE(DGENSKIP)
39 D:(DGENSKIP) ^%ZISC
40 I $D(ZTQUEUED) S ZTREQ="@"
41 Q
42DEVICE() ;
43 ;Description: allows the user to select a device.
44 ;
45 ;Output:
46 ; Function Value - Returns 0 if the user decides not to print or to
47 ; queue the report, 1 otherwise.
48 ;
49 N OK,IOP,POP,%ZIS
50 S OK=1
51 S %ZIS="MQ"
52 D ^%ZIS
53 S:POP OK=0
54 D:OK&$D(IO("Q"))
55 .N ZTRTN,ZTDESC,ZTSKM,ZTREQ,ZTSTOP
56 .S ZTRTN="ENTER^DG53P641",ZTDESC=$S(DGENSKIP:"Report",1:"Update")_" of Patient Records"
57 .S ZTSAVE("DGENSKIP")=""
58 .D ^%ZTLOAD
59 .W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
60 .D HOME^%ZIS
61 .S OK=0
62 Q OK
63 ;
64UPDATE(DGENSKIP) ;
65 ;This will update patient records --
66 ;
67 ;Input: If DGENSKIP=1, the records will not be updated,
68 ;just reported.
69 ;
70 N DFN,COUNT,DGSSN,DGS,DGFLG,DGXREF,DGVAL,DGFDA,DGERR
71 S (COUNT,DFN)=0
72 F S DFN=$O(^DPT(DFN)) Q:'DFN D
73 .; merged record
74 .I $D(^DPT(DFN,-9)) Q
75 .; in process of being merged
76 .I $P($G(^DPT(DFN,0)),U)["MERGING INTO" Q
77 .I $D(^DPT(DFN,0)) D
78 ..S DGSSN=$P($G(^DPT(DFN,0)),U,9)
79 ..Q:'DGSSN
80 ..Q:$E(DGSSN,1,5)'="00000"
81 ..Q:$D(^DPT("ATEST",DFN))
82 ..D UPDR
83 ;
84 D PRINT
85 Q
86 ;
87UPDR ;
88 S COUNT=COUNT+1
89 S ^XTMP("DG53P641",$J,DFN)=DGSSN
90 I 'DGENSKIP D
91 .N DA,DIK
92 .S DA=DFN,DIK="^DPT(",DIK(1)=".09^ATP"
93 .D EN1^DIK
94 Q
95PRINT ;
96 U IO
97 N DGDDT,DGQUIT,DGPG
98 S DGDDT=$$FMTE^XLFDT($$NOW^XLFDT,"D")
99 S (DGQUIT,DGPG)=0
100 D HEAD
101 I '$G(COUNT) D Q
102 .W !!!,?20,"*** No records to report ***"
103 W !!,"*** COUNT OF BAD PATIENT RECORDS"_$S(DGENSKIP:"",1:" UPDATED")_": ",COUNT," ***",!!
104 S DFN=0
105 F S DFN=$O(^XTMP("DG53P641",$J,DFN)) Q:'DFN D Q:DGQUIT
106 .I $Y>(IOSL-4) D HEAD
107 .S DGSSN=$P($G(^XTMP("DG53P641",$J,DFN)),U)
108 .W ?2,DFN,?15,DGSSN,!
109 ;
110 I DGQUIT W:$D(ZTQUEUED) !!,"Report stopped at user's request" Q
111 I $G(DGPG)>0,$E(IOST)="C" K DIR S DIR(0)="E" D ^DIR K DIR S:+Y=0 DGQUIT=1
112 I $D(ZTQUEUED) S ZTREQ="@"
113 Q
114 ;
115HEAD ;
116 I $D(ZTQUEUED),$$S^%ZTLOAD S (ZTSTOP,DGQUIT)=1 Q
117 I $G(DGPG)>0,$E(IOST)="C" K DIR S DIR(0)="E" D ^DIR K DIR S:+Y=0 DGQUIT=1
118 Q:DGQUIT
119 S DGPG=$G(DGPG)+1
120 W @IOF,!,DGDDT,?15,"DG*5.3*641 Patient File Update Utility",?70,"Page:",$J(DGPG,5),! K X S $P(X,"-",81)="" W X,!
121 W !
122 W !,?2,"DFN",?15,"SSN",!
123 S $P(X,"-",81)="" W X,!
124 Q
Note: See TracBrowser for help on using the repository browser.