-
Notifications
You must be signed in to change notification settings - Fork 1
/
CPRS28_REQUIRED.KID
10982 lines (10849 loc) · 357 KB
/
CPRS28_REQUIRED.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@10:53:25
CPRS28 REQUIRED PATCHES RELEASED
**KIDS**:CPRS28 REQUIRED 1.0^OR*3.0*293^GMRA*4.0*45^GMRC*3.0*66^
**INSTALL NAME**
CPRS28 REQUIRED 1.0
"BLD",19525,0)
CPRS28 REQUIRED 1.0^^1^3110210^y
"BLD",19525,6.3)
1
"BLD",19525,10,0)
^9.63^3^3
"BLD",19525,10,1,0)
OR*3.0*293^1
"BLD",19525,10,2,0)
GMRA*4.0*45^1
"BLD",19525,10,3,0)
GMRC*3.0*66^1
"BLD",19525,10,"B","GMRA*4.0*45",2)
"BLD",19525,10,"B","GMRC*3.0*66",3)
"BLD",19525,10,"B","OR*3.0*293",1)
"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**
OR*3.0*293
"BLD",18545,0)
OR*3.0*293^ORDER ENTRY/RESULTS REPORTING^0^3110210^y
"BLD",18545,4,0)
^9.64PA^100.05^1
"BLD",18545,4,100.05,0)
100.05
"BLD",18545,4,100.05,222)
y^y^f^^^^n
"BLD",18545,4,"B",100.05,100.05)
"BLD",18545,6)
11^
"BLD",18545,6.3)
20
"BLD",18545,"INIT")
POST^ORY293
"BLD",18545,"KRN",0)
^9.67PA^779.2^20
"BLD",18545,"KRN",.4,0)
.4
"BLD",18545,"KRN",.401,0)
.401
"BLD",18545,"KRN",.402,0)
.402
"BLD",18545,"KRN",.403,0)
.403
"BLD",18545,"KRN",.5,0)
.5
"BLD",18545,"KRN",.84,0)
.84
"BLD",18545,"KRN",3.6,0)
3.6
"BLD",18545,"KRN",3.8,0)
3.8
"BLD",18545,"KRN",9.2,0)
9.2
"BLD",18545,"KRN",9.8,0)
9.8
"BLD",18545,"KRN",9.8,"NM",0)
^9.68A^8^8
"BLD",18545,"KRN",9.8,"NM",1,0)
OROCAPI1^^0^B44849780
"BLD",18545,"KRN",9.8,"NM",2,0)
ORCHECK^^0^B56557816
"BLD",18545,"KRN",9.8,"NM",3,0)
ORCSAVE^^0^B74510622
"BLD",18545,"KRN",9.8,"NM",4,0)
ORCSAVE2^^0^B68162412
"BLD",18545,"KRN",9.8,"NM",5,0)
ORMBLDPS^^0^B77690426
"BLD",18545,"KRN",9.8,"NM",6,0)
ORQ2^^0^B46973301
"BLD",18545,"KRN",9.8,"NM",7,0)
ORSRCHOR^^0^B81351241
"BLD",18545,"KRN",9.8,"NM",8,0)
ORY293^^0^B2220767
"BLD",18545,"KRN",9.8,"NM","B","ORCHECK",2)
"BLD",18545,"KRN",9.8,"NM","B","ORCSAVE",3)
"BLD",18545,"KRN",9.8,"NM","B","ORCSAVE2",4)
"BLD",18545,"KRN",9.8,"NM","B","ORMBLDPS",5)
"BLD",18545,"KRN",9.8,"NM","B","OROCAPI1",1)
"BLD",18545,"KRN",9.8,"NM","B","ORQ2",6)
"BLD",18545,"KRN",9.8,"NM","B","ORSRCHOR",7)
"BLD",18545,"KRN",9.8,"NM","B","ORY293",8)
"BLD",18545,"KRN",19,0)
19
"BLD",18545,"KRN",19.1,0)
19.1
"BLD",18545,"KRN",101,0)
101
"BLD",18545,"KRN",409.61,0)
409.61
"BLD",18545,"KRN",771,0)
771
"BLD",18545,"KRN",779.2,0)
779.2
"BLD",18545,"KRN",870,0)
870
"BLD",18545,"KRN",8989.51,0)
8989.51
"BLD",18545,"KRN",8989.52,0)
8989.52
"BLD",18545,"KRN",8994,0)
8994
"BLD",18545,"KRN","B",.4,.4)
"BLD",18545,"KRN","B",.401,.401)
"BLD",18545,"KRN","B",.402,.402)
"BLD",18545,"KRN","B",.403,.403)
"BLD",18545,"KRN","B",.5,.5)
"BLD",18545,"KRN","B",.84,.84)
"BLD",18545,"KRN","B",3.6,3.6)
"BLD",18545,"KRN","B",3.8,3.8)
"BLD",18545,"KRN","B",9.2,9.2)
"BLD",18545,"KRN","B",9.8,9.8)
"BLD",18545,"KRN","B",19,19)
"BLD",18545,"KRN","B",19.1,19.1)
"BLD",18545,"KRN","B",101,101)
"BLD",18545,"KRN","B",409.61,409.61)
"BLD",18545,"KRN","B",771,771)
"BLD",18545,"KRN","B",779.2,779.2)
"BLD",18545,"KRN","B",870,870)
"BLD",18545,"KRN","B",8989.51,8989.51)
"BLD",18545,"KRN","B",8989.52,8989.52)
"BLD",18545,"KRN","B",8994,8994)
"BLD",18545,"QUES",0)
^9.62^^
"BLD",18545,"REQB",0)
^9.611^2^2
"BLD",18545,"REQB",1,0)
OR*3.0*282^2
"BLD",18545,"REQB",2,0)
OR*3.0*303^2
"BLD",18545,"REQB","B","OR*3.0*282",1)
"BLD",18545,"REQB","B","OR*3.0*303",2)
"FIA",100.05)
ORDER CHECK INSTANCES
"FIA",100.05,0)
^ORD(100.05,
"FIA",100.05,0,0)
100.05P
"FIA",100.05,0,1)
y^y^f^^^^n
"FIA",100.05,0,10)
"FIA",100.05,0,11)
"FIA",100.05,0,"RLRO")
"FIA",100.05,0,"VR")
3.0^OR
"FIA",100.05,100.05)
0
"FIA",100.05,100.515)
0
"FIA",100.05,100.5152)
0
"FIA",100.05,100.5153)
0
"FIA",100.05,100.51534)
0
"FIA",100.05,100.518)
0
"FIA",100.05,100.57)
0
"FIA",100.05,100.58)
0
"INIT")
POST^ORY293
"IX",100.05,100.05,"C",0)
100.05^C^USED FOR FINDING ORDER CHECKS BASED ON OCCURENCE^R^^R^IR^I^100.05^^^^^LS
"IX",100.05,100.05,"C",.1,0)
^^2^2^3090121^
"IX",100.05,100.05,"C",.1,1,0)
This Index is used to increase the performance of the lookup of order
"IX",100.05,100.05,"C",.1,2,0)
check instances based on the Occurrence descriptor and the Order number.
"IX",100.05,100.05,"C",1)
S ^ORD(100.05,"C",X(1),$E(X(2),1,30),DA)=""
"IX",100.05,100.05,"C",2)
K ^ORD(100.05,"C",X(1),$E(X(2),1,30),DA)
"IX",100.05,100.05,"C",2.5)
K ^ORD(100.05,"C")
"IX",100.05,100.05,"C",11.1,0)
^.114IA^2^2
"IX",100.05,100.05,"C",11.1,1,0)
1^F^100.05^.01^^1^F
"IX",100.05,100.05,"C",11.1,2,0)
2^F^100.05^2^30^2^F
"IX",100.05,100.05,"D",0)
100.05^D^USED FOR FINDING ORDER CHECKS BASED ON OC TYPE^R^^F^IR^I^100.05^^^^^LS
"IX",100.05,100.05,"D",1)
S ^ORD(100.05,"D",X,DA)=""
"IX",100.05,100.05,"D",2)
K ^ORD(100.05,"D",X,DA)
"IX",100.05,100.05,"D",2.5)
K ^ORD(100.05,"D")
"IX",100.05,100.05,"D",11.1,0)
^.114IA^2^1
"IX",100.05,100.05,"D",11.1,2,0)
1^F^100.05^5^^1^F
"IX",100.05,100.05,"D",11.1,2,3)
"MBREQ")
1
"PKG",22,-1)
1^1
"PKG",22,0)
ORDER ENTRY/RESULTS REPORTING^OR^Order Entry/Results Reporting
"PKG",22,20,0)
^9.402P^^
"PKG",22,22,0)
^9.49I^1^1
"PKG",22,22,1,0)
3.0^2971217^2980204^64
"PKG",22,22,1,"PAH",1,0)
293^3110210^1392
"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")
8
"RTN","ORCHECK")
0^2^B56557816
"RTN","ORCHECK",1,0)
ORCHECK ;SLC/MKB-Order checking calls ; 9/28/2009 15:00
"RTN","ORCHECK",2,0)
;;3.0;ORDER ENTRY/RESULTS REPORTING;**7,56,70,94,141,215,243,293**;Dec 17, 1997;Build 20
"RTN","ORCHECK",3,0)
;;Per VHA Directive 2004-038, this routine should not be modified.
"RTN","ORCHECK",4,0)
DISPLAY ; -- DISPLAY event [called from ORCDLG,ORCACT4,ORCMED]
"RTN","ORCHECK",5,0)
; Expects ORVP, ORNMSP, ORTAB, [ORWARD]
"RTN","ORCHECK",6,0)
Q:$$GET^XPAR("DIV^SYS^PKG","ORK SYSTEM ENABLE/DISABLE")'="E"
"RTN","ORCHECK",7,0)
N ORX,ORY,I
"RTN","ORCHECK",8,0)
I ORNMSP="PS" D ;reset to PSJ, PSJI, or PSO
"RTN","ORCHECK",9,0)
. I $G(ORDG) S I=$P($G(^ORD(100.98,+ORDG,0)),U,3),I=$P(I," ") Q:'$L(I) S ORNMSP="PS"_$S(I="UD":"I",1:I) Q
"RTN","ORCHECK",10,0)
. I $G(ORXFER) S I=$P($P(^TMP("OR",$J,ORTAB,0),U,3),";",3) S:I="" I=$G(ORWARD) S ORNMSP="PS"_$S(I:"O",1:"I") ;opposite of list
"RTN","ORCHECK",11,0)
S ORX(1)="|"_ORNMSP,ORX=1
"RTN","ORCHECK",12,0)
D EN^ORKCHK(.ORY,+ORVP,.ORX,"DISPLAY") Q:'$D(ORY)
"RTN","ORCHECK",13,0)
S I=0 F S I=$O(ORY(I)) Q:I'>0 W !,$P(ORY(I),U,4) ; display only
"RTN","ORCHECK",14,0)
Q
"RTN","ORCHECK",15,0)
;
"RTN","ORCHECK",16,0)
SELECT ; -- SELECT event
"RTN","ORCHECK",17,0)
; Expects ORVP, ORDAILOG(PROMPT,ORI), ORNMSP
"RTN","ORCHECK",18,0)
Q:$$GET^XPAR("DIV^SYS^PKG","ORK SYSTEM ENABLE/DISABLE")'="E"
"RTN","ORCHECK",19,0)
N ORX,ORY,OI
"RTN","ORCHECK",20,0)
S OI=+$G(ORDIALOG(PROMPT,ORI))
"RTN","ORCHECK",21,0)
S ORX=1,ORX(1)=OI_"|"_ORNMSP_"|"_$$USID^ORMBLD(OI)
"RTN","ORCHECK",22,0)
D EN^ORKCHK(.ORY,+ORVP,.ORX,"SELECT"),RETURN:$D(ORY)
"RTN","ORCHECK",23,0)
Q
"RTN","ORCHECK",24,0)
;
"RTN","ORCHECK",25,0)
ACCEPT(MODE) ; -- ACCEPT event [called from ORCDLG,ORCACT4,ORCMED]
"RTN","ORCHECK",26,0)
; Expects ORVP, ORDIALOG(), ORNMSP
"RTN","ORCHECK",27,0)
Q:$$GET^XPAR("DIV^SYS^PKG","ORK SYSTEM ENABLE/DISABLE")'="E"
"RTN","ORCHECK",28,0)
N ORX,ORY,ORZ,OI,ORSTRT,ORI,ORIT,ORID,ORSP
"RTN","ORCHECK",29,0)
S:'$L($G(MODE)) MODE="ACCEPT"
"RTN","ORCHECK",30,0)
S OI=$$PTR^ORCD("OR GTX ORDERABLE ITEM"),ORSTRT=$$START,ORX=0
"RTN","ORCHECK",31,0)
S ORI=0 F S ORI=$O(ORDIALOG(OI,ORI)) Q:ORI'>0 D STUF
"RTN","ORCHECK",32,0)
I $G(ORDG)=+$O(^ORD(100.98,"B","IV RX",0)) S OI=$$PTR^ORCD("OR GTX ADDITIVE"),ORI=0 F S ORI=$O(ORDIALOG(OI,ORI)) Q:ORI'>0 D STUF
"RTN","ORCHECK",33,0)
D EN^ORKCHK(.ORY,+ORVP,.ORX,MODE),RETURN:$D(ORY)
"RTN","ORCHECK",34,0)
Q
"RTN","ORCHECK",35,0)
STUF S ORIT=ORDIALOG(OI,ORI),ORSP=""
"RTN","ORCHECK",36,0)
S:ORNMSP="LR" ORSP=+$G(ORDIALOG($$PTR^ORCD("OR GTX SPECIMEN"),ORI))
"RTN","ORCHECK",37,0)
S ORID=$S($E(ORNMSP,1,2)="PS":$$DRUG(ORIT,OI),1:$$USID^ORMBLD(ORIT))
"RTN","ORCHECK",38,0)
S ORZ=1,ORZ(1)=ORIT_"|"_ORNMSP_"|"_ORID
"RTN","ORCHECK",39,0)
I MODE'="ALL" D EN^ORKCHK(.ORY,+ORVP,.ORZ,"SELECT"),RETURN:$D(ORY)
"RTN","ORCHECK",40,0)
S ORX=ORX+1,ORX(ORX)=ORZ(1)_"|"_ORSTRT_"||"_ORSP K ORY,ORZ
"RTN","ORCHECK",41,0)
Q
"RTN","ORCHECK",42,0)
;
"RTN","ORCHECK",43,0)
DELAY(MODE) ; -- Delayed ACCEPT event [called from ORMEVNT]
"RTN","ORCHECK",44,0)
; Expects ORVP, ORIFN
"RTN","ORCHECK",45,0)
Q:$$GET^XPAR("DIV^SYS^PKG","ORK SYSTEM ENABLE/DISABLE")'="E"
"RTN","ORCHECK",46,0)
N ORX,ORY,ORCHECK S:'$L($G(MODE)) MODE="NOTIF"
"RTN","ORCHECK",47,0)
D BLD(+ORIFN),EN^ORKCHK(.ORY,+ORVP,.ORX,MODE) Q:'$D(ORY)
"RTN","ORCHECK",48,0)
D RETURN I MODE="NOTIF" S ORCHECK("OK")="Notification sent to provider" D OC^ORCSAVE2 Q ; silent
"RTN","ORCHECK",49,0)
Q
"RTN","ORCHECK",50,0)
;
"RTN","ORCHECK",51,0)
BLD(ORDER) ; -- Build new ORX(#) for ORDER
"RTN","ORCHECK",52,0)
Q:'$G(ORDER) Q:'$D(^OR(100,ORDER,0)) ;Q:$P($G(^(3)),U,11) ;edit/renew
"RTN","ORCHECK",53,0)
N PKG,START,ORI,ITEM,USID,SPEC,ORDG,PTR,INST
"RTN","ORCHECK",54,0)
S ORDG=$P(^OR(100,ORDER,0),U,11),PKG=$$GET1^DIQ(9.4,$P(^(0),U,14)_",",1)
"RTN","ORCHECK",55,0)
I PKG="PS",$G(ORDG) S ORI=$P($G(^ORD(100.98,+ORDG,0)),U,3),ORI=$P(ORI," "),PKG=PKG_$S(ORI="UD":"I",1:ORI)
"RTN","ORCHECK",56,0)
S START=$$START(ORDER),ORI=0
"RTN","ORCHECK",57,0)
F S ORI=$O(^OR(100,ORDER,4.5,"ID","ORDERABLE",ORI)) Q:ORI'>0 D
"RTN","ORCHECK",58,0)
. S INST=$P($G(^OR(100,ORDER,4.5,ORI,0)),U,3),PTR=$P($G(^(0)),U,2),ITEM=+$G(^(1))
"RTN","ORCHECK",59,0)
. S USID=$S(PKG?1"PS".E:$$DRUG(ITEM,PTR,ORDER),1:$$USID^ORMBLD(ITEM))
"RTN","ORCHECK",60,0)
. S SPEC=$S(PKG="LR":$$VALUE^ORCSAVE2(ORDER,"SPECIMEN",INST),1:"")
"RTN","ORCHECK",61,0)
. S ORX=+$G(ORX)+1,ORX(ORX)=ITEM_"|"_PKG_"|"_USID_"|"_START_"|"_ORDER_"|"_SPEC
"RTN","ORCHECK",62,0)
Q
"RTN","ORCHECK",63,0)
;
"RTN","ORCHECK",64,0)
REMDUPS ;
"RTN","ORCHECK",65,0)
N IFN,CDL,I
"RTN","ORCHECK",66,0)
S IFN=0 F S IFN=$O(ORCHECK(IFN)) Q:'IFN D
"RTN","ORCHECK",67,0)
. S CDL=0 F S CDL=$O(ORCHECK(IFN,CDL)) Q:'CDL D
"RTN","ORCHECK",68,0)
. . S I=0 F S I=$O(ORCHECK(IFN,CDL,I)) Q:'I D
"RTN","ORCHECK",69,0)
. . . S J=I F S J=$O(ORCHECK(IFN,CDL,J)) Q:'J I $G(ORCHECK(IFN,CDL,I))=$G(ORCHECK(IFN,CDL,J)) K ORCHECK(IFN,CDL,J) S ORCHECK=$G(ORCHECK)-1
"RTN","ORCHECK",70,0)
Q
"RTN","ORCHECK",71,0)
START(DA) ; -- Returns start date/time
"RTN","ORCHECK",72,0)
N I,X,Y,%DT S Y=""
"RTN","ORCHECK",73,0)
I $G(DA) S X=$O(^OR(100,DA,4.5,"ID","START",0)),X=$G(^OR(100,DA,4.5,+X,1))
"RTN","ORCHECK",74,0)
E D ; look in ORDIALOG instead
"RTN","ORCHECK",75,0)
. S I=0 F S I=$O(ORDIALOG(I)) Q:I'>0 Q:$P(ORDIALOG(I),U,2)="START"
"RTN","ORCHECK",76,0)
. S X=$S(I:$G(ORDIALOG(I,1)),1:"")
"RTN","ORCHECK",77,0)
D AM^ORCSAVE2:X="AM",NEXT^ORCSAVE2:X="NEXT"
"RTN","ORCHECK",78,0)
D ADMIN^ORCSAVE2("NEXT"):X="NEXTA",ADMIN^ORCSAVE2("CLOSEST"):X="CLOSEST"
"RTN","ORCHECK",79,0)
I $L(X) S %DT="TX" D ^%DT S:Y'>0 Y=""
"RTN","ORCHECK",80,0)
Q Y
"RTN","ORCHECK",81,0)
;
"RTN","ORCHECK",82,0)
DRUG(OI,PTR,IFN) ; -- Returns 6 ^-piece identifier for Dispense Drug
"RTN","ORCHECK",83,0)
N ORDD,ORNDF,Y
"RTN","ORCHECK",84,0)
I ORDG=+$O(^ORD(100.98,"B","IV RX",0)) S ORDD=$$IV G D1
"RTN","ORCHECK",85,0)
I $G(IFN) S ORDD=$O(^OR(100,IFN,4.5,"ID","DRUG",0)),ORDD=+$G(^OR(100,IFN,4.5,+ORDD,1))
"RTN","ORCHECK",86,0)
E S ORDD=+$G(ORDIALOG($$PTR^ORCD("OR GTX DISPENSE DRUG"),1))
"RTN","ORCHECK",87,0)
D1 Q:'ORDD "" S ORNDF=$$ENDCM^PSJORUTL(ORDD)
"RTN","ORCHECK",88,0)
S Y=$P(ORNDF,U,3)_"^^99NDF^"_ORDD_U_$$NAME50^ORPEAPI(ORDD)_"^99PSD"
"RTN","ORCHECK",89,0)
Q Y
"RTN","ORCHECK",90,0)
;
"RTN","ORCHECK",91,0)
IV() ; -- Get Dispense Drug for IV orderable
"RTN","ORCHECK",92,0)
N PSOI,TYPE,VOL,ORY
"RTN","ORCHECK",93,0)
S PSOI=+$P($G(^ORD(101.43,+OI,0)),U,2),VOL=""
"RTN","ORCHECK",94,0)
S TYPE=$S(PTR=$$PTR^ORCD("OR GTX ADDITIVE"):"A",1:"B")
"RTN","ORCHECK",95,0)
S:TYPE="B" VOL=$S($G(IFN):$$VALUE^ORCSAVE2(IFN,"VOLUME"),1:+$G(ORDIALOG($$PTR^ORCD("OR GTX VOLUME"),1)))
"RTN","ORCHECK",96,0)
D ENDDIV^PSJORUTL(PSOI,TYPE,VOL,.ORY)
"RTN","ORCHECK",97,0)
Q +$G(ORY)
"RTN","ORCHECK",98,0)
;
"RTN","ORCHECK",99,0)
LIST(IFN) ; -- Displays list of ORCHECK(IFN) checks
"RTN","ORCHECK",100,0)
N ORI,ORJ,ORZ,ORMAX,ORTX,ON,OFF
"RTN","ORCHECK",101,0)
S ORZ=0 F S ORZ=$O(ORCHECK(IFN,ORZ)) Q:ORZ'>0 D
"RTN","ORCHECK",102,0)
. S:ORZ=1 ON=IOINHI,OFF=IOINORM S:ORZ'=1 (ON,OFF)="" ; use bold if High
"RTN","ORCHECK",103,0)
. S ORI=0 F S ORI=$O(ORCHECK(IFN,ORZ,ORI)) Q:ORI'>0 D
"RTN","ORCHECK",104,0)
. . S X=$P(ORCHECK(IFN,ORZ,ORI),U,3) I $L(X)<75 W !,ON_">>> "_X_OFF Q
"RTN","ORCHECK",105,0)
. . S ORMAX=74 K ORTX D TXT^ORCHTAB Q:'$G(ORTX) ; wrap
"RTN","ORCHECK",106,0)
. . F ORJ=1:1:ORTX W !,ON_$S(ORJ=1:">>> ",1:" ")_ORTX(ORJ)_OFF
"RTN","ORCHECK",107,0)
W !
"RTN","ORCHECK",108,0)
Q
"RTN","ORCHECK",109,0)
;
"RTN","ORCHECK",110,0)
CANCEL() ; -- Returns 1 or 0: Cancel order(s)?
"RTN","ORCHECK",111,0)
N X,Y,DIR,NUM
"RTN","ORCHECK",112,0)
S NUM=+$G(ORCHECK("IFN")),DIR(0)="YA"
"RTN","ORCHECK",113,0)
S DIR("A")="Do you want to cancel "_$S(NUM>1:"any of the new orders? ",1:"the new order? ")
"RTN","ORCHECK",114,0)
S DIR("?",1)="Enter YES to cancel "_$S(NUM>1:"an",1:"the")_" order. If you wish to override these order checks"
"RTN","ORCHECK",115,0)
S DIR("?",2)="and release "_$S(NUM>1:"these orders",1:"this order")_", enter NO; you will be prompted for a justification",DIR("?")="if there are any highlighted critical order checks."
"RTN","ORCHECK",116,0)
D ^DIR
"RTN","ORCHECK",117,0)
Q +Y
"RTN","ORCHECK",118,0)
;
"RTN","ORCHECK",119,0)
REASON() ; -- Reason for overriding order checks
"RTN","ORCHECK",120,0)
; I '$D(^XUSEC("ORES",DUZ)),'$D(^XUSEC("ORELSE",DUZ)) Q ??
"RTN","ORCHECK",121,0)
N X,Y,DIR
"RTN","ORCHECK",122,0)
S DIR(0)="FA^2:80^K:X?1."" "" X",DIR("A")="REASON FOR OVERRIDE: "
"RTN","ORCHECK",123,0)
S DIR("?")="Enter a justification for overriding these order checks, up to 80 characters"
"RTN","ORCHECK",124,0)
D ^DIR I $D(DTOUT)!$D(DUOUT) S Y="^"
"RTN","ORCHECK",125,0)
Q Y
"RTN","ORCHECK",126,0)
;
"RTN","ORCHECK",127,0)
SESSION ; -- SESSION event [called from ORCSIGN]
"RTN","ORCHECK",128,0)
; Expects ORVP, ORES()
"RTN","ORCHECK",129,0)
Q:$$GET^XPAR("DIV^SYS^PKG","ORK SYSTEM ENABLE/DISABLE")'="E"
"RTN","ORCHECK",130,0)
N ORX,ORY,ORIFN,I,X,Y
"RTN","ORCHECK",131,0)
S ORIFN=0 F S ORIFN=$O(ORES(ORIFN)) Q:ORIFN'>0 I +$P(ORIFN,";",2)'>1 D
"RTN","ORCHECK",132,0)
. I "^5^6^10^11^"'[(U_$P($G(^OR(100,+ORIFN,3)),U,3)_U) Q ;unreleased
"RTN","ORCHECK",133,0)
. D BLD(+ORIFN) K ^TMP($J,"OCDATA") Q:'$$OCAPI^ORCHECK(+ORIFN,"OCDATA")
"RTN","ORCHECK",134,0)
. S ORCHECK("IFN")=+$G(ORCHECK("IFN"))+1
"RTN","ORCHECK",135,0)
. S I=0 F S I=$O(^TMP($J,"OCDATA",I)) Q:'I D
"RTN","ORCHECK",136,0)
. . S ORCHECK=+$G(ORCHECK)+1,ORCHECK(+ORIFN,$S($G(^TMP($J,"OCDATA",I,"OC LEVEL")):^TMP($J,"OCDATA",I,"OC LEVEL"),1:99),ORCHECK)=$G(^TMP($J,"OCDATA",I,"OC NUMBER"))_U_$G(^TMP($J,"OCDATA",I,"OC LEVEL"))_U_$G(^TMP($J,"OCDATA",I,"OC TEXT",1,0))
"RTN","ORCHECK",137,0)
. K ^TMP($J,"OCDATA")
"RTN","ORCHECK",138,0)
I $D(ORX) D EN^ORKCHK(.ORY,+ORVP,.ORX,"SESSION"),RETURN:$D(ORY),REMDUPS
"RTN","ORCHECK",139,0)
Q
"RTN","ORCHECK",140,0)
;
"RTN","ORCHECK",141,0)
RETURN ; -- Return checks in ORCHECK(ORIFN,CDL,#)
"RTN","ORCHECK",142,0)
N I,IFN,CDL S I=0 F S I=$O(ORY(I)) Q:I'>0 D
"RTN","ORCHECK",143,0)
. S IFN=+$P(ORY(I),U) S:'IFN IFN="NEW"
"RTN","ORCHECK",144,0)
. S CDL=+$P(ORY(I),U,3) S:'CDL CDL=99
"RTN","ORCHECK",145,0)
. S:'$D(ORCHECK(IFN)) ORCHECK("IFN")=+$G(ORCHECK("IFN"))+1 ; count
"RTN","ORCHECK",146,0)
. S ORCHECK=+$G(ORCHECK)+1,ORCHECK(IFN,CDL,ORCHECK)=$P(ORY(I),U,2,4)
"RTN","ORCHECK",147,0)
Q
"RTN","ORCHECK",148,0)
;
"RTN","ORCHECK",149,0)
OCAPI(IFN,ORPLACE) ;IA #4859
"RTN","ORCHECK",150,0)
;LOOK AT ROUTINE OROCAPI1 FOR MORE DETAILED APIS
"RTN","ORCHECK",151,0)
;API to get the order checking info for a specific order (IFN)
"RTN","ORCHECK",152,0)
;info is stored in ^TMP($J,ORPLACE)
"RTN","ORCHECK",153,0)
; ^TMP($J,ORPLACE,D0,"OC LEVEL")="order check level"
"RTN","ORCHECK",154,0)
; ,"OC NUMBER")="file 100.8 ien"
"RTN","ORCHECK",155,0)
; ,"OC TEXT")="order check text"
"RTN","ORCHECK",156,0)
; ,"OR REASON")="over ride reason text"
"RTN","ORCHECK",157,0)
; ,"OR PROVIDER")="provider DUZ who entered over ride reason"
"RTN","ORCHECK",158,0)
; ,"OR DT")="date/time over ride reason was entered"
"RTN","ORCHECK",159,0)
; NOTE on OC LEVEL: 1 is HIGH, 2 is MODERATE, 3 is LOW
"RTN","ORCHECK",160,0)
N RET,ORN,CNT,I,ORFLAG
"RTN","ORCHECK",161,0)
S ORN=+IFN,CNT=0,ORFLAG=0
"RTN","ORCHECK",162,0)
;if the order is not released then show ACCEPTANCE_CPRS ocs
"RTN","ORCHECK",163,0)
I "^14^13^11^"[(U_$P($G(^OR(100,ORN,3)),U,3)_U) D GETOC5^OROCAPI1(ORN,"ACCEPTANCE_CPRS",.RET) S ORFLAG=1
"RTN","ORCHECK",164,0)
;if it has been signed then show SIGNATURE_CPRS ocs
"RTN","ORCHECK",165,0)
I 'ORFLAG D GETOC5^OROCAPI1(ORN,"SIGNATURE_CPRS",.RET)
"RTN","ORCHECK",166,0)
I $D(RET) S I=0 F S I=$O(RET(ORN,"DATA",I)) Q:'I S CNT=CNT+1 D
"RTN","ORCHECK",167,0)
.S ^TMP($J,ORPLACE,CNT,"OC NUMBER")=$P($G(RET(ORN,"DATA",I,1)),U)
"RTN","ORCHECK",168,0)
.S ^TMP($J,ORPLACE,CNT,"OC LEVEL")=$P($G(RET(ORN,"DATA",I,1)),U,2)
"RTN","ORCHECK",169,0)
.M ^TMP($J,ORPLACE,CNT,"OC TEXT")=RET(ORN,"DATA",I,"OC")
"RTN","ORCHECK",170,0)
.S ^TMP($J,ORPLACE,CNT,"OR REASON")=$G(RET(ORN,"DATA",I,"OR",1,0))
"RTN","ORCHECK",171,0)
.S ^TMP($J,ORPLACE,CNT,"OR PROVIDER")=$S($L(^TMP($J,ORPLACE,CNT,"OR REASON")):$P($G(RET(ORN,"DATA",I,0)),U,4),1:"")
"RTN","ORCHECK",172,0)
.S ^TMP($J,ORPLACE,CNT,"OR DT")=$S($L(^TMP($J,ORPLACE,CNT,"OR REASON")):$P($G(RET(ORN,"DATA",I,0)),U,5),1:"")
"RTN","ORCHECK",173,0)
.S ^TMP($J,ORPLACE,CNT,"OR STATUS")=$P($G(RET(ORN,"DATA",I,0)),U,2)
"RTN","ORCHECK",174,0)
.S ^TMP($J,ORPLACE,CNT,"OC INSTANCE")=I
"RTN","ORCHECK",175,0)
Q CNT
"RTN","ORCHECK",176,0)
;
"RTN","ORCSAVE")
0^3^B74510622
"RTN","ORCSAVE",1,0)
ORCSAVE ;SLC/MKB/JDL-Save ;09/28/2009 15:00
"RTN","ORCSAVE",2,0)
;;3.0;ORDER ENTRY/RESULTS REPORTING;**7,56,70,73,92,94,116,141,163,187,190,195,243,303,293**;Dec 17, 1997;Build 20
"RTN","ORCSAVE",3,0)
;Per VHA Directive 2004-038, this routine should not be modified.
"RTN","ORCSAVE",4,0)
NEW(ORDIALOG,ORDG,ORPKG,ORCAT,OREVENT,ORDUZ,ORLOG) ; -- New order
"RTN","ORCSAVE",5,0)
; Returns ORIFN = [new] order number, if created/saved
"RTN","ORCSAVE",6,0)
D EN
"RTN","ORCSAVE",7,0)
Q
"RTN","ORCSAVE",8,0)
;
"RTN","ORCSAVE",9,0)
XX ; -- save new/unreleased edited order into Orders file
"RTN","ORCSAVE",10,0)
; Requires: ORDIALOG() = array of dialog values
"RTN","ORCSAVE",11,0)
; ORIFN = IFN of original order that was edited
"RTN","ORCSAVE",12,0)
;
"RTN","ORCSAVE",13,0)
N OLDIFN S ORIFN=+ORIFN,OLDIFN=0
"RTN","ORCSAVE",14,0)
I $S($P(^OR(100,ORIFN,3),U,3)=11:0,$P(^(3),U,3)'=10:1,$P(^(8,1,0),U,4)=2:0,1:1) S OLDIFN=ORIFN K ORIFN ; create new order if released or delayed&signed
"RTN","ORCSAVE",15,0)
D EN Q:'ORIFN S:'$G(ORDA) ORDA=1
"RTN","ORCSAVE",16,0)
I $G(OLDIFN) D ;save links between orders
"RTN","ORCSAVE",17,0)
. S $P(^OR(100,ORIFN,3),U,5)=OLDIFN,$P(^(3),U,11)=1
"RTN","ORCSAVE",18,0)
. S $P(^OR(100,OLDIFN,3),U,6)=ORIFN S:$D(^(5)) ^OR(100,ORIFN,5)=^OR(100,OLDIFN,5)
"RTN","ORCSAVE",19,0)
I $D(^OR(100,+OLDIFN,0)) D
"RTN","ORCSAVE",20,0)
. Q:'$G(OREVTDF)
"RTN","ORCSAVE",21,0)
. N OLDEVT,OLDSTS,LSTACT,PATID,NOW,WHEN
"RTN","ORCSAVE",22,0)
. S (OLDEVT,OLDSTS,LSTACT)=0
"RTN","ORCSAVE",23,0)
. S NOW=$$NOW^XLFDT
"RTN","ORCSAVE",24,0)
. S OLDEVT=$P(^OR(100,+OLDIFN,0),U,17),OLDSTS=$P(^OR(100,+OLDIFN,3),U,3)
"RTN","ORCSAVE",25,0)
. ; Active status = 6 from #100.01
"RTN","ORCSAVE",26,0)
. I (OLDEVT>0),OLDSTS=6 D
"RTN","ORCSAVE",27,0)
. . S $P(^OR(100,+ORIFN,0),U,17)=OLDEVT
"RTN","ORCSAVE",28,0)
. . S $P(^OR(100,+ORIFN,3),U,3)=11
"RTN","ORCSAVE",29,0)
. . S LSTACT=$P($G(^OR(100,+ORIFN,3)),U,7)
"RTN","ORCSAVE",30,0)
. . I $D(^OR(100,+ORIFN,8,LSTACT,0)) D
"RTN","ORCSAVE",31,0)
. . . S $P(^OR(100,+ORIFN,8,LSTACT,0),U,15)=11
"RTN","ORCSAVE",32,0)
. . . S PATID=$P(^OR(100,+ORIFN,0),U,2)
"RTN","ORCSAVE",33,0)
. . . S WHEN=$P(^OR(100,+ORIFN,8,LSTACT,0),U)
"RTN","ORCSAVE",34,0)
. . . S ^OR(100,"AC",PATID,9999999-WHEN,+ORIFN,LSTACT)=""
"RTN","ORCSAVE",35,0)
Q
"RTN","ORCSAVE",36,0)
;
"RTN","ORCSAVE",37,0)
RN ; -- save new/unreleased renewal order into Orders file
"RTN","ORCSAVE",38,0)
; Requires: ORDIALOG() = array of new dialog values
"RTN","ORCSAVE",39,0)
; ORIFN = IFN of original order that was renewed
"RTN","ORCSAVE",40,0)
;
"RTN","ORCSAVE",41,0)
N OLDIFN S OLDIFN=+ORIFN K ORIFN
"RTN","ORCSAVE",42,0)
D EN Q:'ORIFN S:'$G(ORDA) ORDA=1
"RTN","ORCSAVE",43,0)
S $P(^OR(100,ORIFN,3),U,5)=OLDIFN,$P(^(3),U,11)=2
"RTN","ORCSAVE",44,0)
S $P(^OR(100,OLDIFN,3),U,6)=ORIFN S:$D(^(5)) ^OR(100,ORIFN,5)=^OR(100,OLDIFN,5)
"RTN","ORCSAVE",45,0)
Q
"RTN","ORCSAVE",46,0)
;
"RTN","ORCSAVE",47,0)
EN ; -- save new/unreleased order in ORDIALOG() into Orders file
"RTN","ORCSAVE",48,0)
; Requires: ORVP, ORNP [and ORL, ORTS, ORAPPT if available]
"RTN","ORCSAVE",49,0)
; If defined: ORCAT,ORPKG,ORDG,ORLOG,ORDUZ,OREVENT,ORDCNTRL,ORSRC
"RTN","ORCSAVE",50,0)
; (else use values from ORDIALOG and current state)
"RTN","ORCSAVE",51,0)
;
"RTN","ORCSAVE",52,0)
N PKG,NOW,NODE,CNT,CDL,I,X,STS,SIGNREQD,LOC,TRSPEC,NATR,CATG,DG,LOG,USR,TYPE,ORK
"RTN","ORCSAVE",53,0)
Q:'$G(ORVP) Q:'$G(ORDIALOG) Q:'$D(^ORD(101.41,+ORDIALOG,0))
"RTN","ORCSAVE",54,0)
S NOW=$$NOW^XLFDT,SIGNREQD=+$P(^ORD(101.41,+ORDIALOG,0),U,6)
"RTN","ORCSAVE",55,0)
S CATG=$S($L($G(ORCAT)):ORCAT,1:$S($$INPT^ORCD:"I",1:"O"))
"RTN","ORCSAVE",56,0)
S PKG=$S($G(ORPKG):ORPKG,1:$P(^ORD(101.41,+ORDIALOG,0),U,7))
"RTN","ORCSAVE",57,0)
I $G(ORIFN),$D(^OR(100,ORIFN,0)) S STS=$P(^(3),U,3) G EN2 ; unrel order
"RTN","ORCSAVE",58,0)
S DG=$S($G(ORDG):+ORDG,1:$P(^ORD(101.41,+ORDIALOG,0),U,5))
"RTN","ORCSAVE",59,0)
I $G(OREVENT),$$GET1^DIQ(9.4,+PKG_",",1)'="PSO",'$G(DGPMT) S LOC="",TRSPEC="" ;195
"RTN","ORCSAVE",60,0)
E S LOC=$G(ORL),TRSPEC=$G(ORTS)
"RTN","ORCSAVE",61,0)
S TYPE=$S("^B^C^X^P^0^"[(U_$G(ORSRC)_U):ORSRC,$G(ORDCNTRL)="SN":"P",1:0)
"RTN","ORCSAVE",62,0)
S LOG=$S($G(ORLOG):ORLOG,1:+$E(NOW,1,12)),USR=$S($G(ORDUZ):ORDUZ,1:DUZ)
"RTN","ORCSAVE",63,0)
S NATR=+$O(^ORD(100.02,"C","E",0)) ;assume Elec Entered until changed
"RTN","ORCSAVE",64,0)
S STS=$S($G(OREVENT):10,1:11),ORIFN=$$NEXTIFN Q:'ORIFN
"RTN","ORCSAVE",65,0)
EN1 S ^OR(100,ORIFN,0)=ORIFN_U_ORVP_U_U_$G(ORNP)_U_+ORDIALOG_";ORD(101.41,^"_USR_U_LOG_U_U_U_LOC_U_DG_U_CATG_U_TRSPEC_U_PKG_U_U_SIGNREQD_U_$G(OREVENT)_U_$G(ORAPPT)
"RTN","ORCSAVE",66,0)
S ^OR(100,ORIFN,3)=LOG_"^90^"_STS_U_$S($G(ORIT):ORIT_";ORD(101.41,",1:"")_U_$G(ORDIALOG("PREV"))_"^^1^^^^"_TYPE
"RTN","ORCSAVE",67,0)
S ^OR(100,ORIFN,8,0)="^100.008DA^1^1",^OR(100,ORIFN,8,1,0)=LOG_"^NW^"_$G(ORNP)_U_$S(SIGNREQD:2,1:3)_"^^^^^^^^"_NATR_U_USR_"^1^"_STS,^OR(100,ORIFN,8,"C","NW",1)=""
"RTN","ORCSAVE",68,0)
S ^OR(100,"AF",LOG,ORIFN,1)=""
"RTN","ORCSAVE",69,0)
S ^OR(100,"ACT",ORVP,9999999-LOG,+DG,ORIFN,1)=""
"RTN","ORCSAVE",70,0)
S:STS'=10 ^OR(100,"AC",ORVP,9999999-LOG,ORIFN,1)=""
"RTN","ORCSAVE",71,0)
S:SIGNREQD ^OR(100,"AS",ORVP,9999999-LOG,ORIFN,1)=""
"RTN","ORCSAVE",72,0)
S:$G(OREVENT) ^OR(100,"AEVNT",ORVP,OREVENT,ORIFN)=""
"RTN","ORCSAVE",73,0)
;check if OR GTX STUDY REASON is in ORDIALOG and strip out control characters
"RTN","ORCSAVE",74,0)
N ORRFSID
"RTN","ORCSAVE",75,0)
S ORRFSID=$O(^ORD(101.41,"B","OR GTX STUDY REASON",""))
"RTN","ORCSAVE",76,0)
I ORRFSID,$D(ORDIALOG(ORRFSID,1)) D
"RTN","ORCSAVE",77,0)
.N X,I
"RTN","ORCSAVE",78,0)
.S X=ORDIALOG(ORRFSID,1)
"RTN","ORCSAVE",79,0)
.F I=1:1:31 S X=$TR(X,$C(I))
"RTN","ORCSAVE",80,0)
.S ORDIALOG(ORRFSID,1)=X
"RTN","ORCSAVE",81,0)
EN2 S ORIFN=+ORIFN D RESPONSE ; save responses
"RTN","ORCSAVE",82,0)
I $P(^OR(100,ORIFN,0),"^",5) D ;Copy orders PKI fix
"RTN","ORCSAVE",83,0)
. N OI
"RTN","ORCSAVE",84,0)
. S OI=+$O(^OR(100,ORIFN,4.5,"ID","ORDERABLE",0)),OI=+$G(^OR(100,ORIFN,4.5,OI,1)) Q:'OI
"RTN","ORCSAVE",85,0)
. I PKG'=$O(^DIC(9.4,"B","OUTPATIENT PHARMACY",0)) Q
"RTN","ORCSAVE",86,0)
. D PKI^ORWDPS1(.ORY,OI,CATG,+ORVP,$$GET^XPAR("ALL^USR.`"_DUZ,"ORWOR PKI USE",1,"Q"))
"RTN","ORCSAVE",87,0)
. I $E($G(ORY))=2 S ORDEA=ORY
"RTN","ORCSAVE",88,0)
K ^OR(100,ORIFN,8,1,.1) D ORDTEXT^ORCSAVE1(ORIFN_";1") ; order text
"RTN","ORCSAVE",89,0)
S NODE=$G(^OR(100,ORIFN,0)) D S ^OR(100,ORIFN,0)=NODE
"RTN","ORCSAVE",90,0)
. S $P(NODE,U,4)=$G(ORNP) ; COST?
"RTN","ORCSAVE",91,0)
. S I=$O(^OR(100,ORIFN,4.5,"ID","LOCATION",0))
"RTN","ORCSAVE",92,0)
. I I,$P(NODE,U,10) S X=+$G(^OR(100,ORIFN,4.5,+I,1)) S:X $P(NODE,U,10)=X_";SC(" ;reset Loc if prev value
"RTN","ORCSAVE",93,0)
. S I=$O(^OR(100,ORIFN,4.5,"ID","CLASS",0))
"RTN","ORCSAVE",94,0)
. I I S X=$G(^OR(100,ORIFN,4.5,+I,1)) S:"^I^O^"[(U_X_U) $P(NODE,U,12)=X
"RTN","ORCSAVE",95,0)
S $P(^OR(100,ORIFN,3),U)=NOW
"RTN","ORCSAVE",96,0)
I $G(ORCHECK) D ; save order checks
"RTN","ORCSAVE",97,0)
. S (CNT,CDL)=0 F S CDL=$O(ORCHECK("NEW",CDL)) Q:CDL'>0 S I=0 D
"RTN","ORCSAVE",98,0)
. . F S I=$O(ORCHECK("NEW",CDL,I)) Q:I'>0 S X=ORCHECK("NEW",CDL,I) D
"RTN","ORCSAVE",99,0)
. . . S ORK(I,1)=+ORIFN_U_"ACCEPTANCE_CPRS"_U_DUZ_U_$$NOW^XLFDT_U_$P(X,U)_U_CDL
"RTN","ORCSAVE",100,0)
. . . S ORK(I,2)=$E($P(X,U,3),1,500)
"RTN","ORCSAVE",101,0)
. I $D(ORK) D SAVEOC^OROCAPI1(.ORK)
"RTN","ORCSAVE",102,0)
K ORDEA
"RTN","ORCSAVE",103,0)
ENQ Q
"RTN","ORCSAVE",104,0)
;
"RTN","ORCSAVE",105,0)
NEXTIFN() ; -- Returns next available ORIFN
"RTN","ORCSAVE",106,0)
N I,HDR,LAST,TOTAL,DA
"RTN","ORCSAVE",107,0)
L +^OR(100,0):$S($G(DILOCKTM)>0:DILOCKTM,1:5)
"RTN","ORCSAVE",108,0)
I '$T Q "^"
"RTN","ORCSAVE",109,0)
S HDR=$G(^OR(100,0)),TOTAL=+$P(HDR,U,4),LAST=$O(^OR(100,"?"),-1)
"RTN","ORCSAVE",110,0)
S I=LAST\1 F I=(I+1):1 Q:'$D(^OR(100,I,0))
"RTN","ORCSAVE",111,0)
S DA=I,^OR(100,DA,0)=DA,$P(HDR,U,3,4)=DA_U_(TOTAL+1)
"RTN","ORCSAVE",112,0)
S ^OR(100,0)=HDR L -^OR(100,0)
"RTN","ORCSAVE",113,0)
Q DA
"RTN","ORCSAVE",114,0)
;
"RTN","ORCSAVE",115,0)
RESPONSE ; -- Save responses in ORDIALOG() into ^OR(100,ORIFN,4.5)
"RTN","ORCSAVE",116,0)
N PROMPT,CNT,ITM,TYPE,INST,VALUE,I,START,PAT,X
"RTN","ORCSAVE",117,0)
S PAT=$P(^OR(100,ORIFN,0),U,2),START=$P(^(0),U,8) K ^(4.5)
"RTN","ORCSAVE",118,0)
S (PROMPT,CNT)=0 F S PROMPT=$O(ORDIALOG(PROMPT)) Q:PROMPT'>0 D
"RTN","ORCSAVE",119,0)
. S ITM=$G(ORDIALOG(PROMPT)) Q:'ITM
"RTN","ORCSAVE",120,0)
. S TYPE=$E($G(ORDIALOG(PROMPT,0))) Q:'$L(TYPE)
"RTN","ORCSAVE",121,0)
. S INST=0 F S INST=$O(ORDIALOG(PROMPT,INST)) Q:INST'>0 D
"RTN","ORCSAVE",122,0)
. . S VALUE=$G(ORDIALOG(PROMPT,INST)) Q:VALUE="" S CNT=CNT+1
"RTN","ORCSAVE",123,0)
. . S ^OR(100,ORIFN,4.5,CNT,0)=+ITM_U_PROMPT_U_INST_U_$P(ITM,U,2)