LRPEND ;DALISC/FHS - SET LAB PENDING FILE ; 2/9/97 15:41 ;
;;5.2T9;LR;**1018**;Nov 17, 2004
;;5.2;LAB SERVICE;**153**;Sep 27, 1994
Q
;PID = SSN / PSITE = Ordering Site # / CSITE = Collecting Site #
;PUID = Ordering Site UID / SPEC = Specimen
;LRRSITE("SMID") = Shipping Manifest # / SAMP = Colection Sample
;STATUS = Processing status / LRSD(REIN)= IEN in ^LRT(67
;ODT = Order date/time / CDT = Collection date/time
;SDT = Ship date/time / LRNT = Receive date/time
PSET(PID,PSITE,PUID,CSITE,SPEC,SAMP,STATUS,ODT,CDT,SDT,RDT,TST) ;
Q:'$D(^LRO(69.6,0))#2 S:'$G(LRNT) LRNT=$$NOW^LRAFUNC1
N DA,DIC,DIE,DINUM,DIR,DR,LRNNODE,LRX,X,Y,DLAYGO
K DO,DD
L +^LRO(69.6,0)
F LRNNODE=+$P(^LRO(69.6,0),U,3):1 Q:'$D(^LRO(69.6,LRNNODE))#2
L +^LRO(69.6,LRNNODE)
S (LR696IEN,DINUM,DA)=LRNNODE,DA(1)=69.6
S X=PNM,DIC="^LRO(69.6,",DIC(0)="LFNM",DLAYGO=69
S DIC("DR")=".01////"_PNM_";.02////"_SEX_";.03////"_DOB_";.09////"_PID
S DIC("DR")=DIC("DR")_";1////"_PSITE_";2////"_CSITE_";3////"_PUID_";4////"_SPEC_";18///"_$G(LRRSITE("SMID"))
FILE K DD,DO
D FILE^DICN S LRX=Y
L -(^LRO(69.6,0),^LRO(69.6,LRNNODE))
K DIC,DA,DR,DO,DD
I LRX<1 Q
S DR="5////"_SAMP_";6////"_STATUS_";7////"_+$G(LRSD("RIEN"))
S DR(1,69.6,1)="10////"_ODT_";11////"_CDT_";12////"_$P(SDT,U)_";13////"_LRNT
S DA=+LRX,DIE="^LRO(69.6,",DIC(0)="LNM"
D ^DIE
Q
TST ;
K DR,DA,DIC,DO
S PNM="STALLING,FRANK",SEX="M",DOB=2440120,LRDPTDFN=7
S LRDPF=67,LRRIEN=10
S LRUID=170_DT,I=100 F S I=I+1 I '$D(LRO(68,"C",LRUID_I)) S LRUID=LRUID_I Q
S SSN(2)=111223333,LRRSITE=41,LRSPEC=72
S LRSD("RIEN")=10
S LRSAMP=4,(LRODT,LRCDT,LRODT)=DT,LRNT=$$NOW^LRAFUNC1
S STATUS=131
S LROT(4,72,11)=181,LROT(4,72,11,2)=71
S LROT(4,72,"SN")=3
;(PID,PSITE,PUID,SPEC,SAMP,STATUS,ODT,CDT,SDT,RDT,.TST)
D PSET(SSN(2),+LRRSITE,LRUID,+LRRSITE,LRSPEC,LRSAMP,STATUS,LRODT,$P(LRCDT,U),LRCDT,LRNT,.LROT)
Q
LRPEND ;DALISC/FHS - SET LAB PENDING FILE ; 2/9/97 15:41 ;
+1 ;;5.2T9;LR;**1018**;Nov 17, 2004
+2 ;;5.2;LAB SERVICE;**153**;Sep 27, 1994
+3 QUIT
+4 ;PID = SSN / PSITE = Ordering Site # / CSITE = Collecting Site #
+5 ;PUID = Ordering Site UID / SPEC = Specimen
+6 ;LRRSITE("SMID") = Shipping Manifest # / SAMP = Colection Sample
+7 ;STATUS = Processing status / LRSD(REIN)= IEN in ^LRT(67
+8 ;ODT = Order date/time / CDT = Collection date/time
+9 ;SDT = Ship date/time / LRNT = Receive date/time
PSET(PID,PSITE,PUID,CSITE,SPEC,SAMP,STATUS,ODT,CDT,SDT,RDT,TST) ;
+1 IF '$DATA(^LRO(69.6,0))#2
QUIT
IF '$GET(LRNT)
SET LRNT=$$NOW^LRAFUNC1
+2 NEW DA,DIC,DIE,DINUM,DIR,DR,LRNNODE,LRX,X,Y,DLAYGO
+3 KILL DO,DD
+4 LOCK +^LRO(69.6,0)
+5 FOR LRNNODE=+$PIECE(^LRO(69.6,0),U,3):1
IF '$DATA(^LRO(69.6,LRNNODE))#2
QUIT
+6 LOCK +^LRO(69.6,LRNNODE)
+7 SET (LR696IEN,DINUM,DA)=LRNNODE
SET DA(1)=69.6
+8 SET X=PNM
SET DIC="^LRO(69.6,"
SET DIC(0)="LFNM"
SET DLAYGO=69
+9 SET DIC("DR")=".01////"_PNM_";.02////"_SEX_";.03////"_DOB_";.09////"_PID
+10 SET DIC("DR")=DIC("DR")_";1////"_PSITE_";2////"_CSITE_";3////"_PUID_";4////"_SPEC_";18///"_$GET(LRRSITE("SMID"))
FILE KILL DD,DO
+1 DO FILE^DICN
SET LRX=Y
+2 LOCK -(^LRO(69.6,0),^LRO(69.6,LRNNODE))
+3 KILL DIC,DA,DR,DO,DD
+4 IF LRX<1
QUIT
+5 SET DR="5////"_SAMP_";6////"_STATUS_";7////"_+$GET(LRSD("RIEN"))
+6 SET DR(1,69.6,1)="10////"_ODT_";11////"_CDT_";12////"_$PIECE(SDT,U)_";13////"_LRNT
+7 SET DA=+LRX
SET DIE="^LRO(69.6,"
SET DIC(0)="LNM"
+8 DO ^DIE
+9 QUIT
TST ;
+1 KILL DR,DA,DIC,DO
+2 SET PNM="STALLING,FRANK"
SET SEX="M"
SET DOB=2440120
SET LRDPTDFN=7
+3 SET LRDPF=67
SET LRRIEN=10
+4 SET LRUID=170_DT
SET I=100
FOR
SET I=I+1
IF '$DATA(LRO(68,"C",LRUID_I))
SET LRUID=LRUID_I
QUIT
+5 SET SSN(2)=111223333
SET LRRSITE=41
SET LRSPEC=72
+6 SET LRSD("RIEN")=10
+7 SET LRSAMP=4
SET (LRODT,LRCDT,LRODT)=DT
SET LRNT=$$NOW^LRAFUNC1
+8 SET STATUS=131
+9 SET LROT(4,72,11)=181
SET LROT(4,72,11,2)=71
+10 SET LROT(4,72,"SN")=3
+11 ;(PID,PSITE,PUID,SPEC,SAMP,STATUS,ODT,CDT,SDT,RDT,.TST)
+12 DO PSET(SSN(2),+LRRSITE,LRUID,+LRRSITE,LRSPEC,LRSAMP,STATUS,LRODT,$PIECE(LRCDT,U),LRCDT,LRNT,.LROT)
+13 QUIT