source: WorldVistAEHR/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMC1.m@ 1800

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

initial load of WorldVistAEHR

File size: 1.3 KB
RevLine 
[613]1QAMC1 ;HISC/DAD-CONDITION: AGE ;2/10/92 07:33
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3EN1 ; *** CONDITION CODE
4 S LOWERAGE=+$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:0)
5 S UPPERAGE=+$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:+^("P2"),1:0)
6 Q:UPPERAGE+LOWERAGE'>0
7 S X1=QAMTODAY,X2=-1*(UPPERAGE*365.25+1) D C^%DTC S START=$S(UPPERAGE'>0:0,1:X)
8 S X1=QAMTODAY,X2=-1*(LOWERAGE*365.25) D C^%DTC S END=X
9 F QAMDOB=START:0:END S QAMDOB=$O(^DPT("ADOB",QAMDOB)) Q:QAMDOB'>0!(QAMDOB>END)!(QAMDOB\1'?7N) F QAMDFN=0:0 S QAMDFN=$O(^DPT("ADOB",QAMDOB,QAMDFN)) Q:QAMDFN'>0 D LOOP1
10 K LOWERAGE,UPPERAGE,X1,X2,X,START,QAMDOB,END
11 Q
12LOOP1 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,QAMTODAY)=QAMDFN
13 Q
14EN2 ; *** PARAMETER CODE
15 K DIR,DIRUT S DIR(0)="NO^1:130:0",DIR("A")="LOWER AGE LIMIT",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:"") K:DIR("B")="" DIR("B")
16 S QAMPARAM="P1" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
17 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=Y S QAMY=Y
182 K DIR,DIRUT S DIR(0)="NO^"_$S(QAMY>0:QAMY,1:1)_":130:0",DIR("A")="UPPER AGE LIMIT",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:+^("P2"),1:"") K:DIR("B")="" DIR("B")
19 S QAMPARAM="P2" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
20 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=Y
21EXIT K Y
22Y K QAMPARAM
23 Q
Note: See TracBrowser for help on using the repository browser.