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

BQI23P2.m

Go to the documentation of this file.
BQI23P2 ;GDIT/HS/ALA-Patch 2 Installation ; 28 Dec 2012  8:13 AM
 ;;2.3;ICARE MANAGEMENT SYSTEM;**2**;Apr 18, 2012;Build 14
 ;
PRE ;EP
 NEW DA,DIK
 S DA=0,DIK="^BQI(90509.9,"
 F  S DA=$O(^BQI(90509.9,DA)) Q:'DA  D ^DIK
 Q
 ;
POS ;EP
 ;
 ; Fix Goal Setting
 NEW TPRN,TPRD,GPRN,GPRD,DEN,FAC,YEAR,BQDATE
 S YEAR=$$GET1^DIQ(90508,1_",",2,"E")
 S FAC=$$HME^BQIGPUTL()
 S TPRN=$O(^BQIFAC(FAC,30,"B","IPC_TOTP",""))
 S GPRN=$O(^BQIFAC(FAC,30,"B",YEAR_"_2452",""))
 I GPRN'="",TPRN'="" D
 . S BQDATE=""
 . F  S BQDATE=$O(^BQIFAC(FAC,30,GPRN,1,"B",BQDATE)) Q:BQDATE=""  D
 .. S TPRD=$O(^BQIFAC(FAC,30,TPRN,1,"B",BQDATE,"")) I TPRD="" Q
 .. S GPRD=$O(^BQIFAC(FAC,30,GPRN,1,"B",BQDATE,"")) I GPRD="" Q
 .. S DEN=$P(^BQIFAC(FAC,30,TPRN,1,TPRD,0),U,2)
 .. S $P(^BQIFAC(FAC,30,GPRN,1,GPRD,0),U,2)=DEN
 ;
 ; fix A1C
 I $P($G(^BQI(90508,1,"GPRA")),U,1)=2012 D
 . S ^BQI(90508,1,22,2,1,15,2,1,0)="2012_2633"
 . K ^BQI(90508,1,22,2,1,15,2,"B")
 . S ^BQI(90508,1,22,2,1,15,2,"B","2012_2633",1)=""
 I $P($G(^BQI(90508,1,"GPRA")),U,1)=2013 D
 . S ^BQI(90508,1,22,2,1,15,2,1,0)="2013_2633"
 . K ^BQI(90508,1,22,2,1,15,2,"B")
 . S ^BQI(90508,1,22,2,1,15,2,"B","2013_2633",1)=""
 S $P(^BQI(90508,1,22,2,1,16,0),U,4)="Alcohol Screen Females 15-44"
 ;
 NEW TAX,DIK,DA
 F TAX="BQI SYPH DARK FIELD TEST LOINC","BQI SYPHILIS QUAL TEST LOINC","BQI SYPHILIS QUANT TEST LOINC" D
 . S DIK="^ATXAX(",DA=$O(^ATXAX("B",TAX,"")) I DA'="" D ^DIK
 F TAX="BQI SYPH DARK FIELD TEST TAX","BQI SYPHILIS QUAL TEST TAX","BQI SYPHILIS QUANT TEST TAX" D
 . S DIK="^ATXLAB(",DA=$O(^ATXLAB("B",TAX,"")) I DA'="" D ^DIK
 ;
LTAX ;EP  Add Lab Taxonomies to ^ATXLAB
 NEW X,DIC,DLAYGO,DA,DR,DIE,Y,LTAX,D0,DINUM
 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")
 ;
 K DA,BJ,BQTXUP,DIC,DLAYGO,DINUM,D0,DR,X,Y
 ;
TAX ;EP  Set up the taxonomies
 D ^BQIHTX
 ;
 ; Remove LOINC code
 NEW TXN
 S TXN=$O(^ATXAX("B","BQI HIV ID SPEC CONFIRM LOINC",""))
 I TXN'="" D
 . NEW DA,DIK
 . S DA=$O(^ATXAX(TXN,21,"B","13499-9","")) I DA="" Q
 . S DA(1)=TXN,DIK="^ATXAX("_DA(1)_",21," D ^DIK
 ;
GLS ;EP Update glossary
 NEW GN,GNM,GSN,BQIUPD
 S GN=0
 F  S GN=$O(^BQI(90509.9,GN)) Q:'GN  D
 . S GNM=$P(^BQI(90509.9,GN,0),U,1)
 . S GSN=$O(^BQI(90508.2,"B",GNM,"")) Q:GSN=""
 . S BQIUPD(90508.2,GSN_",",1)="@"
 . D FILE^DIE("","BQIUPD","ERROR")
 . M ^BQI(90508.2,GSN,1)=^BQI(90509.9,GN,1)
 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 SYPHILIS TP-AB TEST TAX
 ;;BQI SYPHILIS REAGIN TEST TAX
 Q