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

BGP8P181.m

Go to the documentation of this file.
BGP8P181 ; IHS/CMI/LAB - V18.1 PATCH 1 POST INIT
 ;;18.1;IHS CLINICAL REPORTING;**1**;MAY 25, 2018;Build 65
 ;
 ;
 ;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
 ;I '$$INSTALLD("BGP*18.0*1") D MES^XPDUTL($$CJ^XLFSTR("CRS v18.0 patch 1 is required.  Not installed.",80)) D SORRY(2)
 I +$$VERSION^XPDUTL("BGP")<18.1 D MES^XPDUTL($$CJ^XLFSTR("Version 18.1 of the IHS CLINICAL REPORTING is required.  Not installed.",80)) D SORRY(2) I 1
 Q
 ;
PRE ;EP
 Q
POST ;EP - called from kids build
 D DRUGS^BGP8POS1
 D LAB^BGP8POS1
 D RXNORM
 D S17
T ;OOO OPTIONS
 D OOO
 Q
OOO ;
 S BGPN="BGP 02" F  S BGPN=$O(^DIC(19,"B",BGPN)) Q:BGPN]"BGP 13Z"!(BGPN="")  D
 .S DA=$O(^DIC(19,"B",BGPN,0))
 .S DIE="^DIC(19,"
 .S DR="2///NO LONGER AVAILABLE"
 .D ^DIE K DA,DR,DIE
 .Q
 Q
S17 ;WIPE OUT ALL 18.0 FILES SO START CLEAN WITH 18.1 FILES
 S BGPX=0 F  S BGPX=$O(^BGPGPDCR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPGPDCR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPGPDPR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPGPDPR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPGPDBR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPGPDBR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPEDLCR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPEDLCR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPEDLPR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPEDLPR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPEDLBR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPEDLBR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPPEDCR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPPEDCR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPPEDPR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPPEDPR(" D ^DIK
 S BGPX=0 F  S BGPX=$O(^BGPPEDBR(BGPX)) Q:BGPX'=+BGPX  D
 .S DA=BGPX,DIK="^BGPPEDBR(" D ^DIK
 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 IPC BMI ADA CODES",BGPDA))
 I BGPDA S DIK="^ATXAX(",DA=BGPDA D ^DIK  ;get rid of existing one
 W !,"Creating/Updating BGP IPC BMI ADA Codes Taxonomy..."
 S X="BGP IPC BMI 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 BGP IPC BMI ADA CODES TAX" Q
 S BGPTX=+Y,$P(^ATXAX(BGPTX,0),U,2)="BGP IPC BMI 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="7140","7210" 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
RXNORM ;
 S ATXFLG=1
 S BGPX="BGP IPC DEPRESSION MEDS",BGPRXN="BGP IPC DEPRESSION RXNORM" D RXNORM1
 S BGPX="BGP IPC ABOVE NORMAL MEDS",BGPRXN="BGP IPC ABOVE NORMAL RXNORM" D RXNORM1
 S BGPX="BGP IPC BELOW NORMAL MEDS",BGPRXN="BGP IPC BELOW NORMAL RXNORM" D RXNORM1
 Q
RXNORM1 ;
 W !,BGPRXN
 W !,"Creating ",BGPX," Taxonomy..."
 S BGPTX=$O(^ATXAX("B",BGPX,0))
 I 'BGPTX D  Q:Y=-1
 .S X=BGPX,DIC="^ATXAX(",DIC(0)="L",DIADD=1,DLAYGO=9002226 D ^DIC K DIC,DA,DIADD,DLAYGO,I
 .I Y=-1 W !!,"ERROR IN CREATING ",BGPX," TAX" Q
 .S BGPTX=+Y,$P(^ATXAX(BGPTX,0),U,2)=BGPX,$P(^(0),U,8)=0,$P(^(0),U,9)=DT,$P(^(0),U,12)=173,$P(^(0),U,13)=0,$P(^(0),U,15)=50,^ATXAX(BGPTX,21,0)="^9002226.02101A^0^0"
 S DA=BGPTX,DIK="^ATXAX(" D IX1^DIK
 I $G(BGPRXN)]"" D
 .S A=0,B="" F  S A=$O(^ATXAX(BGPTX,21,A)) Q:A'=+A  S B=A
 .S BGPC=B
 .S ^ATXAX(BGPTX,21,0)="^9002226.02101A^"_B_U_B
 .S Z=$O(^BGPSNOMR("B",BGPRXN,0))
 .S J=0 F  S J=$O(^PSDRUG(J)) Q:J'=+J  S C=$$VAL^XBDIQ1(50,J,9999999.27) I C]"",$D(^BGPSNOMR(Z,11,"B",C)) D
 ..Q:$D(^ATXAX(BGPTX,21,"B",J))
 ..S BGPC=BGPC+1,^ATXAX(BGPTX,21,BGPC,0)=J_U_J
 S DA=BGPTX,DIK="^ATXAX(" D IX1^DIK
 Q