-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathEPIP_PSO_PSS_IP21.KIDs
3724 lines (3634 loc) · 118 KB
/
EPIP_PSO_PSS_IP21.KIDs
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 Oct 24, 2018@15:43:05
PSO*7.0*452 and PSS*1.0*215
**KIDS**:PSO*7.0*452^PSS*1.0*215^
**INSTALL NAME**
PSO*7.0*452
"BLD",10177,0)
PSO*7.0*452^OUTPATIENT PHARMACY^0^3181024^y
"BLD",10177,1,0)
^^8^8^3181004^^
"BLD",10177,1,1,0)
Patch PSO*7*452 is part of a Multi Build with patch PSS*1.0*215.
"BLD",10177,1,2,0)
PSO*7.0*452 contains the routine changes.
"BLD",10177,1,3,0)
PSS*1.0*215 contains the DD changes.
"BLD",10177,1,4,0)
"BLD",10177,1,5,0)
The NSRs involved in this build are:
"BLD",10177,1,6,0)
NSR20150311 High Cost Rx Report; NSR20151109 Pharmacy Print from Suspense
"BLD",10177,1,7,0)
by Category; NSR20150512 Early Warning Advisory for Approaching the
"BLD",10177,1,8,0)
end of Rx Number Ranges; and NSR20151001 Pharmacy Patient Demographics.
"BLD",10177,4,0)
^9.64PA^^0
"BLD",10177,6.3)
56
"BLD",10177,"INID")
^y
"BLD",10177,"INIT")
PSOP452P
"BLD",10177,"KRN",0)
^9.67PA^779.2^20
"BLD",10177,"KRN",.4,0)
.4
"BLD",10177,"KRN",.4,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",.401,0)
.401
"BLD",10177,"KRN",.401,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",.402,0)
.402
"BLD",10177,"KRN",.402,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",.403,0)
.403
"BLD",10177,"KRN",.403,"NM",0)
^9.68A^^
"BLD",10177,"KRN",.5,0)
.5
"BLD",10177,"KRN",.5,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",.84,0)
.84
"BLD",10177,"KRN",3.6,0)
3.6
"BLD",10177,"KRN",3.8,0)
3.8
"BLD",10177,"KRN",3.8,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",9.2,0)
9.2
"BLD",10177,"KRN",9.2,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",9.8,0)
9.8
"BLD",10177,"KRN",9.8,"NM",0)
^9.68A^10^9
"BLD",10177,"KRN",9.8,"NM",1,0)
PSOEOPNW^^0^B11880159
"BLD",10177,"KRN",9.8,"NM",2,0)
PSOSITED^^0^B11480103
"BLD",10177,"KRN",9.8,"NM",4,0)
PSOSULB1^^0^B47930066
"BLD",10177,"KRN",9.8,"NM",5,0)
PSOSUCAT^^0^B81054236
"BLD",10177,"KRN",9.8,"NM",6,0)
PSODEM^^0^B21822724
"BLD",10177,"KRN",9.8,"NM",7,0)
PSODEMSB^^0^B62505884
"BLD",10177,"KRN",9.8,"NM",8,0)
PSODIR4^^0^B57253130
"BLD",10177,"KRN",9.8,"NM",9,0)
PSOCST10^^0^B20212856
"BLD",10177,"KRN",9.8,"NM",10,0)
PSOSULBL^^0^B105467816
"BLD",10177,"KRN",9.8,"NM","B","PSOCST10",9)
"BLD",10177,"KRN",9.8,"NM","B","PSODEM",6)
"BLD",10177,"KRN",9.8,"NM","B","PSODEMSB",7)
"BLD",10177,"KRN",9.8,"NM","B","PSODIR4",8)
"BLD",10177,"KRN",9.8,"NM","B","PSOEOPNW",1)
"BLD",10177,"KRN",9.8,"NM","B","PSOSITED",2)
"BLD",10177,"KRN",9.8,"NM","B","PSOSUCAT",5)
"BLD",10177,"KRN",9.8,"NM","B","PSOSULB1",4)
"BLD",10177,"KRN",9.8,"NM","B","PSOSULBL",10)
"BLD",10177,"KRN",19,0)
19
"BLD",10177,"KRN",19,"NM",0)
^9.68A^2^2
"BLD",10177,"KRN",19,"NM",1,0)
PSO CLINICAL ALERT ENTER/EDIT^^0
"BLD",10177,"KRN",19,"NM",2,0)
PSO RX NUMBERING WARNING^^0
"BLD",10177,"KRN",19,"NM","B","PSO CLINICAL ALERT ENTER/EDIT",1)
"BLD",10177,"KRN",19,"NM","B","PSO RX NUMBERING WARNING",2)
"BLD",10177,"KRN",19.1,0)
19.1
"BLD",10177,"KRN",19.1,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",101,0)
101
"BLD",10177,"KRN",101,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",409.61,0)
409.61
"BLD",10177,"KRN",409.61,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",771,0)
771
"BLD",10177,"KRN",771,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",779.2,0)
779.2
"BLD",10177,"KRN",870,0)
870
"BLD",10177,"KRN",870,"NM",0)
^9.68A^^0
"BLD",10177,"KRN",8989.51,0)
8989.51
"BLD",10177,"KRN",8989.52,0)
8989.52
"BLD",10177,"KRN",8994,0)
8994
"BLD",10177,"KRN","B",.4,.4)
"BLD",10177,"KRN","B",.401,.401)
"BLD",10177,"KRN","B",.402,.402)
"BLD",10177,"KRN","B",.403,.403)
"BLD",10177,"KRN","B",.5,.5)
"BLD",10177,"KRN","B",.84,.84)
"BLD",10177,"KRN","B",3.6,3.6)
"BLD",10177,"KRN","B",3.8,3.8)
"BLD",10177,"KRN","B",9.2,9.2)
"BLD",10177,"KRN","B",9.8,9.8)
"BLD",10177,"KRN","B",19,19)
"BLD",10177,"KRN","B",19.1,19.1)
"BLD",10177,"KRN","B",101,101)
"BLD",10177,"KRN","B",409.61,409.61)
"BLD",10177,"KRN","B",771,771)
"BLD",10177,"KRN","B",779.2,779.2)
"BLD",10177,"KRN","B",870,870)
"BLD",10177,"KRN","B",8989.51,8989.51)
"BLD",10177,"KRN","B",8989.52,8989.52)
"BLD",10177,"KRN","B",8994,8994)
"BLD",10177,"QDEF")
^^^^NO^^^^NO^^NO
"BLD",10177,"QUES",0)
^9.62^^
"BLD",10177,"REQB",0)
^9.611^5^4
"BLD",10177,"REQB",1,0)
PSO*7.0*398^2
"BLD",10177,"REQB",2,0)
PSO*7.0*500^2
"BLD",10177,"REQB",4,0)
PSO*7.0*448^2
"BLD",10177,"REQB",5,0)
PSO*7.0*539^2
"BLD",10177,"REQB","B","PSO*7.0*398",1)
"BLD",10177,"REQB","B","PSO*7.0*448",4)
"BLD",10177,"REQB","B","PSO*7.0*500",2)
"BLD",10177,"REQB","B","PSO*7.0*539",5)
"INIT")
PSOP452P
"KRN",19,2921973,-1)
0^2
"KRN",19,2921973,0)
PSO RX NUMBERING WARNING^End of Prescription Numbering Warning^^R^^^^^^^^
"KRN",19,2921973,1,0)
^19.06^7^7^3170724^^^^
"KRN",19,2921973,1,1,0)
Search the Outpatient Site (#59) for sites with less than 1000 numbers
"KRN",19,2921973,1,2,0)
left.
"KRN",19,2921973,1,3,0)
"KRN",19,2921973,1,4,0)
NARCOTIC UPPER BOUND - LAST NARCOTIC NUMBER ISSUED
"KRN",19,2921973,1,5,0)
LAST PRESCRIPTION # NUMBER ISSUED - LAST PRESCRIPTION # NUMBER ISSUED
"KRN",19,2921973,1,6,0)
"KRN",19,2921973,1,7,0)
If less than 250, display *** EXTREMELY LOW ***
"KRN",19,2921973,25)
CHECK^PSOEOPNW
"KRN",19,2921973,200.9)
y
"KRN",19,2921973,"U")
END OF PRESCRIPTION NUMBERING
"KRN",19,2921975,-1)
0^1
"KRN",19,2921975,0)
PSO CLINICAL ALERT ENTER/EDIT^Clinical Alert Enter/Edit^^R^^^^^^^^OUTPATIENT PHARMACY
"KRN",19,2921975,1,0)
^^11^11^3180622^
"KRN",19,2921975,1,1,0)
This option provides Enter/Edit of Clinical Alerts multiple (#109) in
"KRN",19,2921975,1,2,0)
Pharmacy Patient file (#55).
"KRN",19,2921975,1,3,0)
"KRN",19,2921975,1,4,0)
This option was developed for alerting pharmacy personnel of important
"KRN",19,2921975,1,5,0)
information (i.e., Drug to Drug interactions on research programs that the
"KRN",19,2921975,1,6,0)
normal software would not know about, etc.).
"KRN",19,2921975,1,7,0)
"KRN",19,2921975,1,8,0)
This option is only assigned to Pharmacy Supervisors. The supervisor
"KRN",19,2921975,1,9,0)
enters the clinical alert and then this information is displayed in the
"KRN",19,2921975,1,10,0)
appropriate places. Someone filling an order (or RX) would view this
"KRN",19,2921975,1,11,0)
information beforehand and act accordingly.
"KRN",19,2921975,25)
ENTER^PSODEMSB
"KRN",19,2921975,99.1)
64729,30553
"KRN",19,2921975,"U")
CLINICAL ALERT ENTER/EDIT
"MBREQ")
0
"ORD",18,19)
19;18;;;OPT^XPDTA;OPTF1^XPDIA;OPTE1^XPDIA;OPTF2^XPDIA;;OPTDEL^XPDIA
"ORD",18,19,0)
OPTION
"PKG",170,-1)
1^1
"PKG",170,0)
OUTPATIENT PHARMACY^PSO^OUTPATIENT LABELS, PROFILE, INVENTORY, PRESCRIPTIONS
"PKG",170,20,0)
^9.402P^^
"PKG",170,22,0)
^9.49I^1^1
"PKG",170,22,1,0)
7.0^2971216^2981113^1
"PKG",170,22,1,"PAH",1,0)
452^3181024^520736441
"PKG",170,22,1,"PAH",1,1,0)
^^8^8^3181024
"PKG",170,22,1,"PAH",1,1,1,0)
Patch PSO*7*452 is part of a Multi Build with patch PSS*1.0*215.
"PKG",170,22,1,"PAH",1,1,2,0)
PSO*7.0*452 contains the routine changes.
"PKG",170,22,1,"PAH",1,1,3,0)
PSS*1.0*215 contains the DD changes.
"PKG",170,22,1,"PAH",1,1,4,0)
"PKG",170,22,1,"PAH",1,1,5,0)
The NSRs involved in this build are:
"PKG",170,22,1,"PAH",1,1,6,0)
NSR20150311 High Cost Rx Report; NSR20151109 Pharmacy Print from Suspense
"PKG",170,22,1,"PAH",1,1,7,0)
by Category; NSR20150512 Early Warning Advisory for Approaching the
"PKG",170,22,1,"PAH",1,1,8,0)
end of Rx Number Ranges; and NSR20151001 Pharmacy Patient Demographics.
"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")
10
"RTN","PSOCST10")
0^9^B20212856
"RTN","PSOCST10",1,0)
PSOCST10 ;BHAM ISC/SAB - high cost report ; 12/16/14 8:53am
"RTN","PSOCST10",2,0)
;;7.0;OUTPATIENT PHARMACY;**31,56,331,398,452**;DEC 1997;Build 56
"RTN","PSOCST10",3,0)
;this routine list rxs that cost over a specified $ amount for a specified date range
"RTN","PSOCST10",4,0)
;External Ref. ^PSDRUG( is supp. by DBIA# 221
"RTN","PSOCST10",5,0)
BEG W ! S %DT(0)=-DT,%DT("A")="Beginning Date: ",%DT="APE" D ^%DT G:Y<0!($D(DTOUT)) EXIT S (%DT(0),BEGDATE)=Y
"RTN","PSOCST10",6,0)
W ! S %DT("A")="Ending Date: " D ^%DT G:Y<0!($D(DTOUT)) EXIT S ENDDATE=Y D:+$E(Y,6,7)=0 DTC
"RTN","PSOCST10",7,0)
MAX K DIR S DIR("A")="Dollar Limit ",DIR("B")=30,DIR(0)="N^0:9999:2",DIR("?")="Enter a dollar amount between 0-9999 with no more than two decimals or ^ quit"
"RTN","PSOCST10",8,0)
D ^DIR K DIR G:$D(DIRUT) EXIT S MAX=Y
"RTN","PSOCST10",9,0)
; BEGIN prompt for selection of Outpatient Site(s) //rtw
"RTN","PSOCST10",10,0)
N @($$DIR^PSODIR4()),PSOSITE D OPTSITE^PSODIR4(.PSOSITE,$T(+0),1) G:PSOSITE="^" EXIT
"RTN","PSOCST10",11,0)
; END prompt for selection of Outpatient Site(s)
"RTN","PSOCST10",12,0)
DEV K %ZIS,IOP,POP,ZTSK S PSOION=ION,%ZIS="QM" D ^%ZIS K %ZIS I POP S IOP=PSOION D ^%ZIS K IOP,PSOION W !,"Please try later!" G EXIT
"RTN","PSOCST10",13,0)
K PSOION I $D(IO("Q")) D G EXIT
"RTN","PSOCST10",14,0)
.S ZTDESC="Outpatient High Cost Report",ZTRTN="START^PSOCST10" F G="BEGDATE","ENDDATE","MAX" S:$D(@G) ZTSAVE(G)=""
"RTN","PSOCST10",15,0)
.; Begin save & pass PSOSITE* to tasked entry point //rtw
"RTN","PSOCST10",16,0)
.S ZTSAVE("PSOSITE*")=""
"RTN","PSOCST10",17,0)
.; End save & pass PSOSITE* to tasked entry point /rtw
"RTN","PSOCST10",18,0)
.K IO("Q") D ^%ZTLOAD W:$D(ZTSK) !,"Report is Queued to print !!" K ZTSK
"RTN","PSOCST10",19,0)
START U IO S PAGE=1,(CNT,TCOST)=0 D HD
"RTN","PSOCST10",20,0)
F NDT=BEGDATE:1:ENDDATE F PSOTY="AL","AM" S PSDT=NDT-1_".999999" D ST1 Q:$D(DIRUT) ;*331
"RTN","PSOCST10",21,0)
Q:$D(DIRUT) D HD:($Y+4)>IOSL
"RTN","PSOCST10",22,0)
D:'$D(DIRUT) FT
"RTN","PSOCST10",23,0)
EXIT W ! D ^%ZISC K XTYPE,DIR,DTOUT,DUOUT,DIROUT,DIRUT,^TMP($J),NDT,PSOTY,BEGDATE,CNT,COST,TCOST,DR0,DRCST,ENDDATE,MAX,PAGE,PGM,POP,PSDT,PSFILL,PSRXN,QTY,RX0,RX1,VAR,X,Y,%DT
"RTN","PSOCST10",24,0)
S:$D(ZTQUEUED) ZTREQ="@" Q
"RTN","PSOCST10",25,0)
ST1 F S PSDT=$O(^PSRX(PSOTY,PSDT)) Q:'PSDT!(PSDT>(NDT_".999999")) D ST2 Q:$D(DIRUT)
"RTN","PSOCST10",26,0)
Q
"RTN","PSOCST10",27,0)
ST2 S PSRXN=0 F S PSRXN=$O(^PSRX(PSOTY,PSDT,PSRXN)) Q:'PSRXN D ST3 Q:$D(DIRUT)
"RTN","PSOCST10",28,0)
Q
"RTN","PSOCST10",29,0)
ST3 S PSFILL=""
"RTN","PSOCST10",30,0)
F S PSFILL=$O(^PSRX(PSOTY,PSDT,PSRXN,PSFILL)) Q:PSFILL="" D CHK Q:$D(DIRUT)
"RTN","PSOCST10",31,0)
Q
"RTN","PSOCST10",32,0)
CHK Q:'$D(^PSRX(PSRXN,0))!(+$P(^PSRX(PSRXN,"STA"),"^")=13) S RX0=^(0) Q:'$D(^PSDRUG(+$P(RX0,"^",6),0)) S DR0=^(0)
"RTN","PSOCST10",33,0)
I PSOTY="AL" S:PSFILL RX1=$G(^PSRX(PSRXN,1,PSFILL,0)) Q:PSFILL&($G(RX1)="")
"RTN","PSOCST10",34,0)
I PSOTY="AM" Q:'$P($G(^PSRX(PSRXN,"P",PSFILL,0)),"^",19) S RX1=^(0)
"RTN","PSOCST10",35,0)
; Begin to screen RX on selected Outpatient Site(s) ;rtw
"RTN","PSOCST10",36,0)
Q:'$$DIVOK^PSODIR4(.PSOSITE,PSOTY,PSRXN,PSFILL)
"RTN","PSOCST10",37,0)
; End screen of RX on selected Outpatient Site(s) ;rtw
"RTN","PSOCST10",38,0)
S DRCST=$S('PSFILL&(+$P(RX0,"^",17)):$P(RX0,"^",17),PSFILL&(+$P($G(RX1),"^",11)):$P($G(RX1),"^",11),1:0)
"RTN","PSOCST10",39,0)
S QTY=$S('PSFILL:+$P(RX0,"^",7),1:+$P(RX1,"^",4))
"RTN","PSOCST10",40,0)
I 'DRCST S DRCST=$S($P($G(^PSDRUG(+$P(RX0,"^",6),660)),"^",6):+$P(^(660),"^",6),1:0)
"RTN","PSOCST10",41,0)
S COST=QTY*DRCST Q:COST<MAX
"RTN","PSOCST10",42,0)
Q:$D(DIRUT) D HD:($Y+4)>IOSL
"RTN","PSOCST10",43,0)
Q:$D(DIRUT) W !,$S(PSFILL&(PSOTY="AL"):"*",PSOTY="AM":"%",1:" ")_$P(RX0,"^"),?11,$E($P(DR0,"^"),"^",40),?51,$J(QTY,6),?60,$J(DRCST,6,3),?68,$J(COST,12,2) S CNT=CNT+1,TCOST=TCOST+COST
"RTN","PSOCST10",44,0)
Q
"RTN","PSOCST10",45,0)
HD I PAGE>1,$E(IOST)="C" S DIR(0)="E",DIR("A")=" Press Return to Continue or ^ to Exit" D ^DIR K DIR
"RTN","PSOCST10",46,0)
Q:$D(DIRUT) W @IOF,!,"Fills That Cost at Least $"_MAX_" for the Period: " S Y=BEGDATE D DT^DIO2 W " to " S Y=ENDDATE D DT^DIO2 W ?72,"Page "_PAGE,!,"Run Date: " S Y=DT D DT^DIO2 S PAGE=PAGE+1
"RTN","PSOCST10",47,0)
; Begin display selected Outpatient Site(s) //rtw
"RTN","PSOCST10",48,0)
N PSOLTIEN,PSOIEN59,PSOSTANM
"RTN","PSOCST10",49,0)
W !,"Outpatient Site" I PSOSITE("PSOSCNT")>1 W "s"
"RTN","PSOCST10",50,0)
W " Included in this Report: " I PSOSITE("PSOSCNT")>1 W !?2
"RTN","PSOCST10",51,0)
S PSOLTIEN=$O(PSOSITE(":"),-1) ; Do not append a comma on last site
"RTN","PSOCST10",52,0)
S PSOIEN59=0 F S PSOIEN59=$O(PSOSITE(PSOIEN59)) Q:'PSOIEN59 D ;
"RTN","PSOCST10",53,0)
. ; Format PSOSTANM variable, for example: JOHN COCHRAN VAMC (657)
"RTN","PSOCST10",54,0)
. S PSOSTANM=PSOSITE(PSOIEN59)_" ("_$$GET1^DIQ(59,PSOIEN59,.06)_")"
"RTN","PSOCST10",55,0)
. I PSOIEN59'=PSOLTIEN S PSOSTANM=PSOSTANM_", " ; Format multiples sites w/comma separation
"RTN","PSOCST10",56,0)
. I $X+($L(PSOSTANM)+2)>(IOM-1) W !?2 ; Issue line feed if IOM exceeded
"RTN","PSOCST10",57,0)
. W PSOSTANM
"RTN","PSOCST10",58,0)
; End display selected Outpatient Site(s) //rtw
"RTN","PSOCST10",59,0)
W !!,"Rx #",?11,"Drug",?54,"QTY",?59,"Un.Cost",?70,"Total Cost"
"RTN","PSOCST10",60,0)
W ! F I=1:1:80 W "-"
"RTN","PSOCST10",61,0)
Q
"RTN","PSOCST10",62,0)
FT W ! F I=1:1:80 W "-"
"RTN","PSOCST10",63,0)
S TCOST="Total Cost = "_$FN(TCOST,",",2)
"RTN","PSOCST10",64,0)
W !,"No. of Fills = "_CNT,?50,$J(TCOST,30)
"RTN","PSOCST10",65,0)
W ! F I=1:1:80 W "-"
"RTN","PSOCST10",66,0)
W !,"(* indicates a refill, % indicates a partial) "
"RTN","PSOCST10",67,0)
Q
"RTN","PSOCST10",68,0)
DTC N DD,MM S DD=31,MM=+$E(Y,4,5) I MM'=12 S MM=MM+1,MM=$S(MM<10:"0",1:"")_MM,X2=Y,X1=$E(Y,1,3)_MM_"00" D ^%DTC S DD=X
"RTN","PSOCST10",69,0)
S ENDDATE=Y+DD
"RTN","PSOCST10",70,0)
Q
"RTN","PSODEM")
0^6^B21822724
"RTN","PSODEM",1,0)
PSODEM ;BHAM ISC/SAB - PATIENT DEMOGRAPHICS ; 02/17/93 12:29
"RTN","PSODEM",2,0)
;;7.0;OUTPATIENT PHARMACY;**5,19,233,258,326,390,411,402,500,452**;DEC 1997;Build 56
"RTN","PSODEM",3,0)
;External reference to ^GMRADPT supported by DBIA 10099
"RTN","PSODEM",4,0)
;External reference to ^DIC(31 supported by DBIA 658
"RTN","PSODEM",5,0)
;External reference to $$BSA^PSSDSAPI supported by DBIA 5425
"RTN","PSODEM",6,0)
;
"RTN","PSODEM",7,0)
;RTW BEGIN PATIENT DEMOGRAPHIC CHANGE INFORMATION---------------------------
"RTN","PSODEM",8,0)
;EPIP NSR20151001 PATIENT DEMOGRAPHICS and Clinical Alerts added
"RTN","PSODEM",9,0)
;output, which will appear right after the Pharmacy Narrative:
"RTN","PSODEM",10,0)
; * Primary Care Team and their office Phone
"RTN","PSODEM",11,0)
; * PC Provider and Position
"RTN","PSODEM",12,0)
; * PC Provider's pager and office phone number
"RTN","PSODEM",13,0)
; * Current facility (or institution) of the Patient based on PC Team or appointment & visit history}
"RTN","PSODEM",14,0)
; * Patient file REMARKS
"RTN","PSODEM",15,0)
; * Clinical Alerts (for example, when a patient part of a researh study)
"RTN","PSODEM",16,0)
; * then pause the screen until the user pressed the <ENTER> key
"RTN","PSODEM",17,0)
;RTW END PATIENT DEMOGRAPHIC CHANGE INFORMATION---------------------------
"RTN","PSODEM",18,0)
GET S DFN=DA D 6^VADPT,PID^VADPT U IO W @IOF,!,VADM(1)
"RTN","PSODEM",19,0)
I +VAPA(9) W !?5,"(TEMP ADDRESS from "_$P(VAPA(9),"^",2)_" till "_$S($P(VAPA(10),"^",2)]"":$P(VAPA(10),"^",2),1:"(no end date)")_")"
"RTN","PSODEM",20,0)
W !,VAPA(1),?40,"DOB: ",$S(+VADM(3):$P(VADM(3),"^",2),1:"UNKNOWN") W:VAPA(2)]"" !,VAPA(2) W:VAPA(3)]"" !,VAPA(3)
"RTN","PSODEM",21,0)
W !,VAPA(4),?40,"PHONE: "_VAPA(8),!,$P(VAPA(5),"^",2)_" "_$S(VAPA(11)]"":$P(VAPA(11),"^",2),1:VAPA(6)),?40,"ELIG: "_$P(VAEL(1),"^",2) W:+VAEL(3) !?40,"SC%: "_$P(VAEL(3),"^",2)
"RTN","PSODEM",22,0)
I $D(^PS(55,DFN,0)) W:$P(^(0),"^",2) !,"CANNOT USE SAFETY CAPS." I +$P(^(0),"^",4) W ?40,"DIALYSIS PATIENT."
"RTN","PSODEM",23,0)
I $G(^PS(55,DFN,1))]"" S X=^(1) W !!?5,"Pharmacy Narrative: " F I=1:1 Q:$P(X," ",I,99)="" W:$X+$L($P(X," ",I))+$L(" ")>IOM ! W $P(X," ",I)," "
"RTN","PSODEM",24,0)
RE ;
"RTN","PSODEM",25,0)
D DEMOG^PSODEMSB(DFN) ;RTW PATIENT DEMOGRAPHIC CHANGE
"RTN","PSODEM",26,0)
S (WT,HT)="",X="GMRVUTL" X ^%ZOSF("TEST") I $T D
"RTN","PSODEM",27,0)
.F GMRVSTR="WT","HT" S VM=GMRVSTR D EN6^GMRVUTL S @VM=X,$P(@VM,"^")=$E($P(@VM,"^"),4,5)_"/"_$E($P(@VM,"^"),6,7)_"/"_($E($P(@VM,"^"),1,3)+1700)
"RTN","PSODEM",28,0)
.S X=$P(WT,"^",8),Y=$J(X/2.2046226,0,2),$P(WT,"^",9)=Y,X=$P(HT,"^",8),Y=$J(2.54*X,0,2),$P(HT,"^",9)=Y
"RTN","PSODEM",29,0)
Q:$G(POERR)
"RTN","PSODEM",30,0)
W !!,"WEIGHT(Kg): " W:+$P(WT,"^",8) $P(WT,"^",9)_" ("_$P(WT,"^")_")" W ?41,"HEIGHT(cm): " W:$P(HT,"^",8) $P(HT,"^",9)_" ("_$P(HT,"^")_")" K VM,WT,HT
"RTN","PSODEM",31,0)
;
"RTN","PSODEM",32,0)
; Display CrCl/BSA - show serum creatinine if CrCl can't be calculated
"RTN","PSODEM",33,0)
CRCL S PSOBSA=$$BSA^PSSDSAPI(DFN),PSOBSA=$P(PSOBSA,"^",3),PSOBSA=$S(PSOBSA'>0:"_______",1:$J(PSOBSA,4,2))
"RTN","PSODEM",34,0)
S RSLT=$$CRCL^PSOORUT2(DFN)
"RTN","PSODEM",35,0)
; RSLT -- DATE^CRCL^Serum Creatinine -- Ex. 11/25/11^68.7^1.1
"RTN","PSODEM",36,0)
I ($P($G(RSLT),"^",2)["Not Found")&($P($G(RSLT),"^",3)<.01) S ZDSPL=" CrCL: "_$P(RSLT,"^",2)_" (CREAT: Not Found)"
"RTN","PSODEM",37,0)
I ($P($G(RSLT),"^",2)["Not Found")&($P($G(RSLT),"^",3)>.01) S ZDSPL=" CrCL: "_$P(RSLT,"^",2)_" (CREAT: "_$P($G(RSLT),"^",3)_"mg/dL "_$P($G(RSLT),"^")_")"
"RTN","PSODEM",38,0)
I ($P($G(RSLT),"^",2)>0)&($P($G(RSLT),"^",3)>.01) S ZDSPL=" CrCL: "_$P(RSLT,"^",2)_"(est.)"_" (CREAT: "_$P($G(RSLT),"^",3)_"mg/dL "_$P($G(RSLT),"^")_")"
"RTN","PSODEM",39,0)
W !,ZDSPL,?40," BSA (m2): ",PSOBSA K PSOBSA,ZDSPL,RSLT
"RTN","PSODEM",40,0)
;
"RTN","PSODEM",41,0)
S PSLC=0 G MA:$P($G(^DPT(DFN,.17)),"^",2)'="I"
"RTN","PSODEM",42,0)
I '$D(VAEL(1)) D ELIG^VADPT W !!,"ELIGIBILITY: ",$P(VAEL(1),"^",2) W:+VAEL(3) ?$X+5,"SC%: "_$P(VAEL(3),"^",2) S PSLC=PSLC+2
"RTN","PSODEM",43,0)
MA K SC W !,"DISABILITIES: " S PSLC=PSLC+2
"RTN","PSODEM",44,0)
F I=0:0 S I=$O(^DPT(DFN,.372,I)) Q:'I S I1=$S($D(^DPT(DFN,.372,I,0)):^(0),1:"") D:+I1
"RTN","PSODEM",45,0)
.S PSDIS=$S($P($G(^DIC(31,+I1,0)),"^")]""&($P($G(^(0)),"^",4)']""):$P(^(0),"^"),$P($G(^DIC(31,+I1,0)),"^",4)]"":$P(^(0),"^",4),1:""),PSCNT=$P(I1,"^",2)
"RTN","PSODEM",46,0)
.X:($X+$L(PSDIS)+7)>(IOM-8) "W !?14 S PSLC=PSLC+1" W PSDIS,"-",PSCNT,"% (",$S($P(I1,"^",3):"SC",1:"NSC"),"), "
"RTN","PSODEM",47,0)
.I $E(IOST)="C",$Y+4>IOSL,$D(PSTYPE) K DIR S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR K DIR,DTOUT W @IOF,?13
"RTN","PSODEM",48,0)
X "N X S X=""GMRADPT"" X ^%ZOSF(""TEST"") Q" I $T D:'$D(PSOPTPST) GMRA
"RTN","PSODEM",49,0)
Q K SC,I1,VAROOT,Y,AL,I,X,Y,PSCNT,PSLC,PSDIS D:$G(PSTYPE)']"" KVA^VADPT Q
"RTN","PSODEM",50,0)
GMRA K ^TMP($J,"AL") S GMRA="0^0^111" D ^GMRADPT I GMRAL D
"RTN","PSODEM",51,0)
.F DR=0:0 S DR=$O(GMRAL(DR)) Q:'DR S ^TMP($J,"AL",$S('$P(GMRAL(DR),"^",5):1,1:2),$P(GMRAL(DR),"^",7),$P(GMRAL(DR),"^",2))=""
"RTN","PSODEM",52,0)
.W !!,"ALLERGIES: " S (DR,TY)="" F I=0:0 S TY=$O(^TMP($J,"AL",1,TY)) Q:TY="" F D=0:0 S DR=$O(^TMP($J,"AL",1,TY,DR)) Q:DR="" W:$X+$L(DR)+$L(", ")>IOM !?11 W DR_", " D
"RTN","PSODEM",53,0)
..I $E(IOST)="C",$Y+4>IOSL,$D(PSTYPE) W ! K DIR S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR K DIR,DTOUT W @IOF,?18
"RTN","PSODEM",54,0)
.W !!,"ADVERSE REACTIONS: " S (DR,TY)="" F I=0:0 S TY=$O(^TMP($J,"AL",2,TY)) Q:TY="" F D=0:0 S DR=$O(^TMP($J,"AL",2,TY,DR)) Q:DR="" W:$X+$L(DR)+$L(", ")>IOM !?19 W DR_", " D
"RTN","PSODEM",55,0)
..I $E(IOST)="C",$Y+4>IOSL,$D(PSTYPE) W ! K DIR S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR K DIR,DTOUT W @IOF,?18
"RTN","PSODEM",56,0)
I $G(GMRAL)']"" F AD="ALLERGIES:","ADVERSE REACTIONS:" W !!,AD I $G(PSOFROM)="" F ADL=1:1:IOM-($L(AD)+5) W "_"
"RTN","PSODEM",57,0)
I GMRAL=0 W !!,"ALLERGIES: NKA",!!,"ADVERSE REACTIONS:"
"RTN","PSODEM",58,0)
W ! K TY,D,I,GMRA,GMRAL,DR,AD,ADL,^TMP($J,"AL") Q
"RTN","PSODEMSB")
0^7^B62505884
"RTN","PSODEMSB",1,0)
PSODEMSB ;EPIP/RTW - PSODEM subroutines ; 7/29/17 3:24pm
"RTN","PSODEMSB",2,0)
;;7.0;OUTPATIENT PHARMACY;**452**;Dec 1997;Build 56
"RTN","PSODEMSB",3,0)
;------------------------------------------------------------------
"RTN","PSODEMSB",4,0)
; External reference to $$OUTPTTM^SDUTL3 supported by ICR 1252
"RTN","PSODEMSB",5,0)
; External reference to ^DIE supported by ICR 2022
"RTN","PSODEMSB",6,0)
; External references to $$GET1^DIQ supported by ICR 2056
"RTN","PSODEMSB",7,0)
; External reference to ^PS(55 supported by ICR 2228
"RTN","PSODEMSB",8,0)
; External reference to $$GETALL^SCAPMCA supported by ICR 2848
"RTN","PSODEMSB",9,0)
; External reference to VST^ORWCV supported by ICR 4211
"RTN","PSODEMSB",10,0)
; External reference to $$SDAPI^SDMACA301 supported by ICR 4433
"RTN","PSODEMSB",11,0)
; External reference to ^DD("DILOCKTM" supported by ICR 4909
"RTN","PSODEMSB",12,0)
; External reference to ^DIC supported by ICR 10006
"RTN","PSODEMSB",13,0)
; External reference to ^DIR supported by ICR 10026
"RTN","PSODEMSB",14,0)
; External reference to ^DPT( supported by ICR 10035
"RTN","PSODEMSB",15,0)
; External reference to ^VA(200 supported by ICR 10060
"RTN","PSODEMSB",16,0)
; External reference to LOCK^DILF($NA( supported by ICR 2054
"RTN","PSODEMSB",17,0)
;------------------------------------------------------------------
"RTN","PSODEMSB",18,0)
DEMOG(PSODFN) ;
"RTN","PSODEMSB",19,0)
; Extend patient demographics with PC Team, Current Facility
"RTN","PSODEMSB",20,0)
; Remarks, and Clinical Alerts, pause the screen until <Enter>
"RTN","PSODEMSB",21,0)
; Input:
"RTN","PSODEMSB",22,0)
; DFN ; Required ; IEN of Patient file (#2) entry
"RTN","PSODEMSB",23,0)
;
"RTN","PSODEMSB",24,0)
Q:$D(XQORNOD(0))
"RTN","PSODEMSB",25,0)
N PSOTEAM,PSOCLINA,DIR,DIRUT,PG,X,Y
"RTN","PSODEMSB",26,0)
I $G(XQY0)["PSO P",($I=$P) D ;
"RTN","PSODEMSB",27,0)
. W !
"RTN","PSODEMSB",28,0)
. S DIR("T")=DTIME,DIR(0)="EA",DIR("A")="Press <Enter> to continue: " D ^DIR
"RTN","PSODEMSB",29,0)
;
"RTN","PSODEMSB",30,0)
S PG=0
"RTN","PSODEMSB",31,0)
D PCTEAM(PSODFN)
"RTN","PSODEMSB",32,0)
I 'PSOTEAM W !! D HDR("Extended Patient Demographics:")
"RTN","PSODEMSB",33,0)
D REMARKS(PSODFN)
"RTN","PSODEMSB",34,0)
W !?1,"Assigned/Recent Facility: ",$$CURRFAC(PSODFN)
"RTN","PSODEMSB",35,0)
D CA(PSODFN)
"RTN","PSODEMSB",36,0)
Q:$D(DIRUT)
"RTN","PSODEMSB",37,0)
I $G(XQY0)'["OR CPRS GUI CHART",($I=$P) D ;
"RTN","PSODEMSB",38,0)
. W !
"RTN","PSODEMSB",39,0)
. S DIR("T")=DTIME,DIR(0)="EA",DIR("A")="Press <Enter> to continue: " D ^DIR
"RTN","PSODEMSB",40,0)
Q
"RTN","PSODEMSB",41,0)
;------------------------------------------------------------------
"RTN","PSODEMSB",42,0)
CA(PSODFN) ; Print PHARMACY PATIENT CLINICAL ALERTS multiple field (#2)
"RTN","PSODEMSB",43,0)
; Input:
"RTN","PSODEMSB",44,0)
; DFN ; Required ; IEN of Patient file (#2) entry
"RTN","PSODEMSB",45,0)
;
"RTN","PSODEMSB",46,0)
N PSOFLAG1,PSODATER
"RTN","PSODEMSB",47,0)
;
"RTN","PSODEMSB",48,0)
Q:'$G(PSODFN) ; Quit, if no Patient IEN
"RTN","PSODEMSB",49,0)
Q:'$P($G(^PS(55,PSODFN,2,0)),U,4) ; No CLINICAL ALERTS
"RTN","PSODEMSB",50,0)
;
"RTN","PSODEMSB",51,0)
S PSOFLAG1=1,PSOCLINA=0 ; First time flag to display field header
"RTN","PSODEMSB",52,0)
;
"RTN","PSODEMSB",53,0)
; PSODATER format DINUMed: 9999999.999999-CLINICAL ALERT DATE/TIME
"RTN","PSODEMSB",54,0)
S PSODATER=0
"RTN","PSODEMSB",55,0)
F S PSODATER=$O(^PS(55,PSODFN,2,PSODATER)) Q:'PSODATER D Q:$D(DIRUT) ;
"RTN","PSODEMSB",56,0)
. I PSOFLAG1=1 W !!,"Clinical Alerts:" S PSOFLAG1=0
"RTN","PSODEMSB",57,0)
. ; Display CLINICAL ALERT DATE/TIME (#.01) & CLINICAL ALERT (#1)
"RTN","PSODEMSB",58,0)
. W !!,?2,$$GET1^DIQ(55.0109,PSODATER_","_PSODFN,.01)
"RTN","PSODEMSB",59,0)
. W " ",$$GET1^DIQ(55.0109,PSODATER_","_PSODFN,1)
"RTN","PSODEMSB",60,0)
. I 'PG!($Y+7>IOSL),$O(^PS(55,PSODFN,2,PSODATER)) D HDR("Clinical Alerts:")
"RTN","PSODEMSB",61,0)
Q
"RTN","PSODEMSB",62,0)
;------------------------------------------------------------------
"RTN","PSODEMSB",63,0)
HDR(HDR) ;
"RTN","PSODEMSB",64,0)
N DIR
"RTN","PSODEMSB",65,0)
W !
"RTN","PSODEMSB",66,0)
I PG,($I=$P) S DIR("T")=DTIME,DIR(0)="EA",DIR("A")="Type <Enter> to continue or '^' to exit Clinical Alerts:" D ^DIR I $D(DIRUT) Q
"RTN","PSODEMSB",67,0)
I HDR]"" W @IOF S PG=$G(PG)+1 W HDR,?70,"Page: ",PG,! S $Y=1
"RTN","PSODEMSB",68,0)
Q
"RTN","PSODEMSB",69,0)
CURRFAC(PSODFN) ; Return: The Assigned/Recent Facility INSTITUTION for the Patient's DFN
"RTN","PSODEMSB",70,0)
; Input:
"RTN","PSODEMSB",71,0)
; DFN ; Required ; IEN of Patient file (#2) entry
"RTN","PSODEMSB",72,0)
;
"RTN","PSODEMSB",73,0)
N DATA,DTBEG,DTEND,FLAGQ,IEN4,ORVISIT,PCTEAM,PREVSCDT,RETURN,SUB
"RTN","PSODEMSB",74,0)
;
"RTN","PSODEMSB",75,0)
S RETURN="" ; Default return value is null
"RTN","PSODEMSB",76,0)
;
"RTN","PSODEMSB",77,0)
I $$GET1^DIQ(2,PSODFN,.351,"I") Q RETURN ; .351 Patient DATE OF DEATH
"RTN","PSODEMSB",78,0)
;
"RTN","PSODEMSB",79,0)
; The first choice for returning the INSTITUTION would be the
"RTN","PSODEMSB",80,0)
; INSTITUTION field (#.07) of the TEAM file (#404.51)
"RTN","PSODEMSB",81,0)
;
"RTN","PSODEMSB",82,0)
S PCTEAM=$$OUTPTTM^SDUTL3(PSODFN,DT,1) ; IEN^NAME of file (#404.51) ; ICR #1252
"RTN","PSODEMSB",83,0)
; *** End patch #1 change #1 by R2/Confer on 08/07/2015
"RTN","PSODEMSB",84,0)
I +PCTEAM>0 D Q RETURN
"RTN","PSODEMSB",85,0)
. S RETURN=$$GET1^DIQ(404.51,+PCTEAM,.07) ; INSTITUTION [R*P4']
"RTN","PSODEMSB",86,0)
;
"RTN","PSODEMSB",87,0)
; Return future appointments and past visits for a patient
"RTN","PSODEMSB",88,0)
;
"RTN","PSODEMSB",89,0)
S DTBEG=DT-20000 ; Begin with TODAY - 2 years
"RTN","PSODEMSB",90,0)
S DTEND=DT+20000 ; End with TODAY + 2 years
"RTN","PSODEMSB",91,0)
D VST^ORWCV(.ORVISIT,PSODFN,DTBEG,DTEND) ; ICR #4211
"RTN","PSODEMSB",92,0)
;
"RTN","PSODEMSB",93,0)
; Process ORVISIT array in reverse chronological order. Quantify
"RTN","PSODEMSB",94,0)
; visits & appointments based upon the INSTITUTION pointer field (#3)
"RTN","PSODEMSB",95,0)
; of the HOSPITAL LOCATION file (#44). Once the count reaches
"RTN","PSODEMSB",96,0)
; 3 for a given INSTITUTION, that INSTITUION is returned.
"RTN","PSODEMSB",97,0)
;
"RTN","PSODEMSB",98,0)
S FLAGQ=0 ; Quit flag, set to 1 once the Institution is determined
"RTN","PSODEMSB",99,0)
S PREVSCDT="" ; Previous appt/visit date
"RTN","PSODEMSB",100,0)
S SUB=":" ;.... Sequential number of ORVISIT array subscript
"RTN","PSODEMSB",101,0)
F S SUB=$O(ORVISIT(SUB),-1) Q:'SUB!FLAGQ D ;
"RTN","PSODEMSB",102,0)
. N DATA,SC,SCDT
"RTN","PSODEMSB",103,0)
. S DATA=ORVISIT(SUB)
"RTN","PSODEMSB",104,0)
. S SC=$P($P(DATA,U),";",3) Q:'SC ; HOSPITAL LOCATION file (#44) IEN
"RTN","PSODEMSB",105,0)
. S IEN4=+$$GET1^DIQ(44,SC,3,"I") ; INSTITUTION file (#4) IEN
"RTN","PSODEMSB",106,0)
. S SCDT=$P($P(DATA,U),";",2) Q:'SCDT ; Appt/visit date (fm format)
"RTN","PSODEMSB",107,0)
. S SCDT=$P(SCDT,".") ; Strip the time
"RTN","PSODEMSB",108,0)
. Q:SCDT=PREVSCDT ; Appt/visit must be a N day
"RTN","PSODEMSB",109,0)
. I '$D(IEN4(IEN4)) S IEN4(IEN4)=0 ; Initialize INSTITUTION counter
"RTN","PSODEMSB",110,0)
. S IEN4(IEN4)=IEN4(IEN4)+1 ; Quantify by INSTITUTION ien
"RTN","PSODEMSB",111,0)
. I IEN4(IEN4)=3 D Q ; When count reaches 3, INSTITUTION found
"RTN","PSODEMSB",112,0)
. . S RETURN=$$GET1^DIQ(4,IEN4,.01) ; INSTITUTION NAME (#.01)
"RTN","PSODEMSB",113,0)
. . S FLAGQ=1
"RTN","PSODEMSB",114,0)
. ;
"RTN","PSODEMSB",115,0)
. S PREVSCDT=SCDT ; Save as previous appt/visit date
"RTN","PSODEMSB",116,0)
;
"RTN","PSODEMSB",117,0)
; IF no PCTEAM INSTITUTION
"RTN","PSODEMSB",118,0)
; AND three appt/visits were not found for an INSTITUTION ien
"RTN","PSODEMSB",119,0)
; AND at least one appt/visit was found
"RTN","PSODEMSB",120,0)
; THEN
"RTN","PSODEMSB",121,0)
; return the most recent appt/visit INSTITUTION
"RTN","PSODEMSB",122,0)
;
"RTN","PSODEMSB",123,0)
I RETURN="" D ;
"RTN","PSODEMSB",124,0)
. N DATA,IEN4,SC,SUB
"RTN","PSODEMSB",125,0)
. S SUB=$O(ORVISIT(":"),-1) Q:'SUB
"RTN","PSODEMSB",126,0)
. S DATA=ORVISIT(SUB)
"RTN","PSODEMSB",127,0)
. S SC=$P($P(DATA,U),";",3) Q:'SC ; HOSPITAL LOCATION file (#44) IEN
"RTN","PSODEMSB",128,0)
. S IEN4=$$GET1^DIQ(44,SC,3,"I") ; INSTITUTION file (#4) IEN
"RTN","PSODEMSB",129,0)
. S RETURN=$$GET1^DIQ(4,IEN4,.01) ; INSTITUTION file (#4) NAME (#.01)
"RTN","PSODEMSB",130,0)
;
"RTN","PSODEMSB",131,0)
Q RETURN
"RTN","PSODEMSB",132,0)
;------------------------------------------------------------------
"RTN","PSODEMSB",133,0)
PCTEAM(PSODFN) ; Display current PC TEAM, PC Provider, and phone.
"RTN","PSODEMSB",134,0)
; Input:
"RTN","PSODEMSB",135,0)
; DFN ; Required ; IEN of Patient file (#2) entry
"RTN","PSODEMSB",136,0)
;
"RTN","PSODEMSB",137,0)
S PSOTEAM=0
"RTN","PSODEMSB",138,0)
N DATA,PAGER,PCPOS,PCPROV,PCPROVI,PHONE,PCTM
"RTN","PSODEMSB",139,0)
N SCDT2,SCP,SDI,TEAM,TEAMI
"RTN","PSODEMSB",140,0)
;
"RTN","PSODEMSB",141,0)
S PCTM="^TMP(""SDPLIST"",$J)"
"RTN","PSODEMSB",142,0)
K @PCTM
"RTN","PSODEMSB",143,0)
S SDI=$$GETALL^SCAPMCA(PSODFN,DT,PCTM) Q:'SDI ; ICR #2848
"RTN","PSODEMSB",144,0)
S SDI=0
"RTN","PSODEMSB",145,0)
F S SDI=$O(^TMP("SDPLIST",$J,PSODFN,"PCTM",SDI)) Q:'SDI D ;
"RTN","PSODEMSB",146,0)
. ;
"RTN","PSODEMSB",147,0)
. ; "PCTM" node (PC Team)
"RTN","PSODEMSB",148,0)
. S PSOTEAM=1
"RTN","PSODEMSB",149,0)
. S DATA=$G(^TMP("SDPLIST",$J,PSODFN,"PCTM",SDI)) Q:DATA=""
"RTN","PSODEMSB",150,0)
. S TEAMI=$P(DATA,U,1) ; IEN of TEAM file (#404.51)
"RTN","PSODEMSB",151,0)
. S TEAM=$P(DATA,U,2) ;. NAME of TEAM file entry
"RTN","PSODEMSB",152,0)
. ;
"RTN","PSODEMSB",153,0)
. ; "PCPR" node (PC Provider)
"RTN","PSODEMSB",154,0)
. S DATA=$G(^TMP("SDPLIST",$J,PSODFN,"PCPR",SDI))
"RTN","PSODEMSB",155,0)
. S PCPROVI=+$P(DATA,U,1) ; IEN of PC Provider
"RTN","PSODEMSB",156,0)
. S PCPROV=$P(DATA,U,2) ;. PC Provider
"RTN","PSODEMSB",157,0)
. S PCPOS=$P(DATA,U,4) ;.. PC Provider Position
"RTN","PSODEMSB",158,0)
. S PAGER=$$GET1^DIQ(200,PCPROVI,.138) ; DIGITAL PAGER
"RTN","PSODEMSB",159,0)
. S:PAGER="" PAGER=$$GET1^DIQ(200,PCPROVI,.137) ; VOICE PAGER
"RTN","PSODEMSB",160,0)
. S PHONE=$$GET1^DIQ(200,PCPROVI,.132) ; OFFICE PHONE
"RTN","PSODEMSB",161,0)
. ;
"RTN","PSODEMSB",162,0)
. I PSOTEAM W !! D HDR("Extended Patient Demographics:")
"RTN","PSODEMSB",163,0)
. ;
"RTN","PSODEMSB",164,0)
. W !," Primary Care Team: ",TEAM
"RTN","PSODEMSB",165,0)
. W ?52," Phone: ",$$GET1^DIQ(404.51,TEAMI,.02) ; TEAM PHONE NUMBER
"RTN","PSODEMSB",166,0)
. ;
"RTN","PSODEMSB",167,0)
. W !," PC Provider: ",PCPROV
"RTN","PSODEMSB",168,0)
. W ?52,"Position: ",$E(PCPOS,1,18)
"RTN","PSODEMSB",169,0)
. ;
"RTN","PSODEMSB",170,0)
. W !?13,"Pager: ",PAGER
"RTN","PSODEMSB",171,0)
. W ?52," Phone: ",PHONE
"RTN","PSODEMSB",172,0)
;
"RTN","PSODEMSB",173,0)
K @PCTM
"RTN","PSODEMSB",174,0)
Q
"RTN","PSODEMSB",175,0)
;------------------------------------------------------------------
"RTN","PSODEMSB",176,0)
REMARKS(PSODFN) ; Display PATIENT file (#2) REMARKS field (#.091)
"RTN","PSODEMSB",177,0)
; Input:
"RTN","PSODEMSB",178,0)
; DFN ; Required ; IEN of Patient file (#2) entry
"RTN","PSODEMSB",179,0)
;