source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWNSS.m@ 861

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

revised back to 6/30/08 version

File size: 1.7 KB
Line 
1ORWNSS ;JDL/SLC Non-Standard Schedule ;12/9/04 12:02
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**195**;Dec 17, 1997
3NSSOK(ORY,ORX) ;Check availability for Non-standard schedule
4 N VAL
5 S VAL=$$PATCH^XPDUTL("PSJ*5.0*113")
6 S ORY=VAL
7 Q
8NSSMSG(ORY) ;Retrieve site message for None-Standard Schedule
9 N ORSRV
10 S ORY=""
11 S ORSRV=$G(^VA(200,DUZ,5)) I +ORSRV>0 S ORSRV=$P(ORSRV,U)
12 S ORY=$$GET^XPAR("SRV.`"_+$G(ORSRV)_"^DIV^SYS","ORWIM NSS MESSAGE",1,"I")
13 Q
14VALSCH(ORY,ORID) ;Validate a schedule for IM order; 1: valid, 0: invalid
15 ;
16 S ORY=0
17 Q:'$D(^OR(100,+ORID,0))
18 N IPGRP,ORGRP
19 S IPGRP=$O(^ORD(100.98,"B","UD RX",0))
20 S ORGRP=$P($G(^OR(100,+ORID,0)),U,11)
21 I ORGRP'=IPGRP S ORY=1 Q
22 N SCH,IDX,SCHVAL S (SCH,SCHVAL)=""
23 I $D(^OR(100,+ORID,4.5,"ID","SCHEDULE")) S SCH=$O(^OR(100,+ORID,4.5,"ID","SCHEDULE",0))
24 I SCH="" S ORY=1 Q
25 S IDX=0 F S IDX=$O(^OR(100,+ORID,4.5,SCH,IDX)) Q:'IDX D
26 . S SCHVAL=$G(^OR(100,+ORID,4.5,SCH,IDX))
27 . Q:'$L(SCHVAL)
28 . D VALSCH^ORWDPS32(.ORY,SCHVAL,"I")
29 . I ORY=0 Q
30 Q
31QOSCH(ORY,QOID) ;Validate IM QO schedule
32 ;QOID: Inpt Pharmacy QO
33 S ORY=""
34 N QOSCH,SCHID,SCHVAL,RST
35 S SCHID=$O(^ORD(101.41,"B","OR GTX SCHEDULE",0))
36 S (QOSCH,SCHVAL)="",RST=1
37 I '$D(^ORD(101.41,+QOID,6,"D",SCHID)) S ORY="schedule is not defined." Q
38 S QOSCH=$O(^ORD(101.41,+QOID,6,"D",SCHID,0))
39 I 'QOSCH S ORY="schedule is not defined." Q
40 N IDX S IDX=0
41 F S IDX=$O(^ORD(101.41,+QOID,6,QOSCH,IDX)) Q:'IDX!('RST) D
42 . S SCHVAL=^ORD(101.41,+QOID,6,QOSCH,IDX)
43 . I $$UP^XLFSTR(SCHVAL)="OTHER" S ORY="OTHER" Q
44 . D VALSCH^ORWDPS32(.RST,SCHVAL,"I")
45 . I RST=0 S ORY="This quick order contains a non-standard administration schedule." Q
46 Q
47CHKSCH(ORY,SCH) ;Validate schedule
48 Q:SCH=""
49 D VALSCH^ORWDPS32(.ORY,SCH,"I")
50 Q
Note: See TracBrowser for help on using the repository browser.