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

BWPATCH8.m

Go to the documentation of this file.
  1. BWPATCH8 ;IHS/CMI/LAB - BW PATCH 8 ;30-Jun-2003 22:42;PLS
  1. ;;2.0;WOMEN'S HEALTH;**8**;MAY 16, 1996
  1. ;
  1. ;
  1. ENV ; Check for duplicate RACE file entries
  1. ; The following line prevents the "Disable Options..." and "Move
  1. ; Routines..." questions from being asked during the install.
  1. S XPDENV=1,(XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
  1. N RVAL,IEN,DUP
  1. S RVAL=0 F S RVAL=$O(^DIC(10,"B",RVAL)) Q:RVAL="" D
  1. .S IEN=$O(^DIC(10,"B",RVAL,0))
  1. .S:$O(^DIC(10,"B",RVAL,IEN))>0 DUP=1
  1. D:$G(DUP) MES("THERE ARE DUPLICATE RACE VALUES IN THE RACE FILE!",1)
  1. Q
  1. ;
  1. PRE ;
  1. N DIK,DA
  1. S XPDENV=1,(XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
  1. ; Set Wise Woman Flag
  1. ; If flag =0 the fix in the post-init will not be run.
  1. S @XPDGREF@("WW")=$D(^BWPN(39,0))
  1. ; Purge entries in BW General Retrieval Items File
  1. D MES("Preparing BW GENERAL RETRIEVAL ITEMS File for new entries...")
  1. S DIK="^BWGRI("
  1. S DA=0 F S DA=$O(^BWGRI(DA)) Q:'DA D
  1. .D ^DIK
  1. D MES("Preparing BW RACE (NBCCEDP) for updates...")
  1. S DIK="^BWRACE("
  1. S DA=0 F S DA=$O(^BWRACE(DA)) Q:'DA D
  1. .D ^DIK
  1. Q
  1. POST ; Converts (seeds) the new field CDC RESULTS OF PAP TEST (2001) (#.241) based on the existing
  1. ; field CDC RESULTS OF PAP TEST (1991) (#.24) (old field name CDC EQUIV SCREENING PAP DX) in
  1. ; file BW RESULTS/DIAGNOSIS (#9002086.31) to handle 2001 Bethesda System Categories.
  1. ;
  1. N FDA,BWDA,BWDIE,X,Y,TXT,BWRIEN
  1. D MES("Resolving Race File Pointers in BW RACE MAPPINGS (NBCCEDP) File.")
  1. K ^BWRACE("B")
  1. S BWRIEN=0
  1. F S BWRIEN=$O(@XPDGREF@("RACEPTRS",BWRIEN)) Q:BWRIEN<1 D
  1. .S TXT=@XPDGREF@("RACEPTRS",BWRIEN)
  1. .D MES("Processing entry: "_BWRIEN_" = "_TXT)
  1. .S $P(^BWRACE(BWRIEN,0),U)=$O(^DIC(10,"B",TXT,0))
  1. ; Re-index "B" x-ref of BW RACE MAPPINGS File
  1. S DIK="^BWRACE(",DIK(1)=".01^B" D ENALL^DIK
  1. ;
  1. S BWDA=0
  1. F S BWDA=$O(^BWDIAG(BWDA)) Q:'BWDA D
  1. . S X=+$P(^BWDIAG(BWDA,0),"^",24)
  1. . I X<1 Q
  1. . S Y=$S(X=2:1,X=3:2,X=4:3,X=7:8,X=14:7,1:X)
  1. . S FDA(1,9002086.31,BWDA_",",.241)=Y
  1. . D FILE^DIE("","FDA(1)","BWDIE(1)")
  1. . D CLEAN^DILF
  1. ;
  1. ; Set Bethesda 1991 (#.51) and 2001 (#.52) start dates in BW SITE file.
  1. ; Set MDE version to 4.1 if no value is defined.
  1. S BWDA=0
  1. F S BWDA=$O(^BWSITE(BWDA)) Q:'BWDA D
  1. . S X=$P(^BWSITE(BWDA,0),"^",17)
  1. . I X<1 S X=2910101
  1. . S FDA(2,9002086.02,BWDA_",",.51)=X
  1. . S FDA(2,9002086.02,BWDA_",",.52)=3021001
  1. . S:'$$GET1^DIQ(9002086.02,BWDA,.18,"I") FDA(2,9002086.02,BWDA_",",.18)=41
  1. . D FILE^DIE("","FDA(2)","BWDIE(2)")
  1. . D CLEAN^DILF
  1. ; Importing Race into BW Patient File
  1. D MES("Importing Patient Race...")
  1. D START^BWUCVRC
  1. ; Add procedure type to existing Wise Woman Procedures if needed
  1. Q:'@XPDGREF@("WW") ;Site has not WW Procedures to correct
  1. D MES("Repairing Wise Woman procedures...")
  1. S BWDA=0
  1. F S BWDA=$O(^BWPCD(BWDA)) Q:'BWDA D
  1. .Q:'$D(^BWPCD(BWDA,4)) ; Not a Wise Woman procedure
  1. .W "."
  1. .I '$P(^BWPCD(BWDA,0),U,4) D
  1. ..W ":"
  1. ..S $P(^BWPCD(BWDA,0),U,4)=39
  1. Q
  1. ; Display message in MSG and optionally set quit flag to QUIT
  1. MES(MSG,QUIT) ;
  1. D BMES^XPDUTL(" "_$G(MSG))
  1. S:$G(QUIT) XPDQUIT=QUIT
  1. Q
  1. ; Pre-Transport global for BW RACE file mappings
  1. PRETRAN ;
  1. N IEN,VAL,TXT
  1. S IEN=0
  1. F S IEN=$O(^BWRACE(IEN)) Q:IEN<1 D
  1. .S VAL=$P(^BWRACE(IEN,0),U),TXT=$$GET1^DIQ(10,VAL,.01,"E")
  1. .S @XPDGREF@("RACEPTRS",IEN)=TXT
  1. Q