source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORERR.m@ 1746

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1ORERR(ORTYP,ORMSG,ORVAR) ; RJS/SLC-ISC - Order Entry Error Logger ;11/12/97 08:09
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
3 ;
4 D EN(ORTYP,.ORMSG,.ORVAR)
5 Q
6 ;
7EN(ORTYP,ORMSG,ORVAR) ;
8 ;
9 N ORARRY,ORD0,ORD1,ORD2,OREF,ORVNAM
10 ;
11 S ORARRY=$S($L($G(ORMSG)):ORMSG,1:"ORMSG")
12 ;
13 I '$O(@ORARRY@(0)) S ORARRY="ORARRY",ORARRY(1)="Null HL7 Data Array Found"
14 ;
15 S ORD0=$O(^ORYX("ORERR","@"),-1)+1,^ORYX("ORERR",ORD0,0)="",OREF="^ORYX(""ORERR"","_ORD0_")"
16 S @OREF@(0)=$$NOW_U_$G(ION)_U_$G(DUZ)_U_$G(ORTYP,$ZE)_U_$G(ZTSK)
17 S $P(^ORYX("ORERR",0),U,3)=ORD0,$P(^ORYX("ORERR",0),U,4)=$P(^ORYX("ORERR",0),U,4)+1
18 ;
19 D ADD(" "),ADD("HL7 Array: "),ADD(" ")
20 S ORD1="" F S ORD1=$O(@ORARRY@(ORD1)) Q:'ORD1 D
21 .N ORPC,ORLEN
22 .S ORLEN=$L($G(@ORARRY@(ORD1)))
23 .F ORPC=0:1 Q:((ORPC*200)>ORLEN) D
24 ..D ADD($S(ORPC:" ",1:$J(ORD1,3)_": ")_$E(@ORARRY@(ORD1),(ORPC*200+1),(ORPC+1*200)))
25 .S ORD2="" F S ORD2=$O(@ORARRY@(ORD1,ORD2)) Q:'ORD2 D
26 ..N ORPC,ORLEN
27 ..S ORLEN=$L($G(@ORARRY@(ORD1,ORD2)))
28 ..F ORPC=0:1 Q:((ORPC*200)>ORLEN) D
29 ...D ADD($S(ORPC:" ",1:$J(ORD1,3)_","_$J(ORD2,3)_": ")_$E(@ORARRY@(ORD1),(ORPC*200+1),(ORPC+1*200)))
30 ;
31 D ADD(" "),ADD("Local Variables: "),ADD(" ")
32 ;
33 I $D(ORVAR) S ORVNAM="" F S ORVNAM=$O(ORVAR(ORVNAM)) Q:'$L(ORVNAM) I $D(@ORVNAM) D
34 .I ($D(@ORVNAM)#2) F ORPC=0:1 Q:((ORPC*100)>$L(@ORVNAM)) D
35 ..N ORSP S ORSP=" "
36 ..D ADD($S(ORPC:ORSP,1:$E(ORSP,$L(ORVNAM),12)_ORVNAM_": ")_$E(@ORVNAM,(ORPC*100+1),(ORPC+1*100)))
37 .S ORVARY=ORVNAM F S ORVARY=$Q(@ORVARY) Q:'$L(ORVARY) Q:'($P(ORVARY,"(",1)=ORVNAM) D
38 ..F ORPC=0:1 Q:((ORPC*100)>$L(@ORVARY)) D
39 ...N ORSP S ORSP=" "
40 ...D ADD($S(ORPC:ORSP,1:$E(ORSP,$L(ORVARY),12)_ORVARY_": ")_$E(@ORVARY,(ORPC*100+1),(ORPC+1*100)))
41 ;
42 S @OREF@(1,0)=U_U_$O(@OREF@(1,""),-1)_U_$O(@OREF@(1,""),-1)_U_$$TODAY_U
43 ;
44 Q
45 ;
46NOW() N X,Y,%DT S X="N",%DT="T" D ^%DT Q Y
47 ;
48TODAY() N X,Y,%DT S X="T",%DT="" D ^%DT Q Y
49 ;
50ADD(X) S @OREF@(1,($O(@OREF@(1,""),-1)+1),0)=X Q
51 ;
Note: See TracBrowser for help on using the repository browser.