OCXDI02S ;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 ^OCXDI02T
;
Q
;
DATA ;
;
;;D^NEW PATIENT MOVEMENT
;;R^"860.4:",101,"E"
;;D^BOOLEAN
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.NEW_MOVEMENT
;;EOR^
;;KEY^860.4:^GLUCOPHAGE MEDS
;;R^"860.4:",.01,"E"
;;D^GLUCOPHAGE MEDS
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^LOCAL GLUCOPHAGE MEDS
;;EOR^
;;KEY^860.4:^PATIENT CURRENTLY ON LITHIUM FLAG
;;R^"860.4:",.01,"E"
;;D^PATIENT CURRENTLY ON LITHIUM FLAG
;;R^"860.4:",101,"E"
;;D^BOOLEAN
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.TAKING_LITHIUM
;;EOR^
;;KEY^860.4:^DATE OF LAST LITHIUM LAB TEST
;;R^"860.4:",.01,"E"
;;D^DATE OF LAST LITHIUM LAB TEST
;;R^"860.4:",101,"E"
;;D^DATE/TIME
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.DATE_LAST_LITHIUM_TEST
;;EOR^
;;KEY^860.4:^LITHIUM LAB TEST NID
;;R^"860.4:",.01,"E"
;;D^LITHIUM LAB TEST NID
;;R^"860.4:",101,"E"
;;D^FREE TEXT
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^LITHIUM LAB TEST NID
;;EOR^
;;KEY^860.4:^PATIENT CURRENTLY ON GLUCOPHAGE
;;R^"860.4:",.01,"E"
;;D^PATIENT CURRENTLY ON GLUCOPHAGE
;;R^"860.4:",101,"E"
;;D^BOOLEAN
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.TAKING_GLUCOPHAGE
;;EOR^
;;KEY^860.4:^PATIENT HAS DIABETES
;;R^"860.4:",.01,"E"
;;D^PATIENT HAS DIABETES
;;R^"860.4:",101,"E"
;;D^BOOLEAN
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.HAS_DIABETES
;;EOR^
;;KEY^860.4:^ORDER TEXT (51 CHARS)
;;R^"860.4:",.01,"E"
;;D^ORDER TEXT (51 CHARS)
;;R^"860.4:",101,"E"
;;D^FREE TEXT
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.ORDER TEXT (51 CHARS)
;;EOR^
;;KEY^860.4:^DATE OF LAST LITHIUM LAB ORDER
;;R^"860.4:",.01,"E"
;;D^DATE OF LAST LITHIUM LAB ORDER
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.DATE_LAST_LITH_ORDER
;;EOR^
;;KEY^860.4:^LITHIUM LAB TEST OI IEN
;;R^"860.4:",.01,"E"
;;D^LITHIUM LAB TEST OI IEN
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^LITHIUM LAB TEST OI IEN
;;EOR^
;;KEY^860.4:^PATIENT MOVEMENT DATE PREVIOUS
;;R^"860.4:",.01,"E"
;;D^PATIENT MOVEMENT DATE PREVIOUS
;;R^"860.4:","860.41:3",.01,"E"
;;D^DGPM PATIENT MOVEMENT PROTOCOL
;;R^"860.4:","860.41:3",.02,"E"
;;D^DGPM MOVEMENT EVENTS PROTOCOL
;;R^"860.4:","860.41:3",1,"E"
;;D^PATIENT.MOVE_DATE_PREV
;;EOR^
;;KEY^860.4:^NUMBER OF MEDS
;;R^"860.4:",.01,"E"
;;D^NUMBER OF MEDS
;;R^"860.4:",101,"E"
;;D^NUMERIC
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^NUMMEDS
;;EOR^
;;KEY^860.4:^RECENT SERUM CREATININE RESULT
;;R^"860.4:",.01,"E"
;;D^RECENT SERUM CREATININE RESULT
;;R^"860.4:",101,"E"
;;D^NUMERIC
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^PATIENT.REC_CREATININE_RESULT
;;EOR^
;;KEY^860.4:^ENTERED BY
;;R^"860.4:",.01,"E"
;;D^ENTERED BY
;;R^"860.4:",101,"E"
;;D^FREE TEXT
;;R^"860.4:","860.41:1",.01,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;R^"860.4:","860.41:1",.02,"E"
;;D^HL7 COMMON ORDER SEGMENT
;;R^"860.4:","860.41:1",1,"E"
;;D^HL7_ENTERED BY
;;EOR^
;;KEY^860.4:^ORDERED BY
;;R^"860.4:",.01,"E"
;;D^ORDERED BY
;;R^"860.4:",101,"E"
;;D^FREE TEXT
;;R^"860.4:","860.41:4",.01,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",.02,"E"
;;D^DATABASE LOOKUP
;;R^"860.4:","860.41:4",1,"E"
;;D^ORDER.ORDERED BY
;;EOR^
;;KEY^860.4:^LAB TEST ID
;;R^"860.4:",.01,"E"
;;D^LAB TEST ID
;;R^"860.4:",101,"E"
;;D^NUMERIC
;;R^"860.4:","860.41:1",.01,"E"
;;D^GENERIC HL7 MESSAGE ARRAY
;;R^"860.4:","860.41:1",.02,"E"
;;D^HL7 OBSERVATION/RESULT SEGMENT
;;R^"860.4:","860.41:1",1,"E"
;;D^PATIENT.HL7_LAB_LOCAL_ID
;;EOR^
;;KEY^860.4:^LAB TEST PRINT NAME
;;R^"860.4:",.01,"E"
;;D^LAB TEST PRINT NAME
;;R^"860.4:",101,"E"
;;D^FREE TEXT
;;R^"860.4:","860.41:4",.01,"E"
;1;
;
OCXDI02S ;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 ^OCXDI02T
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;D^NEW PATIENT MOVEMENT
+3 ;;R^"860.4:",101,"E"
+4 ;;D^BOOLEAN
+5 ;;R^"860.4:","860.41:4",.01,"E"
+6 ;;D^DATABASE LOOKUP
+7 ;;R^"860.4:","860.41:4",.02,"E"
+8 ;;D^DATABASE LOOKUP
+9 ;;R^"860.4:","860.41:4",1,"E"
+10 ;;D^PATIENT.NEW_MOVEMENT
+11 ;;EOR^
+12 ;;KEY^860.4:^GLUCOPHAGE MEDS
+13 ;;R^"860.4:",.01,"E"
+14 ;;D^GLUCOPHAGE MEDS
+15 ;;R^"860.4:","860.41:4",.01,"E"
+16 ;;D^DATABASE LOOKUP
+17 ;;R^"860.4:","860.41:4",.02,"E"
+18 ;;D^DATABASE LOOKUP
+19 ;;R^"860.4:","860.41:4",1,"E"
+20 ;;D^LOCAL GLUCOPHAGE MEDS
+21 ;;EOR^
+22 ;;KEY^860.4:^PATIENT CURRENTLY ON LITHIUM FLAG
+23 ;;R^"860.4:",.01,"E"
+24 ;;D^PATIENT CURRENTLY ON LITHIUM FLAG
+25 ;;R^"860.4:",101,"E"
+26 ;;D^BOOLEAN
+27 ;;R^"860.4:","860.41:4",.01,"E"
+28 ;;D^DATABASE LOOKUP
+29 ;;R^"860.4:","860.41:4",.02,"E"
+30 ;;D^DATABASE LOOKUP
+31 ;;R^"860.4:","860.41:4",1,"E"
+32 ;;D^PATIENT.TAKING_LITHIUM
+33 ;;EOR^
+34 ;;KEY^860.4:^DATE OF LAST LITHIUM LAB TEST
+35 ;;R^"860.4:",.01,"E"
+36 ;;D^DATE OF LAST LITHIUM LAB TEST
+37 ;;R^"860.4:",101,"E"
+38 ;;D^DATE/TIME
+39 ;;R^"860.4:","860.41:4",.01,"E"
+40 ;;D^DATABASE LOOKUP
+41 ;;R^"860.4:","860.41:4",.02,"E"
+42 ;;D^DATABASE LOOKUP
+43 ;;R^"860.4:","860.41:4",1,"E"
+44 ;;D^PATIENT.DATE_LAST_LITHIUM_TEST
+45 ;;EOR^
+46 ;;KEY^860.4:^LITHIUM LAB TEST NID
+47 ;;R^"860.4:",.01,"E"
+48 ;;D^LITHIUM LAB TEST NID
+49 ;;R^"860.4:",101,"E"
+50 ;;D^FREE TEXT
+51 ;;R^"860.4:","860.41:4",.01,"E"
+52 ;;D^DATABASE LOOKUP
+53 ;;R^"860.4:","860.41:4",.02,"E"
+54 ;;D^DATABASE LOOKUP
+55 ;;R^"860.4:","860.41:4",1,"E"
+56 ;;D^LITHIUM LAB TEST NID
+57 ;;EOR^
+58 ;;KEY^860.4:^PATIENT CURRENTLY ON GLUCOPHAGE
+59 ;;R^"860.4:",.01,"E"
+60 ;;D^PATIENT CURRENTLY ON GLUCOPHAGE
+61 ;;R^"860.4:",101,"E"
+62 ;;D^BOOLEAN
+63 ;;R^"860.4:","860.41:4",.01,"E"
+64 ;;D^DATABASE LOOKUP
+65 ;;R^"860.4:","860.41:4",.02,"E"
+66 ;;D^DATABASE LOOKUP
+67 ;;R^"860.4:","860.41:4",1,"E"
+68 ;;D^PATIENT.TAKING_GLUCOPHAGE
+69 ;;EOR^
+70 ;;KEY^860.4:^PATIENT HAS DIABETES
+71 ;;R^"860.4:",.01,"E"
+72 ;;D^PATIENT HAS DIABETES
+73 ;;R^"860.4:",101,"E"
+74 ;;D^BOOLEAN
+75 ;;R^"860.4:","860.41:4",.01,"E"
+76 ;;D^DATABASE LOOKUP
+77 ;;R^"860.4:","860.41:4",.02,"E"
+78 ;;D^DATABASE LOOKUP
+79 ;;R^"860.4:","860.41:4",1,"E"
+80 ;;D^PATIENT.HAS_DIABETES
+81 ;;EOR^
+82 ;;KEY^860.4:^ORDER TEXT (51 CHARS)
+83 ;;R^"860.4:",.01,"E"
+84 ;;D^ORDER TEXT (51 CHARS)
+85 ;;R^"860.4:",101,"E"
+86 ;;D^FREE TEXT
+87 ;;R^"860.4:","860.41:4",.01,"E"
+88 ;;D^DATABASE LOOKUP
+89 ;;R^"860.4:","860.41:4",.02,"E"
+90 ;;D^DATABASE LOOKUP
+91 ;;R^"860.4:","860.41:4",1,"E"
+92 ;;D^PATIENT.ORDER TEXT (51 CHARS)
+93 ;;EOR^
+94 ;;KEY^860.4:^DATE OF LAST LITHIUM LAB ORDER
+95 ;;R^"860.4:",.01,"E"
+96 ;;D^DATE OF LAST LITHIUM LAB ORDER
+97 ;;R^"860.4:","860.41:4",.01,"E"
+98 ;;D^DATABASE LOOKUP
+99 ;;R^"860.4:","860.41:4",.02,"E"
+100 ;;D^DATABASE LOOKUP
+101 ;;R^"860.4:","860.41:4",1,"E"
+102 ;;D^PATIENT.DATE_LAST_LITH_ORDER
+103 ;;EOR^
+104 ;;KEY^860.4:^LITHIUM LAB TEST OI IEN
+105 ;;R^"860.4:",.01,"E"
+106 ;;D^LITHIUM LAB TEST OI IEN
+107 ;;R^"860.4:","860.41:4",.01,"E"
+108 ;;D^DATABASE LOOKUP
+109 ;;R^"860.4:","860.41:4",.02,"E"
+110 ;;D^DATABASE LOOKUP
+111 ;;R^"860.4:","860.41:4",1,"E"
+112 ;;D^LITHIUM LAB TEST OI IEN
+113 ;;EOR^
+114 ;;KEY^860.4:^PATIENT MOVEMENT DATE PREVIOUS
+115 ;;R^"860.4:",.01,"E"
+116 ;;D^PATIENT MOVEMENT DATE PREVIOUS
+117 ;;R^"860.4:","860.41:3",.01,"E"
+118 ;;D^DGPM PATIENT MOVEMENT PROTOCOL
+119 ;;R^"860.4:","860.41:3",.02,"E"
+120 ;;D^DGPM MOVEMENT EVENTS PROTOCOL
+121 ;;R^"860.4:","860.41:3",1,"E"
+122 ;;D^PATIENT.MOVE_DATE_PREV
+123 ;;EOR^
+124 ;;KEY^860.4:^NUMBER OF MEDS
+125 ;;R^"860.4:",.01,"E"
+126 ;;D^NUMBER OF MEDS
+127 ;;R^"860.4:",101,"E"
+128 ;;D^NUMERIC
+129 ;;R^"860.4:","860.41:4",.01,"E"
+130 ;;D^DATABASE LOOKUP
+131 ;;R^"860.4:","860.41:4",.02,"E"
+132 ;;D^DATABASE LOOKUP
+133 ;;R^"860.4:","860.41:4",1,"E"
+134 ;;D^NUMMEDS
+135 ;;EOR^
+136 ;;KEY^860.4:^RECENT SERUM CREATININE RESULT
+137 ;;R^"860.4:",.01,"E"
+138 ;;D^RECENT SERUM CREATININE RESULT
+139 ;;R^"860.4:",101,"E"
+140 ;;D^NUMERIC
+141 ;;R^"860.4:","860.41:4",.01,"E"
+142 ;;D^DATABASE LOOKUP
+143 ;;R^"860.4:","860.41:4",.02,"E"
+144 ;;D^DATABASE LOOKUP
+145 ;;R^"860.4:","860.41:4",1,"E"
+146 ;;D^PATIENT.REC_CREATININE_RESULT
+147 ;;EOR^
+148 ;;KEY^860.4:^ENTERED BY
+149 ;;R^"860.4:",.01,"E"
+150 ;;D^ENTERED BY
+151 ;;R^"860.4:",101,"E"
+152 ;;D^FREE TEXT
+153 ;;R^"860.4:","860.41:1",.01,"E"
+154 ;;D^GENERIC HL7 MESSAGE ARRAY
+155 ;;R^"860.4:","860.41:1",.02,"E"
+156 ;;D^HL7 COMMON ORDER SEGMENT
+157 ;;R^"860.4:","860.41:1",1,"E"
+158 ;;D^HL7_ENTERED BY
+159 ;;EOR^
+160 ;;KEY^860.4:^ORDERED BY
+161 ;;R^"860.4:",.01,"E"
+162 ;;D^ORDERED BY
+163 ;;R^"860.4:",101,"E"
+164 ;;D^FREE TEXT
+165 ;;R^"860.4:","860.41:4",.01,"E"
+166 ;;D^DATABASE LOOKUP
+167 ;;R^"860.4:","860.41:4",.02,"E"
+168 ;;D^DATABASE LOOKUP
+169 ;;R^"860.4:","860.41:4",1,"E"
+170 ;;D^ORDER.ORDERED BY
+171 ;;EOR^
+172 ;;KEY^860.4:^LAB TEST ID
+173 ;;R^"860.4:",.01,"E"
+174 ;;D^LAB TEST ID
+175 ;;R^"860.4:",101,"E"
+176 ;;D^NUMERIC
+177 ;;R^"860.4:","860.41:1",.01,"E"
+178 ;;D^GENERIC HL7 MESSAGE ARRAY
+179 ;;R^"860.4:","860.41:1",.02,"E"
+180 ;;D^HL7 OBSERVATION/RESULT SEGMENT
+181 ;;R^"860.4:","860.41:1",1,"E"
+182 ;;D^PATIENT.HL7_LAB_LOCAL_ID
+183 ;;EOR^
+184 ;;KEY^860.4:^LAB TEST PRINT NAME
+185 ;;R^"860.4:",.01,"E"
+186 ;;D^LAB TEST PRINT NAME
+187 ;;R^"860.4:",101,"E"
+188 ;;D^FREE TEXT
+189 ;;R^"860.4:","860.41:4",.01,"E"
+190 ;1;
+191 ;