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

QAMC2.m

Go to the documentation of this file.
QAMC2 ;HISC/DAD-CONDITION: SEX ;4/30/93  12:36
 ;;1.0;Clinical Monitoring System;;09/13/1993
EN1 ; *** CONDITION CODE
 S GENDER=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"")
 Q:GENDER=""
 S PATYPE=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"1,2")
 ;  All patients
 I PATYPE["3" D  G DONE
 . F QAMDFN=0:0 S QAMDFN=$O(^DPT("ASX",GENDER,QAMDFN)) Q:QAMDFN'>0  D LP1
 . Q
 ;  Outpatients
 I PATYPE["2" F QAMAEB=0:0 S QAMAEB=$O(^DPT("AEB",QAMAEB)) Q:(QAMAEB'>0)!(QAMAEB>(QAMTODAY+.9999999))!(QAMAEB\1'?7N)  F QAMDFN=0:0 S QAMDFN=$O(^DPT("AEB",QAMAEB,QAMDFN)) Q:QAMDFN'>0  D LP1
 ;  Inpatients
 I PATYPE["1" S QAMWARD="" F  S QAMWARD=$O(^DPT("CN",QAMWARD)) Q:QAMWARD=""  F QAMDFN=0:0 S QAMDFN=$O(^DPT("CN",QAMWARD,QAMDFN)) Q:QAMDFN'>0  D LP1
DONE ;
 K GENDER,SEX,PATYPE,QAMWARD,QAMAEB
 Q
LP1 S SEX=$P($G(^DPT(QAMDFN,0)),"^",2) Q:SEX'=GENDER
 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,QAMTODAY)=QAMDFN
 Q
EN2 ; *** PARAMETER CODE
 K DIR,DIRUT S DIR(0)="SOB^M:Male;F:Female;",DIR("A")="SEX",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"") K:DIR("B")="" DIR("B")
 S DIR("?",1)="CHOOSE FROM:",DIR("?",2)="   M     Male",DIR("?",3)="   F     Female",DIR("?")="Select one of the codes listed."
 S QAMPARAM="P1" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=Y
22 K DIR S DIR(0)="LO^1:3^K:X[""."" X",DIR("A")="PATIENT TYPE LIST",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"1,2") K:DIR("B")="" DIR("B")
 S DIR("?",1)="Choose from:",DIR("?",2)="  1  INPATIENTS",DIR("?",3)="  2  OUTPATIENTS",DIR("?",4)="  3  ALL PATIENTS",DIR("?",5)="Choose any or all that you wish to monitor, e.g. 1,2 or 3, etc."
 S DIR("?",6)="WARNING: NUMBER 3 WILL SELECT EVERY PATIENT IN DHCP !!"
 S DIR("?")="Press RETURN for INPATIENTS and OUTPATIENTS."
 S QAMPARAM="P2" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
EXIT K Y
 K QAMPARAM
Y Q