Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LROE2

LROE2.m

Go to the documentation of this file.
LROE2 ;DALISC/FHS - CONTINUED MORE ORDER ENTRY ;Aug 11, 1997
 ;;5.2;LAB SERVICE;**121,424,444,573**;Sep 27, 1994;Build 7
 ;Formerly apart of LROE1
Q15 ;from LROE1
 Q:'$D(^LRO(69,LRODT,1,LRSN,0))
 I $D(^LRO(69,LRODT,1,LRSN,1)),$P(^(1),"^",4)="U" W !,"This specimen has already been marked as UNCOLLECTED. Are you sure" S %=2 D YN^DICN Q:%'=1  S ^(1)=LRTIM_"^^"_DUZ,DA=LRSN,DA(1)=LRODT,DIE="^LRO(69,"_DA(1)_",1,",DR=16 D ^DIE
 I M9>1 D LRSPEC^LROE1 S S1=$S($D(^LAB(61,+LRSPEC,0)):$P(^(0),U),1:""),S2=$P(^LAB(62,LRSAMP,0),U),S4=$P(^(0),U,3),S3=S1_$S(S1'=S2:"  "_S2,1:"") W !,"Do you have the  ",S3,"  ",S4 K S1,S2,S3,S4 S %=2 D YN^DICN G Q15:%=0 Q:%'=1
 S DA=DT,LRDFN=+^LRO(69,LRODT,1,LRSN,0),LRDPF=+$P(^LR(LRDFN,0),U,2)
 IF '$D(^LRO(69,LRODT,1,LRSN,1)) S LRSTATUS="C",DA=LRODT I '$D(LRSND) D P15^LROE1 Q:LRCDT<1
 I $D(LRSND),$P(^LRO(69,LRODT,1,LRSN,0),U,4)="LC",$D(^(1)) S LRLLOC=$P(^(0),U,7),LROLLOC=$P(^(0),U,9),LRNT=$S($D(LRNT):LRNT,$D(LRTIM):LRTIM,$D(LRCDT):+LRCDT,1:"") D P15^LRPHITEM G PH
 I $D(LRSND) N COMB S COMB=$P($G(^LRO(69,LRODT,1,LRSN,1)),"^",7) S ^LRO(69,LRODT,1,LRSN,1)=LRTIM_"^"_LRUN_"^"_DUZ_"^"_LRSTATUS_"^^^"_COMB_"^"_DUZ(2) S:LRSTATUS="C" ^LRO(69,"AA",+$G(^LRO(69,LRODT,1,LRSN,.1)),LRODT_"|"_LRSN)=""
PH G Q16:LRORD D ORDER^LROW2 G Q16A
Q16 S J=0 D CHECK^LROW2 I J D BAD^LROW2
Q16A I $D(LRLONG),$D(LRSND) S LRSN=LRSND,^TMP("LROE",$J,"LRORD")=LRORD_U_LRODT_U_LRTIM_U_PNM_U_SSN
 K DR S LRTSTS=0
 S LRSN=0 F  S LRSN=$O(LRSN(LRSN)) Q:'LRSN  D Q17
 I $D(LRLONG),$D(LRSND) S LRSN=LRSND D LROE^LRFAST S X=^TMP("LROE",$J,"LRORD"),LRORD=+X,LRODT=$P(X,"^",2),LRTIM=$P(X,"^",3),LRLONG="",PNM=$P(X,"^",4),SSN=$P(X,"^",5)
 Q
Q17 S I=$O(^LRO(69,LRODT,1,LRSN,6,0)),J=$O(^(1)) S:'$D(IOM) IOM=80 K LRSPCDSC S:J LRSPCDSC=^(J,0) S:I DA=LRSN,DA(1)=LRODT,DR=6,DIC="^LRO(69,"_LRODT_",1," D EN^DIQ:I D LRSPEC^LROE1
 D OLD^LRORDST K ^TMP("LR",$J,"TMP")
 S $P(^LRO(69,LRODT,1,LRSN,1),U,4)="C",$P(^LRO(69,LRODT,1,LRSN,1),U,8)=DUZ(2),^LRO(69,"AA",+$G(^LRO(69,LRODT,1,LRSN,.1)),LRODT_"|"_LRSN)=""
 Q
 ;LR*5.2*573
Q18(LRU) ;Find out if Accession Areas conflict with user
 ;User or HOWDY DUZ(2) - INSTITUTION
 N LRTEST,LRPARENT,LRIX,LRI,LRNAA,LROTS
 D Q19
 S (LRIX,LRI)=0 F  S LRIX=$O(LROTS(LRIX)) Q:LRIX<1  S LROTS(LRIX)=$S('$D(^LAB(60,LRIX,8,LRU)):0,1:1)
 S LRIX=0,LRNAA=1 F  S LRIX=$O(LROTS(LRIX)) Q:LRIX<1  I 'LROTS(LRIX) S LRNAA=0 Q
 I LRNAA Q 1
 I '$G(LRNAAAC) D
 . W !!,"One or more of the ordered tests does not have an "
 . W "appropriate accession area.",!!,"ORDER # ",LRORD," IS NOT ACCESSIONED",!
 H 1 S LRNAAAC=1
 Q 0
 ;
Q19 ;Get tests on the order
 N LRJ,LRTE,LRTN,LROS
 S LRJ=0 F  S LRJ=$O(^LRO(69,"C",LRORD,LRJ)) Q:LRJ<1  D
 . S LRTE=0 F  S LRTE=$O(^LRO(69,"C",LRORD,LRJ,LRTE)) Q:LRTE<1  D
 . . S LRTN=0 F  S LRTN=$O(^LRO(69,LRJ,1,LRTE,2,"B",LRTN)) Q:LRTN<1  D
 . . . S LROS=0 F  S LROS=$O(^LRO(69,LRJ,1,LRTE,2,"B",LRTN,LROS)) Q:LROS<1  D
 . . . . I $P($G(^LRO(69,LRJ,1,LRTE,2,LROS,0)),U,9)'="CA" S LROTS(LRTN)=1