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

PSS160PO.m

Go to the documentation of this file.
PSS160PO ;BIR/RTR-Post Install routine for patch PSS*1*160 ;02/18/11
 ;;1.0;PHARMACY DATA MANAGEMENT;**160**;9/30/97;Build 76
 ;External reference to ^XOB(18.02 supported by DBIA 5814
 ;External reference to ^XOB(18.12 supported by DBIA 5813
 ;
 ;
EN ;Do Mail Message
 N PSSMXUA1,PSSMXUA2 S PSSMXUA2=0
 F PSSMXUA1=0:0 S PSSMXUA1=$O(@XPDGREF@("PSSMLMSG",PSSMXUA1)) Q:'PSSMXUA1  S PSSMXUA2=PSSMXUA2+1
 S PSSMXUA2=PSSMXUA2+1
 D ADDVAL,MNUADD,SETWS
 D BMES^XPDUTL("Generating Mail Message....")
EN2 ;
 D MAIL D BMES^XPDUTL("Mail message sent.")
 I $P($G(^PS(59.7,1,81)),"^")="" S $P(^PS(59.7,1,81),"^")=1
 Q
 ;
 ;
MAIL ;Send mail message
 N PSS60REC,PSS60PLP,XMTEXT,XMY,XMSUB,XMDUZ,XMMG,XMSTRIP,XMROU,XMYBLOB,XMZ,XMDUN
 K ^TMP($J,"PSS60PTX")
 F PSS60PLP=0:0 S PSS60PLP=$O(@XPDGREF@("PSSMLMSG",PSS60PLP)) Q:'PSS60PLP  S ^TMP($J,"PSS60PTX",PSS60PLP)=@XPDGREF@("PSSMLMSG",PSS60PLP)
 S XMSUB="PSS*1*160 Installation Complete"
 S XMDUZ="PSS*1*160 Install"
 S XMTEXT="^TMP($J,""PSS60PTX"","
 S PSS60REC="" F  S PSS60REC=$O(@XPDGREF@("PSSMLMDZ",PSS60REC)) Q:PSS60REC=""  S XMY(PSS60REC)=""
 N DIFROM D ^XMD
 K ^TMP($J,"PSS60PTX")
 Q
 ;
 ;
MNUADD ;Add PSS DRUG DOSING LOOKUP option to PSS DOSAGE MANAGEMENT menu option
 D BMES^XPDUTL("Linking New PSS DRUG DOSING LOOKUP Option....")
 N PSSMXUA,PSSMXUAF
 S PSSMXUAF=0
 K PSSMXUA S PSSMXUA=$$ADD^XPDMENU("PSS DOSAGES MANAGEMENT","PSS DRUG DOSING LOOKUP",,9) I 'PSSMXUA D
 .S PSSMXUAF=1
 .D BMES^XPDUTL("Unable to link PSS DRUG DOSING LOOKUP Option....") D BMES^XPDUTL("Please log a Remedy Ticket for this issue.")
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Unable to link PSS DRUG DOSING LOOKUP Option to PSS DOSAGES MANAGEMENT Menu" S PSSMXUA2=PSSMXUA2+1
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)=" ",PSSMXUA2=PSSMXUA2+1 S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Please log a Remedy Ticket and refer to this message." S PSSMXUA2=PSSMXUA2+1 D LINE
 I 'PSSMXUAF D BMES^XPDUTL("New PSS DRUG DOSING LOOKUP option linked successfully...")
 ;
 D BMES^XPDUTL("Linking New PSS TRAILING SPACES REPORT Option....")
 K PSSMXUA,PSSMXUAF
 S PSSMXUAF=0
 S PSSMXUA=$$ADD^XPDMENU("PSS DOSAGES MANAGEMENT","PSS TRAILING SPACES REPORT",,10) I 'PSSMXUA D
 .S PSSMXUAF=1
 .D BMES^XPDUTL("Unable to link PSS TRAILING SPACES REPORT Option....") D BMES^XPDUTL("Please log a Remedy Ticket for this issue.")
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Unable to link PSS TRAILING SPACES REPORT Option to PSS DOSAGES MANAGEMENT Menu" S PSSMXUA2=PSSMXUA2+1
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)=" ",PSSMXUA2=PSSMXUA2+1 S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Please log a Remedy Ticket and refer to this message." S PSSMXUA2=PSSMXUA2+1 D LINE
 I 'PSSMXUAF D BMES^XPDUTL("New PSS TRAILING SPACES REPORT option linked successfully...")
 Q
 ;
 ;
ADDVAL ; Final validation of data
 D BMES^XPDUTL("Validating new Dose Unit File (#51.24) entries.")
 N PSSADUC1,PSSADUC2,PSSADUC5,PSSADUC6,PSSADUC7,PSSADUC8,PSSADUK1,PSSADUK2,PSSADUK3,PSSATYPE
 S (PSSADUK1,PSSADUK2,PSSADUK3)=0,PSSATYPE="FILM(S)"
 S PSSADUC1=$$FIND1^DIC(51.24,"","X",PSSATYPE,"B") I +PSSADUC1'=52 D ADDKTM S PSSADUK1=1 G ADDLUN
 I $$ADDCHK() S PSSADUK1=1 G ADDLUN
 I $G(^PS(51.24,52,0))'="FILM(S)^FILMS^1" S PSSADUK1=1 G ADDLUN
 F PSSADUC5="FILM;1","FILMS;2" Q:PSSADUK1  D
 .S PSSADUC6=$P(PSSADUC5,";"),PSSADUC7=$P(PSSADUC5,";",2)
 .S PSSADUC8=$$FIND1^DIC(51.242,",52,","X",PSSADUC6,"B")
 .I $$ADDCHK() S PSSADUK1=1 Q
 .I +PSSADUC8'=PSSADUC7 S PSSADUK1=1
ADDLUN ;
 I 'PSSADUK1 D ADDFLM
 S PSSATYPE="ELISA UNIT(S)"
 S PSSADUC2=$$FIND1^DIC(51.24,"","X",PSSATYPE,"B") I +PSSADUC2'=53 D ADDKTM S PSSADUK2=1 G ADDMIL
 I $$ADDCHK() S PSSADUK2=1 G ADDLNX
 I $G(^PS(51.24,53,0))'="ELISA UNIT(S)^ELISA UNIT^0" S PSSADUK2=1 G ADDLNX
 K PSSADUC5,PSSADUC6,PSSADUC7,PSSADUC8
 F PSSADUC5="EL UNIT;1","ELISA UNITS;2","ELISA UNIT;3","EL.U.;4","ELISA UNT;5","ELU;6" Q:PSSADUK2  D
 .S PSSADUC6=$P(PSSADUC5,";"),PSSADUC7=$P(PSSADUC5,";",2)
 .S PSSADUC8=$$FIND1^DIC(51.242,",53,","X",PSSADUC6,"B")
 .I $$ADDCHK() S PSSADUK2=1 Q
 .I +PSSADUC8'=PSSADUC7 S PSSADUK2=1
 D ADDKTM
ADDMIL ;
 I 'PSSADUK2 D ADDELU
 S PSSATYPE="MILLIONUNIT(S)"
 S PSSADUC3=$$FIND1^DIC(51.24,"","X",PSSATYPE,"B") I +PSSADUC3'=23 D ADDKTM S PSSADUK3=1 G ADDLNX
 I $$ADDCHK() S PSSADUK3=1 G ADDLNX
 I $G(^PS(51.24,23,0))'="MILLIONUNIT(S)^MILLIONUNIT(S)^0" S PSSADUK3=1 G ADDLNX
 K PSSADUC5,PSSADUC6,PSSADUC7,PSSADUC8
 F PSSADUC5="MILLION UNIT;8","MILLION UNITS;9" Q:PSSADUK3  D
 .S PSSADUC6=$P(PSSADUC5,";"),PSSADUC7=$P(PSSADUC5,";",2)
 .S PSSADUC8=$$FIND1^DIC(51.242,",23,","X",PSSADUC6,"B")
 .I $$ADDCHK() S PSSADUK3=1 Q
 .I +PSSADUC8'=PSSADUC7 S PSSADUK3=1
 I 'PSSADUK3 D ADDMIL2
ADDLNX ;
 I 'PSSADUK1,'PSSADUK2,'PSSADUK3 D BMES^XPDUTL("DOSE UNITS File (#51.24) entries are correct.") Q
 I PSSADUK1 D ADDMS("FILM(S)")
 I PSSADUK2 D ADDMS("ELISA UNIT(S)")
 I PSSADUK3 D ADDMS("MILLIONUNIT(S)")
 Q
 ;
 ;
ADDMS(PSSATYPE) ; 
 D BMES^XPDUTL("Problem found with "_PSSATYPE_" entry in DOSE UNITS File (#51.24).")
 S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Problem found with "_PSSATYPE_" entry in DOSE UNITS File (#51.24)." S PSSMXUA2=PSSMXUA2+1
 S @XPDGREF@("PSSMLMSG",PSSMXUA2)=" " S PSSMXUA2=PSSMXUA2+1
 D BMES^XPDUTL("Please log a Remedy Ticket for this issue.")
 S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Please log a Remedy Ticket and refer to this message." S PSSMXUA2=PSSMXUA2+1
 S @XPDGREF@("PSSMLMSG",PSSMXUA2)=" " S PSSMXUA2=PSSMXUA2+1
 Q
 ;
 ;
ADDCHK() ;
 I $D(^TMP("DIERR",$J)) D ADDKTM Q 1
 K ^TMP("DIERR",$J)
 Q 0
 ;
 ;
ADDKTM ;
 K ^TMP("DIERR",$J)
 Q
 ;
 ;
ADDFLM ;Validate synonyms and cross references for FILM(S)
 I $G(^PS(51.24,52,1,1,0))'="FILM" S PSSADUK1=1 Q
 I $G(^PS(51.24,52,1,2,0))'="FILMS" S PSSADUK1=1 Q
 I '$D(^PS(51.24,52,1,"B","FILM",1)) S PSSADUK1=1 Q
 I '$D(^PS(51.24,52,1,"B","FILMS",2)) S PSSADUK1=1 Q
 I '$D(^PS(51.24,"B","FILM(S)",52)) S PSSADUK1=1 Q
 I '$D(^PS(51.24,"C","FILMS",52)) S PSSADUK1=1 Q
 I '$D(^PS(51.24,"D","FILM",52,1)) S PSSADUK1=1 Q
 I '$D(^PS(51.24,"D","FILMS",52,2)) S PSSADUK1=1 Q
 Q
 ;
 ;
ADDELU ;Validate synonyms and cross references for ELISA UNIT(S)
 I $G(^PS(51.24,53,1,1,0))'="EL UNIT" S PSSADUK2=1 Q
 I $G(^PS(51.24,53,1,2,0))'="ELISA UNITS" S PSSADUK2=1 Q
 I $G(^PS(51.24,53,1,3,0))'="ELISA UNIT" S PSSADUK2=1 Q
 I $G(^PS(51.24,53,1,4,0))'="EL.U." S PSSADUK2=1 Q
 I $G(^PS(51.24,53,1,5,0))'="ELISA UNT" S PSSADUK2=1 Q
 I $G(^PS(51.24,53,1,6,0))'="ELU" S PSSADUK2=1 Q
 I '$D(^PS(51.24,53,1,"B","EL UNIT",1)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,53,1,"B","EL.U.",4)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,53,1,"B","ELISA UNIT",3)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,53,1,"B","ELISA UNITS",2)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,53,1,"B","ELISA UNT",5)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,53,1,"B","ELU",6)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"B","ELISA UNIT(S)",53)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"C","ELISA UNIT",53)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"D","EL UNIT",53,1)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"D","EL.U.",53,4)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"D","ELISA UNIT",53,3)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"D","ELISA UNITS",53,2)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"D","ELISA UNT",53,5)) S PSSADUK2=1 Q
 I '$D(^PS(51.24,"D","ELU",53,6)) S PSSADUK2=1 Q
 Q
 ;
SETWS ;define DOSING_INFO web service
 N PSSWSERV,PSSWSER2,PSSWPEPS,PSSWSCNT,PSSWSMSG,PSSWSSTA,PSSWSERR,DA,DIE,DIC,DR,X,Y,DLAYGO S PSSWSCNT=0
 S DIC="^XOB(18.12,",X="PEPS",DIC(0)="X" D ^DIC S PSSWPEPS=+Y K DIC  ;find the PEPS web server IEN
 D BMES^XPDUTL("Beginning DOSING_INFO Web Service definition for PEPS web server: ")
 S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Beginning DOSING_INFO Web Service definition: " S PSSMXUA2=PSSMXUA2+1
 I PSSWPEPS=-1 D  G SETWSQT
 .D BMES^XPDUTL("     PEPS Web Server is not defined. Please contact product support.") S PSSWSERR=1
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  PEPS Web Server isn't defined and DOSING_INFO Web Service couldn't be" S PSSMXUA2=PSSMXUA2+1
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="     created.  Please log a Remedy Ticket and refer to this message." S PSSMXUA2=PSSMXUA2+1
SETWS2 ;
 S DIC="^XOB(18.02,",X="DOSING_INFO",DIC(0)="X" D ^DIC S PSSWSERV=+Y ;get the IEN for the DOSING_INFO web service
 I +Y<1,PSSWSCNT=0 D REGREST^XOBWLIB("DOSING_INFO","/MOCHA/","dosinginfo") H 3 S PSSWSCNT=1 G SETWS2  ;if not there register the web service
 I +Y<1 D  H 3 G SETWSQT
 .D BMES^XPDUTL("     DOSING_INFO web service has NOT been created. Please contact product support.")
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  DOSING_INFO web service has NOT been defined.  Please log a" S PSSMXUA2=PSSMXUA2+1,PSSWSERR=1
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  Remedy Ticket and refer to this message." S PSSMXUA2=PSSMXUA2+1
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)=" " S PSSMXUA2=PSSMXUA2+1
 S PSSWSMSG=$S(PSSWSCNT=0:"DOSING_INFO web service was previously defined.  No action taken.",1:"DOSING_INFO web service has been defined.")
 S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  "_PSSWSMSG S PSSMXUA2=PSSMXUA2+1
 D BMES^XPDUTL("     "_PSSWSMSG)
 ;
 K DIC,DIE,DA,DR,X,Y
 S DIC="^XOB(18.12,"_PSSWPEPS_",100,",X="DOSING_INFO",DIC(0)="X" D ^DIC S PSSWSER2=+Y
 L +^XOB(18.12,PSSWPEPS):20 I '$T D  H 3 G SETWSQT
 .D BMES^XPDUTL("     Unable to lock file 18.12 to enable DOSING_INFO web service. Please ")
 .D BMES^XPDUTL("     contact product support.")
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  Unable to lock file 18.12 to enable DOSING_INFO web service." S PSSMXUA2=PSSMXUA2+1
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  Please log a Remedy Ticket and refer to this message." S PSSMXUA2=PSSMXUA2+1,PSSWSERR=1
 I PSSWSER2=-1 D PSSENABL G SETWSQT
 S PSSWSSTA=$$GET1^DIQ(18.121,PSSWSER2_",1",".06","I")
 I PSSWSSTA=-1 D PSSENABL G SETWSQT
 I PSSWSSTA=""!(PSSWSSTA=0) D PSSENAB2 G SETWSQT
 I PSSWSSTA D
 .D BMES^XPDUTL("     DOSING_INFO web service was previously enabled.  No action taken.")
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  DOSING_INFO web service was previously enabled. No action taken." S PSSMXUA2=PSSMXUA2+1
SETWSQT ;
 L -^XOB(18.12,PSSWPEPS)
 I $G(PSSWSERR) D
 .D BMES^XPDUTL("     **************************************************************************")
 .D BMES^XPDUTL("     ** Due to error(s), DOSING_INFO web service definition is not complete. **")
 .D BMES^XPDUTL("     **************************************************************************")
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="*** Due to error(s), DOSING_INFO web service definition is not complete." S PSSMXUA2=PSSMXUA2+1
 I '$G(PSSWSERR) D BMES^XPDUTL("Web Service definition process is complete for PEPS web server.") D
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="Web Service definition process is complete." S PSSMXUA2=PSSMXUA2+1
 D LINE
 Q
 ;
PSSENABL ;
 S DIC="^XOB(18.12,"_PSSWPEPS_",100,",DLAYGO=18.121,DIC(0)="L",DA(1)=PSSWPEPS,X="DOSING_INFO" D ^DIC S PSSWSER2=+Y
PSSENAB2 ;
 S DIE="^XOB(18.12,"_PSSWPEPS_",100,",DR=".06///ENABLE",DA(1)=PSSWPEPS,DA=PSSWSER2 D ^DIE
 S PSSWSSTA=$$GET1^DIQ(18.121,PSSWSER2_",1",".06","I")
 I PSSWSSTA D
 .D BMES^XPDUTL("     DOSING_INFO web service has been enabled.")
 .S @XPDGREF@("PSSMLMSG",PSSMXUA2)="  DOSING_INFO web service has been enabled." S PSSMXUA2=PSSMXUA2+1
 Q
 ;
LINE ;
 S @XPDGREF@("PSSMLMSG",PSSMXUA2)=" " S PSSMXUA2=PSSMXUA2+1
 Q
 ;
ADDMIL2 ;
 I $G(^PS(51.24,23,1,1,0))'="MU" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,2,0))'="MIU" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,3,0))'="MILU" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,4,0))'="MILI U" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,5,0))'="MILI UNIT" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,6,0))'="MILI UNITS" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,7,0))'="MILLION UNT" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,8,0))'="MILLION UNIT" S PSSADUK3=1 Q
 I $G(^PS(51.24,23,1,9,0))'="MILLION UNITS" S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MILI U",4)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MILI UNIT",5)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MILI UNITS",6)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MILLION UNIT",8)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MILLION UNITS",9)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MILLION UNT",7)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MILU",3)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MIU",2)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,23,1,"B","MU",1)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"B","MILLIONUNIT(S)",23)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"C","MILLIONUNIT(S)",23)) S PSSADUK3=1 Q 
 I '$D(^PS(51.24,"D","MILI U",23,4)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MILI UNIT",23,5)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MILI UNITS",23,6)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MILLION UNIT",23,8)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MILLION UNITS",23,9)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MILLION UNT",23,7)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MILU",23,3)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MIU",23,2)) S PSSADUK3=1 Q
 I '$D(^PS(51.24,"D","MU",23,1)) S PSSADUK3=1 Q
 Q
 ;