-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathCPRS28_RELATED.KID
4030 lines (3938 loc) · 119 KB
/
CPRS28_RELATED.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 Feb 10, 2011@12:37:10
CPRS28 RELATED PATCHES RELEASED
**KIDS**:CPRS28 RELATED 1.0^GMRC*3.0*64^GMTS*2.7*90^OR*3.0*337^
**INSTALL NAME**
CPRS28 RELATED 1.0
"BLD",19530,0)
CPRS28 RELATED 1.0^^1^3110210^y
"BLD",19530,6.3)
3
"BLD",19530,10,0)
^9.63^2^3
"BLD",19530,10,1,0)
GMRC*3.0*64^1
"BLD",19530,10,2,0)
GMTS*2.7*90^1
"BLD",19530,10,3,0)
OR*3.0*337^1
"BLD",19530,10,"B","GMRC*3.0*64",1)
"BLD",19530,10,"B","GMTS*2.7*90",2)
"BLD",19530,10,"B","OR*3.0*337",3)
"MBREQ")
0
"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
"VER")
8.0^22.0
**INSTALL NAME**
GMRC*3.0*64
"BLD",19531,0)
GMRC*3.0*64^CONSULT/REQUEST TRACKING^0^3110210^y
"BLD",19531,1,0)
^^7^7^3101118^^^^
"BLD",19531,1,1,0)
This patch stores and provides an audit of the PREVIOUS ATTENTION TO
"BLD",19531,1,2,0)
field. The value is displayed in the Details section of the Consult
"BLD",19531,1,3,0)
order. In Vista, the patch prompts the user with the current ATTENTION
"BLD",19531,1,4,0)
value which they are then allowed to change, if needed. This patch also
"BLD",19531,1,5,0)
prevents consults in a status of "PR" and consults with unsigned or
"BLD",19531,1,6,0)
uncosigned notes from being forwarded to a new service. The patch also
"BLD",19531,1,7,0)
corrects the lock in GMRCGUIA which was missing a time out value.
"BLD",19531,4,0)
^9.64PA^123^1
"BLD",19531,4,123,0)
123
"BLD",19531,4,123,2,0)
^9.641^123.02^1
"BLD",19531,4,123,2,123.02,0)
REQUEST PROCESSING ACTIVITY (sub-file)
"BLD",19531,4,123,2,123.02,1,0)
^9.6411^7^1
"BLD",19531,4,123,2,123.02,1,7,0)
PREVIOUSLY ASSIGNED TO
"BLD",19531,4,123,222)
y^y^p^^^^n^^n
"BLD",19531,4,123,224)
"BLD",19531,4,"APDD",123,123.02)
"BLD",19531,4,"APDD",123,123.02,7)
"BLD",19531,4,"B",123,123)
"BLD",19531,6)
6^
"BLD",19531,6.3)
20
"BLD",19531,"ABPKG")
n
"BLD",19531,"KRN",0)
^9.67PA^8989.52^19
"BLD",19531,"KRN",.4,0)
.4
"BLD",19531,"KRN",.4,"NM",0)
^9.68A^^
"BLD",19531,"KRN",.401,0)
.401
"BLD",19531,"KRN",.401,"NM",0)
^9.68A^^
"BLD",19531,"KRN",.402,0)
.402
"BLD",19531,"KRN",.402,"NM",0)
^9.68A^^
"BLD",19531,"KRN",.403,0)
.403
"BLD",19531,"KRN",.403,"NM",0)
^9.68A^^
"BLD",19531,"KRN",.5,0)
.5
"BLD",19531,"KRN",.5,"NM",0)
^9.68A^^
"BLD",19531,"KRN",.84,0)
.84
"BLD",19531,"KRN",.84,"NM",0)
^9.68A^^
"BLD",19531,"KRN",3.6,0)
3.6
"BLD",19531,"KRN",3.6,"NM",0)
^9.68A^^
"BLD",19531,"KRN",3.8,0)
3.8
"BLD",19531,"KRN",9.2,0)
9.2
"BLD",19531,"KRN",9.8,0)
9.8
"BLD",19531,"KRN",9.8,"NM",0)
^9.68A^4^4
"BLD",19531,"KRN",9.8,"NM",1,0)
GMRCAFRD^^0^B53980720
"BLD",19531,"KRN",9.8,"NM",2,0)
GMRCGUIB^^0^B44471877
"BLD",19531,"KRN",9.8,"NM",3,0)
GMRCGUIA^^0^B63812781
"BLD",19531,"KRN",9.8,"NM",4,0)
GMRCSLM4^^0^B39443452
"BLD",19531,"KRN",9.8,"NM","B","GMRCAFRD",1)
"BLD",19531,"KRN",9.8,"NM","B","GMRCGUIA",3)
"BLD",19531,"KRN",9.8,"NM","B","GMRCGUIB",2)
"BLD",19531,"KRN",9.8,"NM","B","GMRCSLM4",4)
"BLD",19531,"KRN",19,0)
19
"BLD",19531,"KRN",19.1,0)
19.1
"BLD",19531,"KRN",101,0)
101
"BLD",19531,"KRN",409.61,0)
409.61
"BLD",19531,"KRN",771,0)
771
"BLD",19531,"KRN",870,0)
870
"BLD",19531,"KRN",8989.51,0)
8989.51
"BLD",19531,"KRN",8989.52,0)
8989.52
"BLD",19531,"KRN",8994,0)
8994
"BLD",19531,"KRN","B",.4,.4)
"BLD",19531,"KRN","B",.401,.401)
"BLD",19531,"KRN","B",.402,.402)
"BLD",19531,"KRN","B",.403,.403)
"BLD",19531,"KRN","B",.5,.5)
"BLD",19531,"KRN","B",.84,.84)
"BLD",19531,"KRN","B",3.6,3.6)
"BLD",19531,"KRN","B",3.8,3.8)
"BLD",19531,"KRN","B",9.2,9.2)
"BLD",19531,"KRN","B",9.8,9.8)
"BLD",19531,"KRN","B",19,19)
"BLD",19531,"KRN","B",19.1,19.1)
"BLD",19531,"KRN","B",101,101)
"BLD",19531,"KRN","B",409.61,409.61)
"BLD",19531,"KRN","B",771,771)
"BLD",19531,"KRN","B",870,870)
"BLD",19531,"KRN","B",8989.51,8989.51)
"BLD",19531,"KRN","B",8989.52,8989.52)
"BLD",19531,"KRN","B",8994,8994)
"BLD",19531,"QUES",0)
^9.62^^
"BLD",19531,"REQB",0)
^9.611^3^3
"BLD",19531,"REQB",1,0)
GMRC*3.0*39^2
"BLD",19531,"REQB",2,0)
GMRC*3.0*50^2
"BLD",19531,"REQB",3,0)
GMRC*3.0*55^2
"BLD",19531,"REQB","B","GMRC*3.0*39",1)
"BLD",19531,"REQB","B","GMRC*3.0*50",2)
"BLD",19531,"REQB","B","GMRC*3.0*55",3)
"FIA",123)
REQUEST/CONSULTATION
"FIA",123,0)
^GMR(123,
"FIA",123,0,0)
123DI
"FIA",123,0,1)
y^y^p^^^^n^^n
"FIA",123,0,10)
"FIA",123,0,11)
"FIA",123,0,"RLRO")
"FIA",123,0,"VR")
3.0^GMRC
"FIA",123,123)
1
"FIA",123,123.02)
1
"FIA",123,123.02,7)
"MBREQ")
1
"PKG",66,-1)
1^1
"PKG",66,0)
CONSULT/REQUEST TRACKING^GMRC^CONSULTS/REQUESTS
"PKG",66,20,0)
^9.402P^^
"PKG",66,22,0)
^9.49I^1^1
"PKG",66,22,1,0)
3.0^2980101^2980204^64
"PKG",66,22,1,"PAH",1,0)
64^3110210^1392
"PKG",66,22,1,"PAH",1,1,0)
^^7^7^3110210
"PKG",66,22,1,"PAH",1,1,1,0)
This patch stores and provides an audit of the PREVIOUS ATTENTION TO
"PKG",66,22,1,"PAH",1,1,2,0)
field. The value is displayed in the Details section of the Consult
"PKG",66,22,1,"PAH",1,1,3,0)
order. In Vista, the patch prompts the user with the current ATTENTION
"PKG",66,22,1,"PAH",1,1,4,0)
value which they are then allowed to change, if needed. This patch also
"PKG",66,22,1,"PAH",1,1,5,0)
prevents consults in a status of "PR" and consults with unsigned or
"PKG",66,22,1,"PAH",1,1,6,0)
uncosigned notes from being forwarded to a new service. The patch also
"PKG",66,22,1,"PAH",1,1,7,0)
corrects the lock in GMRCGUIA which was missing a time out value.
"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")
4
"RTN","GMRCAFRD")
0^1^B53980720
"RTN","GMRCAFRD",1,0)
GMRCAFRD ;SLC/DLT,DCM,JFR - LM FORWARD ACTION ;7/11/03 14:02
"RTN","GMRCAFRD",2,0)
;;3.0;CONSULT/REQUEST TRACKING;**1,4,10,12,15,22,35,39,64**;DEC 27, 1997;Build 20
"RTN","GMRCAFRD",3,0)
;
"RTN","GMRCAFRD",4,0)
; This routine invokes IA #2395
"RTN","GMRCAFRD",5,0)
;
"RTN","GMRCAFRD",6,0)
FR(GMRCO) ;Forward Request to a new service
"RTN","GMRCAFRD",7,0)
N ORVP,GMRCLCK,DFN,GMRCACT,GMRCSEQ,GMRCDOC
"RTN","GMRCAFRD",8,0)
W !!,"Forward Request To Another Service For Action."
"RTN","GMRCAFRD",9,0)
W !,"Select the service to send the consult to.",!
"RTN","GMRCAFRD",10,0)
S:$D(GMRCSS) GMRCSSS=GMRCSS
"RTN","GMRCAFRD",11,0)
N GMRCPL,GMRCPR,GMRCURG,GMRCDG,GMRCFF,GMRCORNP,GMRCAD,GMRCTO,GMRCADUZ,GMRCATTN,NEWATTN,GMRCPA
"RTN","GMRCAFRD",12,0)
K GMRCQUT,GMRCSEL,GMRCSSS
"RTN","GMRCAFRD",13,0)
I '$L($G(GMRCO)) D SELECT^GMRCA2(.GMRCO) I $D(GMRCQUT) D END Q
"RTN","GMRCAFRD",14,0)
I '+$G(GMRCO) D END S GMRCQUT=1 Q
"RTN","GMRCAFRD",15,0)
I $P($G(^GMR(123,GMRCO,12)),U,5)="P" D Q
"RTN","GMRCAFRD",16,0)
. N DIR
"RTN","GMRCAFRD",17,0)
. W !,"The requesting facility may not take this action on an "
"RTN","GMRCAFRD",18,0)
. W "inter-facility consult."
"RTN","GMRCAFRD",19,0)
. S DIR(0)="E" D ^DIR
"RTN","GMRCAFRD",20,0)
. D END
"RTN","GMRCAFRD",21,0)
. S GMRCQUT=1
"RTN","GMRCAFRD",22,0)
I '$$LOCK^GMRCA1(GMRCO) D END S GMRCQUT=1 Q
"RTN","GMRCAFRD",23,0)
S GMRCLCK=1
"RTN","GMRCAFRD",24,0)
;
"RTN","GMRCAFRD",25,0)
I $P(^GMR(123,GMRCO,0),"^",12)<3 S GMRCMSG="NO ACTION POSSIBLE. This Consult Has Already Been Completed Or Discontinued." D EXAC^GMRCADC(GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",26,0)
I $P(^GMR(123,GMRCO,0),"^",12)=13 S GMRCMSG="NO ACTION POSSIBLE. This Consult Has Already Been Cancelled." D EXAC^GMRCADC(GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",27,0)
I $P(^GMR(123,GMRCO,0),"^",12)=9 D Q:+$G(GMRCQUT)
"RTN","GMRCAFRD",28,0)
.S GMRCMSG="Invalid action. This consult has partial results."
"RTN","GMRCAFRD",29,0)
.S GMRCMSG(1)="Remove the associated results before forwarding."
"RTN","GMRCAFRD",30,0)
.D EXAC^GMRCADC(.GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",31,0)
S GMRCSEQ=0,GMRCDOC="" F S GMRCSEQ=$O(^GMR(123,+GMRCO,50,GMRCSEQ)) Q:GMRCSEQ="" D Q:+$G(GMRCQUT)
"RTN","GMRCAFRD",32,0)
. I $P($G(^GMR(123,+GMRCO,50,GMRCSEQ,0)),";",2)="TIU(8925," S GMRCDOC=$P(^GMR(123,+GMRCO,50,GMRCSEQ,0),";",1)
"RTN","GMRCAFRD",33,0)
. I $G(GMRCDOC)="" Q
"RTN","GMRCAFRD",34,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=5 D
"RTN","GMRCAFRD",35,0)
. . S GMRCMSG="Invalid Action. This consult has an unsigned note."
"RTN","GMRCAFRD",36,0)
. . D EXAC^GMRCADC(.GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",37,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=6 D
"RTN","GMRCAFRD",38,0)
. . S GMRCMSG="Invalid Action. This consult has an uncosigned note."
"RTN","GMRCAFRD",39,0)
. . D EXAC^GMRCADC(.GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",40,0)
Q:+$G(GMRCQUT) S GMRCSEQ=0,GMRCDOC="" F S GMRCSEQ=$O(^GMR(123,+GMRCO,40,GMRCSEQ)) Q:GMRCSEQ="" D Q:+$G(GMRCQUT)
"RTN","GMRCAFRD",41,0)
. I $P($P($G(^GMR(123,+GMRCO,40,GMRCSEQ,0)),U,9),";",2)="TIU(8925," S GMRCDOC=$P($P($G(^GMR(123,+GMRCO,40,GMRCSEQ,0)),U,9),";",1)
"RTN","GMRCAFRD",42,0)
. I $G(GMRCDOC)="" Q
"RTN","GMRCAFRD",43,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=5 D
"RTN","GMRCAFRD",44,0)
. . S GMRCMSG="Invalid Action. This consult has an unsigned note."
"RTN","GMRCAFRD",45,0)
. . D EXAC^GMRCADC(.GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",46,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=6 D
"RTN","GMRCAFRD",47,0)
. . S GMRCMSG="Invalid Action. This consult has an uncosigned note."
"RTN","GMRCAFRD",48,0)
. . D EXAC^GMRCADC(.GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",49,0)
Q:+$G(GMRCQUT)
"RTN","GMRCAFRD",50,0)
;
"RTN","GMRCAFRD",51,0)
I $D(IOBM),$D(IOTM),$D(IOSTBM) D FULL^VALM1
"RTN","GMRCAFRD",52,0)
I $P(^GMR(123,GMRCO,0),"^",16) W !!,"This is a SERVICE ENTERED order stub. Please send the written consult to the",!,"Service, in addition to the automated forwarding!"
"RTN","GMRCAFRD",53,0)
S DFN=+$P(^GMR(123,GMRCO,0),"^",2)
"RTN","GMRCAFRD",54,0)
S GMRCTO=1,GMRCASV="Forward Consult To Which Service/Specialty: "
"RTN","GMRCAFRD",55,0)
D ASRV^GMRCASV K GMRCASV I $S($D(DTOUT):1,$D(DIROUT):1,$D(GMRCQUT):1,1:0) D END Q
"RTN","GMRCAFRD",56,0)
I 'GMRCDG S GMRCMSG="No Service Was Selected. Consult Was Not Forwarded To Any Service!" D EXAC^GMRCADC(GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",57,0)
S GMRCFF=$P(^GMR(123,GMRCO,0),"^",5) I GMRCFF=+GMRCDG S GMRCMSG="The Forwarding Service Cannot Forward A Consult To Itself!" D EXAC^GMRCADC(GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",58,0)
S GMRCATTN=$P($G(^GMR(123,GMRCO,0)),"^",11)
"RTN","GMRCAFRD",59,0)
N DIE,DR
"RTN","GMRCAFRD",60,0)
S DIE="^GMR(123,",DA=GMRCO,DR="7//"_$S($G(GMRCATTN)'="":GMRCATTN,1:"")
"RTN","GMRCAFRD",61,0)
D ^DIE
"RTN","GMRCAFRD",62,0)
S NEWATTN=$P($G(^GMR(123,+GMRCO,0)),"^",11)
"RTN","GMRCAFRD",63,0)
I NEWATTN'=GMRCATTN S GMRCPA=$G(GMRCATTN)
"RTN","GMRCAFRD",64,0)
S GETPROV="Who is responsible for Forwarding the Consult?"
"RTN","GMRCAFRD",65,0)
FRGTPRV D GETPROV^GMRCAU I '$D(GMRCORNP) D END S GMRCQUT=1 Q
"RTN","GMRCAFRD",66,0)
S GMRCACT=$$PROVIDER^XUSER(GMRCORNP) I $P(GMRCACT,U)'=1 D G FRGTPRV
"RTN","GMRCAFRD",67,0)
.W !!,"***User account is TERMINATED please choose another responsible user.***"
"RTN","GMRCAFRD",68,0)
S GMRCAD=$$GETDT^GMRCUTL1 I GMRCAD="^" D END S GMRCQUT=1 Q
"RTN","GMRCAFRD",69,0)
I '$G(GMRCAD) S GMRCAD=$$NOW^XLFDT
"RTN","GMRCAFRD",70,0)
N GMRCSS,GMRCSSNM,GMRCA,GMRCMSG,GMRCIROL,GMRCINM,GMRCIROU,ORSTS
"RTN","GMRCAFRD",71,0)
D DEFAULT
"RTN","GMRCAFRD",72,0)
S GMRCSS=+GMRCDG
"RTN","GMRCAFRD",73,0)
I +GMRCSS,'$D(^GMR(123.5,+GMRCSS,0)) S GMRCMSG="Error in Service Chosen - SERVICE Does Not Exist!" D EXAC^GMRCADC(GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",74,0)
S GMRCSSNM=$S($L($G(^GMR(123.5,+GMRCSS,.1))):^(.1),1:$P($G(^GMR(123.5,+GMRCSS,0)),U,1))
"RTN","GMRCAFRD",75,0)
D URG I $D(GMRCEND),GMRCEND D END S GMRCQUT=1 Q
"RTN","GMRCAFRD",76,0)
S GMRCA=17,DR=""
"RTN","GMRCAFRD",77,0)
I $D(^GMR(123.5,+GMRCSS,"IFC")) D ; if fwd to IFC serv, get extra flds
"RTN","GMRCAFRD",78,0)
. S GMRCIROU=$P(^GMR(123.5,+GMRCSS,"IFC"),U) Q:GMRCIROU="" ;no rout fac
"RTN","GMRCAFRD",79,0)
. S GMRCINM=$P(^GMR(123.5,+GMRCSS,"IFC"),U,2) Q:GMRCINM="" ;no serv nm
"RTN","GMRCAFRD",80,0)
. S GMRCA=25,GMRCIROL="P"
"RTN","GMRCAFRD",81,0)
. S DR=".07////^S X=GMRCIROU;.125////^S X=GMRCIROL;.131///^S X=GMRCINM;"
"RTN","GMRCAFRD",82,0)
S DIE="^GMR(123,",DA=GMRCO,ORSTS=5
"RTN","GMRCAFRD",83,0)
S DR=DR_"1////^S X=GMRCSS;5////^S X=GMRCURGI;8////^S X=ORSTS;9////^S X=GMRCA;.1///@"
"RTN","GMRCAFRD",84,0)
L +^GMR(123,GMRCO):2 I '$T K DIE,DA,DR S GMRCMSG="Another User Is Accessing This Record. UPDATE WAS UNSUCCESSFUL.",GMRCMSG(1)="Try Again Later." D EXAC^GMRCADC(.GMRCMSG),END S GMRCQUT=1 Q
"RTN","GMRCAFRD",85,0)
D ^DIE L -^GMR(123,GMRCO) K DIE,DA,DR
"RTN","GMRCAFRD",86,0)
S GMRCOM=1 D AUDIT^GMRCP ;GMRCORNP is the responsible provider here
"RTN","GMRCAFRD",87,0)
;
"RTN","GMRCAFRD",88,0)
I $G(GMRCLCK) D UNLOCK^GMRCA1(GMRCO) ;unlk before FWD changes order #
"RTN","GMRCAFRD",89,0)
;
"RTN","GMRCAFRD",90,0)
FRMSG ; Common logic used by GUI and List Manager to process the HL7 message
"RTN","GMRCAFRD",91,0)
; to update the order in OE/RR and then forward an alert to recipients
"RTN","GMRCAFRD",92,0)
; is passed in as the DUZ instead of the responsible provider
"RTN","GMRCAFRD",93,0)
D EN^GMRCHL7(DFN,GMRCO,$G(GMRCTYPE),$G(GMRCRB),"XX^FORWARD",$G(DUZ),$G(VISIT),.GMRCOM,,$G(GMRCAD))
"RTN","GMRCAFRD",94,0)
S GMRCADUZ=""
"RTN","GMRCAFRD",95,0)
S GMRCORNP=$P(^GMR(123,GMRCO,0),"^",14) ;This is the original provider that ordered the consult
"RTN","GMRCAFRD",96,0)
I +$G(GMRCORNP) S GMRCADUZ(+GMRCORNP)="" ;alert original provider of forward
"RTN","GMRCAFRD",97,0)
S GMRCORTX="Forwarded consult "_$$ORTX^GMRCAU(+GMRCO)_" ("_GMRCURG_")"
"RTN","GMRCAFRD",98,0)
D MSG^GMRCP(DFN,GMRCORTX,+GMRCO,27,.GMRCADUZ,1) ;GMRCO=IEN of consult from file 123; 27 is notification entry from file ORD(100.9
"RTN","GMRCAFRD",99,0)
K GMRCOM
"RTN","GMRCAFRD",100,0)
S GMRCDEV=$P($G(^GMR(123.5,GMRCSS,123)),"^",9)
"RTN","GMRCAFRD",101,0)
I GMRCDEV D PRNT^GMRCUTL1(GMRCSS,+GMRCO)
"RTN","GMRCAFRD",102,0)
D END
"RTN","GMRCAFRD",103,0)
Q
"RTN","GMRCAFRD",104,0)
URG ;Get the default urgency
"RTN","GMRCAFRD",105,0)
N X,Y,XQORM,DIROUT,DTOUT,DIRUT,DUOUT
"RTN","GMRCAFRD",106,0)
I $P(^GMR(123,+GMRCO,0),"^",18)["I" D
"RTN","GMRCAFRD",107,0)
.I GMRCTYPE="GMRCOR CONSULT" S X="GMRCURGENCYM CSLT - INPATIENT"
"RTN","GMRCAFRD",108,0)
.S X="GMRCURGENCYM REQ - INPATIENT"
"RTN","GMRCAFRD",109,0)
E S X="GMRCURGENCYM - OUTPATIENT"
"RTN","GMRCAFRD",110,0)
I '$D(GMRCURG) S GMRCURGI=$O(^ORD(101,"B","GMRCURGENCY - ROUTINE","")) S:+GMRCURGI GMRCURG=$P($G(^ORD(101,+GMRCURGI,0)),"^",2)
"RTN","GMRCAFRD",111,0)
S Y=$O(^ORD(101,"B",X,""))
"RTN","GMRCAFRD",112,0)
S XQORM=+Y_";ORD(101,",XQORM(0)="1A\",XQORM("A")="Urgency: ",XQORM("NO^^")=""
"RTN","GMRCAFRD",113,0)
S:$L(GMRCURG) XQORM("B")=GMRCURG D EN^XQORM I X="^"!($D(DIROUT)) K XQORM S GMRCEND=1 Q
"RTN","GMRCAFRD",114,0)
K XQORM(0),XQORM("A"),XQORM("B"),XQORM("NO^^") S XQORM=""
"RTN","GMRCAFRD",115,0)
I '$D(Y) S GMRCEND=1 Q
"RTN","GMRCAFRD",116,0)
I $D(Y(1)) S GMRCURG=$P(Y(1),"^",3),GMRCURGI=$P(Y(1),"^",2)
"RTN","GMRCAFRD",117,0)
Q
"RTN","GMRCAFRD",118,0)
DEFAULT ;Set up defaults for editing to be equal to the existing data.
"RTN","GMRCAFRD",119,0)
D DEM^GMRCU
"RTN","GMRCAFRD",120,0)
N GMRC,GMRCDIC,GMRCPLI,GMRCPRI
"RTN","GMRCAFRD",121,0)
Q:'$D(GMRCO) S (GMRCSS,GMRCSSNM,GMRCPL,GMRCPR,GMRCPRI,GMRCURG)=""
"RTN","GMRCAFRD",122,0)
S GMRCOM=0,GMRC(0)=$S($D(^GMR(123,+GMRCO,0)):^(0),1:"")
"RTN","GMRCAFRD",123,0)
S GMRCSS=$P(GMRC(0),"^",5) I +GMRCSS,$D(^GMR(123.5,+GMRCSS,0)) S GMRCSSNM=$S($L($P($G(^GMR(123.5,+GMRCSS,0)),U,1)):$P(^(0),U,1),1:"")
"RTN","GMRCAFRD",124,0)
S GMRCPLI=$P(GMRC(0),"^",10) I GMRCPLI S GMRCPL=$P($G(^ORD(101,GMRCPLI,0)),"^",2)
"RTN","GMRCAFRD",125,0)
S GMRCURGI=$P(GMRC(0),"^",9) I GMRCURGI S GMRCURG=$P($G(^ORD(101,GMRCURGI,0)),"^",2)
"RTN","GMRCAFRD",126,0)
S GMRCPRI=$P(GMRC(0),"^",8) I GMRCPRI["ORD(101" D
"RTN","GMRCAFRD",127,0)
. S GMRCPR=$$GET1^DIQ(101,+GMRCPRI,1)
"RTN","GMRCAFRD",128,0)
I $L(GMRCPRI),GMRCPRI'["ORD(101" D ;ZPROC
"RTN","GMRCAFRD",129,0)
. S GMRCPR=$$GET1^DIQ(123.3,+GMRCPRI,.01)
"RTN","GMRCAFRD",130,0)
TYPE ;This entry point is used when the only default needed is the GMRCTYPE
"RTN","GMRCAFRD",131,0)
;Called by GMRCGUIA to get variables ready for FRMSG call.
"RTN","GMRCAFRD",132,0)
S GMRCTYPE=$$GET1^DIQ(123,+GMRCO,13,"I") ;ZPROC (P or C)
"RTN","GMRCAFRD",133,0)
Q
"RTN","GMRCAFRD",134,0)
END ;Kill off variables and exit
"RTN","GMRCAFRD",135,0)
I $G(GMRCLCK) D UNLOCK^GMRCA1(GMRCO)
"RTN","GMRCAFRD",136,0)
K GETPROV,GMRCDG,GMRCDEV,GMRCEND,GMRCFF,GMRCOM,GMRCIFN,GMRCO,GMRCORNP
"RTN","GMRCAFRD",137,0)
K GMRCTYPE,GMRCORTX,GMRCPL,GMRCPR,GMRCSEL,GMRCURG,GMRCADUZ,Y
"RTN","GMRCAFRD",138,0)
K DTOUT,DIROUT,DUOUT,GMRCURGI
"RTN","GMRCAFRD",139,0)
S:$D(^TMP("GMRC",$J,"CURRENT","MENU")) XQORM("HIJACK")=^("MENU")
"RTN","GMRCAFRD",140,0)
Q
"RTN","GMRCGUIA")
0^3^B63812781
"RTN","GMRCGUIA",1,0)
GMRCGUIA ;SLC/DCM,JFR - File Consult actions from GUI ;7/8/03 07:36
"RTN","GMRCGUIA",2,0)
;;3.0;CONSULT/REQUEST TRACKING;**1,4,12,15,22,35,64**;DEC 27, 1997;Build 20
"RTN","GMRCGUIA",3,0)
;
"RTN","GMRCGUIA",4,0)
; This routine invokes IA #2638,#2926
"RTN","GMRCGUIA",5,0)
;
"RTN","GMRCGUIA",6,0)
NEW(DFN,GMRCDA,GMRCLOC,GMRCTYPE,GMRCSVC,GMRCPROV,GMRCURG,GMRCPLI,GMRCNP,GMRCATN,GMRCINOT,GMRCDIAG,GMRCRFQ) ;Add a new consult for a patient.
"RTN","GMRCGUIA",7,0)
;DFN=Patient ^DPT( file number
"RTN","GMRCGUIA",8,0)
;GMRCRFQ=Reason For Request, why the consult is being ordered. Passed in as
"RTN","GMRCGUIA",9,0)
; an array
"RTN","GMRCGUIA",10,0)
;GMRCDIAG=Povisional diagnosis; what is suspected to be the problem
"RTN","GMRCGUIA",11,0)
;GMRCTYPE=Request type -Consult or Procedure
"RTN","GMRCGUIA",12,0)
;GMRCLOC=Patient location.
"RTN","GMRCGUIA",13,0)
;GMRCDA=Date Time of Request
"RTN","GMRCGUIA",14,0)
;GMRCSVC=To Service; consulting service
"RTN","GMRCGUIA",15,0)
;GMRCLOC=Hospital Location ordering consult
"RTN","GMRCGUIA",16,0)
;GMRCPR=If a procedure, the procedure ordered (pointer to file 101)
"RTN","GMRCGUIA",17,0)
;GMRCURG=Urgency of request (stat, routine, etc) from file 101
"RTN","GMRCGUIA",18,0)
;GMRCPLI=Place of consultation (bedside, consultants choice, etc.) from file 101
"RTN","GMRCGUIA",19,0)
;GMRCPROV=Sending Provider
"RTN","GMRCGUIA",20,0)
;GMRCATN=if consult is to go to a specific provider, this provider is identified here.
"RTN","GMRCGUIA",21,0)
;GMRCINOT=Service provided as Inpatient or Outpatient
"RTN","GMRCGUIA",22,0)
N DIC,DLAYGO,Y,DIE,GMRCADUZ,X,GMRCO,DR
"RTN","GMRCGUIA",23,0)
S DIC="^GMR(123,",DIC(0)="L",X="""N""",DLAYGO=123 D ^DIC K DLAYGO
"RTN","GMRCGUIA",24,0)
S (DA,GMRCO)=+Y,GMRCSTS=5,GMRCA=1,DIE=DIC
"RTN","GMRCGUIA",25,0)
L +^GMR(123,GMRCO):$S($G(DILOCKTM)>0:DILOCKTM,1:5)
"RTN","GMRCGUIA",26,0)
S DR=".02////^S X=DFN;.04////^S X=GMRCLOC;1////^S X=GMRCSVC;3////^S X=GMRCDA;4////^S X=GMRCPR;5////^S X=GMRCURG;6////^S X=GMRCPLI"_$S(GMRCATN]"":"7////^S X=GMRCATN",1:"")
"RTN","GMRCGUIA",27,0)
D ^DIE
"RTN","GMRCGUIA",28,0)
S DR="8////^S X=GMRCSTS;9////^S X=GMRCA;10////^S X=GMRCPROV;11////^S X=GMRCATN;13////^S X=GMRCTYPE;14////^S X=GMRCINOT"_$S($D(GMRCDIAG):"30:////^S X=GMRCDIAG",1:"")
"RTN","GMRCGUIA",29,0)
D ^DIE L -^GMR(123,GMRCO)
"RTN","GMRCGUIA",30,0)
I $O(GMRCRFQ(0)) D REASON^GMRCGUIB(GMRCO,GMRCRFQ,GMRCDA)
"RTN","GMRCGUIA",31,0)
D EN^GMRCHL7(DFN,GMRCDA,GMRCTYPE,$G(GMRCRB),"NW",DUZ,$G(VISIT),"")
"RTN","GMRCGUIA",32,0)
D EXIT
"RTN","GMRCGUIA",33,0)
Q
"RTN","GMRCGUIA",34,0)
;
"RTN","GMRCGUIA",35,0)
RC(GMRCO,GMRCORNP,GMRCAD,GMRCMT,GMRCDUZ) ;Receive consult into service
"RTN","GMRCGUIA",36,0)
;
"RTN","GMRCGUIA",37,0)
;Input variables:
"RTN","GMRCGUIA",38,0)
;GMRCO - The internal file number of the consult from File 123
"RTN","GMRCGUIA",39,0)
;GMRCORNP - Name of the person who actually 'Received'the consult
"RTN","GMRCGUIA",40,0)
;GMRCDUZ - DUZ of person entering the consult as being 'RECEIVED'.
"RTN","GMRCGUIA",41,0)
;GMRCAD - Actual date time that consult was received into the service.
"RTN","GMRCGUIA",42,0)
;GMRCMT - array of comments if entered (by reference)
"RTN","GMRCGUIA",43,0)
; ARRAY(1)="FIRST LINE OF COMMENT"
"RTN","GMRCGUIA",44,0)
; ARRAY(2)="SECOND LINE OF COMMENT"
"RTN","GMRCGUIA",45,0)
;GMRCDUZ - DUZ of person entering the consult as being 'RECEIVED'
"RTN","GMRCGUIA",46,0)
;
"RTN","GMRCGUIA",47,0)
;Output:
"RTN","GMRCGUIA",48,0)
;GMRCERR - Error Condition Code: 0 = NO error, 1=error
"RTN","GMRCGUIA",49,0)
;GMRCERMS - Error message or null
"RTN","GMRCGUIA",50,0)
; returned as GMRCERR^GMRCERMS
"RTN","GMRCGUIA",51,0)
;
"RTN","GMRCGUIA",52,0)
N DFN,GMRCSTS,GMRCNOW,GMRCERR,GMRCERMS
"RTN","GMRCGUIA",53,0)
S GMRCERR=0,GMRCERMS="",GMRCNOW=$$NOW^XLFDT
"RTN","GMRCGUIA",54,0)
S:$G(GMRCAD)="" GMRCAD=GMRCNOW
"RTN","GMRCGUIA",55,0)
S:'$G(GMRCDUZ) GMRCDUZ=DUZ
"RTN","GMRCGUIA",56,0)
S DFN=$P($G(^GMR(123,GMRCO,0)),"^",2) I DFN="" S GMRCERR="1",GMRCERMS="Not A Valid Consult - File Not Found." D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",57,0)
S GMRCSTS=6,GMRCA=21
"RTN","GMRCGUIA",58,0)
D STATUS^GMRCP I $D(GMRCQUT) D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",59,0)
I '$O(GMRCMT(0)) D AUDIT^GMRCP
"RTN","GMRCGUIA",60,0)
I $O(GMRCMT(0)) D
"RTN","GMRCGUIA",61,0)
. S DA=$$SETDA^GMRCGUIB
"RTN","GMRCGUIA",62,0)
. D SETCOM^GMRCGUIB(.GMRCMT,GMRCDUZ)
"RTN","GMRCGUIA",63,0)
D EN^GMRCHL7(DFN,GMRCO,"","","SC",GMRCORNP,"","")
"RTN","GMRCGUIA",64,0)
D EXIT
"RTN","GMRCGUIA",65,0)
Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",66,0)
;
"RTN","GMRCGUIA",67,0)
DC(GMRCO,GMRCORNP,GMRCAD,GMRCACTM,GMRCOM) ;Discontinue or Deny a consult
"RTN","GMRCGUIA",68,0)
;
"RTN","GMRCGUIA",69,0)
;Input variables:
"RTN","GMRCGUIA",70,0)
;GMRCO - Internal file number of consult from File 123
"RTN","GMRCGUIA",71,0)
;GMRCORNP - Provider who Discontinued or Denied consult
"RTN","GMRCGUIA",72,0)
;GMRCAD - FM date/time of actual activity.
"RTN","GMRCGUIA",73,0)
;GMRCACTM - set to "DY" if 'CANCELLED'(old DENY)
"RTN","GMRCGUIA",74,0)
; set to "DC" if consult is Discontinued
"RTN","GMRCGUIA",75,0)
;GMRCOM - Comment array containing explanation of action
"RTN","GMRCGUIA",76,0)
; Passed by reference in the following form :
"RTN","GMRCGUIA",77,0)
; ARRAY(1)="xxx xxx xxx"
"RTN","GMRCGUIA",78,0)
; ARRAY(2)="XXX XXX"
"RTN","GMRCGUIA",79,0)
; ARRAY(3)="XXX XXX xx", etc.
"RTN","GMRCGUIA",80,0)
; Comment is a required field when consult is denied or discontinued.
"RTN","GMRCGUIA",81,0)
;
"RTN","GMRCGUIA",82,0)
;Output:
"RTN","GMRCGUIA",83,0)
;GMRCERR=Error Flag: 0 if no error, 1 if error occurred
"RTN","GMRCGUIA",84,0)
;GMRCERMS - Error message or null
"RTN","GMRCGUIA",85,0)
; returned as GMRCERR^GMRCERMS
"RTN","GMRCGUIA",86,0)
;
"RTN","GMRCGUIA",87,0)
N GMRCDUZ,DFN,GMRCNOW,GMRCSTS,GMRCERR,GMRCERMS,GMRCADUZ,GMRCTRLC
"RTN","GMRCGUIA",88,0)
S GMRCERR=0,GMRCERMS=""
"RTN","GMRCGUIA",89,0)
S GMRCDUZ=DUZ,GMRCERR=0,GMRCERMS="",GMRCNOW=$$NOW^XLFDT
"RTN","GMRCGUIA",90,0)
K GMRCQUT
"RTN","GMRCGUIA",91,0)
S:$G(GMRCAD)="" GMRCAD=GMRCNOW
"RTN","GMRCGUIA",92,0)
S DFN=$P($G(^GMR(123,GMRCO,0)),"^",2) I DFN="" S GMRCERR="1",GMRCERMS="Not A Valid Consult - File Not Found." D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",93,0)
I '$D(GMRCOM) S GMRCERR=1,GMRCERMS="Comments are required for this action." D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",94,0)
S GMRCSTS=$P(^ORD(100.01,$P(^GMR(123,GMRCO,0),"^",12),0),U,2)
"RTN","GMRCGUIA",95,0)
I GMRCSTS="dc" S GMRCERR=1,GMRCERMS="Order Has Already Been Discontinued." D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",96,0)
I GMRCSTS="ca" S GMRCERR=1,GMRCERMS="Order Has Already Been Cancelled." D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",97,0)
I GMRCSTS="comp" S GMRCERR=1,GMRCERMS="Order Has Already Been Completed." D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",98,0)
S GMRCA=$S(GMRCACTM="DC":6,1:19),GMRCSTS=$S(GMRCA=6:1,1:13)
"RTN","GMRCGUIA",99,0)
D STATUS^GMRCP I $D(GMRCQUT) D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",100,0)
I GMRCACTM="DC",$$DCPRNT^GMRCUTL1(GMRCO,DUZ) D PRNT^GMRCUTL1("",GMRCO)
"RTN","GMRCGUIA",101,0)
S DA=$$SETDA^GMRCGUIB D SETCOM^GMRCGUIB(.GMRCOM)
"RTN","GMRCGUIA",102,0)
S GMRCOM(0)=DA
"RTN","GMRCGUIA",103,0)
S GMRCTRLC=$S(GMRCACTM="DC":"OD",1:"OC")
"RTN","GMRCGUIA",104,0)
D EN^GMRCHL7(DFN,GMRCO,$G(GMRCTYPE),$G(GMRCRB),GMRCTRLC,GMRCORNP,$G(GMRCVSIT),.GMRCOM,,GMRCAD)
"RTN","GMRCGUIA",105,0)
S GMRCORTX=$S(GMRCACTM="DY":"Cancelled",1:"Discontinued")_" consult "
"RTN","GMRCGUIA",106,0)
S GMRCORTX=GMRCORTX_$$ORTX^GMRCAU(+GMRCO)
"RTN","GMRCGUIA",107,0)
S GMRCADUZ="",GMRCFL=0
"RTN","GMRCGUIA",108,0)
I GMRCACTM="DC" D
"RTN","GMRCGUIA",109,0)
. S GMRCFL=$$DCNOTE^GMRCADC(GMRCO,DUZ) ;NOTIFY SERVICE ON DC ?
"RTN","GMRCGUIA",110,0)
I +$P($G(^GMR(123,+GMRCO,0)),"^",14),$P(^(0),"^",14)'=DUZ D
"RTN","GMRCGUIA",111,0)
. S GMRCADUZ($P(^(0),"^",14))=""
"RTN","GMRCGUIA",112,0)
;send notification
"RTN","GMRCGUIA",113,0)
N NOTYPE S NOTYPE=$S(GMRCA=6:23,1:30)
"RTN","GMRCGUIA",114,0)
D MSG^GMRCP(DFN,GMRCORTX,+GMRCO,NOTYPE,.GMRCADUZ,GMRCFL)
"RTN","GMRCGUIA",115,0)
D EXIT
"RTN","GMRCGUIA",116,0)
Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",117,0)
;
"RTN","GMRCGUIA",118,0)
FR(GMRCO,GMRCSS,GMRCORNP,GMRCATTN,GMRCURGI,GMRCOM,GMRCAD) ;FWD consult
"RTN","GMRCGUIA",119,0)
;to another service
"RTN","GMRCGUIA",120,0)
;
"RTN","GMRCGUIA",121,0)
;Input variables:
"RTN","GMRCGUIA",122,0)
;GMRCO=File 123 IEN of the consult record
"RTN","GMRCGUIA",123,0)
;GMRCSS=service being forwarded to; ptr to REQUEST SERVICES (#123.5)
"RTN","GMRCGUIA",124,0)
;GMRCORNP=Provider Responsible for action
"RTN","GMRCGUIA",125,0)
;GMRCATTN=NEW PERSON to whose attention action should be directed
"RTN","GMRCGUIA",126,0)
;GMRCURGI=urgency from PROTOCOL(#101) file
"RTN","GMRCGUIA",127,0)
;GMRCOM=Comment array containing explanation of action
"RTN","GMRCGUIA",128,0)
; Passed by reference in the following form :
"RTN","GMRCGUIA",129,0)
; ARRAY(1)="xxx xxx xxx"
"RTN","GMRCGUIA",130,0)
; ARRAY(2)="XXX XXX"
"RTN","GMRCGUIA",131,0)
; ARRAY(3)="XXX XXX xx", etc.
"RTN","GMRCGUIA",132,0)
;GMRCAD=FM date/time of actual activity
"RTN","GMRCGUIA",133,0)
;
"RTN","GMRCGUIA",134,0)
;Output:
"RTN","GMRCGUIA",135,0)
; GMRCERR=Error Flag: 0 if no error, 1 if error occurred
"RTN","GMRCGUIA",136,0)
; GMRCERMS - Error message or null
"RTN","GMRCGUIA",137,0)
; returned as GMRCERR^GMRCERMS
"RTN","GMRCGUIA",138,0)
;
"RTN","GMRCGUIA",139,0)
N DR,GMRCDUZ,GMRCNOW,GMRCFF,GMRCFR,GMRCADUZ,GMRCURG,GMRCPA,GMRCSEQ,GMRCDOC
"RTN","GMRCGUIA",140,0)
N GMRCERR,GMRCERMS,GMRCIROL,GMRCINM,GMRCIROU
"RTN","GMRCGUIA",141,0)
S GMRCERR=0,GMRCERMS=""
"RTN","GMRCGUIA",142,0)
I $P(^GMR(123,+GMRCO,0),U,12)=9 S GMRCERR=1,GMRCERMS="Invalid action. This consult has partial results."
"RTN","GMRCGUIA",143,0)
S GMRCSEQ=0,GMRCDOC="" F S GMRCSEQ=$O(^GMR(123,+GMRCO,50,GMRCSEQ)) Q:GMRCSEQ="" D Q:+$G(GMRCERR)
"RTN","GMRCGUIA",144,0)
. I $P($G(^GMR(123,+GMRCO,50,GMRCSEQ,0)),";",2)="TIU(8925," S GMRCDOC=$P(^GMR(123,+GMRCO,50,GMRCSEQ,0),";",1)
"RTN","GMRCGUIA",145,0)
. I $G(GMRCDOC)="" Q
"RTN","GMRCGUIA",146,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=5 D
"RTN","GMRCGUIA",147,0)
. . S GMRCERMS="Invalid Action. This consult has an unsigned note.",GMRCERR=1
"RTN","GMRCGUIA",148,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=6 D
"RTN","GMRCGUIA",149,0)
. . S GMRCERMS="Invalid Action. This consult has an uncosigned note.",GMRCERR=1
"RTN","GMRCGUIA",150,0)
S GMRCSEQ=0,GMRCDOC="" F S GMRCSEQ=$O(^GMR(123,+GMRCO,40,GMRCSEQ)) Q:GMRCSEQ="" D Q:+$G(GMRCERR)
"RTN","GMRCGUIA",151,0)
. I $P($P($G(^GMR(123,+GMRCO,40,GMRCSEQ,0)),U,9),";",2)="TIU(8925," S GMRCDOC=$P($P($G(^GMR(123,+GMRCO,40,GMRCSEQ,0)),U,9),";",1)
"RTN","GMRCGUIA",152,0)
. I $G(GMRCDOC)="" Q
"RTN","GMRCGUIA",153,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=5 D
"RTN","GMRCGUIA",154,0)
. . S GMRCERMS="Invalid Action. This consult has an unsigned note.",GMRCERR=1
"RTN","GMRCGUIA",155,0)
. I $P($G(^TIU(8925,GMRCDOC,0)),U,5)=6 D
"RTN","GMRCGUIA",156,0)
. . S GMRCERMS="Invalid Action. This consult has an uncosigned note.",GMRCERR=1
"RTN","GMRCGUIA",157,0)
I GMRCERR=1 D EXIT Q GMRCERR_"^"_GMRCERMS
"RTN","GMRCGUIA",158,0)
S DFN=$P(^GMR(123,+GMRCO,0),U,2)
"RTN","GMRCGUIA",159,0)
S GMRCDUZ=DUZ,GMRCNOW=$$NOW^XLFDT
"RTN","GMRCGUIA",160,0)
S:'$G(GMRCAD) GMRCAD=GMRCNOW ;Actual FM date/time consult was FWD'd