source: WorldVistAEHR/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMC2.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.9 KB
RevLine 
[613]1QAMC2 ;HISC/DAD-CONDITION: SEX ;4/30/93 12:36
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3EN1 ; *** CONDITION CODE
4 S GENDER=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"")
5 Q:GENDER=""
6 S PATYPE=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"1,2")
7 ; All patients
8 I PATYPE["3" D G DONE
9 . F QAMDFN=0:0 S QAMDFN=$O(^DPT("ASX",GENDER,QAMDFN)) Q:QAMDFN'>0 D LP1
10 . Q
11 ; Outpatients
12 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
13 ; Inpatients
14 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
15DONE ;
16 K GENDER,SEX,PATYPE,QAMWARD,QAMAEB
17 Q
18LP1 S SEX=$P($G(^DPT(QAMDFN,0)),"^",2) Q:SEX'=GENDER
19 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,QAMTODAY)=QAMDFN
20 Q
21EN2 ; *** PARAMETER CODE
22 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")
23 S DIR("?",1)="CHOOSE FROM:",DIR("?",2)=" M Male",DIR("?",3)=" F Female",DIR("?")="Select one of the codes listed."
24 S QAMPARAM="P1" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
25 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=Y
2622 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")
27 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."
28 S DIR("?",6)="WARNING: NUMBER 3 WILL SELECT EVERY PATIENT IN DHCP !!"
29 S DIR("?")="Press RETURN for INPATIENTS and OUTPATIENTS."
30 S QAMPARAM="P2" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
31 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
32EXIT K Y
33 K QAMPARAM
34Y Q
Note: See TracBrowser for help on using the repository browser.