OCXDI02C ;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 ^OCXDI02D
;
Q
;
DATA ;
;
;;D^ORDER CHECK DATA CONTEXT
;;R^"863:",.02,"E"
;;D^860.6
;;EOR^
;;EOF^OCXS(863)^1
;;SOF^860.9 ORDER CHECK NATIONAL TERM
;;KEY^860.9:^SERUM CREATININE
;;R^"860.9:",.01,"E"
;;D^SERUM CREATININE
;;R^"860.9:",.02,"E"
;;D^60
;;EOR^
;;KEY^860.9:^SERUM UREA NITROGEN
;;R^"860.9:",.01,"E"
;;D^SERUM UREA NITROGEN
;;R^"860.9:",.02,"E"
;;D^60
;;EOR^
;;KEY^860.9:^DNR
;;R^"860.9:",.01,"E"
;;D^DNR
;;R^"860.9:",.02,"E"
;;D^101.43
;;EOR^
;;KEY^860.9:^PROTHROMBIN TIME
;;R^"860.9:",.01,"E"
;;D^PROTHROMBIN TIME
;;R^"860.9:",.02,"E"
;;D^101.43
;;EOR^
;;KEY^860.9:^NPO
;;R^"860.9:",.01,"E"
;;D^NPO
;;R^"860.9:",.02,"E"
;;D^101.43
;;EOR^
;;KEY^860.9:^SERUM SPECIMEN
;;R^"860.9:",.01,"E"
;;D^SERUM SPECIMEN
;;R^"860.9:",.02,"E"
;;D^61
;;EOR^
;;KEY^860.9:^PARTIAL THROMBOPLASTIN TIME
;;R^"860.9:",.01,"E"
;;D^PARTIAL THROMBOPLASTIN TIME
;;R^"860.9:",.02,"E"
;;D^101.43
;;EOR^
;;KEY^860.9:^ANGIOGRAM (PERIPHERAL)
;;R^"860.9:",.01,"E"
;;D^ANGIOGRAM (PERIPHERAL)
;;R^"860.9:",.02,"E"
;;D^101.43
;;EOR^
;;KEY^860.9:^WBC
;;R^"860.9:",.01,"E"
;;D^WBC
;;R^"860.9:",.02,"E"
;;D^60
;;EOR^
;;KEY^860.9:^BLOOD SPECIMEN
;;R^"860.9:",.01,"E"
;;D^BLOOD SPECIMEN
;;R^"860.9:",.02,"E"
;;D^61
;;EOR^
;;KEY^860.9:^ONE TIME MED
;;R^"860.9:",.01,"E"
;;D^ONE TIME MED
;;R^"860.9:",.02,"E"
;;D^51.1
;;R^"860.9:",2,"E"
;;D^I $E($P(^(0),U,4),1,2)="PS"
;;EOR^
;;EOF^OCXS(860.9)^1
;;SOF^860.8 ORDER CHECK COMPILER FUNCTIONS
;;KEY^860.8:^CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
;;R^"860.8:",.01,"E"
;;D^CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
;;R^"860.8:",.02,"E"
;;D^DT2INT
;;R^"860.8:",1,1
;;D^ ;DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
;;R^"860.8:",1,2
;;D^ ; ; By taking the Years, Months, Days, Hours and Minutes converting
;;R^"860.8:",1,3
;;D^ ; ; Them into Seconds and then adding them all together into one big integer
;;R^"860.8:",100,1
;;D^ ;DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
;;R^"860.8:",100,2
;;D^ ; ; By taking the Years, Months, Days, Hours and Minutes converting
;;R^"860.8:",100,3
;;D^ ; ; Them into Seconds and then adding them all together into one big integer
;;R^"860.8:",100,4
;;D^ ; ;
;;R^"860.8:",100,5
;;D^ ; Q:'$L($G(OCXDT)) ""
;;R^"860.8:",100,6
;;D^ ; N OCXVAL S OCXVAL=0
;;R^"860.8:",100,7
;;D^ ; I (OCXDT?5N1","5N) Q (OCXDT*86400+$P(OCXDT,",",2)) ; $H FORMAT
;;R^"860.8:",100,8
;;D^ ; I ($E(OCXDT,1)="T") D Q OCXVAL ; TODAY
;;R^"860.8:",100,9
;;D^ ; .S OCXVAL=$H*86400
;;R^"860.8:",100,10
;;D^ ; .S:(OCXDT["+") OCXVAL=OCXVAL+($P(OCXDT,"+",2)*86400)
;;R^"860.8:",100,11
;;D^ ; .S:(OCXDT["-") OCXVAL=OCXVAL-($P(OCXDT,"-",2)*86400)
;;R^"860.8:",100,12
;;D^ ; I ($E(OCXDT,1)="N") D Q OCXVAL ; NOW
;;R^"860.8:",100,13
;;D^ ; .S OCXVAL=$H*86400+$P($H,",",2)
;;R^"860.8:",100,14
;;D^ ; .S:(OCXDT["+") OCXVAL=OCXVAL+($P(OCXDT,"+",2)*86400)
;;R^"860.8:",100,15
;;D^ ; .S:(OCXDT["-") OCXVAL=OCXVAL-($P(OCXDT,"-",2)*86400)
;;R^"860.8:",100,16
;;D^ ; I +OCXDT,($L(OCXDT\1)=7) S OCXDT=($E(OCXDT,1,3)+1700)_$E(OCXDT,4,7)_$S((OCXDT["."):$P(OCXDT,".",2),1:"") ; CONVERT INTERNAL FILEMAN FORMAT TO HL7 FORMAT
;;R^"860.8:",100,17
;;D^ ; I +OCXDT,($L(OCXDT\1)>7) D Q OCXVAL ; HL7 FORMAT
;;R^"860.8:",100,18
;;D^ ; .S OCXVAL=($E(OCXDT,1,4)-1841*365)+($E(OCXDT,1,4)\4-460)-($E(OCXDT,1,4)\200-9) ; ADJUST FOR LEAP YEARS
;;R^"860.8:",100,19
;;D^ ; .S OCXVAL=OCXVAL+$P("000^031^059^090^120^151^181^212^243^273^304^334",U,$E(OCXDT,5,6)) ; MONTHS TO DAYS
;;R^"860.8:",100,20
;;D^ ; .S OCXVAL=OCXVAL+$E(OCXDT,7,8)-1 ; ADD DAYS
;;R^"860.8:",100,21
;;D^ ; .S OCXVAL=OCXVAL*86400 ; CONVERT TO SECONDS
;;R^"860.8:",100,22
;;D^ ; .S OCXVAL=OCXVAL+($E(OCXDT,9,10)*3600)+($E(OCXDT,11,12)*60)+$E(OCXDT,13,14) ; ADD TIME
;;R^"860.8:",100,23
;;D^ ; Q OCXDT
;;R^"860.8:",100,24
;;D^ ; ;
;;EOR^
;;KEY^860.8:^PTRNODE
;;R^"860.8:",.01,"E"
;;D^PTRNODE
;;R^"860.8:",.02,"E"
;;D^PTRNODE
;;R^"860.8:",1,1
;;D^ ;PTRNODE(OCXFIL,OCXKEY,OCXNODE) ; This Local Extrinsic Function returns the specified Node (OCXNODE)
;;R^"860.8:",1,2
;;D^ ; ; From the specified record (OCXKEY) in a file (OCXFIL).
;;R^"860.8:",1,3
;;D^ ; ;
;;R^"860.8:",100,1
;;D^ ;PTRNODE(OCXFIL,OCXKEY,OCXNODE) ; This Local Extrinsic Function returns the specified Node (OCXNODE)
;;R^"860.8:",100,2
;;D^ ; ; From the specified record (OCXKEY) in a file (OCXFIL).
;;R^"860.8:",100,3
;;D^ ; ;
;;R^"860.8:",100,4
;;D^ ; ;
;;R^"860.8:",100,5
;;D^ ; N OCXDATA,OCXSUB,OCXGL S OCXDATA=0
;;R^"860.8:",100,6
;;D^ ; Q:'$L(OCXFIL) "" Q:'$L($G(OCXKEY)) "" S:'$L($G(OCXNODE)) OCXNODE=0
;1;
;
OCXDI02C ;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 ^OCXDI02D
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;D^ORDER CHECK DATA CONTEXT
+3 ;;R^"863:",.02,"E"
+4 ;;D^860.6
+5 ;;EOR^
+6 ;;EOF^OCXS(863)^1
+7 ;;SOF^860.9 ORDER CHECK NATIONAL TERM
+8 ;;KEY^860.9:^SERUM CREATININE
+9 ;;R^"860.9:",.01,"E"
+10 ;;D^SERUM CREATININE
+11 ;;R^"860.9:",.02,"E"
+12 ;;D^60
+13 ;;EOR^
+14 ;;KEY^860.9:^SERUM UREA NITROGEN
+15 ;;R^"860.9:",.01,"E"
+16 ;;D^SERUM UREA NITROGEN
+17 ;;R^"860.9:",.02,"E"
+18 ;;D^60
+19 ;;EOR^
+20 ;;KEY^860.9:^DNR
+21 ;;R^"860.9:",.01,"E"
+22 ;;D^DNR
+23 ;;R^"860.9:",.02,"E"
+24 ;;D^101.43
+25 ;;EOR^
+26 ;;KEY^860.9:^PROTHROMBIN TIME
+27 ;;R^"860.9:",.01,"E"
+28 ;;D^PROTHROMBIN TIME
+29 ;;R^"860.9:",.02,"E"
+30 ;;D^101.43
+31 ;;EOR^
+32 ;;KEY^860.9:^NPO
+33 ;;R^"860.9:",.01,"E"
+34 ;;D^NPO
+35 ;;R^"860.9:",.02,"E"
+36 ;;D^101.43
+37 ;;EOR^
+38 ;;KEY^860.9:^SERUM SPECIMEN
+39 ;;R^"860.9:",.01,"E"
+40 ;;D^SERUM SPECIMEN
+41 ;;R^"860.9:",.02,"E"
+42 ;;D^61
+43 ;;EOR^
+44 ;;KEY^860.9:^PARTIAL THROMBOPLASTIN TIME
+45 ;;R^"860.9:",.01,"E"
+46 ;;D^PARTIAL THROMBOPLASTIN TIME
+47 ;;R^"860.9:",.02,"E"
+48 ;;D^101.43
+49 ;;EOR^
+50 ;;KEY^860.9:^ANGIOGRAM (PERIPHERAL)
+51 ;;R^"860.9:",.01,"E"
+52 ;;D^ANGIOGRAM (PERIPHERAL)
+53 ;;R^"860.9:",.02,"E"
+54 ;;D^101.43
+55 ;;EOR^
+56 ;;KEY^860.9:^WBC
+57 ;;R^"860.9:",.01,"E"
+58 ;;D^WBC
+59 ;;R^"860.9:",.02,"E"
+60 ;;D^60
+61 ;;EOR^
+62 ;;KEY^860.9:^BLOOD SPECIMEN
+63 ;;R^"860.9:",.01,"E"
+64 ;;D^BLOOD SPECIMEN
+65 ;;R^"860.9:",.02,"E"
+66 ;;D^61
+67 ;;EOR^
+68 ;;KEY^860.9:^ONE TIME MED
+69 ;;R^"860.9:",.01,"E"
+70 ;;D^ONE TIME MED
+71 ;;R^"860.9:",.02,"E"
+72 ;;D^51.1
+73 ;;R^"860.9:",2,"E"
+74 ;;D^I $E($P(^(0),U,4),1,2)="PS"
+75 ;;EOR^
+76 ;;EOF^OCXS(860.9)^1
+77 ;;SOF^860.8 ORDER CHECK COMPILER FUNCTIONS
+78 ;;KEY^860.8:^CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
+79 ;;R^"860.8:",.01,"E"
+80 ;;D^CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
+81 ;;R^"860.8:",.02,"E"
+82 ;;D^DT2INT
+83 ;;R^"860.8:",1,1
+84 ;;D^ ;DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
+85 ;;R^"860.8:",1,2
+86 ;;D^ ; ; By taking the Years, Months, Days, Hours and Minutes converting
+87 ;;R^"860.8:",1,3
+88 ;;D^ ; ; Them into Seconds and then adding them all together into one big integer
+89 ;;R^"860.8:",100,1
+90 ;;D^ ;DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
+91 ;;R^"860.8:",100,2
+92 ;;D^ ; ; By taking the Years, Months, Days, Hours and Minutes converting
+93 ;;R^"860.8:",100,3
+94 ;;D^ ; ; Them into Seconds and then adding them all together into one big integer
+95 ;;R^"860.8:",100,4
+96 ;;D^ ; ;
+97 ;;R^"860.8:",100,5
+98 ;;D^ ; Q:'$L($G(OCXDT)) ""
+99 ;;R^"860.8:",100,6
+100 ;;D^ ; N OCXVAL S OCXVAL=0
+101 ;;R^"860.8:",100,7
+102 ;;D^ ; I (OCXDT?5N1","5N) Q (OCXDT*86400+$P(OCXDT,",",2)) ; $H FORMAT
+103 ;;R^"860.8:",100,8
+104 ;;D^ ; I ($E(OCXDT,1)="T") D Q OCXVAL ; TODAY
+105 ;;R^"860.8:",100,9
+106 ;;D^ ; .S OCXVAL=$H*86400
+107 ;;R^"860.8:",100,10
+108 ;;D^ ; .S:(OCXDT["+") OCXVAL=OCXVAL+($P(OCXDT,"+",2)*86400)
+109 ;;R^"860.8:",100,11
+110 ;;D^ ; .S:(OCXDT["-") OCXVAL=OCXVAL-($P(OCXDT,"-",2)*86400)
+111 ;;R^"860.8:",100,12
+112 ;;D^ ; I ($E(OCXDT,1)="N") D Q OCXVAL ; NOW
+113 ;;R^"860.8:",100,13
+114 ;;D^ ; .S OCXVAL=$H*86400+$P($H,",",2)
+115 ;;R^"860.8:",100,14
+116 ;;D^ ; .S:(OCXDT["+") OCXVAL=OCXVAL+($P(OCXDT,"+",2)*86400)
+117 ;;R^"860.8:",100,15
+118 ;;D^ ; .S:(OCXDT["-") OCXVAL=OCXVAL-($P(OCXDT,"-",2)*86400)
+119 ;;R^"860.8:",100,16
+120 ;;D^ ; I +OCXDT,($L(OCXDT\1)=7) S OCXDT=($E(OCXDT,1,3)+1700)_$E(OCXDT,4,7)_$S((OCXDT["."):$P(OCXDT,".",2),1:"") ; CONVERT INTERNAL FILEMAN FORMAT TO HL7 FORMAT
+121 ;;R^"860.8:",100,17
+122 ;;D^ ; I +OCXDT,($L(OCXDT\1)>7) D Q OCXVAL ; HL7 FORMAT
+123 ;;R^"860.8:",100,18
+124 ;;D^ ; .S OCXVAL=($E(OCXDT,1,4)-1841*365)+($E(OCXDT,1,4)\4-460)-($E(OCXDT,1,4)\200-9) ; ADJUST FOR LEAP YEARS
+125 ;;R^"860.8:",100,19
+126 ;;D^ ; .S OCXVAL=OCXVAL+$P("000^031^059^090^120^151^181^212^243^273^304^334",U,$E(OCXDT,5,6)) ; MONTHS TO DAYS
+127 ;;R^"860.8:",100,20
+128 ;;D^ ; .S OCXVAL=OCXVAL+$E(OCXDT,7,8)-1 ; ADD DAYS
+129 ;;R^"860.8:",100,21
+130 ;;D^ ; .S OCXVAL=OCXVAL*86400 ; CONVERT TO SECONDS
+131 ;;R^"860.8:",100,22
+132 ;;D^ ; .S OCXVAL=OCXVAL+($E(OCXDT,9,10)*3600)+($E(OCXDT,11,12)*60)+$E(OCXDT,13,14) ; ADD TIME
+133 ;;R^"860.8:",100,23
+134 ;;D^ ; Q OCXDT
+135 ;;R^"860.8:",100,24
+136 ;;D^ ; ;
+137 ;;EOR^
+138 ;;KEY^860.8:^PTRNODE
+139 ;;R^"860.8:",.01,"E"
+140 ;;D^PTRNODE
+141 ;;R^"860.8:",.02,"E"
+142 ;;D^PTRNODE
+143 ;;R^"860.8:",1,1
+144 ;;D^ ;PTRNODE(OCXFIL,OCXKEY,OCXNODE) ; This Local Extrinsic Function returns the specified Node (OCXNODE)
+145 ;;R^"860.8:",1,2
+146 ;;D^ ; ; From the specified record (OCXKEY) in a file (OCXFIL).
+147 ;;R^"860.8:",1,3
+148 ;;D^ ; ;
+149 ;;R^"860.8:",100,1
+150 ;;D^ ;PTRNODE(OCXFIL,OCXKEY,OCXNODE) ; This Local Extrinsic Function returns the specified Node (OCXNODE)
+151 ;;R^"860.8:",100,2
+152 ;;D^ ; ; From the specified record (OCXKEY) in a file (OCXFIL).
+153 ;;R^"860.8:",100,3
+154 ;;D^ ; ;
+155 ;;R^"860.8:",100,4
+156 ;;D^ ; ;
+157 ;;R^"860.8:",100,5
+158 ;;D^ ; N OCXDATA,OCXSUB,OCXGL S OCXDATA=0
+159 ;;R^"860.8:",100,6
+160 ;;D^ ; Q:'$L(OCXFIL) "" Q:'$L($G(OCXKEY)) "" S:'$L($G(OCXNODE)) OCXNODE=0
+161 ;1;
+162 ;