VistA-WorldVistAEHR/r/LIBRARY-LBR-LBRS/LBRYPRC1.m

46 lines
2.4 KiB
Mathematica

LBRYPRC1 ;SSI/ALA-PROCESS TRANSACTIONS CONTINUED ;[ 05/23/97 12:13 PM ]
;;2.5;Library;**2**;Mar 11, 1996
FR ; Update frequencies
S IDA=$P(LDATA(1),U,3),FRQ=$P(LDATA(4),U,4),SYN=$P(LDATA(2),U),DIC="^LBRY(680.2,"
I $D(^LBRY(680.2,IDA)) S DIE=DIC,DA=IDA,DR="[LBRYFRUP]" D ^DIE
I '$D(^LBRY(680.2,IDA)) S ^LBRY(680.2,IDA,0)=FRQ_U_SYN,DIK=DIC,DA=IDA D EN^DIK
I TAF'="",$G(^LBRY(680.5,TAF,0))'="" S $P(^LBRY(680.5,TAF,0),U,4)=IDA
K IDA,LDATA,FRQ,SYN,DIC,DIE,DA,DR,DIK,TAF,D,D0,DA,X
Q
PU ; Update publishers
S IDA=$P(LDATA(1),U,3),PUB=$P(LDATA(4),U),DIC="^LBRY(680.1,"
I $D(^LBRY(680.1,IDA)) S DIE=DIC,DA=IDA,DR="[LBRYPUUP]" D ^DIE
I '$D(^LBRY(680.1,IDA)) S ^LBRY(680.1,IDA,0)=PUB,DIK=DIC,DA=IDA D EN^DIK
I TAF'="",$G(^LBRY(680.5,TAF,3))'="" S $P(^LBRY(680.5,TAF,3),U,2)=IDA
K IDA,LDATA,FRQ,SYN,DIC,DIE,DA,DR,DIK,TAF,D,D0,DA,X
Q
IN ; Update indexing sources
K LDATA S NM=$O(^LBRY(682.1,TRN,6,"")),LDATA=^LBRY(682.1,TRN,6,NM,0)
S IDA=$P(LDATA,U,3),TIT=$P(LDATA,U),COD=$P(LDATA,U,2),DIC="^LBRY(680.8,"
I $D(^LBRY(680.8,IDA)) S DIE=DIC,DA=IDA,DR="[LBRYINUP]" D ^DIE
I '$D(^LBRY(680.8,IDA)) S ^LBRY(680.8,IDA,0)=TIT_U_COD,DIK=DIC,DA=IDA D EN^DIK
I TAF'="",'$D(^LBRY(680.5,TAF,1,"B",IDA)) D
. S NM=0 F S NM=$O(^LBRY(680.5,TAF,1,NM)) Q:NM'>0!(NM="") S LNM=NM
. Q:$G(LNM)=""
. S LNM=LNM+1,^LBRY(680.5,TAF,1,LNM,0)=IDA,^LBRY(680.5,TAF,1,"B",IDA,LNM)=""
. S $P(^LBRY(680.5,TAF,1,0),U,3,4)=LNM_U_LNM
K LDATA,NM,IDA,TIT,COD,DIC,DIE,DA,DR,DIK,LNM,D,D0,DA,X
Q
PP ; Update prediction patterns
S LDATA(5)=$G(^LBRY(682.1,TRN,5)),IDA=$P(LDATA(1),U,3),DIC="^LBRY(680.9,"
S COD=$P(LDATA(4),U,6),NAM=$P(LDATA(4),U,5)
I $D(^LBRY(680.9,IDA)) S DIE=DIC,DA=IDA,DR="[LBRYPPUP]" D ^DIE
I '$D(^LBRY(680.9,IDA)) S $P(^LBRY(680.9,IDA,0),U,1,2)=COD_U_NAM,DIK=DIC,DA=IDA D EN^DIK
S FRM="5;1^5;2^5;3^5;4^5;5^5;6^5;7^5;8",TOM="0;3^3;1^0;4^2;4^2;1^2;3^2;2^0;5"
F I=1:1:8 S FR=$P(FRM,U,I),TO=$P(TOM,U,I) D
. S ND1=$P(FR,";"),PC1=$P(FR,";",2),ND2=$P(TO,";"),PC2=$P(TO,";",2)
. S $P(^LBRY(680.9,IDA,ND2),U,PC2)=$P(^LBRY(682.1,TRN,ND1),U,PC1)
K ^LBRY(680.9,IDA,1) S NM=0
F S NM=$O(^LBRY(682.1,TRN,8,NM)) Q:NM="" D
. S ^LBRY(680.9,IDA,1,NM,0)=^LBRY(682.1,TRN,8,NM,0)
. S $P(^LBRY(680.9,IDA,1,0),U,3,4)=NM_U_NM
I $D(^LBRY(680.9,IDA,1))>0 S $P(^LBRY(680.9,IDA,1,0),U,5)=DT
I TAF'="",$G(^LBRY(680.5,TAF,0))'="" S $P(^LBRY(680.5,TAF,0),U,3)=IDA
K LDATA,NAM,COD,IDA,TAF,ND1,ND2,PC1,PC2,FRM,FR,TOM,TM,NM,DR,DIC,DIE,D,D0,DA,X
Q