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

APSPQ.m

Go to the documentation of this file.
APSPQ ; IHS/DSD/ENM - CHECK/ASK DUE QUESTIONNAIRE INFO ;  [ 09/03/97   1:30 PM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;;09/03/97
EP ;Check for drug in questionnaire file
 S APSPCTR=0,APSPD="",APSPDR="",APSPZRN="",APSP=0
 I $G(APFLAG)']"" S APFLAG="" ;IHS/DSD/ENM 01/11/96
 S APSPD=$S(APFLAG="RF":$P($G(PSOREF("RX0")),"^",6),APFLAG="N":$G(PSODRUG("IEN")),APFLAG="RE":$G(PSORENW("DRUG IEN")),1:"") Q:APSPD']""
 ;S APSPD=$G(PSODRUG("IEN")) Q:APSPD']""
 F APSP=0:0 S APSPDR=$O(^PS(50.073,"AD",APSPDR)) Q:'APSPDR  F  S APSPZRN=$O(^PS(50.073,"AD",APSPDR,APSPZRN)) Q:'APSPZRN  D CK
 D XIT ;IHS/DSD/ENM 11/12/96
 Q
CK ;
 I APSPDR=APSPD S APSPCTR=APSPCTR+1 D GETAS ;NEXT, GET ANSWER SHEET QUESTIONS
 Q
GETAS ;SET  PARAMS AND ASK ANSWER SHEET QUESTIONS
 ;
 S APNODE=$G(^PS(50.073,APSPZRN,0)) Q:APNODE']""
 S APACT=$P(APNODE,"^",3) Q:APACT'=1
 W !!,"*** This drug is a part of the "
 W $P($G(^PS(50.073,APSPZRN,0)),"^")," study !! **"
 W !,"Please answer the following questionnaire ...."
 I APFLAG="RF" S PSODRUG("IEN")=$P(PSOREF("RX0"),"^",6),PSONEW("IRXN")=PSOREF("IRXN"),PSONEW("PROVIDER")=$P(PSOREF("RX0"),"^",4),PSDFN=PSODFN,PSONEW("RX #")=$P(PSOREF("RX0"),"^")
 I APFLAG="RE" S PSONEW("IRXN")=PSORENW("OIRXN"),PSONEW("PROVIDER")=$P(PSORENW("RX0"),"^",4),PSDFN=PSODFN,PSONEW("RX #")=$P(PSORENW("RX0"),"^") ;IHS/DSD/ENM 08/27/96
 D EP^APSPQ1
 W !,"DUE questionnaire Complete!.....Thank You!",!
 Q
 ;S APQN=$O(^PS(50.073,APSPZRN,APQN)) Q:'APQN  S APQNU=$P(^(0),"^")
XIT K APACT,APNODE
 Q