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

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

initial load of WorldVistAEHR

File size: 3.9 KB
RevLine 
[613]1DGRPCF ;ALB/MRL,BAJ - CONSISTENCY OF PATIENT DATA (FILE/EDIT) ;Nov 2, 2005
2 ;;5.3;Registration;**250,653**;Aug 13, 1993;Build 2
3 ;
4 ; file new inconsistencies or update file entries for patient
5 ;
6 ; DGCT = count of inconsistencies found (passed in from checker)
7 ; DGCT1= count of inconsistencies which can't be edited because
8 ; user does not hold appropriate key
9 ; DGCT2= count of already filed inconsistencies
10 ; DGCT3= count of inconsistencies which are uneditable through
11 ; checker options
12 ;
13 ;
14 ;
15EN I '$D(DGCT) G KVAR^DGRPCE
16 ; DG*5.3*653 BAJ modified to delete only inconsistencies numbered 99 or less
17 I 'DGCT,$O(^DGIN(38.5,DFN,"I",""),-1)>99 D DELETE G KVAR^DGRPCE
18 S DGEDCN=+$G(DGEDCN),DGRPOUT=+$G(DGRPOUT),DGCON=1 D:DGEDCN START^DGRPC I 'DGCT D ^DGRPCF1,TIMEQ^DGRPC G KVAR^DGRPCE
19 S:'$D(^DGIN(38.5,DFN,0)) ^(0)=DFN_"^"_DT_"^"_$S(('$D(DUZ)#2):"",1:DUZ) S X=$P(^(0),"^",4),^DGIN(38.5,DFN,0)=$P(^(0),"^",1,3)_"^"_DT_"^"_$S(('$D(DUZ)#2):"",1:DUZ)_"^"_$P(^(0),"^",6) K ^DGIN(38.5,"AC",9999999-X,DFN)
20 S ^DGIN(38.5,"B",DFN,DFN)="",^DGIN(38.5,"AC",9999999-DT,DFN)="",^DGIN(38.5,0)=$P(^DGIN(38.5,0),"^",1,2)_"^"_DFN_"^"_($P(^(0),"^",4)+1)
21 I $D(^DGIN(38.5,DFN,"I")) D DELETE
22 S DGD2=0 F DGD=1:1 S DGD1=$P(DGER,",",DGD) Q:DGD1="" I $D(^DGIN(38.6,DGD1,0)) S DGD2=DGD1 S ^DGIN(38.5,DFN,"I",DGD1,0)=DGD1
23 S ^DGIN(38.5,DFN,"I",0)="^38.51PA^"_DGD2_"^"_DGCT I DGCT,DGEDCN G DIS
24 G KVAR^DGRPCE
25 ;
26DIS D TIME^DGRPC S DGRPE=$S($D(DGRPE):DGRPE+1,1:0) D KEY S IOP="HOME" D ^%ZIS K IOP W @IOF,! D DEM^VADPT W VADM(1)," (",$P(VADM(2),"^",2),")",?65,$P(VADM(3),"^",2) S X="",$P(X,"=",79)="" W !,X
27 S (C,DGCT1,DGCT2,DGCT3)=0,DGEDIT="0000000011111110011111113333222223313333332222220030000" F I=1:1 S J=$P(DGER,",",I) Q:J="" I $D(^DGIN(38.6,J,0)) S X2=$P(^(0),"^",1) D WRIT
28 I DGCT1!DGCT3 W ! D NOEDIT
29 S DGINC55=$S(DGER'[55:0,($G(DGRPVV(9))'["0"):0,1:1)
30EDIT G:DGRPOUT BUL I DGCT1+DGCT3'=DGCT W !!,"DO YOU WANT TO UPDATE THESE INCONSISTENCIES NOW" S %=1 D YN^DICN I %=1 D G ^DGRPC
31 . S DGINC55=$S(DGER'[55:0,($G(DGRPVV(9))'["0"):0,1:1)
32 . L +^DPT(DFN):3 E W *7,!!,"Patient is being edited. Try again later." S DGEDCN=0 Q
33 . D ^DGRPCE
34 . L -^DPT(DFN)
35 . S DGEDCN=1
36 I $S(($G(DGRETURN)>10):0,$G(DGINC55):1,1:0) D
37 .N DIR
38 .S DIR(0)="Y",DIR("A")="Do you wish to return to Screen #9 to enter missing Income Data? ",DIR("B")="YES" D ^DIR
39 .S:Y>0 DGRPV=0
40 .S:Y>0 DGRETURN=$G(DGRETURN)+1
41 I $S($G(Y)'>0:0,(DGRETURN>11):0,1:1) D ^DGRPV G ^DGRP9
42 I DGCT1+DGCT3'=DGCT,'% W !!?4,"YES - To correct inconsistencies to unrestricted fields immediately.",!?4,"NO - To abort this process immediately." G EDIT
43BUL K DGRETURN,X,Y D ^DGRPCB G KVAR^DGRPCE
44 ;
45WRIT S C=C+1 W:(C#2) ! S X1=$S((C#2):0,1:40) W ?X1,$E(J_" ",1,3),"- ",X2 I DGKEY(+$E(DGEDIT,J)) W "*" S DGCT1=DGCT1+1
46 I "^17^55^"[("^"_+J_"^") W "**" S DGCT3=DGCT3+1
47 I +$P(DGRPCOLD,",",2),DGRPCOLD'[(","_J_",") S DGCT2=DGCT2+1
48 Q
49KEY S X=$S(('$D(DUZ)#2):1,'$D(^XUSEC("DG ELIGIBILITY",DUZ)):1,1:0) F I=.3,.32,.361 S DGP(I)=$S($D(^DPT(DFN,I)):^(I),1:"")
50 F I=0:1:4 S DGKEY(I)=""
51 I $P(DGP(.361),"^",1)="V",X S DGKEY(1)=1
52 I $P(DGP(.3),"^",6)]"",X S DGKEY(2)=1
53 I $P(DGP(.32),"^",2)]"",X S DGKEY(3)=1
54 S:'X DGKEY(4)=1 K DGP Q
55 ;
56DELETE ; Delete all Registration inconsistencies from INCONSISTENT DATA file (#38.5).
57 ;
58 ;
59 N RULE,DIK,DA
60 ;
61 S RULE=0,DA=""
62 S DIK="^DGIN(38.5,"_DFN_","_"""I"""_","
63 F S RULE=$O(^DGIN(38.5,DFN,"I",RULE)) Q:RULE="" Q:RULE>99 S DA=RULE D ^DIK
64 Q
65 ;
66NOEDIT ; write explanation of non-editable items
67 I DGCT1 W !,"You will not be able to edit inconsistencies followed by an asterisk [*]",!,"as you do not hold the appropriate ""DG ELIGIBILITY"" security key."
68 I DGCT3 W !,"Inconsistencies followed by two (2) asterisks [**] must be corrected by",!,"using the appropriate MAS menu option(s)."
69 I DGCT1+DGCT3'=DGCT W !!,"All items not followed by an asterisk can be edited at this time. If these",!,"items are not corrected at this time, a bulletin will be sent to the",!,"appropriate hospital personnel."
70 ;;QUIT
Note: See TracBrowser for help on using the repository browser.