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

BGP5POS.m

Go to the documentation of this file.
BGP5POS ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED 08 Dec 2010 3:10 PM ; 04 Aug 2015  2:27 PM
 ;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
 ;
 ;
 ;SEND OUT BGP TAXONOMIES
 ; The following line prevents the "Disable Options..." and "Move
 ; Routines..." questions from being asked during the install.
 I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
 F X="XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
 ; '$$INSTALLD("BGP*14.1*1") D SORRY(2)
 I +$$VERSION^XPDUTL("BGP")<15.0 D MES^XPDUTL($$CJ^XLFSTR("Version 15.0 of the IHS CLINICAL REPORTING is required.  Not installed",80)) D SORRY(2) I 1
 Q
 ;
PRE ;EP
 ;WIPE OUT CHS AND URBAN PARAMETERS, FIELDS ARE BEING DELETED
 S BGPX=0 F  S BGPX=$O(^BGPSITE(BGPX)) Q:BGPX'=+BGPX  S DIE="^BGPSITE(",DA=BGPX,DR=".06///@;.08///@" D ^DIE K DA,DR,DIE
 D PRE^BGP5POS2
 S DA=$O(^DIC(19,"B","BGP 02 MENU",0))
 I DA S DIE="^DIC(19,",DR="4///A" D ^DIE
PRE1 ;FIX TAXONOMIES
 S DA=$O(^ATXAX("B","BGPMU PREGNANCY ALL ICD",0))
 I DA,$P(^ATXAX(DA,0),U,15)="" S DIE="^ATXAX(",DR=".15///80" D ^DIE
 S DA=$O(^ATXAX("B","BGPMU CHEMOTHERAPY CPTS",0))
 I DA,$P(^ATXAX(DA,0),U,15)="" S DIE="^ATXAX(",DR=".15///81" D ^DIE
 Q
POST ;EP - called from kids build
 ;DELETE OLD 101, LIST TEMPLATES, REMOTE PROCEDURES
 ;D DELOLD
 ;D ^BGP50
 ;D ^BGP51
 ;D ^BGP52
 D ^BGP53
 S BGPX=$O(^ATXAX("B","BGP HYSTERECTOMY DXS",0))
 I BGPX D
 .S BGPY=0 F  S BGPY=$O(^ATXAX(BGPX,21,BGPY)) Q:BGPY'=+BGPY  D
 ..I $P(^ATXAX(BGPX,21,BGPY,0),U,1)["V67.01"!($P(^ATXAX(BGPX,21,BGPY,0),U,1)["V76.47") D
 ...;delete out of multiple
 ...S DA(1)=BGPX,DA=BGPY,DIK="^ATXAX("_DA(1)_",21," D ^DIK K DIK,DA
 S BGPX=$O(^ATXAX("B","BGP FRACTURE DXS",0))
 I BGPX D
 .S BGPY=0 F  S BGPY=$O(^ATXAX(BGPX,21,BGPY)) Q:BGPY'=+BGPY  D
 ..I $P(^ATXAX(BGPX,21,BGPY,0),U,1)["733.1" D
 ...;delete out of multiple
 ...S DA(1)=BGPX,DA=BGPY,DIK="^ATXAX("_DA(1)_",21," D ^DIK K DIK,DA
 S BGPX=$O(^ATXAX("B","BGP HEPATITIS C DXS",0))
 I BGPX D
 .NEW BGPY,C,CNT,G
 .S BGPY=0,C=0,CNT=0,G=0 F  S BGPY=$O(^ATXAX(BGPX,21,BGPY)) Q:BGPY'=+BGPY  S C=BGPY,CNT=CNT+1 I $P(^ATXAX(BGPX,21,BGPY,0),U,1)["V02.62" S G=1
 .Q:G
 .S C=C+1,CNT=CNT+1,^ATXAX(BGPX,21,C,0)="V02.62 ^V02.62 ^1"
 .S $P(^ATXAX(BGPX,21,0),U,3)=C
 .S $P(^ATXAX(BGPX,21,0),U,4)=CNT
 .S DA=C,DIK="^ATXAX(" D IX^DIK
 ;D ^BGP53
 D DRUGS^BGP5POS1
 D LAB^BGP5POS1
 D BMXPO
 D ADA
 D NDC
 ;STUFF VERSION # IN BGP DATA FILES
 D S15
 Q
S15 ;WIPE OUT ALL 15.0 FILES SO START CLEAN WITH 15.1 FILES
 S BGPX=0 F  S BGPX=$O(^BGPGPDCK(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPGPDCK(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPGPDPK(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPGPDPK(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPGPDBK(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPGPDBK(" D ^DIK
 Q
HOLD NEW BGPD,BGPX
 S BGPX=$O(^XPD(9.7,"B","IHS CLINICAL REPORTING 15.1",0))
 I 'BGPX D  Q
 .;SET ALL TO 15.0
 .S BGPX=0 F  S BGPX=$O(^BGPGPDCK(BGPX)) Q:BGPX'=+BGPX  D
 ..Q:'$D(^BGPGPDCK(BGPX,0))
 ..Q:$P(^BGPGPDCK(BGPX,0),U,21)]""
 ..S DA=BGPX,DIE="^BGPGPDCK(",DR=".21///15.0" D ^DIE
 ..S DA=BGPX,DIE="^BGPGPDPK(",DR=".21///15.0" D ^DIE
 ..S DA=BGPX,DIE="^BGPGPDBK(",DR=".21///15.0" D ^DIE
 S BGPD=$P($P(^XPD(9.7,BGPX,0),U,3),".")  ;DATE FIRST INSTALLED
 ;IF DATE CREATED IS BEFORE THIS DATE SET TO 15.0, OTHERWISE SET TO 15.0
 S BGPX=0 F  S BGPX=$O(^BGPGPDCK(BGPX)) Q:BGPX'=+BGPX  D
 .S V=""
 .Q:'$D(^BGPGPDCK(BGPX,0))
 .Q:$P(^BGPGPDCK(BGPX,0),U,21)]""
 .I BGPD="" S V="15.0" G S151
 .I $P(^BGPGPDCK(BGPX,0),U,13)<BGPD S V="15.0" G S151
 .S V="15.1"
S151 .S DA=BGPX,DIE="^BGPGPDCK(",DR=".21///"_V D ^DIE
 .S DA=BGPX,DIE="^BGPGPDPK(",DR=".21///"_V D ^DIE
 .S DA=BGPX,DIE="^BGPGPDBK(",DR=".21///"_V D ^DIE
 Q
NDC ;
 S BGPX=0 F  S BGPX=$O(^ATXAX(BGPX)) Q:BGPX'=+BGPX  D
 .Q:$P(^ATXAX(BGPX,0),U,15)]""  ;already has a file
 .Q:$P(^ATXAX(BGPX,0),U,1)'["NDC"
 .Q:$E($P(^ATXAX(BGPX,0),U,1),1,3)'="BGP"
 .S $P(^ATXAX(BGPX,0),U,15)=50.67
 .Q
 Q
BMXPO ;-- update the RPC file
 N BGPRPC
 S BGPRPC=$O(^DIC(19,"B","BGPGRPC",0))
 Q:'BGPRPC
 D CLEAN(BGPRPC)
 D GUIEP^BMXPO(.RETVAL,BGPRPC_"|BGP")
 D GUIEP^BMXPO(.RETVAL,BGPRPC_"|ATX")
 Q
CLEAN(APP) ;-- clean out the RPC multiple first
 S DA(1)=APP
 S DIK="^DIC(19,"_DA(1)_","_"""RPC"""_","
 N BGPDA
 S BGPDA=0 F  S BGPDA=$O(^DIC(19,APP,"RPC",BGPDA)) Q:'BGPDA  D
 . S DA=BGPDA
 . D ^DIK
 K ^DIC(19,APP,"RPC","B")
 Q
 ;
INSTALLD(BGPSTAL) ;EP - Determine if patch BGPSTAL was installed, where
 ; BGPSTAL is the name of the INSTALL.  E.g "AG*6.0*11".
 ;
 NEW BGPY,DIC,X,Y
 S X=$P(BGPSTAL,"*",1)
 S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
 D IX^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",22,",X=$P(BGPSTAL,"*",2)
 D ^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",""PAH"",",X=$P(BGPSTAL,"*",3)
 D ^DIC
 S BGPY=Y
 D IMES
 Q $S(BGPY<1:0,1:1)
IMES ;
 D MES^XPDUTL($$CJ^XLFSTR("Patch """_BGPSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
 Q
SORRY(X) ;
 KILL DIFQ
 I X=3 S XPDQUIT=2 Q
 S XPDQUIT=X
 W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
 Q
ADA ;
 S ATXFLG=1
 S BGPDA=0 S BGPDA=$O(^ATXAX("B","BGP GEN ANESTHESIA ADA CODES",BGPDA))
 I BGPDA S DIK="^ATXAX(",DA=BGPDA D ^DIK  ;get rid of existing one
 W !,"Creating/Updating DENTAL ANESTHESIA ADA Codes Taxonomy..."
 S X="BGP GEN ANESTHESIA ADA CODES",DIC="^ATXAX(",DIC(0)="L",DIADD=1,DLAYGO=9002226 D ^DIC K DIC,DA,DIADD,DLAYGO,I
 I Y=-1 W !!,"ERROR IN CREATING DENTAL ANESTHISIZ ADA CODES TAX" Q
 S BGPTX=+Y,$P(^ATXAX(BGPTX,0),U,2)="BGP GEN ANESTHESIA ADA CODES",$P(^(0),U,5)=DUZ,$P(^(0),U,8)=0,$P(^(0),U,9)=DT,$P(^(0),U,12)=174,$P(^(0),U,13)=0,$P(^(0),U,15)=9999999.31,^ATXAX(BGPTX,21,0)="^9002226.02101A^0^0"
 S BGPX=0
 F X="9220" S DIC="^AUTTADA(",DIC(0)="M" D ^DIC K DIC,DA,DR,DIADD,DLAYGO,DQ,DI,D1,D0 I $P(Y,U)>0 D
 .S BGPX=BGPX+1
 .S ^ATXAX(BGPTX,21,BGPX,0)=+Y,$P(^ATXAX(BGPTX,21,0),U,3)=BGPX,$P(^(0),U,4)=BGPX,^ATXAX(BGPTX,21,"AA",+Y,BGPX)=""
 .Q
 S DA=BGPTX,DIK="^ATXAX(" D IX1^DIK
 ;SSC
 S BGPDA=0 S BGPDA=$O(^ATXAX("B","BGP SSC ADA CODES",BGPDA))
 I BGPDA S DIK="^ATXAX(",DA=BGPDA D ^DIK  ;get rid of existing one
 W !,"Creating/Updating SSC ADA Codes Taxonomy..."
 S X="BGP SSC ADA CODES",DIC="^ATXAX(",DIC(0)="L",DIADD=1,DLAYGO=9002226 D ^DIC K DIC,DA,DIADD,DLAYGO,I
 I Y=-1 W !!,"ERROR IN CREATING SSC ADA CODES TAX" Q
 S BGPTX=+Y,$P(^ATXAX(BGPTX,0),U,2)="BGP SSC ADA CODES",$P(^(0),U,5)=DUZ,$P(^(0),U,8)=0,$P(^(0),U,9)=DT,$P(^(0),U,12)=174,$P(^(0),U,13)=0,$P(^(0),U,15)=9999999.31,^ATXAX(BGPTX,21,0)="^9002226.02101A^0^0"
 S BGPX=0
 F X=2930,2931 S DIC="^AUTTADA(",DIC(0)="M" D ^DIC K DIC,DA,DR,DIADD,DLAYGO,DQ,DI,D1,D0 I $P(Y,U)>0 D
 .S BGPX=BGPX+1
 .S ^ATXAX(BGPTX,21,BGPX,0)=+Y,$P(^ATXAX(BGPTX,21,0),U,3)=BGPX,$P(^(0),U,4)=BGPX,^ATXAX(BGPTX,21,"AA",+Y,BGPX)=""
 .Q
 S DA=BGPTX,DIK="^ATXAX(" D IX1^DIK
 Q