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

APSPMED1.m

Go to the documentation of this file.
APSPMED1 ; IHS/DSD/ENM - OUTPATIENT MED PROFILE MOD ;  [ 05/14/1998   4:04 PM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;**1**;09/03/97
 ; GET FROM AND TO DATES AND MULTIPLE PATIENT SELECTION
EP1 ;EP
 S APSPAGE=0,APSP=0,APSPDEL=""
 S %DT("A")="Select Beginning Date: ",%DT="AEP" D ^%DT Q:Y<0  S X1=Y,X2=-1 D C^%DTC S APSPBD=X_.2359 ;IHS/DSD/ENM/POC 05/11/98
 S %DT("A")="Ending Date: ",%DT("B")="TODAY",%DT="AEP" D ^%DT S APSPED=Y_".2359" Q:Y<0  ;IHS/DSD/ENM/POC 05/11/98
EP ;EP - Entry point to Select 1 or more patients
 S DIC=2,DIC(0)="QEAM" D ^DIC
 I X="^" K APSPDPT,APSPAGE Q
 I +Y>0 D PASS G EP
 I '$D(APSPDPT)&((+Y["^")!(+Y<0)) Q
 ;LIST NAMES AND ALLOW DE-SELECTION
 I $D(APSPDPT) D SELDEL
 K APSPX1,APSPEM,APSPCTR,APSPXA,APSPZAP,DIR,DIC
 Q
SELDEL ;SELECT/DE-SELECT PATIENT FROM LIST............................
 S APSPDEL="" ;IHS/DSD/ENM 010595
 W !,"So far, you've selected...." S APSPX1="",APSPCTR=0
 F I=1:1 S APSPX1=$O(APSPDPT(APSPX1)) Q:'APSPX1  S APSPEM(I)=APSPX1,APSPCTR=APSPCTR+1 W ?30,"("_I_") "_APSPDPT(APSPX1),!
RETRY S DIR("A")="Would you like to De-select a patient from this list",DIR(0)="Y",DIR("?")="Enter a ""Y"" for ""Yes"" or an ""N"" for ""No"""
 S DIR("B")="No" D ^DIR K DIR S APSPXA=X K X
 Q:"Nn"[$E(APSPXA)  ;IHS/DSD/ENM 08/23/96
DEL ;
 I "Yy"[$E(APSPXA) S DIR(0)="NO^1:"_APSPCTR,DIR("A")="Delete Number" D ^DIR S APSPDEL=X ;IHS/DSD/ENM 08/23/96
 I APSPDEL["^"!(APSPDEL="") Q
 I APSPDEL<1!(APSPDEL>APSPCTR) W !,"Enter a number from 1 to ",APSPCTR G DEL
 I APSPDEL'>APSPCTR!(APSPDEL'<1) S APSPZAP=APSPEM(APSPDEL) K APSPDPT(APSPZAP) G DEL
 Q
PASS D DT^DICRW S (FN,DFN,D0,DA)=+Y I '$D(^PS(55,+Y,"P")),'$D(^PS(55,+Y,"ARC")) W !?20,*7,"NO PHARMACY INFORMATION" H 2 D ^APSPMED2 G APSPMED1
 I '$O(^PS(55,+Y,"P",0)),$D(^PS(55,+Y,"ARC")) D ^APSPMED2 W !!,"PATIENT HAS ARCHIVED PRESCRIPTIONS",! D ^APSPMED2 G APSPMED1
 S:+Y>0 APSPDPT(+Y)=$P(Y,"^",2)
 Q
XIT K APSPDEL
 Q