source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OR3C100A.m@ 1476

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

initial load of WorldVistAEHR

File size: 7.6 KB
RevLine 
[613]1OR3C100A ; SLC/MKB - Orders file conversion cont ;8/8/97 15:28
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**14**;Dec 17, 1997
3EN ; -- continue here
4 I '$L($T(@ORPKG)) S ORQUIT=1 Q
5 G @ORPKG
6 Q
7 ;
8PTR(X) ; -- Returns ptr to 101.41 for prompt OR GTX X
9 Q +$O(^ORD(101.41,"AB",$E("OR GTX "_X,1,63),0))
10 ;
11LR ; -- Lab
12 N TEST,START,SAMP,SPEC,TYPE,URG,OI
13 S TEST=$P(ORPK,U),START=$P(ORPK,U,2),SAMP=$P(ORPK,U,3),SPEC=$P(ORPK,U,4),TYPE=$P(ORPK,U,5),URG=$P(ORPK,U,6)
14 I 'TEST S ORQUIT=1 Q
15 S OI=$O(^ORD(101.43,"ID",TEST_";99LRT",0)) I 'OI S ORQUIT=1 Q
16 S ORDIALOG=+$O(^ORD(101.41,"AB","LR OTHER LAB TESTS",0))
17 D GETDLG1^ORCD(ORDIALOG) I '$O(ORDIALOG(0)) S ORQUIT=1 Q
18 S ORDIALOG($$PTR("ORDERABLE ITEM"),1)=OI
19 S:SAMP ORDIALOG($$PTR("COLLECTION SAMPLE"),1)=SAMP
20 S:SPEC ORDIALOG($$PTR("SPECIMEN"),1)=SPEC
21 S:$L(TYPE) ORDIALOG($$PTR("COLLECTION TYPE"),1)=TYPE
22 S:START ORDIALOG($$PTR("START DATE/TIME"),1)=START
23 S:URG ORDIALOG($$PTR("LAB URGENCY"),1)=URG
24 Q
25 ;
26RA ; -- Radiology
27 N PROC,CATG,URG,CONTR,PREOP,PREG,MODE,ILOC,START,OI,X,Y,WP,MOD,STS,DA,DIK
28 S X=$G(^RAO(75.1,+ORPK,0)) I '$L(X) S ORQUIT=1 Q
29 S STS=$P(X,U,5) I STS,STS'=11 S $P(^OR(100,ORIFN,3),U,3)=STS,ORQUIT=1 Q
30 S PROC=$P(X,U,2),CATG=$P(X,U,4),URG=$P(X,U,6),CONTR=$P(X,U,9),PREOP=$P(X,U,12),PREG=$P(X,U,13),MODE=$P(X,U,19),ILOC=$P(X,U,20),START=$P(X,U,21)
31 I 'PROC S ORQUIT=1 Q
32 S OI=$O(^ORD(101.43,"ID",PROC_";99RAP",0)) I 'OI S ORQUIT=1 Q
33 S ORDIALOG=+$O(^ORD(101.41,"AB","RA OERR EXAM",0))
34 D GETDLG1^ORCD(ORDIALOG) I '$O(ORDIALOG(0)) S ORQUIT=1 Q
35 S ORDIALOG($$PTR("ORDERABLE ITEM"),1)=OI
36 S:START ORDIALOG($$PTR("START DATE/TIME"),1)=START
37 S:URG ORDIALOG($$PTR("URGENCY"),1)=URG
38 S:$L(MODE) ORDIALOG($$PTR("MODE OF TRANSPORT"),1)=$$UP^XLFSTR(MODE)
39 S:$L(CATG) ORDIALOG($$PTR("CATEGORY"),1)=CATG
40 S:(CATG="I")!(CATG="O") ORCAT=CATG
41 I (CATG="C")!(CATG="S") S:CONTR ORDIALOG($$PTR("CONTRACT/SHARING SOURCE"),1)=CONTR
42 I CATG="R" S X=$G(^RAO(75.1,+ORPK,"R")) S:$L(X) ORDIALOG($$PTR("RESEARCH SOURCE"),1)=X
43 S:PREOP ORDIALOG($$PTR("PRE-OP SCHEDULED DATE/TIME"),1)=PREOP
44 S:$L(PREG) ORDIALOG($$PTR("PREGNANT"),1)=$$UP^XLFSTR(PREG)
45 S:ILOC ORDIALOG($$PTR("IMAGING LOCATION"),1)=ILOC
46 S MOD=$$PTR("MODIFIERS"),(X,Y)=0 F S Y=$O(^RAO(75.1,+ORPK,"M",Y)) Q:Y'>0 S X=X+1,ORDIALOG(MOD,X)=+$G(^(Y,0))
47 I $D(^RAO(75.1,+ORPK,"H")) S WP=$$PTR("WORD PROCESSING 1"),ORDIALOG(WP,1)="^TMP(""ORWORD"",$J,"_WP_",1)" M ^TMP("ORWORD",$J,WP,1)=^RAO(75.1,+ORPK,"H")
48 I '$D(^RADPT("AO",+ORPK)) S DA=+ORPK,DIK="^RAO(75.1," D ^DIK
49 Q
50 ;
51GMRC ; -- Consults
52 N PROC,TO,CATG,URG,PLACE,ATTN,TYPE,DX,WP,OI,X,Y,DA,DIK
53 S X=$G(^GMR(123,+ORPK,0)) I '$L(X) S ORQUIT=1 Q
54 S TO=$P(X,U,5),URG=$P(X,U,9),PLACE=$P(X,U,10),ATTN=$P(X,U,11),TYPE=$P(X,U,17),CATG=$P(X,U,18),DX=$G(^GMR(123,+ORPK,30)),PROC=""
55 S Y=$P($G(^ORD(101,+TYPE,0)),U) I Y'?1"GMRCOR ".E S ORQUIT=1 Q
56 S ORDIALOG=+$O(^ORD(101.41,"AB",Y,0)) I 'ORDIALOG S ORQUIT=1 Q
57 I Y="GMRCOR REQUEST" S PROC=$P(X,U,8) I 'PROC S ORQUIT=1 Q
58 D GETDLG1^ORCD(ORDIALOG) I '$O(ORDIALOG(0)) S ORQUIT=1 Q
59 S OI=$S(PROC:PROC_";99PRO",1:TO_";99CON")
60 S OI=$O(^ORD(101.43,"ID",OI,0)) I 'OI S ORQUIT=1 Q
61 S ORDIALOG($$PTR("ORDERABLE ITEM"),1)=OI
62 S URG=$P($P($G(^ORD(101,+URG,0)),U)," - ",2) S:(URG="NOW")!(URG="EMERGENCY") URG="ASAP" S:(URG="INPATIENT")!(URG="") URG="ROUTINE"
63 S Y=$O(^ORD(101.42,"B",URG,0)) S:Y ORDIALOG($$PTR("URGENCY"),1)=Y
64 S PLACE=$P($P($G(^ORD(101,+PLACE,0)),U)," - ",2),Y=$S(PLACE="BEDSIDE":"B",PLACE="EMERGENCY ROOM":"E",PLACE="ON CALL":"C",1:"")
65 S:$L(Y) ORDIALOG($$PTR("PLACE OF CONSULTATION"),1)=Y
66 S:$L(CATG) ORDIALOG($$PTR("CATEGORY"),1)=CATG
67 S:ATTN ORDIALOG($$PTR("PROVIDER"),1)=ATTN
68 S:$L(DX) ORDIALOG($$PTR("FREE TEXT"),1)=DX
69 I $D(^GMR(123,+ORPK,20)) S WP=$$PTR("WORD PROCESSING 1"),ORDIALOG(WP,1)="^TMP(""ORWORD"",$J,"_WP_",1)" M ^TMP("ORWORD",$J,WP,1)=^GMR(123,+ORPK,20)
70 S DA=+ORPK,DIK="^GMR(123," D ^DIK
71 Q
72 ;
73OR ; -- Generic orders
74 I $P(^OR(100,ORIFN,0),U,11)'=$O(^ORD(100.98,"B","V/M",0)) S ORQUIT=1 Q ; Vitals only
75GMRV ; -- Vitals
76 N START,STOP,SCH,TEXT,DLG,X,Y,I,OI
77 S START=$P(ORPK,U),STOP=$P(ORPK,U,2),SCH=$P(ORPK,U,3),TEXT=$P(ORPK,U,4)
78 S X=$P($G(^ORD(101,+$P(OR0,U,5),0)),U) I '$L(X) S ORQUIT=1 Q
79 S DLG=$O(^ORD(101.41,"AB",X,0)) I 'DLG S ORQUIT=1 Q
80 S OI=$$PTR("ORDERABLE ITEM"),I=$O(^ORD(101.41,+DLG,6,"D",OI,0))
81 S Y=+$G(^ORD(101.41,+DLG,6,+I,1)) I 'Y S ORQUIT=1 Q
82 S ORDIALOG=+$O(^ORD(101.41,"AB","GMRVOR",0)) D GETDLG1^ORCD(ORDIALOG)
83 S ORDIALOG(OI,1)=Y
84 S:START ORDIALOG($$PTR("START DATE/TIME"),1)=START
85 S:STOP ORDIALOG($$PTR("STOP DATE/TIME"),1)=STOP
86 S:$L(SCH) ORDIALOG($$PTR("SCHEDULE"),1)=SCH
87 S:$L(TEXT) ORDIALOG($$PTR("FREE TEXT 1"),1)=TEXT
88 Q
89 ;
90FH ; -- Dietetics
91 N X S X=$P($G(^ORD(101,+$P(OR0,U,5),0)),U)
92 I (X="FHW6")!(X'?1"FHW"1N) S ORQUIT=1 Q
93 G 1:X="FHW1",2:X="FHW2",3:X="FHW3",4:X="FHW4",7:X="FHW7",8:X="FHW8"
94 S ORQUIT=1
95 Q
961 ; -- Diet order
97 N OI,I,P,X,Y
98 S ORDIALOG=+$O(^ORD(101.41,"AB","FHW1",0)) D GETDLG1^ORCD(ORDIALOG)
99 S OI=$$PTR("ORDERABLE ITEM"),I=0
100 F P=9:1:13 S X=$P(ORPK,U,P) Q:'X S Y=$O(^ORD(101.43,"ID",X_";99FHD",0)) S:Y I=I+1,ORDIALOG(OI,I)=Y
101 I 'I S ORQUIT=1 Q ; no diets found
102 S:$P(ORPK,U,3) ORDIALOG($$PTR("START DATE/TIME"),1)=$P(ORPK,U,3)
103 S:$P(ORPK,U,4) ORDIALOG($$PTR("STOP DATE/TIME"),1)=$P(ORPK,U,4)
104 S:$L($P(ORPK,U,7)) ORDIALOG($$PTR("DELIVERY"),1)=$P(ORPK,U,7)
105 S:$L($P(ORPK,U,6)) ORDIALOG($$PTR("FREE TEXT 1"),1)=$P(ORPK,U,6)
106 Q
1072 ; -- Early/late tray
108 N ORPARAM,MEAL,TIME,I,X,Y,OI
109 D EN^FHWOR8(+ORVP,.ORPARAM) I '$L($G(ORPARAM(1))) S ORQUIT=1 Q
110 S MEAL=$P(ORPK,U,6),TIME=$P(ORPK,U,7) I '$L(MEAL)!('TIME) S ORQUIT=1 Q
111 S I=$S(MEAL="B":1,MEAL="N":7,MEAL="E":13,1:0) I 'I S ORQUIT=1 Q
112 S X=$P(ORPARAM(1),U,I,I+5),Y=""
113 F I=1:1:6 I $P(X,U,I)=TIME S Y=$S(I<4:"EARLY TRAY",1:"LATE TRAY")
114 I '$L(Y) S ORQUIT=1 Q
115 S ORDIALOG=+$O(^ORD(101.41,"AB","FHW2",0)) D GETDLG1^ORCD(ORDIALOG)
116 S OI=+$O(^ORD(101.43,"S.E/L T",Y,0)),ORDIALOG($$PTR("ORDERABLE ITEM"),1)=OI
117 S ORDIALOG($$PTR("MEAL"),1)=MEAL,ORDIALOG($$PTR("MEAL TIME"),1)=TIME
118 S:$P(ORPK,U,3) ORDIALOG($$PTR("START DATE"),1)=$P($P(ORPK,U,3),".")
119 S:$P(ORPK,U,4) ORDIALOG($$PTR("STOP DATE"),1)=$P($P(ORPK,U,4),".")
120 S:$L($P(ORPK,U,5)) ORDIALOG($$PTR("SCHEDULE"),1)=$P(ORPK,U,5)
121 S:$L($P(ORPK,U,8)) ORDIALOG($$PTR("YES/NO"),1)=($P(ORPK,U,8)="Y")
122 Q
1233 ; -- Isolation
124 S ORDIALOG=+$O(^ORD(101.41,"AB","FHW3",0))
125 D GETDLG1^ORCD(ORDIALOG)
126 N OI S OI=+$O(^ORD(101.43,"S.PREC","ISOLATION PROCEDURES",0))
127 S ORDIALOG($$PTR("ORDERABLE ITEM"),1)=OI
128 S:$P(ORPK,U,2) ORDIALOG($$PTR("ISOLATION TYPE"),1)=$P(ORPK,U,2)
129 Q
1304 ; -- NPO
131 S ORDIALOG=+$O(^ORD(101.41,"AB","FHW4",0)) D GETDLG1^ORCD(ORDIALOG)
132 N OI S OI=+$O(^ORD(101.43,"S.DIET","NPO",0))
133 S ORDIALOG($$PTR("ORDERABLE ITEM"),1)=OI
134 S:$P(ORPK,U,3) ORDIALOG($$PTR("START DATE/TIME"),1)=$P(ORPK,U,3)
135 S:$P(ORPK,U,4) ORDIALOG($$PTR("STOP DATE/TIME"),1)=$P(ORPK,U,4)
136 S:$L($P(ORPK,U,6)) ORDIALOG($$PTR("FREE TEXT 1"),1)=$P(ORPK,U,6)
137 Q
1387 ; -- Additional order
139 S ORDIALOG=+$O(^ORD(101.41,"AB","FHW7",0)) D GETDLG1^ORCD(ORDIALOG)
140 S:$L($P(ORPK,U,3)) ORDIALOG($$PTR("FREE TEXT 1"),1)=$P(ORPK,U,3)
141 Q
1428 ; -- Tubefeeding
143 N PROD,OI,I,X,Y
144 S ORDIALOG=+$O(^ORD(101.41,"AB","FHW8",0)) D GETDLG1^ORCD(ORDIALOG)
145 F I=2:1:6 S PROD=$P(ORPK,"~",I) Q:PROD="" D Q:$G(ORQUIT)
146 . S OI=+$O(^ORD(101.43,"ID",+$P(PROD,U)_";99FHT",0)) I 'OI S ORQUIT=1 Q
147 . S ORDIALOG($$PTR("ORDERABLE ITEM"),1)=OI
148 . S:$P(PROD,U,2) ORDIALOG($$PTR("STRENGTH FH"),1)=$P(PROD,U,2)
149 . I $L($P(PROD,U,3)) D S ORDIALOG($$PTR("INSTRUCTIONS"),1)=Y
150 . . S X=$P(PROD,U,3),Y=$P(X,"/") Q:$L(X,"/")'>1 ;done
151 . . S X=$P(X,"/",2),Y=Y_"/"_$S(X="per Day":"QD",X="per Hour":"QH",X="Twice a Day":"BID",X="Three times a Day":"TID",X="Every 2 Hours":"Q2H",X="Every 3 Hours":"Q3H",X="Every 4 Hours":"Q4H",X="Every 6 Hours":"Q6H",1:"")
152 S:$L($P(ORPK,U,5)) ORDIALOG($$PTR("FREE TEXT 1"),1)=$P(ORPK,U,5)
153 S:$L($P(ORPK,U,6)) ORDIALOG($$PTR("CANCEL FUTURE ORDERS"),1)=$P(ORPK,U,6)
154 Q
Note: See TracBrowser for help on using the repository browser.