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

ICPTMIDX.m

Go to the documentation of this file.
  1. ICPTMIDX ;DLS/DEK - MUMPS Cross Reference Routine for History ; 04/28/2003
  1. ;;6.0;CPT/HCPCS;**14**;May 19, 1997;Build 44
  1. ;
  1. ; ICPTMOD CPT/HCPC Code Modifier from Global
  1. ; ICPTMODX CPT/HCPC Code Modifier passed in (X)
  1. ; ICPTEFF Effective Date
  1. ; ICPTSTA Status
  1. ; ICPTNOD Global Node (to reduce Global hits)
  1. ; DA ien file 81.3 or 81.33
  1. ; ICPTIEN,DA(1) ien of file 81.3
  1. ; ICPTHIS ien of file 81.33
  1. ; X Data passed in to be indexed
  1. ;
  1. ; Set and Kill Activation History
  1. ;
  1. ; File 81.3, field .01
  1. SAHC ; Set new value when CPT Code Modifier is Edited
  1. ; ^DD(81.3,.01,1,D0,1) = D SAHC^ICPTMIDX
  1. N ICPTNOD,ICPTSTA,ICPTEFF,ICPTMOD,ICPTMODX,ICPTHIS,ICPTIEN
  1. S ICPTMODX=$G(X) Q:'$L(ICPTMODX) S ICPTIEN=+($G(DA)) Q:+ICPTIEN'>0
  1. S ICPTHIS=0 F S ICPTHIS=$O(^DIC(81.3,+ICPTIEN,60,ICPTHIS)) Q:+ICPTHIS=0 D
  1. . N DA,X S DA=+ICPTHIS,DA(1)=+ICPTIEN D HDC
  1. . S ICPTMOD=ICPTMODX Q:'$L($G(ICPTMOD))
  1. . Q:'$L($G(ICPTEFF)) Q:'$L($G(ICPTSTA)) D SHIS
  1. Q
  1. KAHC ; Kill old value when CPT Code is Edited
  1. ; ^DD(81.3,.01,1,D0,2) = D KAHC^ICPTMIDX
  1. N ICPTNOD,ICPTSTA,ICPTEFF,ICPTMOD,ICPTMODX,ICPTHIS,ICPTIEN
  1. S ICPTMODX=$G(X) Q:'$L(ICPTMODX) S ICPTIEN=+($G(DA)) Q:+ICPTIEN'>0
  1. S ICPTHIS=0 F S ICPTHIS=$O(^DIC(81.3,+ICPTIEN,60,ICPTHIS)) Q:+ICPTHIS=0 D
  1. . N DA,X S DA=+ICPTHIS,DA(1)=+ICPTIEN D HDC
  1. . S ICPTMOD=ICPTMODX Q:'$L($G(ICPTMOD))
  1. . Q:'$L($G(ICPTEFF)) Q:'$L($G(ICPTSTA)) D KHIS
  1. Q
  1. ;
  1. ; File 81.33, field .01
  1. SAHD ; Set new value when Effective Date is Edited
  1. ; ^DD(81.33,.01,1,D0,1) = D SAHD^ICPTMIDX
  1. N ICPTNOD,ICPTSTA,ICPTEFF,ICPTMOD
  1. D HDC Q:'$L($G(ICPTMOD)) Q:'$L($G(ICPTSTA)) S ICPTEFF=+($G(X)) Q:+ICPTEFF=0 D SHIS
  1. Q
  1. KAHD ; Kill old value when Effective Date is Edited
  1. ; ^DD(81.33,.01,1,D0,2) = D KAHD^ICPTMIDX
  1. N ICPTNOD,ICPTSTA,ICPTEFF,ICPTMOD
  1. D HDC Q:'$L($G(ICPTMOD)) Q:'$L($G(ICPTSTA))
  1. S ICPTEFF=+($G(X)) Q:+ICPTEFF=0 D KHIS
  1. Q
  1. ;
  1. ; File 81.33, field .02
  1. SAHS ; Set new value when Status is Edited
  1. ; ^DD(81.33,.02,1,D0,1) = D SAHS^ICPTMIDX
  1. N ICPTNOD,ICPTSTA,ICPTEFF,ICPTMOD
  1. D HDC Q:'$L($G(ICPTMOD)) Q:+ICPTEFF=0
  1. S ICPTSTA=$G(X) Q:'$L(ICPTSTA) D SHIS
  1. Q
  1. KAHS ; Kill old value when Status is Edited
  1. ; ^DD(81.33,.02,1,D0,2) = D KAHS^ICPTMIDX
  1. N ICPTNOD,ICPTSTA,ICPTEFF,ICPTMOD
  1. D HDC Q:'$L($G(ICPTMOD)) Q:+ICPTEFF=0
  1. S ICPTSTA=$G(X) Q:'$L(ICPTSTA) D KHIS
  1. Q
  1. ;
  1. HDC ; Set Common Variables (Code, Status and Effective Date)
  1. S (ICPTMOD,ICPTSTA,ICPTEFF)=""
  1. Q:+($G(DA(1)))'>0 Q:+($G(DA))'>0 Q:'$D(^DIC(81.3,+($G(DA(1))),60,+($G(DA)),0))
  1. S ICPTMOD=$P($G(^DIC(81.3,+($G(DA(1))),0)),"^",1),ICPTNOD=$G(^DIC(81.3,+($G(DA(1))),60,+($G(DA)),0))
  1. S ICPTSTA=$P(ICPTNOD,"^",2),ICPTEFF=$P(ICPTNOD,"^",1)
  1. Q
  1. ;
  1. SHIS ; Set Index ^DIC(81.3,"ACT",<code>,<status>,<date>,<ien>,<history>)
  1. Q:+($G(DA(1)))'>0 Q:+($G(DA))'>0 Q:'$D(^DIC(81.3,+($G(DA(1))),60,+($G(DA)),0))
  1. S ^DIC(81.3,"ACT",(ICPTMOD_" "),ICPTSTA,ICPTEFF,DA(1),DA)=""
  1. N PIECE,INACT S PIECE=$S('ICPTSTA:7,1:8),INACT=$S('ICPTSTA:1,1:"")
  1. S $P(^DIC(81.3,DA(1),0),"^",5)=INACT,$P(^DIC(81.3,DA(1),0),"^",PIECE)=ICPTEFF
  1. Q
  1. KHIS ; Kill Index ^DIC(81.3,"ACT",<code>,<status>,<date>,<ien>,<history>)
  1. Q:+($G(DA(1)))'>0 Q:+($G(DA))'>0 Q:'$D(^DIC(81.3,+($G(DA(1))),60,+($G(DA)),0))
  1. N PIECE,INACT,IEN,OPP,OPPSTA,OPPEFF,BOOL
  1. S PIECE=$S('ICPTSTA:7,1:8),INACT=$S('ICPTSTA:"",1:1),OPPEFF=ICPTEFF,BOOL=0
  1. F S OPPEFF=$O(^DIC(81.3,DA(1),60,"B",OPPEFF),-1) Q:'OPPEFF!BOOL D
  1. . S IEN=$O(^DIC(81.3,DA(1),60,"B",OPPEFF,""))
  1. . I 'IEN S OPPEFF="" Q
  1. . S OPP=$G(^DIC(81.3,DA(1),60,IEN,0)),OPPEFF=$P($G(OPP),"^",1)
  1. . S OPPSTA=$P($G(OPP),"^",2),BOOL=OPPSTA'=ICPTSTA
  1. I BOOL D
  1. . S $P(^DIC(81.3,DA(1),0),"^",5)=INACT,$P(^DIC(81.3,DA(1),0),"^",PIECE)=OPPEFF
  1. E S $P(^DIC(81.3,DA(1),0),"^",5)=1,$P(^DIC(81.3,DA(1),0),"^",7,8)="^"
  1. K ^DIC(81.3,"ACT",(ICPTMOD_" "),ICPTSTA,ICPTEFF,DA(1),DA)
  1. Q