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

BLRTN1.m

Go to the documentation of this file.
BLRTN1 ; IHS/HQT/MJL - CREATE/EDIT TRANSACTIONS ; [ 11/19/2002  8:22 AM ]
 ;;5.2;LR;**1011,1013,1015**;NOV 18, 2002
SETPRNT ;
 K BLR
 S BLRCDT=^BLRSITE(BLRQSITE,20,BLRQDH,1,BLRLTP,"LRCDT")\1,BLR("STATUS FLAG")="R"
 ;S BLRLTST=0 F  S BLRLTST=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST)) Q:BLRLTST=""  S BLRSEQ=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST,""),-1) I BLRSEQ'="",$P(^BLRTXLOG(BLRSEQ,12),U)=$G(BLRCDT) S BLRANSEQ(BLRSEQ)=""
 Q:$G(BLRACCN)=""  ;IHS/ITSC/TPF 06/06/02 IF WE DON'T HAVE AN ACCESSION
 ;                  NUM WE CAN'T PROCESS
 ;                  DUE TO DELETION 
 S BLRLTST=0 F  S BLRLTST=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST)) Q:'BLRLTST  S BLRSEQ=0 F  S BLRSEQ=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST,BLRSEQ)) Q:'BLRSEQ  I $P($G(^BLRTXLOG(BLRSEQ,12)),U)\1=BLRCDT S BLRANSEQ(BLRSEQ)=""
 S BLRSEQ="" F  S BLRSEQ=$O(BLRANSEQ(BLRSEQ),-1) Q:BLRSEQ=""  S BLRDEL=$G(^BLRTXLOG(BLRSEQ,1)),BLRPAR=$P(BLRDEL,U),BLRDEL=$P(BLRDEL,U,2)="D" S:BLRPAR'="" BLRPAR(BLRPAR)=$G(BLRPAR(BLRPAR)) D
 .;A CHILD WHOSE PARENT IS DISQUALIFIED
 .;I 'BLRCMP,BLRPAR,BLRPAR(BLRPAR) Q
 .I BLRPAR,BLRPAR(BLRPAR) Q
 .;A PARENT
 .I $D(BLRPAR(BLRSEQ)) D  Q
 ..;I 'BLRCMP,BLRPAR(BLRSEQ) S:BLRPAR'="" BLRPAR(BLRPAR)=1 Q
 ..I BLRPAR(BLRSEQ) S:BLRPAR'="" BLRPAR(BLRPAR)=1 Q
 ..I 'BLRDEL S BLR("SEQUENCE NUMBER")=BLRSEQ,BLRIEN=BLRSEQ_",",BLRENT=BLRSEQ,BLRENTS(1)=BLRENT D ^BLRNFLTL Q
 .;NOT A PARENT
 .I $P($G(^BLRTXLOG(BLRSEQ,20)),U)="" D  Q
 ..;I 'BLRCMP,BLRPAR,$P(^LAB(60,$P(^BLRTXLOG(BLRSEQ,0),U,6),0),U,17) S BLRPAR(BLRPAR)=1 Q
 ..I BLRPAR,$P(^LAB(60,$P(^BLRTXLOG(BLRSEQ,0),U,6),0),U,17) S BLRPAR(BLRPAR)=1 Q
 .; NOT NEEDED - ONLY PARENTS S/B UPDATED -- DEACTIVATED - Q ADDED TO
 .; DO DOING THIS BLOCK
 .;I BLRCMP,'BLRDEL S BLR("SEQUENCE NUMBER")=BLRSEQ,BLRIEN=BLRSEQ_",",BLRENT=BLRSEQ D ^BLRNFLTL Q
 K BLRANSEQ,BLRHSEQ,BLRLSEQ,BLRLTST,BLRPAR
 Q