source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LROR6.m@ 1005

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1LROR6 ;SLC/DCM - EDIT LAB ORDERS FOR OE/RR ;8/11/97
2 ;;5.2;LAB SERVICE;**100,121,202**;Sep 27, 1994
3DC(REQ,STAT) ;DC reason
4 ;REQ=1 to require a response
5 ;STAT=1 to set the variable LRMSTATI for sending status back to OE/RR.
6 I $$VER^LR7OU1<3 Q ;OE/RR 2.5 Check
7 N DEF,R,PKG,X,OK
8 S PKG=$O(^DIC(9.4,"B","LAB SERVICE",0))
9 S DEF=$P($G(^LAB(69.9,1,"OR")),"^",2)
10AGAIN S X=$$DC^ORX1(DEF,+$G(REQ),PKG,"Cancellation Reason"),LRNATURE=$S(X:"^^^"_$P(X,"^",1,2)_"^99ORR",1:-1)
11 I $G(STAT)=1 S OK=1,LRMSTATI=$P(X,"^",9) I LRMSTATI,LRMSTATI'=1 D G:'OK AGAIN
12 . W !,"This Cancellation Reason will ONLY remove the accession.",!,"The Doctor's original order will NOT be canceled, so that it may be"
13 . W !,"re-accessioned at a later time. OK"
14 . ;"To later cancel the order, use the option: ",!," Delete entire order or individual tests",!
15 . S %=1 D YN^DICN I %'=1 S OK=0
16 . I %=0 W !!,"You may enter a different Cancellation Reason, if you wish.",!
17 Q
18DC1(REASON,TEXT) ;Set HL7 String for DC Reason
19 ;REASON=ptr to DC Reason (100.03)
20 ;TEXT=free text reason to be associated with order (optional)
21 I $$VER^LR7OU1<3 Q "" ;OE/RR 2.5 Check
22 Q:'$G(REASON) ""
23 N X S X=$G(^ORD(100.03,REASON,0)),X="^^^"_REASON_"^"_$S($L($G(TEXT)):TEXT,1:$P(X,"^"))_"^99ORR"
24 Q X
25NEW(REQ) ;Get Nature of order
26 ;REQ=1 to require a response
27 I $$VER^LR7OU1<3 Q ;OE/RR 2.5 Check
28 N DEF,X
29 S DEF=$P($G(^LAB(69.9,1,"OR")),"^"),X=$$NA^ORX1(DEF,+$G(REQ),"B","Nature of Order/Change"),LRNATURE=$S(X:$P(X,"^",1,2)_"^99ORN",1:-1)
30 Q
31NEW1(NATURE) ;Set HL7 String for Nature of Order
32 ;NATURE=ptr to Nature of Order (100.02)
33 I $$VER^LR7OU1<3 Q "" ;OE/RR 2.5 Check
34 Q:'$G(NATURE)
35 N X S X=$G(^ORD(100.02,NATURE,0)),X="^^^"_NATURE_"^"_$P(X,"^")_"^99ORN"
36 Q X
37EN ;OE/RR 2.5 Nature of Order processes
38 I ORSTS=""!(+ORSTS=11) D EDITUR^LROR6A Q
39 I ORGY'=0 S OREND=0 D C^LROR3 Q
40EDIT ;Edit orders for OE/RR 2.5
41 S LRODT=$P(ORPK,"^"),LRSN=$P(ORPK,"^",2),I=$P(ORPK,"^",3)
42 S X="" W !!,"Released laboratory orders are UNEDITABLE." Q:+ORSTS=6 W !,"You may use this action to ADD a test to the existing lab order number."
43 N ORACTION,ORPARAM S ORNDO=1 D EN^LROR9
44 K LRODT,LRSN,LRSX
45 Q
46OT ;OE/RR 2.5 Natuer of Order processing
47 S DIR("?",1)="This order/change will be recorded in the patient's electronic record."
48 S DIR("?",2)="A notification will be sent to the requesting clinician to electronically"
49 S DIR("?",3)="sign this action, and a copy of this action will be printed in the"
50 S DIR("?",4)="ward/clinic to be placed in the chart, unless specified as a 'CORRECTION'"
51 S DIR("?",5)="(not affecting the original order), or 'WRITTEN REQUEST' (Signed on chart)."
52 S DIR("?",6)=""
53 S DIR("?")="Enter reason: (C)ORRECTION, (W)RITTEN, (V)ERBAL, (P)HONED"
54 S DIR("A")="NATURE OF ORDER/CHANGE: "
55 S DIR("B")=$S($D(^XUSEC("LRLAB",DUZ)):"CORRECTION",1:"WRITTEN")
56 S DIR(0)="SA^C:CORRECTION (internal to lab);W:WRITTEN REQUEST (Signed on chart);P:TELEPHONED REQUEST;V:VERBAL REQUEST"
57 D ^DIR K DIR S ORNATR=$S($L(Y)&(Y="P"!(Y="V")):Y,1:"C") ;Correction=""
58 I "VPWC"'[Y W !,"NATURE OF ORDER/CHANGE must be entered",$C(7),! G OT
59 Q
Note: See TracBrowser for help on using the repository browser.