-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathDG_53_P840.KID
3286 lines (3186 loc) · 91.3 KB
/
DG_53_P840.KID
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
KIDS Distribution saved on May 18, 2011@13:44:39
ESR 3.5 Public Law 111-163 project VistA changes.
**KIDS**:DG*5.3*840^IB*2.0*449^IVM*2.0*149^
**INSTALL NAME**
DG*5.3*840
"BLD",8016,0)
DG*5.3*840^REGISTRATION^0^3110518^y
"BLD",8016,1,0)
^^2^2^3110404^
"BLD",8016,1,1,0)
This patch contains VistA changes to support technology and business
"BLD",8016,1,2,0)
changes that are occurring with the implementation of Public Law 111-163.
"BLD",8016,4,0)
^9.64PA^27.11^2
"BLD",8016,4,2,0)
2
"BLD",8016,4,2,2,0)
^9.641^2^1
"BLD",8016,4,2,2,2,0)
PATIENT (File-top level)
"BLD",8016,4,2,2,2,1,0)
^9.6411^.541^2
"BLD",8016,4,2,2,2,1,.39,0)
VETERAN CATASTROPHICALLY DISABLED?
"BLD",8016,4,2,2,2,1,.541,0)
CURRENT MOH INDICATOR
"BLD",8016,4,2,222)
y^n^p^^^^n^^n
"BLD",8016,4,2,224)
"BLD",8016,4,27.11,0)
27.11
"BLD",8016,4,27.11,2,0)
^9.641^27.11^1
"BLD",8016,4,27.11,2,27.11,0)
PATIENT ENROLLMENT (File-top level)
"BLD",8016,4,27.11,2,27.11,1,0)
^9.6411^50.23^1
"BLD",8016,4,27.11,2,27.11,1,50.23,0)
MEDAL OF HONOR INDICATED?
"BLD",8016,4,27.11,222)
y^n^p^^^^n^^n
"BLD",8016,4,27.11,224)
"BLD",8016,4,"APDD",2,2)
"BLD",8016,4,"APDD",2,2,.39)
"BLD",8016,4,"APDD",2,2,.541)
"BLD",8016,4,"APDD",27.11,27.11)
"BLD",8016,4,"APDD",27.11,27.11,50.23)
"BLD",8016,4,"B",2,2)
"BLD",8016,4,"B",27.11,27.11)
"BLD",8016,6)
3^
"BLD",8016,6.3)
20
"BLD",8016,"ABPKG")
n
"BLD",8016,"KRN",0)
^9.67PA^779.2^20
"BLD",8016,"KRN",.4,0)
.4
"BLD",8016,"KRN",.4,"NM",0)
^9.68A^^
"BLD",8016,"KRN",.401,0)
.401
"BLD",8016,"KRN",.402,0)
.402
"BLD",8016,"KRN",.403,0)
.403
"BLD",8016,"KRN",.5,0)
.5
"BLD",8016,"KRN",.84,0)
.84
"BLD",8016,"KRN",3.6,0)
3.6
"BLD",8016,"KRN",3.8,0)
3.8
"BLD",8016,"KRN",9.2,0)
9.2
"BLD",8016,"KRN",9.8,0)
9.8
"BLD",8016,"KRN",9.8,"NM",0)
^9.68A^5^5
"BLD",8016,"KRN",9.8,"NM",1,0)
DGMTCOU1^^0^B13494520
"BLD",8016,"KRN",9.8,"NM",2,0)
DGMTR^^0^B68425673
"BLD",8016,"KRN",9.8,"NM",3,0)
DGMTR1^^0^B32321945
"BLD",8016,"KRN",9.8,"NM",4,0)
DGMTCOR^^0^B36016297
"BLD",8016,"KRN",9.8,"NM",5,0)
DGMTA^^0^B43096781
"BLD",8016,"KRN",9.8,"NM","B","DGMTA",5)
"BLD",8016,"KRN",9.8,"NM","B","DGMTCOR",4)
"BLD",8016,"KRN",9.8,"NM","B","DGMTCOU1",1)
"BLD",8016,"KRN",9.8,"NM","B","DGMTR",2)
"BLD",8016,"KRN",9.8,"NM","B","DGMTR1",3)
"BLD",8016,"KRN",19,0)
19
"BLD",8016,"KRN",19.1,0)
19.1
"BLD",8016,"KRN",101,0)
101
"BLD",8016,"KRN",409.61,0)
409.61
"BLD",8016,"KRN",771,0)
771
"BLD",8016,"KRN",779.2,0)
779.2
"BLD",8016,"KRN",870,0)
870
"BLD",8016,"KRN",8989.51,0)
8989.51
"BLD",8016,"KRN",8989.52,0)
8989.52
"BLD",8016,"KRN",8994,0)
8994
"BLD",8016,"KRN","B",.4,.4)
"BLD",8016,"KRN","B",.401,.401)
"BLD",8016,"KRN","B",.402,.402)
"BLD",8016,"KRN","B",.403,.403)
"BLD",8016,"KRN","B",.5,.5)
"BLD",8016,"KRN","B",.84,.84)
"BLD",8016,"KRN","B",3.6,3.6)
"BLD",8016,"KRN","B",3.8,3.8)
"BLD",8016,"KRN","B",9.2,9.2)
"BLD",8016,"KRN","B",9.8,9.8)
"BLD",8016,"KRN","B",19,19)
"BLD",8016,"KRN","B",19.1,19.1)
"BLD",8016,"KRN","B",101,101)
"BLD",8016,"KRN","B",409.61,409.61)
"BLD",8016,"KRN","B",771,771)
"BLD",8016,"KRN","B",779.2,779.2)
"BLD",8016,"KRN","B",870,870)
"BLD",8016,"KRN","B",8989.51,8989.51)
"BLD",8016,"KRN","B",8989.52,8989.52)
"BLD",8016,"KRN","B",8994,8994)
"BLD",8016,"QUES",0)
^9.62^^
"BLD",8016,"REQB",0)
^9.611^2^2
"BLD",8016,"REQB",1,0)
DG*5.3*661^2
"BLD",8016,"REQB",2,0)
DG*5.3*773^2
"BLD",8016,"REQB","B","DG*5.3*661",1)
"BLD",8016,"REQB","B","DG*5.3*773",2)
"FIA",2)
PATIENT
"FIA",2,0)
^DPT(
"FIA",2,0,0)
2I
"FIA",2,0,1)
y^n^p^^^^n^^n
"FIA",2,0,10)
"FIA",2,0,11)
"FIA",2,0,"RLRO")
"FIA",2,0,"VR")
5.3^DG
"FIA",2,2)
1
"FIA",2,2,.39)
"FIA",2,2,.541)
"FIA",27.11)
PATIENT ENROLLMENT
"FIA",27.11,0)
^DGEN(27.11,
"FIA",27.11,0,0)
27.11OID
"FIA",27.11,0,1)
y^n^p^^^^n^^n
"FIA",27.11,0,10)
"FIA",27.11,0,11)
"FIA",27.11,0,"RLRO")
"FIA",27.11,0,"VR")
5.3^DG
"FIA",27.11,27.11)
1
"FIA",27.11,27.11,50.23)
"MBREQ")
0
"PKG",47,-1)
1^1
"PKG",47,0)
REGISTRATION^DG^PATIENT REGISTRATION, ADMISSION, DISCHARGE, EMBOSSER
"PKG",47,20,0)
^9.402P^^
"PKG",47,22,0)
^9.49I^1^1
"PKG",47,22,1,0)
5.3^2930813^2960613
"PKG",47,22,1,"PAH",1,0)
840^3110518^100992
"PKG",47,22,1,"PAH",1,1,0)
^^2^2^3110518
"PKG",47,22,1,"PAH",1,1,1,0)
This patch contains VistA changes to support technology and business
"PKG",47,22,1,"PAH",1,1,2,0)
changes that are occurring with the implementation of Public Law 111-163.
"QUES","XPF1",0)
Y
"QUES","XPF1","??")
^D REP^XPDH
"QUES","XPF1","A")
Shall I write over your |FLAG| File
"QUES","XPF1","B")
YES
"QUES","XPF1","M")
D XPF1^XPDIQ
"QUES","XPF2",0)
Y
"QUES","XPF2","??")
^D DTA^XPDH
"QUES","XPF2","A")
Want my data |FLAG| yours
"QUES","XPF2","B")
YES
"QUES","XPF2","M")
D XPF2^XPDIQ
"QUES","XPI1",0)
YO
"QUES","XPI1","??")
^D INHIBIT^XPDH
"QUES","XPI1","A")
Want KIDS to INHIBIT LOGONs during the install
"QUES","XPI1","B")
NO
"QUES","XPI1","M")
D XPI1^XPDIQ
"QUES","XPM1",0)
PO^VA(200,:EM
"QUES","XPM1","??")
^D MG^XPDH
"QUES","XPM1","A")
Enter the Coordinator for Mail Group '|FLAG|'
"QUES","XPM1","B")
"QUES","XPM1","M")
D XPM1^XPDIQ
"QUES","XPO1",0)
Y
"QUES","XPO1","??")
^D MENU^XPDH
"QUES","XPO1","A")
Want KIDS to Rebuild Menu Trees Upon Completion of Install
"QUES","XPO1","B")
NO
"QUES","XPO1","M")
D XPO1^XPDIQ
"QUES","XPZ1",0)
Y
"QUES","XPZ1","??")
^D OPT^XPDH
"QUES","XPZ1","A")
Want to DISABLE Scheduled Options, Menu Options, and Protocols
"QUES","XPZ1","B")
NO
"QUES","XPZ1","M")
D XPZ1^XPDIQ
"QUES","XPZ2",0)
Y
"QUES","XPZ2","??")
^D RTN^XPDH
"QUES","XPZ2","A")
Want to MOVE routines to other CPUs
"QUES","XPZ2","B")
NO
"QUES","XPZ2","M")
D XPZ2^XPDIQ
"RTN")
5
"RTN","DGMTA")
0^5^B43096781
"RTN","DGMTA",1,0)
DGMTA ;ALB/RMO/CAW/LD/SCG/AEG/PHH - Add a New Means Test;2/24/10 2:58pm
"RTN","DGMTA",2,0)
;;5.3;Registration;**33,45,137,166,177,182,290,344,332,433,458,535,612,564,688,661,840**;Aug 13, 1993;Build 20
"RTN","DGMTA",3,0)
;
"RTN","DGMTA",4,0)
EN ;Entry point to add a new means test
"RTN","DGMTA",5,0)
N DGMDOD S DGMDOD=""
"RTN","DGMTA",6,0)
S DGADDF=1
"RTN","DGMTA",7,0)
I $D(DGMTDFN)#2 D UNLOCK^DGMTUTL(DGMTDFN) K DGMTDFN
"RTN","DGMTA",8,0)
S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q:Y<0 S (DFN,DGMTDFN)=+Y
"RTN","DGMTA",9,0)
I $P($G(^DPT(DFN,.35)),U)'="" S DGMDOD=$P(^DPT(DFN,.35),U)
"RTN","DGMTA",10,0)
I $G(DGMDOD) W !,"Patient died on: ",$$FMTE^XLFDT(DGMDOD,"1D") Q
"RTN","DGMTA",11,0)
;
"RTN","DGMTA",12,0)
; check if income test in progress
"RTN","DGMTA",13,0)
D CKUPLOAD^IVMCUPL(DFN)
"RTN","DGMTA",14,0)
;
"RTN","DGMTA",15,0)
; obtain lock used to synchronize local MT/CT options with income test upload
"RTN","DGMTA",16,0)
I $$LOCK^DGMTUTL(DFN)
"RTN","DGMTA",17,0)
;
"RTN","DGMTA",18,0)
I DGMTYPT=1 N DGDOM1 D EN^DGMTR I 'DGREQF,'$G(DGDOM1) W !,*7,"A means test can only be added for patients who require one.",! K DGDOM1 G EN
"RTN","DGMTA",19,0)
;
"RTN","DGMTA",20,0)
N FUTMT S FUTMT=$$FUT^DGMTU(DFN,"",DGMTYPT) I FUTMT D FTST G EN
"RTN","DGMTA",21,0)
;
"RTN","DGMTA",22,0)
;if a test was auto-completed, DGADDF gets set to 0
"RTN","DGMTA",23,0)
I 'DGADDF W !!,*7,"A means test already exists and is in effect" G EN
"RTN","DGMTA",24,0)
;
"RTN","DGMTA",25,0)
K:DGMTYPT=1 DGDOM1
"RTN","DGMTA",26,0)
I DGMTYPT=2 D EN^DGMTCOR I 'DGMTCOR S I=$P($T(WHY+DGWRT),";",3,99) W !!,*7,"A copay exemption test can only be added for applicable veterans.",!,I G EN
"RTN","DGMTA",27,0)
S DGLDT=$$LST^DGMTU(DFN,"",DGMTYPT),DGLD=$P(DGLDT,U,2),DGLDYR=$E(DGLD,1,3)_"1231"
"RTN","DGMTA",28,0)
;
"RTN","DGMTA",29,0)
DT S %DT("A")="DATE OF TEST: ",%DT="AEX",%DT(0)="-NOW",%DT("B")="NOW" W ! D ^%DT K %DT G Q:Y<0 S DGMTDT=Y
"RTN","DGMTA",30,0)
I DGMTDT<$S(DGMTYPT=1:2860701,1:2921029) W !?3,*7,"The date of test cannot be before "_$S(DGMTYPT=1:"7/1/1986.",1:"10/29/1992.") G DT
"RTN","DGMTA",31,0)
I DGLD,DGMTDT<DGLD W !?3,*7,"The date of test cannot be before the last date of test on " S Y=DGLD X ^DD("DD") W Y,"." G DT
"RTN","DGMTA",32,0)
I DGLD S X1=DGMTDT,X2=DGLD D ^%DTC I X<365,DGMTDT'>DGLDYR D G EN
"RTN","DGMTA",33,0)
.W !?3,*7,"An annual date of test already exists on " S Y=DGLD X ^DD("DD") W Y,"."
"RTN","DGMTA",34,0)
.S DGTTYP=$S(DGMTYPT=1:"Means ",1:"Copay Exemption ")
"RTN","DGMTA",35,0)
.W !,$S($P($G(^DG(408.34,+$P($G(^DGMT(408.31,+DGLDT,0)),U,23),0)),U)="VAMC":" Use the 'Edit an Existing "_DGTTYP_"Test' Option.",1:" Use the 'View a Past Means Test' Option.")
"RTN","DGMTA",36,0)
;
"RTN","DGMTA",37,0)
;Means Test cannot be added for patient on a DOM ward on date of test
"RTN","DGMTA",38,0)
I DGMTYPT=2 G PRINT
"RTN","DGMTA",39,0)
N VAINDT,VADMVT,DGDOM,DGDOM1
"RTN","DGMTA",40,0)
S VAINDT=DGMTDT
"RTN","DGMTA",41,0)
D DOM1^DGMTR I $G(DGDOM1) D K VAINDT,VADMVT,DGDOM,DGDOM1 G EN
"RTN","DGMTA",42,0)
.W !,*7,"A Means Test cannot be added for patients on a DOM ward on date of test.",!
"RTN","DGMTA",43,0)
K VAINDT,VADMVT,DGDOM,DGDOM1
"RTN","DGMTA",44,0)
;
"RTN","DGMTA",45,0)
;A warning message is displayed if last means test for patient is
"RTN","DGMTA",46,0)
;from a prior year and has a status of required. The user is given
"RTN","DGMTA",47,0)
;the option to continue or stop adding a new means test.
"RTN","DGMTA",48,0)
N %
"RTN","DGMTA",49,0)
I DGLD,DGMTDT>DGLDYR,$P(DGLDT,"^",4)="R" D Q:%=-1 I %=2 K % G EN
"RTN","DGMTA",50,0)
.W !?3,*7,"WARNING - last means test on " S Y=DGLD X ^DD("DD") W Y," has a status of required."
"RTN","DGMTA",51,0)
DT2 .W !?3,"Do you still want to continue adding new test"
"RTN","DGMTA",52,0)
.S %=2 D YN^DICN
"RTN","DGMTA",53,0)
.I %=0 W !?3,"Answer 'Y'es to continue adding new test." G DT2
"RTN","DGMTA",54,0)
.Q
"RTN","DGMTA",55,0)
K %
"RTN","DGMTA",56,0)
;
"RTN","DGMTA",57,0)
PRINT I "^P^A^C^G^"[(U_$P(DGLDT,U,4)_U) S %=1 W !,"Do you wish to print the prior means test" D YN^DICN G:%=-1 Q I %Y["?" W !!,"This will print the prior means test information.",! G PRINT
"RTN","DGMTA",58,0)
I $G(%)=1 S DGX=DGMTDT,DGMTDT=DGLD,DGMTI=+DGLDT,DGOPT="" D DEV^DGMTP,CLOSE^DGUTQ S DGMTDT=DGX K DGX
"RTN","DGMTA",59,0)
D ADD G EN:DGMTI<0
"RTN","DGMTA",60,0)
S DGMTACT="ADD",DGMTROU="EN^DGMTA" G EN^DGMTSC
"RTN","DGMTA",61,0)
;
"RTN","DGMTA",62,0)
Q K DA,DFN,DGADDF,DGBL,DGFL,DGFLD,DGIRO,DGLD,DGLDT,DGLDYR,DGMTACT,DGMTCOR,DGMTDT,DGMTI,DGMTROU,DGREQF,DGTTYP,DGMTYPT,DGVI,DGVO,X,X1,X2,Y
"RTN","DGMTA",63,0)
;
"RTN","DGMTA",64,0)
; release lock used to synchronize local MT/CT options with income test upload
"RTN","DGMTA",65,0)
I $D(DGMTDFN)#2 D UNLOCK^DGMTUTL(DGMTDFN) K DGMTDFN
"RTN","DGMTA",66,0)
Q
"RTN","DGMTA",67,0)
;
"RTN","DGMTA",68,0)
ADD ;Add means test
"RTN","DGMTA",69,0)
; Input -- DFN Patient IEN
"RTN","DGMTA",70,0)
; DGMTDT Date
"RTN","DGMTA",71,0)
; DGMTYPT Type of Test 1=MT 2=COPAY 4=LTC
"RTN","DGMTA",72,0)
; Output -- DGMTI Annual Means/Copay/LTC Test IEN
"RTN","DGMTA",73,0)
N DA,DD,DIC,DIK,DINUM,DLAYGO,DO,DS,X,D0,DGSITE,CONVRT,CURIEN,LINK,DGLNKMT
"RTN","DGMTA",74,0)
;
"RTN","DGMTA",75,0)
; obtain lock used to synchronize local MT/CT options with income test upload
"RTN","DGMTA",76,0)
I $$LOCK^DGMTUTL(DFN) E Q
"RTN","DGMTA",77,0)
;
"RTN","DGMTA",78,0)
; Check for Linked test and don't lose the link.
"RTN","DGMTA",79,0)
S LINK="",DGLNKMT=$$LST^DGMTU(DFN,DGMTDT,DGMTYPT),CURIEN=+DGLNKMT
"RTN","DGMTA",80,0)
I CURIEN D
"RTN","DGMTA",81,0)
. ;Don't link test if it's in a different year (DG*5.3*661)
"RTN","DGMTA",82,0)
. I $E($P(DGLNKMT,U,2),1,3)'=$E(DGMTDT,1,3) Q
"RTN","DGMTA",83,0)
. S LINK=$P($G(^DGMT(408.31,CURIEN,2)),U,6)
"RTN","DGMTA",84,0)
;
"RTN","DGMTA",85,0)
S DGSITE=$$GETSITE^DGMTU4(.DUZ)
"RTN","DGMTA",86,0)
S X=DGMTDT,(DIC,DIK)="^DGMT(408.31,",DIC(0)="L",DLAYGO=408.31
"RTN","DGMTA",87,0)
;
"RTN","DGMTA",88,0)
;Look for existing IAI records and convert (if necessary)
"RTN","DGMTA",89,0)
D ALL^DGMTU21(DFN,"VSD",DT,"IPR") ;ALL only returns IAI from last IY
"RTN","DGMTA",90,0)
I $D(DGINC) DO
"RTN","DGMTA",91,0)
. D ISCNVRT^DGMTUTL(.DGINC)
"RTN","DGMTA",92,0)
;
"RTN","DGMTA",93,0)
; The DIC("DR") string is built in this specific order so that
"RTN","DGMTA",94,0)
; all triggers and "M" x-refs fire correctly. Should not be
"RTN","DGMTA",95,0)
; modified without an in-depth review of DD of file #408.31.
"RTN","DGMTA",96,0)
;
"RTN","DGMTA",97,0)
I DGMTYPT=2 D
"RTN","DGMTA",98,0)
.S DIC("DR")="2////"_(DGMTYPT'=4)_";2.05////"_DGSITE_";2.06////"_LINK
"RTN","DGMTA",99,0)
.S DIC("DR")=DIC("DR")_";.02////"_DFN_";.019////"_DGMTYPT_";.23////1"
"RTN","DGMTA",100,0)
E D
"RTN","DGMTA",101,0)
.S DIC("DR")="2////"_(DGMTYPT'=4)_";2.05////"_DGSITE_";2.06////"_LINK
"RTN","DGMTA",102,0)
.S DIC("DR")=DIC("DR")_";.019////"_DGMTYPT_";.02////"_DFN_";.23////1"
"RTN","DGMTA",103,0)
K DD,DO
"RTN","DGMTA",104,0)
D FILE^DICN S DGMTI=+Y
"RTN","DGMTA",105,0)
;
"RTN","DGMTA",106,0)
; Check for another test in the current year and convert IAI records if needed
"RTN","DGMTA",107,0)
; Send new test date (as test that have) into VRCHKUP
"RTN","DGMTA",108,0)
I $D(TYPE),((+TYPE=1)!(TYPE=4)) S CONVRT=$$VRCHKUP^DGMTU2(DGMTYPT,TYPE,DGMTDT)
"RTN","DGMTA",109,0)
I $D(TYPE),((+TYPE'=1)&(TYPE'=4)) S CONVRT=$$VRCHKUP^DGMTU2(DGMTYPT,,DGMTDT)
"RTN","DGMTA",110,0)
I '$D(TYPE) S CONVRT=$$VRCHKUP^DGMTU2(DGMTYPT,,DGMTDT)
"RTN","DGMTA",111,0)
N DGERR,DGMTRT
"RTN","DGMTA",112,0)
S DGMTRT(408.31,DGMTI_",",2.11)=1
"RTN","DGMTA",113,0)
S DGERR=""
"RTN","DGMTA",114,0)
D FILE^DIE("","DGMTRT",DGERR)
"RTN","DGMTA",115,0)
; release lock used to synchronize local MT/CT options with income test upload
"RTN","DGMTA",116,0)
D UNLOCK^DGMTUTL(DFN)
"RTN","DGMTA",117,0)
;
"RTN","DGMTA",118,0)
ADDQ Q
"RTN","DGMTA",119,0)
;
"RTN","DGMTA",120,0)
FTST ; Build message for future tests that are added to the system, but
"RTN","DGMTA",121,0)
; were not performed by the VAMC trying to add a new MT.
"RTN","DGMTA",122,0)
N SITE,DGMTYPT,DGTTYP,SRC,SCT
"RTN","DGMTA",123,0)
S SCT=$P(^DGMT(408.31,+FUTMT,2),U,5),SITE=$$INST^DGENU()
"RTN","DGMTA",124,0)
S DGMTYPT=$P(^DGMT(408.31,+FUTMT,0),U,19)
"RTN","DGMTA",125,0)
S DGTTYP=$S(DGMTYPT=1:"Means ",1:"Copay Exemption ")
"RTN","DGMTA",126,0)
W !?3,*7,"A future test already exists on "
"RTN","DGMTA",127,0)
S Y=$P(FUTMT,U,2) X ^DD("DD") W Y,"."
"RTN","DGMTA",128,0)
; This site performed the MT
"RTN","DGMTA",129,0)
I SITE=SCT D
"RTN","DGMTA",130,0)
.W !?3,"Use the 'Edit an Existing "_DGTTYP_"Test' Option."
"RTN","DGMTA",131,0)
;
"RTN","DGMTA",132,0)
; The MT was added by another VAMC
"RTN","DGMTA",133,0)
I SITE'=SCT D
"RTN","DGMTA",134,0)
.S SRC=$P(FUTMT,U,5)
"RTN","DGMTA",135,0)
.I SCT W !?3,"The "_DGTTYP_"Test was conducted at Site: ",SCT
"RTN","DGMTA",136,0)
.W !?3,"Please contact "
"RTN","DGMTA",137,0)
.W $S($D(^DIC(4,+SCT,0)):$P(^DIC(4,+SCT,0),U),SRC=2:"IVM",SRC=3:"the HEC",1:"the site")
"RTN","DGMTA",138,0)
.W ",",!?3,"if it is necessary to edit the test."
"RTN","DGMTA",139,0)
Q
"RTN","DGMTA",140,0)
WHY ;Why Copay Test cannot be added
"RTN","DGMTA",141,0)
;;Patient is not a veteran.
"RTN","DGMTA",142,0)
;;Patient does not have a Primary Eligibility Code.
"RTN","DGMTA",143,0)
;;Patient is Service Connected 50-100%.
"RTN","DGMTA",144,0)
;;Means Test options must be used instead of Copay options.
"RTN","DGMTA",145,0)
;;Patient is receiving Aid and Attendance, automatically exempted.
"RTN","DGMTA",146,0)
;;Patient is receiving Housebound Benefits, automatically exempted.
"RTN","DGMTA",147,0)
;;Patient is receiving a VA Pension, automatically exempted.
"RTN","DGMTA",148,0)
;;Patient is in a DOM ward, automatically exempted.
"RTN","DGMTA",149,0)
;;Patient is an inpatient, automatically exempted.
"RTN","DGMTA",150,0)
;;Patient was a POW, automatically exempted.
"RTN","DGMTA",151,0)
;;Patient is Unemployable, automatically exempted.
"RTN","DGMTA",152,0)
;;Patient is Catastrophically Disabled, automatically exempted.
"RTN","DGMTCOR")
0^4^B36016297
"RTN","DGMTCOR",1,0)
DGMTCOR ;ALB/CAW,SCG,LBD,TMK - Check Copay Test Requirements;07/28/08
"RTN","DGMTCOR",2,0)
;;5.3;Registration;**21,45,182,290,305,330,344,495,564,773,840**;Aug 13, 1993;Build 20
"RTN","DGMTCOR",3,0)
;
"RTN","DGMTCOR",4,0)
;A patient may apply for a copay test under the following conditions:
"RTN","DGMTCOR",5,0)
; - Applicant is a veteran
"RTN","DGMTCOR",6,0)
; - Applicant's primary or other eligibility does NOT contain
"RTN","DGMTCOR",7,0)
; - Service Connected 50% to 100% or
"RTN","DGMTCOR",8,0)
; - Aid and Attendance or
"RTN","DGMTCOR",9,0)
; - Housebound or
"RTN","DGMTCOR",10,0)
; - VA Pension
"RTN","DGMTCOR",11,0)
; - Catastrophically Disabled
"RTN","DGMTCOR",12,0)
; - Primary Eligibility is NSC
"RTN","DGMTCOR",13,0)
; - who has NOT been means tested
"RTN","DGMTCOR",14,0)
; - who claims exposure to agent orange or ionizing radiation
"RTN","DGMTCOR",15,0)
; - who is eligible for medicaid
"RTN","DGMTCOR",16,0)
; - Applicants who have answered 'no' to Receiving A&A, HB, or Pension
"RTN","DGMTCOR",17,0)
; - Applicants who have previously qualified and applied for a copay
"RTN","DGMTCOR",18,0)
; exemption, still qualify and have NOT been copay tested in the
"RTN","DGMTCOR",19,0)
; past year
"RTN","DGMTCOR",20,0)
; - Applicants who are not currently a DOM patient or inpatient
"RTN","DGMTCOR",21,0)
; (they are temporarily exempt from copay testing) DG*5.3*290
"RTN","DGMTCOR",22,0)
; - Applicants who do not have POW eligibility (DG*5.3*564 - HVE III)
"RTN","DGMTCOR",23,0)
; - Applicants who do not meet criteria for Unemployable:
"RTN","DGMTCOR",24,0)
; Unemployable="Y", SC%>0, not receiving A&A, HB or Pension, and
"RTN","DGMTCOR",25,0)
; Total VA Check Amount>0 (DG*5.3*564 - HVE III)
"RTN","DGMTCOR",26,0)
;
"RTN","DGMTCOR",27,0)
; Input -- DFN Patient IEN
"RTN","DGMTCOR",28,0)
; DGADDF Means Test Add Flag (optional)
"RTN","DGMTCOR",29,0)
; DGNOIVMUPD Do Not Update IVM Copay Test Flag (optional)
"RTN","DGMTCOR",30,0)
; Output -- DGMTCOR Copay Test Flag
"RTN","DGMTCOR",31,0)
; (1 if eligible and 0 if not eligible)
"RTN","DGMTCOR",32,0)
;
"RTN","DGMTCOR",33,0)
;
"RTN","DGMTCOR",34,0)
EN ;
"RTN","DGMTCOR",35,0)
Q:$G(VAFCA08)=1
"RTN","DGMTCOR",36,0)
N DGMTI,DGMTYPT,DGMDOD
"RTN","DGMTCOR",37,0)
D ON^DGMTCOU G:'Y ENQ
"RTN","DGMTCOR",38,0)
S DGRGAUTO=1 ;possible change in cp status w/o call to cp event driver
"RTN","DGMTCOR",39,0)
D CHK
"RTN","DGMTCOR",40,0)
;
"RTN","DGMTCOR",41,0)
Q:($G(DGWRT)=8)!($G(DGWRT)=9) ;brm;quit if inpatient or dom;DG*5.3*290
"RTN","DGMTCOR",42,0)
S IVMZ10F=+$G(IVMZ10F)
"RTN","DGMTCOR",43,0)
I 'DGMTCOR,'$G(DGADDF),'$G(DGMDOD),'IVMZ10F D NLA
"RTN","DGMTCOR",44,0)
I DGMTCOR,'$G(DGADDF),'$G(DGMDOD) D INC
"RTN","DGMTCOR",45,0)
I DGRGAUTO&'$G(DGADDF) D QREGAUTO ;if cp event driver not fired off & NOT a new means test
"RTN","DGMTCOR",46,0)
;
"RTN","DGMTCOR",47,0)
ENQ Q
"RTN","DGMTCOR",48,0)
;
"RTN","DGMTCOR",49,0)
CHK N STATUS,DGELIG,DGE,DGI,DGNODE,DGMDOD,DGMTDT,DGMTI,DGMTL
"RTN","DGMTCOR",50,0)
S DGMTCOR=1,DGMT="",DGMTYPT=2
"RTN","DGMTCOR",51,0)
I $P($G(^DPT(DFN,"VET")),U,1)'="Y" S DGMTCOR=0,DGWRT=1 G CHKQ ;NON-VET
"RTN","DGMTCOR",52,0)
;Added with DG*5.3*344
"RTN","DGMTCOR",53,0)
S DGMTL=$$LST^DGMTU(DFN),DGMTI=+DGMTL,DGMTDT=$P(DGMTL,U,2)
"RTN","DGMTCOR",54,0)
S DGMDOD=$P($G(^DPT(DFN,.35)),U)
"RTN","DGMTCOR",55,0)
I 'DGMTI,$G(DGMDOD) S DGMTCOR=0 Q
"RTN","DGMTCOR",56,0)
I DGMDOD,(DGMTCOR),(DGMTDT>(DGMDOD-1)) S DGMTCOR=0 G CHKQ
"RTN","DGMTCOR",57,0)
;
"RTN","DGMTCOR",58,0)
I '$P($G(^DPT(DFN,.36)),U) S DGMTCOR=0,DGWRT=2 G CHKQ ;NO PRIM ELIG
"RTN","DGMTCOR",59,0)
I +$G(DGMDOD) S DGNOCOPF=1
"RTN","DGMTCOR",60,0)
;
"RTN","DGMTCOR",61,0)
;This doesn't work! The "AEL" x-ref not there when changing the primary
"RTN","DGMTCOR",62,0)
;eligibility! Problem with order that the cross-references are called
"RTN","DGMTCOR",63,0)
;in, DGMTR is called before the "AEL" x-ref is set!
"RTN","DGMTCOR",64,0)
;F S DGMTI=$O(^DPT("AEL",DFN,DGMTI)) Q:'DGMTI S DGMTE=$P($G(^DIC(8,DGMTI,0)),U,9) I "^1^2^4^15^"[("^"_DGMTE_"^") S DGMTCOR=0,DGWRT=3 G CHKQ
"RTN","DGMTCOR",65,0)
;
"RTN","DGMTCOR",66,0)
;
"RTN","DGMTCOR",67,0)
S DGI=$P($G(^DPT(DFN,.36)),"^"),DGELIG=U_$P($G(^DIC(8,+DGI,0)),U,9)_U
"RTN","DGMTCOR",68,0)
S DGI=0 F S DGI=$O(^DPT(DFN,"E",DGI)) Q:'DGI S DGE=$P($G(^DPT(DFN,"E",DGI,0)),U),DGELIG=DGELIG_$P($G(^DIC(8,+DGE,0)),U,9)_U
"RTN","DGMTCOR",69,0)
I (DGELIG["^1^") S DGMTCOR=0,DGWRT=3 G CHKQ ;SC 50-100%
"RTN","DGMTCOR",70,0)
F DGI=.3,.362,.39,.52 S DGNODE(DGI)=$G(^DPT(DFN,DGI)) ;DG*5.3*840
"RTN","DGMTCOR",71,0)
I $P(DGNODE(.362),U,12)["Y"!(DGELIG["^2^") S DGMTCOR=0,DGWRT=5 G CHKQ ;A&A
"RTN","DGMTCOR",72,0)
I $P(DGNODE(.362),U,13)["Y"!(DGELIG["^15^") S DGMTCOR=0,DGWRT=6 G CHKQ ;HB
"RTN","DGMTCOR",73,0)
I $P(DGNODE(.362),U,14)["Y"!(DGELIG["^4^") S DGMTCOR=0,DGWRT=7 G CHKQ ;PENSION
"RTN","DGMTCOR",74,0)
I $P(DGNODE(.52),U,5)["Y"!(DGELIG["^18^") S DGMTCOR=0,DGWRT=10 G CHKQ ;POW (DG*5.3*564)
"RTN","DGMTCOR",75,0)
I $P(DGNODE(.39),U,6)["Y"!(DGELIG["^21^") S DGMTCOR=0,DGWRT=12 G CHKQ ;CD (DG*5.3*840
"RTN","DGMTCOR",76,0)
I $P(DGNODE(.3),U,5)["Y"&($P(DGNODE(.3),U,2)>0)&($P(DGNODE(.362),U,20)>0) S DGMTCOR=0,DGWRT=11 G CHKQ ;UNEMPLOYABLE (DG*5.3*564)
"RTN","DGMTCOR",77,0)
;brm added next 3 lines for DG*5.3*290
"RTN","DGMTCOR",78,0)
N DGDOM,DGDOM1,VAHOW,VAROOT,VAINDT,VAIP,VAERR,NOW
"RTN","DGMTCOR",79,0)
D DOM^DGMTR I $G(DGDOM) S DGMTCOR=0,DGRGAUTO=0,DGWRT=8 Q ;DOM
"RTN","DGMTCOR",80,0)
D IN5^VADPT I $G(VAIP(1))'="" S DGMTCOR=0,DGRGAUTO=0,DGWRT=9 Q ;INP
"RTN","DGMTCOR",81,0)
I DGMTI,'$$OLD^DGMTU4(DGMTDT) S STATUS=$P($G(^DGMT(408.31,+DGMTI,0)),U,3) I STATUS'="3" S DGMTCOR=0,DGWRT=4 G CHKQ
"RTN","DGMTCOR",82,0)
CHKQ Q
"RTN","DGMTCOR",83,0)
;
"RTN","DGMTCOR",84,0)
NLA ; Change Status to NO LONGER APPLICABLE - if appropriate
"RTN","DGMTCOR",85,0)
;
"RTN","DGMTCOR",86,0)
N DGCS,DGMTI,DGMT0,DGINI,DGINR,DGVAL,DGFL,DGFLD,DGIEN,DGMTACT,TDATE
"RTN","DGMTCOR",87,0)
S DGMTI=+$$LST^DGMTU(DFN,"",2) Q:'DGMTI!($P($G(^DGMT(408.31,DGMTI,0)),U,3)=10)
"RTN","DGMTCOR",88,0)
; Do not allow update of IVM test by site
"RTN","DGMTCOR",89,0)
I $G(DGNOIVMUPD),$$IVMCVT^DGMTCOR(DGMTI) D Q ;Check if converted IVM MT
"RTN","DGMTCOR",90,0)
. ;I '$G(DGMSGF),$G(DGNOIVMUPD)<2 W !,"IVM RX COPAY TEST EXISTS, BUT VISTA CALCULATES 'NO LONGER APPLICABLE'",!,"CONTACT IVM TO CLEAR UP THE DISCREPANCY - YOU CANNOT UPDATE AN IVM TEST"
"RTN","DGMTCOR",91,0)
. S DGNOIVMUPD=2 ; Prevent double printing of the message
"RTN","DGMTCOR",92,0)
S DGMT0=$G(^DGMT(408.31,DGMTI,0)) Q:'DGMT0
"RTN","DGMTCOR",93,0)
S DGCS=$P(DGMT0,U,3)
"RTN","DGMTCOR",94,0)
S TDATE=+DGMT0
"RTN","DGMTCOR",95,0)
S DGMTACT="STA" D PRIOR^DGMTEVT
"RTN","DGMTCOR",96,0)
;
"RTN","DGMTCOR",97,0)
D SAVESTAT^DGMTU4(DGMTI)
"RTN","DGMTCOR",98,0)
;
"RTN","DGMTCOR",99,0)
S DGFL=408.31,DGIEN=DGMTI
"RTN","DGMTCOR",100,0)
S DGFLD=.03 I DGCS]"" S DGVAL=DGCS D KILL^DGMTR
"RTN","DGMTCOR",101,0)
S DGVAL=10,$P(^DGMT(408.31,DGMTI,0),"^",3)=DGVAL D SET^DGMTR
"RTN","DGMTCOR",102,0)
S DGFLD=.17,DGVAL=DT,$P(^DGMT(408.31,DGMTI,0),"^",17)=DT D SET^DGMTR
"RTN","DGMTCOR",103,0)
W:'$G(DGMTMSG)&'$D(ZTQUEUED) !,"COPAY TEST NO LONGER APPLICABLE"
"RTN","DGMTCOR",104,0)
D GETINCOM^DGMTU4(DFN,TDATE)
"RTN","DGMTCOR",105,0)
S DGMTYPT=2 D QUE^DGMTR
"RTN","DGMTCOR",106,0)
S DGRGAUTO=0
"RTN","DGMTCOR",107,0)
NLAQ Q
"RTN","DGMTCOR",108,0)
;
"RTN","DGMTCOR",109,0)
INC ;Update copay status to 'INCOMPLETE' if applicable OR restore completed test
"RTN","DGMTCOR",110,0)
N DGMTACT,DGMTI,DGFL,DGFLD,DGIEN,DGMTP,DGVAL,DGMT0,AUTOCOMP,ERROR
"RTN","DGMTCOR",111,0)
S AUTOCOMP=0
"RTN","DGMTCOR",112,0)
S DGMTI=+$$LST^DGMTU(DFN,"",2)
"RTN","DGMTCOR",113,0)
D
"RTN","DGMTCOR",114,0)
.Q:'DGMTI
"RTN","DGMTCOR",115,0)
.I ($P($G(^DGMT(408.31,DGMTI,0)),U,3)'=10) S AUTOCOMP=1 Q
"RTN","DGMTCOR",116,0)
.S DGMT0=$G(^DGMT(408.31,DGMTI,0)),DGCS=$P(DGMT0,U,3)
"RTN","DGMTCOR",117,0)
.Q:'DGMT0
"RTN","DGMTCOR",118,0)
.S DGMTACT="STA" D PRIOR^DGMTEVT
"RTN","DGMTCOR",119,0)
.S AUTOCOMP=$$AUTOCOMP^DGMTR(DGMTI)
"RTN","DGMTCOR",120,0)
.W:'AUTOCOMP&'$G(DGMTMSG)&'$D(ZTQUEUED) !,"COPAY EXEMPTION TEST UPDATED TO INCOMPLETE"
"RTN","DGMTCOR",121,0)
.W:AUTOCOMP&'$G(DGMTMSG)&'$D(ZTQUEUED) !,"COPAY EXEMPTION TEST UPDATED TO ",$$GETNAME^DGMTH($P($G(^DGMT(408.31,DGMTI,0)),"^",3))
"RTN","DGMTCOR",122,0)
.S DGMTYPT=2 D QUE^DGMTR
"RTN","DGMTCOR",123,0)
.S DGRGAUTO=0
"RTN","DGMTCOR",124,0)
;
"RTN","DGMTCOR",125,0)
I $G(IVMZ10)'="UPLOAD IN PROGRESS",$G(DGQSENT)'=1,'AUTOCOMP,'$$OPEN^IVMCQ2(DFN),'$$SENT^IVMCQ2(DFN) D QRYQUE2^IVMCQ2(DFN,$G(DUZ),0,$G(XQY)) S DGQSENT=1 I '$D(ZTQUEUED),'$G(DGMSGF) W !!,"Financial query queued to be sent to HEC..."
"RTN","DGMTCOR",126,0)
;
"RTN","DGMTCOR",127,0)
INCQ Q
"RTN","DGMTCOR",128,0)
;
"RTN","DGMTCOR",129,0)
QREGAUTO ;Queues off test done by IB recalculating CP status
"RTN","DGMTCOR",130,0)
; Input: DFN
"RTN","DGMTCOR",131,0)
; Action: Possible update of Copay Status
"RTN","DGMTCOR",132,0)
;
"RTN","DGMTCOR",133,0)
Q:'$D(^IBA(354.1,"APIDT",DFN,1)) ;No action if no status on file
"RTN","DGMTCOR",134,0)
S ZTDESC="CHECK PATIENT FILE CHANGES VS CP STATUS",ZTDTH=$H,ZTRTN="REGAUTO^IBARXEU5",ZTSAVE("DFN")="",ZTIO=""
"RTN","DGMTCOR",135,0)
D ^%ZTLOAD
"RTN","DGMTCOR",136,0)
K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
"RTN","DGMTCOR",137,0)
Q
"RTN","DGMTCOR",138,0)
;
"RTN","DGMTCOR",139,0)
IVMCVT(IVMTIEN) ; Check for a converted IVM Means Test
"RTN","DGMTCOR",140,0)
; Input IVMTIEN - MT IEN to check
"RTN","DGMTCOR",141,0)
; Return 1 - if converted MT
"RTN","DGMTCOR",142,0)
; 0 - if not a converted MT
"RTN","DGMTCOR",143,0)
;
"RTN","DGMTCOR",144,0)
N FLAG,IVMAR
"RTN","DGMTCOR",145,0)
S FLAG=0
"RTN","DGMTCOR",146,0)
I '$G(IVMTIEN) G IVMQ
"RTN","DGMTCOR",147,0)
D GETS^DIQ(408.31,IVMTIEN,".23;.25","E","IVMAR")
"RTN","DGMTCOR",148,0)
; To identify an IVM converted test in the ANNUAL MEANS TEST, #408.31, if the Source of Test (#.23)
"RTN","DGMTCOR",149,0)
; is equal to 'IVM' OR the Date IVM Verified MT Completed (#.25) is populated, then the test should
"RTN","DGMTCOR",150,0)
; be considered a converted test.
"RTN","DGMTCOR",151,0)
I IVMAR(408.31,IVMTIEN_",",.23,"E")="IVM" S FLAG=1 G IVMQ
"RTN","DGMTCOR",152,0)
I IVMAR(408.31,IVMTIEN_",",.25,"E")]"" S FLAG=1 G IVMQ
"RTN","DGMTCOR",153,0)
IVMQ ;
"RTN","DGMTCOR",154,0)
Q FLAG
"RTN","DGMTCOU1")
0^1^B13494520
"RTN","DGMTCOU1",1,0)
DGMTCOU1 ;ALB/REW,LD,JAN,AEG,LBD - COPAY UTILITIES;8/13/04 8:31am
"RTN","DGMTCOU1",2,0)
;;5.3;Registration;**33,45,54,335,358,401,436,445,564,840**;Aug 13, 1993;Build 20
"RTN","DGMTCOU1",3,0)
AUTO(DFN,AUTOEX) ;
"RTN","DGMTCOU1",4,0)
; Returns 1 if Exempt from CP w/o needing MT/CP information
"RTN","DGMTCOU1",5,0)
; INPUT: DFN [Required]
"RTN","DGMTCOU1",6,0)
; AUTOEX [Optional]
"RTN","DGMTCOU1",7,0)
; RETURNS 1=Exempt 0=Not Exempt
"RTN","DGMTCOU1",8,0)
;
"RTN","DGMTCOU1",9,0)
; Hold the Auto exclusion information for later use
"RTN","DGMTCOU1",10,0)
S AUTOEX=$$AUTOINFO(DFN)
"RTN","DGMTCOU1",11,0)
;
"RTN","DGMTCOU1",12,0)
Q AUTOEX["1"
"RTN","DGMTCOU1",13,0)
AUTOINFO(DFN) ;
"RTN","DGMTCOU1",14,0)
; This returns info needed to IB to see if MT information needs to be
"RTN","DGMTCOU1",15,0)
; looked at to determine Copay Exemption Status
"RTN","DGMTCOU1",16,0)
;
"RTN","DGMTCOU1",17,0)
; INPUT: DFN - IEN of Patient File (Required)
"RTN","DGMTCOU1",18,0)
; OUTPUT:(SC>50%^REC.A&A^REC.HB^REC.PEN^DOM PT^NON.VET^INPT^POW^UNEMP^CD)
"RTN","DGMTCOU1",19,0)
; Piece: ( 1 ^ 2 ^ 3 ^ 4 ^ 5 ^ 6 ^ 7 ^ 8 ^ 9 ^10)
"RTN","DGMTCOU1",20,0)
; PIECES =1 IF TRUE
"RTN","DGMTCOU1",21,0)
;
"RTN","DGMTCOU1",22,0)
N DGALLEL,DGDOM,DGEL,DGNODE,DGX,DGYR,VADMVT,DGI
"RTN","DGMTCOU1",23,0)
S DGX=""
"RTN","DGMTCOU1",24,0)
I $P($G(^DPT(DFN,"VET")),U,1)'="Y" S $P(DGX,U,6)=1 G QTAUTO ;NON-VET
"RTN","DGMTCOU1",25,0)
S DGEL=0,DGALLEL=U
"RTN","DGMTCOU1",26,0)
F S DGEL=$O(^DPT("AEL",DFN,DGEL)) Q:'DGEL S DGALLEL=DGALLEL_$P($G(^DIC(8,DGEL,0)),U,9)_U
"RTN","DGMTCOU1",27,0)
F DGI=.3,.362,.39,.52 S DGNODE(DGI)=$G(^DPT(DFN,DGI)) ;DG*5.3*840
"RTN","DGMTCOU1",28,0)
I (DGALLEL["^1^") S $P(DGX,U,1)=1 G QTAUTO ;SC>50
"RTN","DGMTCOU1",29,0)
I $P(DGNODE(.362),U,12)["Y"!(DGALLEL["^2^") S $P(DGX,U,2)=1 G QTAUTO ;A&A
"RTN","DGMTCOU1",30,0)
I $P(DGNODE(.362),U,13)["Y"!(DGALLEL["^15^") S $P(DGX,U,3)=1 G QTAUTO ;HB
"RTN","DGMTCOU1",31,0)
I $P(DGNODE(.362),U,14)["Y"!(DGALLEL["^4^") S $P(DGX,U,4)=1 G QTAUTO ;PENSION
"RTN","DGMTCOU1",32,0)
I $P(DGNODE(.52),U,5)["Y"!(DGALLEL["^18^") S $P(DGX,U,8)=1 G QTAUTO ;POW