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

PSJDGCK.m

Go to the documentation of this file.
PSJDGCK ;HP/MJE - Drug Interaction Utility ;09/22/11 5:00pm
 ;;5.0;INPATIENT MEDICATIONS;**260,288,281**;16 DEC 97;Build 113
 ;External references to ^PSSDSAPM supported by DBIA 5570
 ;
DGCK ;
 S PSJDGCK=1,PSJDGCKX=1
 D FULL^VALM1
 I $D(PSJDGCK)&($G(VALM("TITLE"))="IV Order Entry") D EN^PSJO1(2)
 I $$DGCKIEN^PSJDGCK()=""!$P($$DGCKIEN^PSJDGCK(),";",2)=0 D
 .W !!,"Not enough active profile drugs to perform drug check",!
 .K DIR S DIR(0)="E",DIR("A")="Press Return to Continue..." D ^DIR K DIR W @IOF
 E  D ^PSGOE7
DGCKEND S VALMBCK="R"
 K PSJDGCK,^TMP($J,"PSJALGDD")
 Q
 ;
DGCKIENX() ;
 ;Where:  PSJDGCK1=STATUS, PSJDGCK2=?, PSJDGCK3=ORDERABLE ITEM, PSJDGCK4=FILE IEN,P PSJDGCK7=DRUG NAME;FILE 50 IEN
 N PSJDGCK7 S PSJDGCK7="" I '$D(^TMP("PSJ",$J)) Q PSJDGCK7
 I $D(PSJDGCK) D
 .N PSJDGCK1,PSJDGCK2,PSJDGCK3,PSJDGCK4,PSJDGCK5,PSJDGCK6 S (PSJDGCK1,PSJDGCK2,PSJDGCK3,PSJDGCK4,PSJDGCK5,PSJDGCK6)=""
 .S PSJDGCK1=$O(^TMP("PSJ",$J,PSJDGCK1)),PSJDGCK2=$O(^TMP("PSJ",$J,PSJDGCK1,PSJDGCK2)),PSJDGCK3=$O(^TMP("PSJ",$J,PSJDGCK1,PSJDGCK2,PSJDGCK3)),PSJDGCK4=$O(^TMP("PSJ",$J,PSJDGCK1,PSJDGCK2,PSJDGCK3,PSJDGCK4))
 .I PSJDGCK4["U" D  K ^TMP($J,"PSJALGDD") Q:$G(PSJDGCKQ)
 ..D PSS431^PSS55(DFN,+PSJDGCK4,"","","PSJALGDD")
 ..S PSJDGCK9="",PSJDGCK9=$G(^TMP($J,"PSJALGDD",+PSJDGCK4,"DDRUG",1,.01)) Q:PSJDGCK9=""
 ..S PSJDGCK7=$P(PSJDGCK9,"^",2)_";"_$P(PSJDGCK9,"^")
 ..I $P(PSJDGCK7,";",2)'="" S PSJDGCKQ=1
 ..S PSJDGCK5=$$GET1^DIQ(55.06,+PSJDGCK4_","_DFN_",",108,"I"),PSJDGCK6=$$DRG^PSSDSAPM(+PSJDGCK5,"I"),PSJDGCK7=$$GET1^DIQ(50,$P(PSJDGCK6,";"),.01,"E")
 .I PSJDGCK4["V" S PSJDGCK5=$$GET1^DIQ(55.01,+PSJDGCK4_","_DFN_",",130,"I"),PSJDGCK6=$$DRG^PSSDSAPM(+PSJDGCK5,"I"),PSJDGCK7=$$GET1^DIQ(50,$P(PSJDGCK6,";"),.01,"E")
 .I PSJDGCK4["P"!(PSJDGCK4["N") S PSJDGCK5=$$GET1^DIQ(53.1,+PSJDGCK4_","_DFN_",",108,"I"),PSJDGCK6=$$DRG^PSSDSAPM(+PSJDGCK5,"I"),PSJDGCK7=$$GET1^DIQ(50,$P(PSJDGCK6,";"),.01,"E")
 .S PSJDGCK7=PSJDGCK7_";"_$P(PSJDGCK6,";")
 Q PSJDGCK7
 ;
PSJSUPCK(CHK) ;
 I $D(PSGDGCKF) Q 0
 I '($P($G(^PSDRUG(CHK,0)),"^",3)["S"!($E($P($G(^PSDRUG(CHK,0)),"^",2),1,2)="XA")) K CHK Q 0
 W !,"You have selected a supply item, please select another drug"
 W !,"or leave blank and hit enter for Profile Order Checks."
 K CHK
 Q 1
 ;
DGCKIEN() ;
 ;Where:  PSJDGCK1=STATUS, PSJDGCK2=?, PSJDGCK3=ORDERABLE ITEM, PSJDGCK4=FILE IEN,P PSJDGCK7=DRUG NAME;FILE 50 IEN
 N PSJDGCK7 S PSJDGCK7="" I '$D(^TMP("PSJ",$J)) Q PSJDGCK7
 N PSJDGCK1,PSJDGCK2,PSJDGCK3,PSJDGCK4,PSJDGCK5,PSJDGCK6,PSJDGCK8 S (PSJDGCK1,PSJDGCK2,PSJDGCK3,PSJDGCK4,PSJDGCK5,PSJDGCK6,PSJDGCK8)="" D
 .F  S PSJDGCK1=$O(^TMP("PSJ",$J,PSJDGCK1)) Q:PSJDGCK1=""!PSJDGCK8  D 
 ..F  S PSJDGCK2=$O(^TMP("PSJ",$J,PSJDGCK1,PSJDGCK2)) Q:PSJDGCK2=""!PSJDGCK8  D
 ...F  S PSJDGCK3=$O(^TMP("PSJ",$J,PSJDGCK1,PSJDGCK2,PSJDGCK3)) Q:PSJDGCK3=""!PSJDGCK8  D
 ....F  S PSJDGCK4=$O(^TMP("PSJ",$J,PSJDGCK1,PSJDGCK2,PSJDGCK3,PSJDGCK4)) Q:PSJDGCK4=""!PSJDGCK8  D
 .....D DGCKIEN2
 K PSJDGCK1,PSJDGCK2,PSJDGCK3,PSJDGCK4,PSJDGCK5,PSJDGCK6,PSJDGCK8
 Q PSJDGCK7
 ;
DGCKIEN2 ;
 N PSJDGCK9,PSJDGCKQ
 I PSJDGCK4["U" D  K ^TMP($J,"PSJALGDD") Q:$G(PSJDGCKQ)
 .D PSS431^PSS55(DFN,+PSJDGCK4,"","","PSJALGDD")
 .;^TMP(543879344,"PSJALGDD",17,"DDRUG",1,.01)="9116^PENICILLIN GK 20 MILLION UNIT VIAL INJ"
 .S PSJDGCK9="",PSJDGCK9=$G(^TMP($J,"PSJALGDD",+PSJDGCK4,"DDRUG",1,.01)) Q:PSJDGCK9=""
 .S PSJDGCK7=$P(PSJDGCK9,"^",2)_";"_$P(PSJDGCK9,"^") K ^TMP($J,"PSJALGDD")
 .I $P(PSJDGCK7,";",2)'="" S PSJDGCKQ=1 Q
 .S PSJDGCK5=$$GET1^DIQ(55.06,+PSJDGCK4_","_DFN_",",108,"I"),PSJDGCK6=$$DRG^PSSDSAPM(+PSJDGCK5,"I"),PSJDGCK7=$$GET1^DIQ(50,$P(PSJDGCK6,";"),.01,"E")
 I PSJDGCK4["V" S PSJDGCK5=$$GET1^DIQ(55.01,+PSJDGCK4_","_DFN_",",130,"I"),PSJDGCK6=$$DRG^PSSDSAPM(+PSJDGCK5,"I"),PSJDGCK7=$$GET1^DIQ(50,$P(PSJDGCK6,";"),.01,"E")
 I PSJDGCK4["P"!(PSJDGCK4["N") S PSJDGCK5=$$GET1^DIQ(53.1,+PSJDGCK4_","_DFN_",",108,"I"),PSJDGCK6=$$DRG^PSSDSAPM(+PSJDGCK5,"I"),PSJDGCK7=$$GET1^DIQ(50,$P(PSJDGCK6,";"),.01,"E")
 S PSJDGCK7=PSJDGCK7_";"_$P(PSJDGCK6,";") I $P(PSJDGCK7,";",2)'=0 S PSJDGCK8=1 Q
 Q