source: FOIAVistA/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMC3.m@ 1437

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1QAMC3 ;HISC/DAD-CONDITION: SSN SAMPLE ;7/12/93 14:31
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3EN1 ; *** CONDITION CODE
4 S QAMDIGIT=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"")
5 S PATYPE=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"1,2")
6 I QAMDIGIT]"" S:$E(QAMDIGIT)'="," QAMDIGIT=","_QAMDIGIT S:$E(QAMDIGIT,$L(QAMDIGIT))'="," QAMDIGIT=QAMDIGIT_","
7 ; All Patients
8 I PATYPE["3" D G DONE
9 . F QAMDFN=0:0 S QAMDFN=$O(^DPT(QAMDFN)) Q:QAMDFN'>0 D LOOP1
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 LOOP1
13 Q
14 ; Inpatients
15 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 LOOP1
16 Q
17DONE ;
18 K QAMDIGIT,QAMSSN,PATYPE,QAMWARD,QAMAEB
19 Q
20LOOP1 K VADM S DFN=QAMDFN D DEM^VADPT
21 S QAMSSN=$P(VADM(2),"^") K DFN,VADM,VAERR Q:QAMSSN=""
22 S QAMSSN=","_$E(QAMSSN,$L(QAMSSN))_"," Q:QAMDIGIT'[QAMSSN
23 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,QAMTODAY)=QAMDFN
24 Q
25EN2 ; *** PARAMETER CODE
26 K DIR S DIR(0)="LO^0:9^K:X[""."" X",DIR("A")="LAST DIGIT(S) OF SSN",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"") K:DIR("B")="" DIR("B")
27 S QAMPARAM="P1" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
28 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
2922 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")
30 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."
31 S DIR("?",6)="WARNING: NUMBER 3 WILL SELECT EVERY PATIENT IN DHCP !!"
32 S DIR("?")="Press RETURN for INPATIENTS and OUTPATIENTS."
33 S QAMPARAM="P2" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
34 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
35EXIT K Y
36 K QAMPARAM
37Y Q
Note: See TracBrowser for help on using the repository browser.