OCXDI02L ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC ROUTINES ;SEP 7,1999 at 10:30
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
;
D DOT^OCXDIAG
;
;
K REMOTE,LOCAL,OPCODE,REF
F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
.S ^TMP("OCXDIAG",$J,$O(^TMP("OCXDIAG",$J,"A"),-1)+1)=TEXT
;
G ^OCXDI02M
;
Q
;
DATA ;
;
;;R^"860.8:",100,24
;;D^ ; ..I CDT'<BDT S CREARSLT=1
;;R^"860.8:",100,25
;;D^ ; Q:+$G(CREARSLT)<1 "0^"
;;R^"860.8:",100,26
;;D^ ; Q $P(ORZ,U)_U_$P(ORZ,U,3)_" "_$P(ORZ,U,4)_" "_$P(ORZ,U,5)_" ("_$P(ORZ,U,6)_") "_$$FMTE^XLFDT(CDT,"2P")_U_$P(ORZ,U,3)
;;EOR^
;;KEY^860.8:^RECENT BARIUM ORDER STATUS
;;R^"860.8:",.01,"E"
;;D^RECENT BARIUM ORDER STATUS
;;R^"860.8:",.02,"E"
;;D^RECBARST
;;R^"860.8:",100,1
;;D^;RECBARST(DFN,HOURS) ;
;;R^"860.8:",100,2
;;D^; ;
;;R^"860.8:",100,3
;;D^; Q:'$G(DFN) 0 Q:'$G(HOURS) 0
;;R^"860.8:",100,4
;;D^; N ORDER S ORDER=$P($$RECENTBA^ORKRA(DFN,HOURS),U) Q:'$L(ORDER) 0
;;R^"860.8:",100,5
;;D^; N STATUS S STATUS=$P($$STATUS^ORQOR2(ORDER),U,2) Q:'$L(STATUS) 0
;;R^"860.8:",100,6
;;D^; Q 1_U_STATUS
;;EOR^
;;KEY^860.8:^RECENT CHOLECYSTOGRAM ORDER STATUS
;;R^"860.8:",.01,"E"
;;D^RECENT CHOLECYSTOGRAM ORDER STATUS
;;R^"860.8:",.02,"E"
;;D^RECCHST
;;R^"860.8:",100,1
;;D^;RECCHST(DFN,DAYS) ;
;;R^"860.8:",100,2
;;D^; ;
;;R^"860.8:",100,3
;;D^; Q:'$G(DFN) 0 Q:'$G(DAYS) 0
;;R^"860.8:",100,4
;;D^; N ORDER S ORDER=$P($$RECENTCH^ORKRA(DFN,DAYS),U) Q:'$L(ORDER) 0
;;R^"860.8:",100,5
;;D^; N STATUS S STATUS=$P($$STATUS^ORQOR2(ORDER),U,2) Q:'$L(STATUS) 0
;;R^"860.8:",100,6
;;D^; Q 1_U_STATUS
;;EOR^
;;EOF^OCXS(860.8)^1
;;SOF^860.6 ORDER CHECK DATA CONTEXT
;;KEY^860.6:^GENERIC HL7 MESSAGE ARRAY
;;R^"860.6:",.01,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;R^"860.6:",.02,"E"
;;D^HL7
;;R^"860.6:",1,"E"
;;D^DATA DRIVEN
;;EOR^
;;KEY^860.6:^CPRS ORDER PROTOCOL
;;R^"860.6:",.01,"E"
;;D^CPRS ORDER PROTOCOL
;;R^"860.6:",.02,"E"
;;D^OERR
;;R^"860.6:",1,"E"
;;D^DATA DRIVEN
;;EOR^
;;KEY^860.6:^DGPM PATIENT MOVEMENT PROTOCOL
;;R^"860.6:",.01,"E"
;;D^DGPM PATIENT MOVEMENT PROTOCOL
;;R^"860.6:",.02,"E"
;;D^DGPM
;;R^"860.6:",1,"E"
;;D^DATA DRIVEN
;;EOR^
;;KEY^860.6:^DATABASE LOOKUP
;;R^"860.6:",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.6:",.02,"E"
;;D^DL
;;R^"860.6:",1,"E"
;;D^PACKAGE LOOKUP
;;EOR^
;;KEY^860.6:^CPRS ORDER PRESCAN
;;R^"860.6:",.01,"E"
;;D^CPRS ORDER PRESCAN
;;R^"860.6:",.02,"E"
;;D^OEPS
;;R^"860.6:",1,"E"
;;D^DATA DRIVEN
;;EOR^
;;KEY^860.6:^TIMED ORDER CHECK
;;R^"860.6:",.01,"E"
;;D^TIMED ORDER CHECK
;;R^"860.6:",.02,"E"
;;D^TIME
;;R^"860.6:",1,"E"
;;D^TIMED EVENT
;;EOR^
;;KEY^860.6:^GENERIC QUERY
;;R^"860.6:",.01,"E"
;;D^GENERIC QUERY
;;R^"860.6:",.02,"E"
;;D^QUERY
;;R^"860.6:",1,"E"
;;D^DATA DRIVEN
;;EOR^
;;EOF^OCXS(860.6)^1
;;SOF^860.5 ORDER CHECK DATA SOURCE
;;KEY^860.5:^HL7 COMMON ORDER SEGMENT
;;R^"860.5:",.01,"E"
;;D^HL7 COMMON ORDER SEGMENT
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^HL7 OBSERVATION/RESULT SEGMENT
;;R^"860.5:",.01,"E"
;;D^HL7 OBSERVATION/RESULT SEGMENT
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^HL7 NOTES AND COMMENTS SECTION
;;R^"860.5:",.01,"E"
;;D^HL7 NOTES AND COMMENTS SECTION
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^DGPM MOVEMENT EVENTS PROTOCOL
;;R^"860.5:",.01,"E"
;;D^DGPM MOVEMENT EVENTS PROTOCOL
;;R^"860.5:",.02,"E"
;;D^DGPM PATIENT MOVEMENT PROTOCOL
;;EOR^
;;KEY^860.5:^HL7 OBSERVATION REQUEST SEGMENT
;;R^"860.5:",.01,"E"
;;D^HL7 OBSERVATION REQUEST SEGMENT
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^OERR ORDER EVENT FLAG PROTOCOL
;;R^"860.5:",.01,"E"
;;D^OERR ORDER EVENT FLAG PROTOCOL
;;R^"860.5:",.02,"E"
;;D^CPRS ORDER PROTOCOL
;;EOR^
;;KEY^860.5:^DATABASE LOOKUP
;;R^"860.5:",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.5:",.02,"E"
;;D^DATABASE LOOKUP
;;EOR^
;;KEY^860.5:^ORDER ENTRY ORDER PRESCAN
;;R^"860.5:",.01,"E"
;;D^ORDER ENTRY ORDER PRESCAN
;;R^"860.5:",.02,"E"
;;D^CPRS ORDER PRESCAN
;;EOR^
;;KEY^860.5:^HL7 DIETARY SEGMENT
;;R^"860.5:",.01,"E"
;;D^HL7 DIETARY SEGMENT
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^HL7 PHARMACY PRESCRIPTION ORDER SEGMENT
;;R^"860.5:",.01,"E"
;;D^HL7 PHARMACY PRESCRIPTION ORDER SEGMENT
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^HL7 MESSAGE HEADER
;;R^"860.5:",.01,"E"
;;D^HL7 MESSAGE HEADER
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^HL7 PATIENT ID SEGMENT
;;R^"860.5:",.01,"E"
;;D^HL7 PATIENT ID SEGMENT
;;R^"860.5:",.02,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;EOR^
;;KEY^860.5:^TIMED EVENT ORDER CHECK
;;R^"860.5:",.01,"E"
;;D^TIMED EVENT ORDER CHECK
;;R^"860.5:",.02,"E"
;;D^TIMED ORDER CHECK
;;EOR^
;;KEY^860.5:^GENERIC QUERY RESULTS
;;R^"860.5:",.01,"E"
;;D^GENERIC QUERY RESULTS
;;R^"860.5:",.02,"E"
;;D^GENERIC QUERY
;;EOR^
;;EOF^OCXS(860.5)^1
;;SOF^860.4 ORDER CHECK DATA FIELD
;;KEY^860.4:^CONTROL CODE
;;R^"860.4:",.01,"E"
;;D^CONTROL CODE
;;R^"860.4:",101,"E"
;1;
;
OCXDI02L ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC ROUTINES ;SEP 7,1999 at 10:30
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ;
+2 DO DOT^OCXDIAG
+3 ;
+4 ;
+5 KILL REMOTE,LOCAL,OPCODE,REF
+6 FOR LINE=1:1:500
SET TEXT=$PIECE($TEXT(DATA+LINE),";",2,999)
IF TEXT
QUIT
IF $LENGTH(TEXT)
Begin DoDot:1
+7 SET ^TMP("OCXDIAG",$JOB,$ORDER(^TMP("OCXDIAG",$JOB,"A"),-1)+1)=TEXT
End DoDot:1
IF QUIT
QUIT
+8 ;
+9 GOTO ^OCXDI02M
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;R^"860.8:",100,24
+3 ;;D^ ; ..I CDT'<BDT S CREARSLT=1
+4 ;;R^"860.8:",100,25
+5 ;;D^ ; Q:+$G(CREARSLT)<1 "0^"
+6 ;;R^"860.8:",100,26
+7 ;;D^ ; Q $P(ORZ,U)_U_$P(ORZ,U,3)_" "_$P(ORZ,U,4)_" "_$P(ORZ,U,5)_" ("_$P(ORZ,U,6)_") "_$$FMTE^XLFDT(CDT,"2P")_U_$P(ORZ,U,3)
+8 ;;EOR^
+9 ;;KEY^860.8:^RECENT BARIUM ORDER STATUS
+10 ;;R^"860.8:",.01,"E"
+11 ;;D^RECENT BARIUM ORDER STATUS
+12 ;;R^"860.8:",.02,"E"
+13 ;;D^RECBARST
+14 ;;R^"860.8:",100,1
+15 ;;D^;RECBARST(DFN,HOURS) ;
+16 ;;R^"860.8:",100,2
+17 ;;D^; ;
+18 ;;R^"860.8:",100,3
+19 ;;D^; Q:'$G(DFN) 0 Q:'$G(HOURS) 0
+20 ;;R^"860.8:",100,4
+21 ;;D^; N ORDER S ORDER=$P($$RECENTBA^ORKRA(DFN,HOURS),U) Q:'$L(ORDER) 0
+22 ;;R^"860.8:",100,5
+23 ;;D^; N STATUS S STATUS=$P($$STATUS^ORQOR2(ORDER),U,2) Q:'$L(STATUS) 0
+24 ;;R^"860.8:",100,6
+25 ;;D^; Q 1_U_STATUS
+26 ;;EOR^
+27 ;;KEY^860.8:^RECENT CHOLECYSTOGRAM ORDER STATUS
+28 ;;R^"860.8:",.01,"E"
+29 ;;D^RECENT CHOLECYSTOGRAM ORDER STATUS
+30 ;;R^"860.8:",.02,"E"
+31 ;;D^RECCHST
+32 ;;R^"860.8:",100,1
+33 ;;D^;RECCHST(DFN,DAYS) ;
+34 ;;R^"860.8:",100,2
+35 ;;D^; ;
+36 ;;R^"860.8:",100,3
+37 ;;D^; Q:'$G(DFN) 0 Q:'$G(DAYS) 0
+38 ;;R^"860.8:",100,4
+39 ;;D^; N ORDER S ORDER=$P($$RECENTCH^ORKRA(DFN,DAYS),U) Q:'$L(ORDER) 0
+40 ;;R^"860.8:",100,5
+41 ;;D^; N STATUS S STATUS=$P($$STATUS^ORQOR2(ORDER),U,2) Q:'$L(STATUS) 0
+42 ;;R^"860.8:",100,6
+43 ;;D^; Q 1_U_STATUS
+44 ;;EOR^
+45 ;;EOF^OCXS(860.8)^1
+46 ;;SOF^860.6 ORDER CHECK DATA CONTEXT
+47 ;;KEY^860.6:^GENERIC HL7 MESSAGE ARRAY
+48 ;;R^"860.6:",.01,"E"
+49 ;;D^GENERIC HL7 MESSAGE ARRAY
+50 ;;R^"860.6:",.02,"E"
+51 ;;D^HL7
+52 ;;R^"860.6:",1,"E"
+53 ;;D^DATA DRIVEN
+54 ;;EOR^
+55 ;;KEY^860.6:^CPRS ORDER PROTOCOL
+56 ;;R^"860.6:",.01,"E"
+57 ;;D^CPRS ORDER PROTOCOL
+58 ;;R^"860.6:",.02,"E"
+59 ;;D^OERR
+60 ;;R^"860.6:",1,"E"
+61 ;;D^DATA DRIVEN
+62 ;;EOR^
+63 ;;KEY^860.6:^DGPM PATIENT MOVEMENT PROTOCOL
+64 ;;R^"860.6:",.01,"E"
+65 ;;D^DGPM PATIENT MOVEMENT PROTOCOL
+66 ;;R^"860.6:",.02,"E"
+67 ;;D^DGPM
+68 ;;R^"860.6:",1,"E"
+69 ;;D^DATA DRIVEN
+70 ;;EOR^
+71 ;;KEY^860.6:^DATABASE LOOKUP
+72 ;;R^"860.6:",.01,"E"
+73 ;;D^DATABASE LOOKUP
+74 ;;R^"860.6:",.02,"E"
+75 ;;D^DL
+76 ;;R^"860.6:",1,"E"
+77 ;;D^PACKAGE LOOKUP
+78 ;;EOR^
+79 ;;KEY^860.6:^CPRS ORDER PRESCAN
+80 ;;R^"860.6:",.01,"E"
+81 ;;D^CPRS ORDER PRESCAN
+82 ;;R^"860.6:",.02,"E"
+83 ;;D^OEPS
+84 ;;R^"860.6:",1,"E"
+85 ;;D^DATA DRIVEN
+86 ;;EOR^
+87 ;;KEY^860.6:^TIMED ORDER CHECK
+88 ;;R^"860.6:",.01,"E"
+89 ;;D^TIMED ORDER CHECK
+90 ;;R^"860.6:",.02,"E"
+91 ;;D^TIME
+92 ;;R^"860.6:",1,"E"
+93 ;;D^TIMED EVENT
+94 ;;EOR^
+95 ;;KEY^860.6:^GENERIC QUERY
+96 ;;R^"860.6:",.01,"E"
+97 ;;D^GENERIC QUERY
+98 ;;R^"860.6:",.02,"E"
+99 ;;D^QUERY
+100 ;;R^"860.6:",1,"E"
+101 ;;D^DATA DRIVEN
+102 ;;EOR^
+103 ;;EOF^OCXS(860.6)^1
+104 ;;SOF^860.5 ORDER CHECK DATA SOURCE
+105 ;;KEY^860.5:^HL7 COMMON ORDER SEGMENT
+106 ;;R^"860.5:",.01,"E"
+107 ;;D^HL7 COMMON ORDER SEGMENT
+108 ;;R^"860.5:",.02,"E"
+109 ;;D^GENERIC HL7 MESSAGE ARRAY
+110 ;;EOR^
+111 ;;KEY^860.5:^HL7 OBSERVATION/RESULT SEGMENT
+112 ;;R^"860.5:",.01,"E"
+113 ;;D^HL7 OBSERVATION/RESULT SEGMENT
+114 ;;R^"860.5:",.02,"E"
+115 ;;D^GENERIC HL7 MESSAGE ARRAY
+116 ;;EOR^
+117 ;;KEY^860.5:^HL7 NOTES AND COMMENTS SECTION
+118 ;;R^"860.5:",.01,"E"
+119 ;;D^HL7 NOTES AND COMMENTS SECTION
+120 ;;R^"860.5:",.02,"E"
+121 ;;D^GENERIC HL7 MESSAGE ARRAY
+122 ;;EOR^
+123 ;;KEY^860.5:^DGPM MOVEMENT EVENTS PROTOCOL
+124 ;;R^"860.5:",.01,"E"
+125 ;;D^DGPM MOVEMENT EVENTS PROTOCOL
+126 ;;R^"860.5:",.02,"E"
+127 ;;D^DGPM PATIENT MOVEMENT PROTOCOL
+128 ;;EOR^
+129 ;;KEY^860.5:^HL7 OBSERVATION REQUEST SEGMENT
+130 ;;R^"860.5:",.01,"E"
+131 ;;D^HL7 OBSERVATION REQUEST SEGMENT
+132 ;;R^"860.5:",.02,"E"
+133 ;;D^GENERIC HL7 MESSAGE ARRAY
+134 ;;EOR^
+135 ;;KEY^860.5:^OERR ORDER EVENT FLAG PROTOCOL
+136 ;;R^"860.5:",.01,"E"
+137 ;;D^OERR ORDER EVENT FLAG PROTOCOL
+138 ;;R^"860.5:",.02,"E"
+139 ;;D^CPRS ORDER PROTOCOL
+140 ;;EOR^
+141 ;;KEY^860.5:^DATABASE LOOKUP
+142 ;;R^"860.5:",.01,"E"
+143 ;;D^DATABASE LOOKUP
+144 ;;R^"860.5:",.02,"E"
+145 ;;D^DATABASE LOOKUP
+146 ;;EOR^
+147 ;;KEY^860.5:^ORDER ENTRY ORDER PRESCAN
+148 ;;R^"860.5:",.01,"E"
+149 ;;D^ORDER ENTRY ORDER PRESCAN
+150 ;;R^"860.5:",.02,"E"
+151 ;;D^CPRS ORDER PRESCAN
+152 ;;EOR^
+153 ;;KEY^860.5:^HL7 DIETARY SEGMENT
+154 ;;R^"860.5:",.01,"E"
+155 ;;D^HL7 DIETARY SEGMENT
+156 ;;R^"860.5:",.02,"E"
+157 ;;D^GENERIC HL7 MESSAGE ARRAY
+158 ;;EOR^
+159 ;;KEY^860.5:^HL7 PHARMACY PRESCRIPTION ORDER SEGMENT
+160 ;;R^"860.5:",.01,"E"
+161 ;;D^HL7 PHARMACY PRESCRIPTION ORDER SEGMENT
+162 ;;R^"860.5:",.02,"E"
+163 ;;D^GENERIC HL7 MESSAGE ARRAY
+164 ;;EOR^
+165 ;;KEY^860.5:^HL7 MESSAGE HEADER
+166 ;;R^"860.5:",.01,"E"
+167 ;;D^HL7 MESSAGE HEADER
+168 ;;R^"860.5:",.02,"E"
+169 ;;D^GENERIC HL7 MESSAGE ARRAY
+170 ;;EOR^
+171 ;;KEY^860.5:^HL7 PATIENT ID SEGMENT
+172 ;;R^"860.5:",.01,"E"
+173 ;;D^HL7 PATIENT ID SEGMENT
+174 ;;R^"860.5:",.02,"E"
+175 ;;D^GENERIC HL7 MESSAGE ARRAY
+176 ;;EOR^
+177 ;;KEY^860.5:^TIMED EVENT ORDER CHECK
+178 ;;R^"860.5:",.01,"E"
+179 ;;D^TIMED EVENT ORDER CHECK
+180 ;;R^"860.5:",.02,"E"
+181 ;;D^TIMED ORDER CHECK
+182 ;;EOR^
+183 ;;KEY^860.5:^GENERIC QUERY RESULTS
+184 ;;R^"860.5:",.01,"E"
+185 ;;D^GENERIC QUERY RESULTS
+186 ;;R^"860.5:",.02,"E"
+187 ;;D^GENERIC QUERY
+188 ;;EOR^
+189 ;;EOF^OCXS(860.5)^1
+190 ;;SOF^860.4 ORDER CHECK DATA FIELD
+191 ;;KEY^860.4:^CONTROL CODE
+192 ;;R^"860.4:",.01,"E"
+193 ;;D^CONTROL CODE
+194 ;;R^"860.4:",101,"E"
+195 ;1;
+196 ;