[613] | 1 | OCXDI02C ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC ROUTINES ;SEP 7,1999 at 10:30
|
---|
| 2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
|
---|
| 3 | ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
|
---|
| 4 | ;
|
---|
| 5 | S ;
|
---|
| 6 | ;
|
---|
| 7 | D DOT^OCXDIAG
|
---|
| 8 | ;
|
---|
| 9 | ;
|
---|
| 10 | K REMOTE,LOCAL,OPCODE,REF
|
---|
| 11 | F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
|
---|
| 12 | .S ^TMP("OCXDIAG",$J,$O(^TMP("OCXDIAG",$J,"A"),-1)+1)=TEXT
|
---|
| 13 | ;
|
---|
| 14 | G ^OCXDI02D
|
---|
| 15 | ;
|
---|
| 16 | Q
|
---|
| 17 | ;
|
---|
| 18 | DATA ;
|
---|
| 19 | ;
|
---|
| 20 | ;;D^ORDER CHECK DATA CONTEXT
|
---|
| 21 | ;;R^"863:",.02,"E"
|
---|
| 22 | ;;D^860.6
|
---|
| 23 | ;;EOR^
|
---|
| 24 | ;;EOF^OCXS(863)^1
|
---|
| 25 | ;;SOF^860.9 ORDER CHECK NATIONAL TERM
|
---|
| 26 | ;;KEY^860.9:^SERUM CREATININE
|
---|
| 27 | ;;R^"860.9:",.01,"E"
|
---|
| 28 | ;;D^SERUM CREATININE
|
---|
| 29 | ;;R^"860.9:",.02,"E"
|
---|
| 30 | ;;D^60
|
---|
| 31 | ;;EOR^
|
---|
| 32 | ;;KEY^860.9:^SERUM UREA NITROGEN
|
---|
| 33 | ;;R^"860.9:",.01,"E"
|
---|
| 34 | ;;D^SERUM UREA NITROGEN
|
---|
| 35 | ;;R^"860.9:",.02,"E"
|
---|
| 36 | ;;D^60
|
---|
| 37 | ;;EOR^
|
---|
| 38 | ;;KEY^860.9:^DNR
|
---|
| 39 | ;;R^"860.9:",.01,"E"
|
---|
| 40 | ;;D^DNR
|
---|
| 41 | ;;R^"860.9:",.02,"E"
|
---|
| 42 | ;;D^101.43
|
---|
| 43 | ;;EOR^
|
---|
| 44 | ;;KEY^860.9:^PROTHROMBIN TIME
|
---|
| 45 | ;;R^"860.9:",.01,"E"
|
---|
| 46 | ;;D^PROTHROMBIN TIME
|
---|
| 47 | ;;R^"860.9:",.02,"E"
|
---|
| 48 | ;;D^101.43
|
---|
| 49 | ;;EOR^
|
---|
| 50 | ;;KEY^860.9:^NPO
|
---|
| 51 | ;;R^"860.9:",.01,"E"
|
---|
| 52 | ;;D^NPO
|
---|
| 53 | ;;R^"860.9:",.02,"E"
|
---|
| 54 | ;;D^101.43
|
---|
| 55 | ;;EOR^
|
---|
| 56 | ;;KEY^860.9:^SERUM SPECIMEN
|
---|
| 57 | ;;R^"860.9:",.01,"E"
|
---|
| 58 | ;;D^SERUM SPECIMEN
|
---|
| 59 | ;;R^"860.9:",.02,"E"
|
---|
| 60 | ;;D^61
|
---|
| 61 | ;;EOR^
|
---|
| 62 | ;;KEY^860.9:^PARTIAL THROMBOPLASTIN TIME
|
---|
| 63 | ;;R^"860.9:",.01,"E"
|
---|
| 64 | ;;D^PARTIAL THROMBOPLASTIN TIME
|
---|
| 65 | ;;R^"860.9:",.02,"E"
|
---|
| 66 | ;;D^101.43
|
---|
| 67 | ;;EOR^
|
---|
| 68 | ;;KEY^860.9:^ANGIOGRAM (PERIPHERAL)
|
---|
| 69 | ;;R^"860.9:",.01,"E"
|
---|
| 70 | ;;D^ANGIOGRAM (PERIPHERAL)
|
---|
| 71 | ;;R^"860.9:",.02,"E"
|
---|
| 72 | ;;D^101.43
|
---|
| 73 | ;;EOR^
|
---|
| 74 | ;;KEY^860.9:^WBC
|
---|
| 75 | ;;R^"860.9:",.01,"E"
|
---|
| 76 | ;;D^WBC
|
---|
| 77 | ;;R^"860.9:",.02,"E"
|
---|
| 78 | ;;D^60
|
---|
| 79 | ;;EOR^
|
---|
| 80 | ;;KEY^860.9:^BLOOD SPECIMEN
|
---|
| 81 | ;;R^"860.9:",.01,"E"
|
---|
| 82 | ;;D^BLOOD SPECIMEN
|
---|
| 83 | ;;R^"860.9:",.02,"E"
|
---|
| 84 | ;;D^61
|
---|
| 85 | ;;EOR^
|
---|
| 86 | ;;KEY^860.9:^ONE TIME MED
|
---|
| 87 | ;;R^"860.9:",.01,"E"
|
---|
| 88 | ;;D^ONE TIME MED
|
---|
| 89 | ;;R^"860.9:",.02,"E"
|
---|
| 90 | ;;D^51.1
|
---|
| 91 | ;;R^"860.9:",2,"E"
|
---|
| 92 | ;;D^I $E($P(^(0),U,4),1,2)="PS"
|
---|
| 93 | ;;EOR^
|
---|
| 94 | ;;EOF^OCXS(860.9)^1
|
---|
| 95 | ;;SOF^860.8 ORDER CHECK COMPILER FUNCTIONS
|
---|
| 96 | ;;KEY^860.8:^CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
|
---|
| 97 | ;;R^"860.8:",.01,"E"
|
---|
| 98 | ;;D^CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
|
---|
| 99 | ;;R^"860.8:",.02,"E"
|
---|
| 100 | ;;D^DT2INT
|
---|
| 101 | ;;R^"860.8:",1,1
|
---|
| 102 | ;;D^ ;DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
|
---|
| 103 | ;;R^"860.8:",1,2
|
---|
| 104 | ;;D^ ; ; By taking the Years, Months, Days, Hours and Minutes converting
|
---|
| 105 | ;;R^"860.8:",1,3
|
---|
| 106 | ;;D^ ; ; Them into Seconds and then adding them all together into one big integer
|
---|
| 107 | ;;R^"860.8:",100,1
|
---|
| 108 | ;;D^ ;DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
|
---|
| 109 | ;;R^"860.8:",100,2
|
---|
| 110 | ;;D^ ; ; By taking the Years, Months, Days, Hours and Minutes converting
|
---|
| 111 | ;;R^"860.8:",100,3
|
---|
| 112 | ;;D^ ; ; Them into Seconds and then adding them all together into one big integer
|
---|
| 113 | ;;R^"860.8:",100,4
|
---|
| 114 | ;;D^ ; ;
|
---|
| 115 | ;;R^"860.8:",100,5
|
---|
| 116 | ;;D^ ; Q:'$L($G(OCXDT)) ""
|
---|
| 117 | ;;R^"860.8:",100,6
|
---|
| 118 | ;;D^ ; N OCXVAL S OCXVAL=0
|
---|
| 119 | ;;R^"860.8:",100,7
|
---|
| 120 | ;;D^ ; I (OCXDT?5N1","5N) Q (OCXDT*86400+$P(OCXDT,",",2)) ; $H FORMAT
|
---|
| 121 | ;;R^"860.8:",100,8
|
---|
| 122 | ;;D^ ; I ($E(OCXDT,1)="T") D Q OCXVAL ; TODAY
|
---|
| 123 | ;;R^"860.8:",100,9
|
---|
| 124 | ;;D^ ; .S OCXVAL=$H*86400
|
---|
| 125 | ;;R^"860.8:",100,10
|
---|
| 126 | ;;D^ ; .S:(OCXDT["+") OCXVAL=OCXVAL+($P(OCXDT,"+",2)*86400)
|
---|
| 127 | ;;R^"860.8:",100,11
|
---|
| 128 | ;;D^ ; .S:(OCXDT["-") OCXVAL=OCXVAL-($P(OCXDT,"-",2)*86400)
|
---|
| 129 | ;;R^"860.8:",100,12
|
---|
| 130 | ;;D^ ; I ($E(OCXDT,1)="N") D Q OCXVAL ; NOW
|
---|
| 131 | ;;R^"860.8:",100,13
|
---|
| 132 | ;;D^ ; .S OCXVAL=$H*86400+$P($H,",",2)
|
---|
| 133 | ;;R^"860.8:",100,14
|
---|
| 134 | ;;D^ ; .S:(OCXDT["+") OCXVAL=OCXVAL+($P(OCXDT,"+",2)*86400)
|
---|
| 135 | ;;R^"860.8:",100,15
|
---|
| 136 | ;;D^ ; .S:(OCXDT["-") OCXVAL=OCXVAL-($P(OCXDT,"-",2)*86400)
|
---|
| 137 | ;;R^"860.8:",100,16
|
---|
| 138 | ;;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
|
---|
| 139 | ;;R^"860.8:",100,17
|
---|
| 140 | ;;D^ ; I +OCXDT,($L(OCXDT\1)>7) D Q OCXVAL ; HL7 FORMAT
|
---|
| 141 | ;;R^"860.8:",100,18
|
---|
| 142 | ;;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
|
---|
| 143 | ;;R^"860.8:",100,19
|
---|
| 144 | ;;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
|
---|
| 145 | ;;R^"860.8:",100,20
|
---|
| 146 | ;;D^ ; .S OCXVAL=OCXVAL+$E(OCXDT,7,8)-1 ; ADD DAYS
|
---|
| 147 | ;;R^"860.8:",100,21
|
---|
| 148 | ;;D^ ; .S OCXVAL=OCXVAL*86400 ; CONVERT TO SECONDS
|
---|
| 149 | ;;R^"860.8:",100,22
|
---|
| 150 | ;;D^ ; .S OCXVAL=OCXVAL+($E(OCXDT,9,10)*3600)+($E(OCXDT,11,12)*60)+$E(OCXDT,13,14) ; ADD TIME
|
---|
| 151 | ;;R^"860.8:",100,23
|
---|
| 152 | ;;D^ ; Q OCXDT
|
---|
| 153 | ;;R^"860.8:",100,24
|
---|
| 154 | ;;D^ ; ;
|
---|
| 155 | ;;EOR^
|
---|
| 156 | ;;KEY^860.8:^PTRNODE
|
---|
| 157 | ;;R^"860.8:",.01,"E"
|
---|
| 158 | ;;D^PTRNODE
|
---|
| 159 | ;;R^"860.8:",.02,"E"
|
---|
| 160 | ;;D^PTRNODE
|
---|
| 161 | ;;R^"860.8:",1,1
|
---|
| 162 | ;;D^ ;PTRNODE(OCXFIL,OCXKEY,OCXNODE) ; This Local Extrinsic Function returns the specified Node (OCXNODE)
|
---|
| 163 | ;;R^"860.8:",1,2
|
---|
| 164 | ;;D^ ; ; From the specified record (OCXKEY) in a file (OCXFIL).
|
---|
| 165 | ;;R^"860.8:",1,3
|
---|
| 166 | ;;D^ ; ;
|
---|
| 167 | ;;R^"860.8:",100,1
|
---|
| 168 | ;;D^ ;PTRNODE(OCXFIL,OCXKEY,OCXNODE) ; This Local Extrinsic Function returns the specified Node (OCXNODE)
|
---|
| 169 | ;;R^"860.8:",100,2
|
---|
| 170 | ;;D^ ; ; From the specified record (OCXKEY) in a file (OCXFIL).
|
---|
| 171 | ;;R^"860.8:",100,3
|
---|
| 172 | ;;D^ ; ;
|
---|
| 173 | ;;R^"860.8:",100,4
|
---|
| 174 | ;;D^ ; ;
|
---|
| 175 | ;;R^"860.8:",100,5
|
---|
| 176 | ;;D^ ; N OCXDATA,OCXSUB,OCXGL S OCXDATA=0
|
---|
| 177 | ;;R^"860.8:",100,6
|
---|
| 178 | ;;D^ ; Q:'$L(OCXFIL) "" Q:'$L($G(OCXKEY)) "" S:'$L($G(OCXNODE)) OCXNODE=0
|
---|
| 179 | ;1;
|
---|
| 180 | ;
|
---|