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

LRSTUF2.m

Go to the documentation of this file.
LRSTUF2 ;SLC/CJS/DALOI/FHS - MASS DATA ENTRY INTO FILE 63.04 ;JUL 06, 2010 3:14 PM
 ;;5.2;LAB SERVICE;**121,153,263,347,1027**;NOV 01, 1997
LRSTUFF W !,"Acc #: ",LRAN I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0))!'$D(^(3)) W !," not set up." Q
 S LRNOP=1,I=0 F  S I=$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,I)) Q:I<1  I $D(^(I,0)),LRTESTSV=+^(0) S LRNOP=0
 I LRNOP W " doesn't have the test required." Q
 ; S LRDFN=+^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRODT=$P(^(0),U,4),LRSN=$P(^(0),U,5),LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX W ?15,PNM,?45,SSN
 S LRDFN=+^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRODT=$P(^(0),U,4),LRSN=$P(^(0),U,5),LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX W ?15,PNM,?45,HRCN  ;IHS/ANMC/CLS 08/18/96
 Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,3))  S LRIDT=$P(^(3),U,5),LRMETH="(BD)"_DUZ_"/"_DUZ(2) I LRDPF'=62.3 S LRLLOC=$P(^(0),U,7) S:'$L(LRLLOC) LRLLOC="UNKNOWN" W ?65,LRLLOC
 L +^LR(LRDFN,"CH",LRIDT):5 I '$T W !!,"Someone else is editing this entry ",!,$C(7) Q
 I $P(^LR(LRDFN,LRSS,LRIDT,0),U,3),("pending"'[$S($D(^(LRFLD)):$P(^(LRFLD),U,1),1:"pending")) W !?25,"VERIFIED DATA, CAN'T CHANGE" L -^LR(LRDFN,"CH",LRIDT) Q
 I $P(^LR(LRDFN,LRSS,LRIDT,0),U,3) W ?45,"Some Data Already Verified "
 I '$T,$O(^LR(LRDFN,LRSS,LRIDT,1))>1 W ?45,"Some Unverified Data Already Entered. " L -^LR(LRDFN,"CH",LRIDT) Q
 S I=0 F  S I=$O(^TMP("LR",$J,"VTO",I)) Q:I<1  S ^TMP("LR",$J,"VTO",I,"P")=I_U_$$NLT^LRVER1(I)
 W ! S DIE="^LR("_LRDFN_",""CH"",",DA=LRIDT D ^DIE I LRA'=1,$D(Y) W !,"Do you wish to stop" S %=1 D YN^DICN I %=1 S LREND=1 L -^LR(LRDFN,"CH",LRIDT) Q
 I $L($G(LRVX)) S X=LRVX,LRFLG="",LRSPEC=+$P(^LR(LRDFN,LRSS,LRIDT,0),U,5),LRTS=LRTESTSV D
 . K LRSB S LRSB=LRFLD
 . D V25^LRVER5,RANGE^LRVER5
STOR I $D(^LR(LRDFN,LRSS,LRIDT,LRFLD))#2,$L($P(^(LRFLD),U)),$L(X) D
 . N LRX,LRXX,LRP
 . X:$G(LRDEL)'="" LRDEL
 . S LRXX=X
 . S $P(LRXX,U,2)=LRFLG,$P(LRXX,U,4)=DUZ,$P(LRXX,U,9)=$G(DUZ(2))
 . S $P(LRXX,U,5)=$TR(LRNG,U,"!")
 . K ^TMP("LR",$J,"TMP")
 . S LRP=$O(^LAB(60,"C",LRSS_";"_LRFLD_";1",0))
 . S ^TMP("LR",$J,"TMP",LRFLD)=LRP
 . S LRX=+$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRTESTSV,0)),U,9)
 . I LRX,LRP D
 . . S ^TMP("LR",$J,"TMP",LRFLD,"P")=LRX_U_$$NLT^LRVER1(LRX)_"!"_$$RNLT^LRVER1(LRP)
 . . S $P(LRXX,U,3)=$P($G(^TMP("LR",$J,"TMP",LRFLD,"P")),U,2)
 . S ^LR(LRDFN,LRSS,LRIDT,LRFLD)=LRXX
 . I $D(^LR(LRDFN,LRSS,LRIDT,0)),$P(^(0),U,8)'[LRMETH S $P(^(0),U,8)=LRMETH_";"_$P(^(0),U,8)
 I '$D(LRSB(LRFLD)) W ?39,"**NOT STUFFED**",$C(7) L -^LR(LRDFN,"CH",LRIDT) Q
 N LRCORECT S LRCORECT=0
 D VER^LRVER3A,REQ W ?45,"STUFFED"
 I $P(LRPARAM,U,14),$P($G(^LRO(68,LRAA,0)),U,16) D LOOK^LRCAPV1
 S ^LRO(68,"AC",LRDFN,LRIDT,LRFLD)=""
 L -^LR(LRDFN,"CH",LRIDT)
 I $P($G(LRORU3),U,3),$O(LRSB(0)) D LRORU3^LRVER3
 Q
RANGE F R=$P(LRAC,"-",1):1:$P(LRAC,"-",2) S LRAC(R)=""
 Q
REQ F X=0:0 S X=$O(M(X)) Q:X<1  S I=M(X) D:'$D(^LR(LRDFN,"CH",LRIDT,X)) ROLL
 Q
ROLL S ^LRO(68,LRAA,1,LRAD,1,LRAN,4,I,0)=I_U_LROUTINE,$P(^(0),U,9)=$P($G(^TMP("LR",$J,"TMP",LRFLD,"P")),U)
 S ^LRO(68,LRAA,1,LRAD,1,LRAN,4,"B",I,I)="",^LR(LRDFN,"CH",LRIDT,X)="pending",$P(^LRO(68,LRAA,1,LRAD,1,LRAN,3),U,4)=""
 Q