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

BQITAXXU.m

Go to the documentation of this file.
BQITAXXU ;GDHSD/HS/ALA-Update Taxonomies for pointers ; 17 Dec 2015  4:08 PM
 ;;2.7;ICARE MANAGEMENT SYSTEM;;Dec 19, 2017;Build 23
 ;
 ;Repoint taxonomies in 90507.8
 NEW ALRT,TXN,TAX,ATXN,TYP
 S ALRT=0
 F  S ALRT=$O(^BQI(90507.8,ALRT)) Q:'ALRT  D
 . S TXN=0
 . F  S TXN=$O(^BQI(90507.8,ALRT,11,TXN)) Q:'TXN  D
 .. S TAX=$P(^BQI(90507.8,ALRT,11,TXN,0),U,1),TYP=$P(^(0),U,5)
 .. I TYP'=5 D
 ... S ATXN=$O(^ATXAX("B",TAX,""))
 ... I ATXN'="" S $P(^BQI(90507.8,ALRT,11,TXN,0),U,2)=ATXN_";ATXAX("
 .. I TYP=5 D
 ... S ATXN=$O(^ATXLAB("B",TAX,""))
 ... I ATXN'="" S $P(^BQI(90507.8,ALRT,11,TXN,0),U,2)=ATXN_";ATXLAB(" Q
 ... S ATXN=$O(^ATXAX("B",TAX,""))
 ... S $P(^BQI(90507.8,ALRT,11,TXN,0),U,2)=ATXN_";ATXAX("
 ;
 ;Repoint taxonomies in 90507
 NEW RGN,TXN,TAX,VALUE,ATXN,GLO,RPN
 S RGN=0
 F  S RGN=$O(^BQI(90507,RGN)) Q:'RGN  D
 . S TXN=0
 . F  S TXN=$O(^BQI(90507,RGN,10,TXN)) Q:'TXN  D
 .. S TAX=$P(^BQI(90507,RGN,10,TXN,0),U,1),VALUE=$P(^(0),U,2)
 .. I VALUE["ATXAX" S ATXN=$O(^ATXAX("B",TAX,"")),GLO=";ATXAX("
 .. I VALUE["ATXLAB" S ATXN=$O(^ATXLAB("B",TAX,"")),GLO=";ATXLAB("
 .. I ATXN="" Q
 .. S $P(^BQI(90507,RGN,10,TXN,0),U,2)=ATXN_GLO
 . S RPN=0
 . F  S RPN=$O(^BQI(90507,RGN,20,RPN)) Q:'RPN  D
 .. S TXN=0
 .. F  S TXN=$O(^BQI(90507,RGN,20,RPN,10,TXN)) Q:'TXN  D
 ... S TAX=$P(^BQI(90507,RGN,20,RPN,10,TXN,0),U,1),VALUE=$P(^(0),U,2)
 ... I VALUE["ATXAX" S ATXN=$O(^ATXAX("B",TAX,"")),GLO=";ATXAX("
 ... I VALUE["ATXLAB" S ATXN=$O(^ATXLAB("B",TAX,"")),GLO=";ATXLAB("
 ... I ATXN="" Q
 ... S $P(^BQI(90507,RGN,20,RPN,10,TXN,0),U,2)=ATXN_GLO
 ;
 ;Repoint taxonomies in 90508
 NEW BQIDA,TXN,TAX,VALUE,ATXN,GLO
 S BQIDA=1,TXN=0
 F  S TXN=$O(^BQI(90508,BQIDA,10,TXN)) Q:'TXN  D
 . S TAX=$P(^BQI(90508,BQIDA,10,TXN,0),U,1),TYP=$P(^(0),U,3)
 . I TYP'=5 D
 .. S ATXN=$O(^ATXAX("B",TAX,""))
 .. I ATXN'="" S $P(^BQI(90508,BQIDA,10,TXN,0),U,2)=ATXN_";ATXAX("
 . I TYP=5 D
 .. S ATXN=$O(^ATXLAB("B",TAX,""))
 .. I ATXN'="" S $P(^BQI(90508,BQIDA,10,TXN,0),U,2)=ATXN_";ATXLAB(" Q
 .. S ATXN=$O(^ATXAX("B",TAX,""))
 .. S $P(^BQI(90508,BQIDA,10,TXN,0),U,2)=ATXN_";ATXAX("
 ;
LTAX ;EP  Add Lab Taxonomies to ^ATXLAB
 NEW X,DIC,DLAYGO,DA,DR,DIE,Y,LTAX,D0,DINUM,TAXX,ATXN
 S DIC="^ATXLAB(",DIC(0)="L",DLAYGO=9002228
 ; Loop through the Taxonomies
 D LDLAB(.LTAX)
 F BJ=1:1 Q:'$D(LTAX(BJ))  S X=LTAX(BJ) D
 . I $D(^ATXLAB("B",X)) Q  ; Skip pre-existing Lab taxonomies
 . D ^DIC S DA=+Y
 . I DA<1 Q
 . S BQTXUP(9002228,DA_",",.02)=$P(X," ",2,999)
 . S BQTXUP(9002228,DA_",",.05)=DUZ
 . S BQTXUP(9002228,DA_",",.06)=DT
 . S BQTXUP(9002228,DA_",",.09)=60
 . D FILE^DIE("I","BQTXUP")
 . S BQTXUP(9002228,DA_",",.08)="B"
 . D FILE^DIE("E","BQTXUP")
 ;
 F BJ=1:1 Q:'$D(LTAX(BJ))  S TAXX=LTAX(BJ) D
 . S TXN=$O(^BQI(90508,BQIDA,10,"B",TAXX,"")) I TXN'="" Q
 . NEW DA,DIC,DLAYGO,IENS
 . S DA(1)=BQIDA,DIC(0)="L",DLAYGO=90508.03,DIC="^BQI(90508,"_DA(1)_",10,",X=TAXX
 . D ^DIC
 . S DA=+Y I DA=-1 Q
 . S IENS=$$IENS^DILF(.DA)
 . S BQIUPD(90508.03,IENS,.03)=5,BQIUPD(90508.03,IENS,.04)="Y",BQIUPD(90508.03,IENS,.05)="T"
 . D FILE^DIE("","BQIUPD","ERROR")
 . S ATXN=$O(^ATXLAB("B",TAXX,""))
 . I ATXN'="" S $P(^BQI(90508,DA(1),10,DA,0),U,2)=ATXN_";ATXLAB(" Q
 K DA,BJ,BQTXUP,DIC,DLAYGO,DINUM,D0,DR,X,Y
 ;
 Q
 ;
LDLAB(ARRAY) ;EP;Load site-populated Lab tests
 NEW I,TEXT
 F I=1:1 S TEXT=$P($T(LAB+I),";;",2) Q:TEXT=""  S ARRAY(I)=TEXT
 Q
 ;
LAB ;EP;LAB TESTS (SITE-POPULATED)
 ;;BQI MMR TITER TAX
 ;;BQI HEP A TITER TAX
 ;;BQI HEP B TITER TAX
 ;;BQI VARICELLA TITER TAX