source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRORD.m@ 767

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

initial load of WorldVistAEHR

File size: 5.2 KB
Line 
1LRORD ;DALOI/CJS - LAZY ACCESSION LOGGING ;2/6/91 12:54 ;
2 ;;5.2;LAB SERVICE;**100,121,153,286**;Sep 27, 1994
3EN ;;
4 I $D(^LAB(69.9,1,"RO")),+$H'=+^("RO") W $C(7),!,"ROLLOVER ",$S($P(^("RO"),U,2):"IS RUNNING.",1:"HAS NOT RUN.")," ACCESSIONING SHOULDN'T BE DONE NOW.",$C(7),!," Are you sure you want to continue"
5 I $T S %=2 D YN^DICN W:%=0 !,"If you continue to accession, you may block accessions from yesterday from",!,"rolling over." G LRORD:%=0 I %'=1 W !,"OK, try later." Q
6EN1 ;;from LROR4
7 D ^LRPARAM
8 K ^TMP("LRSTIK",$J),DIC,LRURG,LRSAME,LRCOM,LRNATURE,LRTCOM
9 S LRORDTIM="" S:'$D(LRORDR) LRORDR="" D DT^LRX
10 I $D(LRADDTST) Q:LRADDTST=""
11 S LRFIRST=1,LRODT=DT,U="^",LRECT=0,LROUTINE=$P(^LAB(69.9,1,3),U,2)
12 S:$G(LRORDRR)="R" LRECT=1,LRFIRST=0
13 I '$G(LRECT),LRORDR="" W !!,"WANT TO ENTER COLLECTION TIMES? Y//" D % S LRECT='(%["N") G KILL:$E(%)="^"
14 I LRORDR="LC" W !!," Ordering for ROUTINE LAB COLLECT ONLY",$C(7),! S LRLWC="LC",LRLLOC=".",LREND=0 D NEXTCOL^LROW5 G KILL:LREND
15 I LRORDR="SP" W !!," Ordering for SEND PATIENT ONLY",$C(7),! S LRLWC="SP"
16 I LRORDR="WC" W !!,"Ordering for WARD COLLECT & DELIVER ONLY",$C(7),! S LRLWC="WC"
17 I LRORDR="I" D ^LRORDIM G KILL:'$D(LRCDT)
18L5 I LRORDR]"",LRORDR'="LC",LRORDR'="I" S %DT="AET",%DT("A")=$S(LRORDR="WC":"COLLECTION",LRORDR="SP":"PATIENT VISIT",1:"")_" DATE: "
19 I $T D DATE^LRWU G KILL:Y<1 S LRORDTIM=$P(Y,".",2),LRODT=$P(Y,".",1),X1=Y,X2=DT D ^%DTC IF X>370 W !,"Can't order more than 12 months ahead!!" G L5
20 I $D(LRODT),$P(LRODT,".")?7N,'+$E($P(LRODT,"."),6,7) W !!?7,$C(7),"Please enter a date, ie. 4/1/90",!! G L5
21 I $D(LRODT),$P(LRODT,".")<DT W !,$C(7),"Cannot order in the Past.",! G L5
22 I $D(LRFLOG) S Y=LRFLOG G G0:LRFLOG>0
23 S DIC="^LAB(62.6,",DIC(0)="AEQMZ"
24 S DIC("S")=$S($D(LRLABKY):"I '(LRORDR=""LC""&'$P(^(0),U,4))",1:"I '(LRORDR=""LC""&'$P(^(0),U,4))&'$P(^(0),U,3)")
25 D ^DIC K DIC G KILL:$D(DUOUT)!$D(DTOUT),G1:Y<1 S LRFLOG=Y
26G0 S $P(LRFLOG,U,3)=$P(^LAB(62.2,+$P(^LAB(62.6,+LRFLOG,0),U,2),0),U,2)
27 S LRFLOG(0)=^LAB(62.6,+LRFLOG,0)
28 S (LRWP,I)=0
29 F S I=$O(^LAB(62.6,+Y,1,I)) Q:I<1 D
30 . S Y(0)=$G(^LAB(62.6,+Y,1,I,0)),LRWP=LRWP+1
31 . S ^TMP("LRSTIK",$J,$S($P(LRFLOG(0),"^",5):I,1:LRWP))=Y(0)
32 . ; Lookup by number user enters.
33 . S ^TMP("LRSTIK",$J,"B",LRWP)=$S($P(LRFLOG(0),"^",5):I,1:LRWP)
34 . ; Lookup by test - used by LEDI (LRORDB) when user creates list "on-the-fly"
35 . S ^TMP("LRSTIK",$J,"C",+Y(0),$S($P(LRFLOG(0),"^",5):I,1:LRWP))=""
36 I LRWP>40 S LRFIRST=0 ; Don't automatically display "long" test lists.
37 G G5
38G1 S LRWP=0 W !,"Select one or more tests from which you will be generating your entries."
39GET D Q15^LRORD2
40 D ^DIC K DIC("S") G:Y<1 G5
41 S LRWP=LRWP+1,LRY=Y
42 S ^TMP("LRSTIK",$J,LRWP)=$P(LRY,U,1,2)
43 ; "B" Used to lookup by number user enters.
44 S ^TMP("LRSTIK",$J,"B",LRWP)=LRWP
45 ; "C" Used by LEDI (LRORDB)
46 S ^TMP("LRSTIK",$J,"C",+LRY,LRWP)=""
47 S LRTSTS=+^TMP("LRSTIK",$J,LRWP) D GS^LRORD3
48 S:+LRSAMP=-1&(LRSPEC=-1) LRWP=LRWP-1
49 G GET:+LRSAMP=-1&(LRSPEC=-1)
50 S ^TMP("LRSTIK",$J,LRWP)=^TMP("LRSTIK",$J,LRWP)_U_LRSAMP_U_U_LRSPEC
51 G GET
52 ;
53G5 G KILL:LRWP<1
54 S:'$D(^LRO(69,LRODT,0)) ^(0)=$P(^LRO(69,0),U,1,2)_U_LRODT_U_(1+$P(^(0),U,4)),^LRO(69,LRODT,0)=LRODT,^LRO(69,"B",LRODT,LRODT)=""
55 S LRURG="",LRAD=DT,LRWPD=LRWP\2+(LRWP#2) D ^LRORD1
56KILL D ^LRORDK,HOME^%ZIS Q
57% R %:DTIME Q:%=""!(%["N")!(%["Y")!($E(%)="^") W !,"Answer 'Y' or 'N': " G %
58EN01 ;LAB COLLECT ORDER ENTRY
59ORDER S %=2 W !,"Do you want copies of the orders" D YN^DICN Q:%=-1 S:%=1 LRSLIP="" I %=0 D QUIZ G ORDER
60 S LRORDR="LC",LRLWCURG=$S($P(^LAB(69.9,1,3),U,2)'="":$P(^(3),U,2),1:9) G LRORD
61EN02 ;SEND PATIENT ORDER ENTRY
62SENDPAT S %=2 W !,"Do you want copies of the orders" D YN^DICN Q:%=-1 S:%=1 LRSLIP="" I %=0 D QUIZ G SENDPAT
63 S LRORDR="SP" G LRORD
64IMMCOL ;IMMEDIATE LAB COLLECTION
65 I '$P($G(^LAB(69.9,1,7,DUZ(2),0)),U,6) W !!?5," This option is not available at the time ",!!,$C(7) Q
66 S LRORDR="I" K LRODT G LRORD
67 ;
68EN03 ;WARD COLLECT ORDER ENTRY
69WARDCOL ;
70 S %=2
71 W !,"Do you want copies of the orders" D YN^DICN Q:%=-1 S:%=1 LRSLIP="" I %=0 D QUIZ G WARDCOL
72 S LRORDR="WC" D LRORD
73 Q
74 ;
75 ;
76LEDI ; Laboratory Electronic Data Exchange
77 ; This entry point is used to select patients from ^LRT(67, file
78 ; Routine LRDPAREF controls patient selection, patients must already
79 ; exist in ^DPT in order to be selected.
80 D ^LRPARAM
81 I $G(LREND) D ^LRORDK Q
82 N CONTROL,LA7,LA7SCFG,LA7X,LA7Y,LR64,LR696,LRLABLIO,LRRSTAT,LRRSITE,LRSD,LRTSN
83 S LRREFBAR=$$BAR^LA7SBCR
84 I LRREFBAR<0 D ^LRORDK Q
85 S LRRSTAT="I"
86 S LRRSTAT(0)=$$FIND1^DIC(64.061,"","OMX","Specimen in process","","I $P(^LAB(64.061,Y,0),U,7)=""U""")
87 D SITE^LA7SBCR2(.LRRSITE,"Scan Remote Site Barcode (SM)",LRREFBAR)
88 I LRRSITE("ERROR") D Q
89 . W !!,$C(7),"ERROR -- ",$P(LRRSITE("ERROR"),"^",2),!
90 . D ^LRORDK
91 ;
92 ; Get shipping manifest ID manual input
93 I $G(LRRSITE("SMID"))="" D
94 . F D SMID^LRORDB Q:LREND!($G(LRRSITE("SMID"))'="")
95 I $G(LREND) D ^LRORDK Q
96 ;
97 ; LRORDRR="R" variable indicates host accessioning of remote orders
98 S LRORDRR="R",LRORDR="" K LRODT
99 D LRORD,^LRORDK
100 Q
101 ;
102 ;
103 ; LRORDRR =TYPE OF ORDER, LRECT =ASK COLECTION TIME
104 ; LRFLOG =ACCESSION TEST GROUP, IF DEFINED ON ENTRY, PRESELECTS GROUP
105 ;
106QUIZ W !,"The order copy is automatically sent to the CLOSEST PRINTER,"
107 W !,"if a closest printer is defined for the device you are using."
108 W !,"Otherwise, you will be prompted with ORDER COPY DEVICE.",!
109 Q
Note: See TracBrowser for help on using the repository browser.