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

APCD206F.m

Go to the documentation of this file.
  1. APCD206F ; IHS/CMI/TUCSON - DATA ENTRY PATCH 6 [ 03/24/03 2:14 PM ]
  1. ;;2.0;IHS RPMS/PCC Data Entry;**6**;MAR 09, 1999
  1. ;
  1. W !,"checking V LAB for correct provider entries...Hold on..."
  1. I $P(^AUTTSITE(1,0),U,22)=1 Q
  1. I $P(^DD(9000010.06,.01,0),U,2)[200 Q
  1. I $P(^DD(9000010.09,1202,0),U,2)[6 Q ;fix already ran or never installed patch 5
  1. FIX ;
  1. D ^APC7INIT
  1. S APCDLAST=$P(^AUPNVLAB(0),U,3)
  1. ;loop through V LAB since date of patch 5 install and fix V LAB 1202
  1. S APCDII=$O(^XPD(9.7,"B","APCD*2.00*5",0))
  1. I 'APCDII W !!,"APCD patch 5 never installed. No need to run post init." K APCDII Q
  1. S APCDID=$P($G(^XPD(9.7,APCDII,1)),U)
  1. S APCDID=$P(APCDID,".")
  1. F S APCDID=$O(^AUPNVSIT("B",APCDID)) Q:APCDID'=+APCDID D
  1. .S APCDV=0 F S APCDV=$O(^AUPNVSIT("B",APCDID,APCDV)) Q:APCDV'=+APCDV D
  1. ..Q:'$D(^AUPNVLAB("AD",APCDV)) ;no v labs
  1. ..S APCDL=0 F S APCDL=$O(^AUPNVLAB("AD",APCDV,APCDL)) Q:APCDL'=+APCDL D
  1. ...Q:APCDL>APCDLAST
  1. ...Q:$P($G(^AUPNVLAB(APCDL,12)),U,2)=""
  1. ...S APCDOLD=$P($G(^AUPNVLAB(APCDL,12)),U,2) ;is a file 200 ptr
  1. ...Q:'$D(^VA(200,APCDOLD,0))
  1. ...S APCDNEW=$P(^VA(200,APCDOLD,0),U,16) ;file 6 ptr
  1. ...Q:APCDNEW=""
  1. ...S Y=$$TXLGN($P(^AUPNVLAB(APCDL,0),U,6),APCDL)
  1. ...I Y]"",Y'=$P(^DIC(16,APCDNEW,0),U,1) Q
  1. ...S DA=APCDL,DIE="^AUPNVLAB(",DR="1202///`"_APCDNEW D ^DIE D ^XBFMK
  1. ...W ":",APCDL
  1. ...Q
  1. ..Q
  1. .Q
  1. D CHECK
  1. W !!,"all done"
  1. Q
  1. ;
  1. TXLGN(ACC,VF) ;
  1. NEW A,B,C,G,P
  1. I $G(ACC)="" Q ""
  1. I $G(VF)="" Q ""
  1. S P="",G=0,A=0 F S A=$O(^BLRTXLOG("D",ACC,A)) Q:A'=+A!(G) D
  1. .S B=$P($G(^BLRTXLOG(A,1)),U,5)
  1. .I B=VF S G=1,P=$P($G(^BLRTXLOG(A,11)),U,4) I P S P=$P(^VA(200,P,0),U)
  1. .Q
  1. Q P
  1. ;
  1. C ;
  1. S X=0 F S X=$O(^VA(200,X)) Q:X'=+X D
  1. .S Y=$P(^VA(200,X,0),U,16)
  1. .Q:Y=""
  1. .I $P(^DIC(16,Y,0),U)'=$P(^VA(200,X,0),U) W !,Y," ",X
  1. .Q
  1. Q
  1. CHECK ;
  1. NEW VFP,TXP,NEW,DA,DIE,APCDX,VF
  1. W !,"hang on...checking..."
  1. S APCDX=0 F S APCDX=$O(^BLRTXLOG(APCDX)) Q:APCDX'=+APCDX D
  1. .I $P($G(^BLRTXLOG(APCDX,1)),U,3)<3021001 Q
  1. .Q:$P(^BLRTXLOG(APCDX,1),U,4)'=9000010.09
  1. .S VF=$P(^BLRTXLOG(APCDX,1),U,5)
  1. .Q:VF=""
  1. .Q:'$D(^AUPNVLAB(VF,12))
  1. .Q:'$D(^AUPNVLAB(VF,0))
  1. .S VFP=$$VAL^XBDIQ1(9000010.09,VF,1202)
  1. .S TXP=$$VAL^XBDIQ1(9009022,APCDX,1104)
  1. .I VFP=TXP Q ;a match
  1. .I $P(VFP,",")=$P(TXP,",") Q
  1. .;I VFP'=TXP W !,"does not match: VF=",VF," TX=",APCDX," ",VFP," ",TXP
  1. .S NEW=$P(^BLRTXLOG(APCDX,11),U,4),NEW=$P(^VA(200,NEW,0),U,16)
  1. .Q:NEW=""
  1. .S DA=VF,DIE="^AUPNVLAB(",DR="1202///`"_NEW D ^DIE,^XBFMK
  1. .Q
  1. W !,"all done"
  1. Q