source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORBCMA5.m@ 1314

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

initial load of FOIAVistA 6/30/08 version

File size: 1.4 KB
Line 
1ORBCMA5 ; SLC/JDL - BCMA Order utility ;2/18/02 13:37
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**133**;Dec 17, 1997
3 ;;BCMA ORDER UTITLITY;**133**;12/12/2001
4 ;
5GETUDID(Y,INFO) ; Get Unit/Dose Order Form ID
6 S Y=$O(^ORD(101.41,"B","PSJ OR PAT OE",0))
7 S:$L(Y)<1 Y=0
8 Q
9GETIVID(Y,INFO) ; Get IV Order Form ID
10 S Y=$O(^ORD(101.41,"B","PSJI OR PAT FLUID OE",0))
11 S:$L(Y)<1 Y=0
12 Q
13GETUD(Y,ODITM) ; get unit dose orderable item
14 ; ODITM: Orderable item ien
15 N DGIDX,OIIEN,UDIEN
16 S DGIDX=0
17 S UDIEN=$O(^ORD(101.44,"B","ORWDSET UD RX",0))
18 F S DGIDX=$O(^ORD(101.44,UDIEN,20,DGIDX)) Q:'DGIDX D
19 . S OIIEN=$P(^ORD(101.44,UDIEN,20,DGIDX,0),U,1)
20 . I OIIEN=ODITM S Y=^ORD(101.44,UDIEN,20,DGIDX,0)
21 K DGIDX,OIIEN,UDIEN
22 Q
23ODITMBC(Y,XREF,ODLST) ; --Return orderable items info based on ItemIen
24 N CNT,NUM,XRF
25 S CNT=0,NUM=0,XRF=""
26 S:$L(XREF) XRF=XREF
27 F S CNT=$O(ODLST(CNT)) Q:'CNT D FNDINFO(.Y,ODLST(CNT))
28 Q
29FNDINFO(Y,ODIEN) ;
30 N ODI,CRTM,FRM,XX,FINDIT
31 S XX="",FINDIT=0
32 S FRM="",CRTM=$$NOW^XLFDT
33 F S FRM=$O(^ORD(101.43,XRF,FRM)) Q:FRM="" D
34 . S ODI=0 F S ODI=$O(^ORD(101.43,XRF,FRM,ODI)) Q:'ODI D
35 .. S XX=^ORD(101.43,XRF,FRM,ODI)
36 .. I +$P(XX,U,3),$P(XX,U,3)<CRTM Q
37 .. I ODI=+ODIEN D
38 ... S NUM=NUM+1,FINDIT=1
39 ... I 'XX S Y(NUM)=ODIEN_U_$P(XX,U,2)_U_$P(XX,U,2)
40 ... E S Y(NUM)=ODIEN_U_$P(XX,U,2)_$C(9)_"<"_$P(XX,U,4)_">"_U_$P(XX,U,4)
41 I FINDIT=0 D
42 . S:$D(^ORD(101.43,+ODIEN,0)) XX=^ORD(101.43,+ODIEN,0)
43 . S NUM=NUM+1
44 . S:$L(XX) Y(NUM)=ODIEN_U_$P(XX,U)_U_$P(XX,U)_U_"NF"
45 Q
Note: See TracBrowser for help on using the repository browser.