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

RMPR145P.m

Go to the documentation of this file.
  1. RMPR145P ;VM/RB - FIX PROBLEM PCE ENCOUNTERS FROM FILE #660 ITEMS ;03/27/08
  1. ;;3.0;Prosthetics;**145**;13/27/08;Build 6
  1. ;;
  1. Q
  1. FIXPCE ;1. Post install to correct 'action required' PCE Encounters created
  1. ; from Prosthetic items via nightly PCE interface and edit/delete
  1. ; issues/orders.
  1. ;
  1. BUILD K ^XTMP("RMPR145P") D NOW^%DTC S RMSTART=%
  1. S ^XTMP("RMPR145P","START COMPILE")=RMSTART
  1. S ^XTMP("RMPR145P","END COMPILE")="RUNNING"
  1. S ^XTMP("RMPR145P",0)=$$FMADD^XLFDT(RMSTART,90)_"^"_RMSTART
  1. 0 ;FIND 660 RECORDS WITH PCE LINKS
  1. S IEN=0,U="^",XX=0,TOT=0
  1. 1 S IEN=$O(^RMPR(660,IEN)) G EXIT:IEN=""!(IEN]"@")
  1. S R=$G(^RMPR(660,IEN,0)),DFN=$P(R,U,2),R10=$G(^RMPR(660,IEN,10))
  1. ;I $E($P(R,U),1,3)<306 G 1
  1. G:DFN="" 1 S PNAME=$P(^DPT(DFN,0),U,1)
  1. I R=""!(R10="") G 1
  1. S VISIEN=$P(R10,U,12) I VISIEN="" G 1
  1. S RV=$G(^AUPNVSIT(VISIEN,0)) I RV="" G 1
  1. S RV8=$G(^AUPNVSIT(VISIEN,800))
  1. 2 ;check for required contaminants in associated encounter
  1. S PCEIEN=$O(^SCE("AVSIT",VISIEN,0)) I PCEIEN="" G 1
  1. S PCE0=$G(^SCE(PCEIEN,0)) I PCE0="" G 1
  1. I $P(PCE0,U,12)'=14 G 1
  1. EVAL ;beginning of evaluation criteria for 'action required'
  1. S SDOE=PCEIEN
  1. S SDOE0=$$GETOE^SDOE(SDOE),SDIV=$P(SDOE0,U,11)
  1. D DEM^VADPT M SDDPT=VADM
  1. K SDX D CLASK^SDCO2(PCEIEN,.SDX)
  1. I '$D(SDX) G 1
  1. S SDI=0,ERR=0,SDXX="" F S SDI=$O(SDX(SDI)) Q:'SDI I $P(SDX(SDI),U,2)="" S SDX="" D I SDX'="" S ERR=1,^XTMP("RMPR145P",660,IEN,99,SDI)=SDX(SDI)_U_SDX,SDXX=SDXX_U_SDI
  1. . I '$D(^SD(409.41,SDI,0)) S SDX="Classification required" S:'$D(TOT(SDI)) TOT(SDI)=0 S TOT(SDI)=TOT(SDI)+1 Q ;W !,SDX Q
  1. . S SDX=$P($G(^SD(409.41,SDI,0)),U,1)_" classification required" S:'$D(TOT(SDI)) TOT(SDI)=0 S TOT(SDI)=TOT(SDI)+1 ;W !,SDX
  1. I ERR=1 S TOT=TOT+1 D
  1. . S ^XTMP("RMPR145P",660,IEN,10)=R
  1. . S ^XTMP("RMPR145P",660,IEN,10)=R10
  1. . S ^XTMP("RMPR145P",660,IEN,11)=RV
  1. . S ^XTMP("RMPR145P",660,IEN,12)=RV8
  1. . S ^XTMP("RMPR145P",660,IEN,13)=PCE0
  1. . ;W !!,IEN,?15,PNAME,!,R,!,R10,!,VISIEN,!,RV,!,RV8,!,PCEIEN,!,PCE0,!,SDXX
  1. . F I=1:1:7 I $P(RV8,U,I)="" S XX=80000+I,DA=VISIEN,DR=XX_"////^S X=0",DIE="^AUPNVSIT(" D ^DIE
  1. . S DA=PCEIEN,DR=".12////^S X=2",DIE="^SCE(" D ^DIE
  1. G 1
  1. EXIT ;
  1. ;S II=0 W !
  1. ;F S II=$O(TOT(II)) Q:II="" D
  1. ;. S ENM=$P($G(^SD(409.41,II,0)),U)
  1. ;. W !,ENM," classification required",?50,TOT(II)
  1. ;W !!,"TOTAL 'ACTION REQUIRED' ENCOUNTERS CORRECTED: ",TOT
  1. D NOW^%DTC S RMEND=%
  1. M ^XTMP("RMPR145P","ERRS")=TOT
  1. S ^XTMP("RMPR145P","END COMPILE")=RMEND
  1. K RMEND,RMSTART,IEN,XX,TOT,R,R10,DFN,PCEIEN,VISIEN,PNAME,RV,RV8,PCE0,SDOE,SDOE0,SDIV,VADM,SDDPT,SDX,SDI
  1. K ERR,SDXX,TOT,I,DA,DR,DIE,II,ENM
  1. Q