source: WorldVistAEHR/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMC13.m@ 1093

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

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1QAMC13 ;HISC/DAD-CONDITION: READMISSION ;9/3/93 13:13
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3EN1 ; *** CONDITION CODE
4 S QAMDAYS=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:0)
5 F ADMDT=(QAMTODAY-.0000001):0 S ADMDT=$O(^DGPM("AMV1",ADMDT)) Q:(ADMDT'>0)!(ADMDT>(QAMTODAY+.9999999))!(ADMDT\1'?7N) F QAMDFN=0:0 S QAMDFN=$O(^DGPM("AMV1",ADMDT,QAMDFN)) Q:QAMDFN'>0 D LOOP0
6 K ADMD0,QAMDAYS,ADMDT,X1,X2,X,STOPDT,QAMDC
7 Q
8LOOP0 F ADMD0=0:0 S ADMD0=$O(^DGPM("AMV1",ADMDT,QAMDFN,ADMD0)) Q:ADMD0'>0 D LOOP1
9 Q
10LOOP1 S X1=ADMDT,X2=-QAMDAYS D C^%DTC S STOPDT=9999999.9999999-X
11 F QAMDC=(9999999.9999999-ADMDT):0 S QAMDC=$O(^DGPM("ATID3",QAMDFN,QAMDC)) Q:(QAMDC'>0)!(QAMDC\1'?7N)!(QAMDC>STOPDT) S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,ADMDT)=ADMD0 Q
12 Q
13EN2 ; *** PARAMETER CODE
14 K DIR,DIRUT S DIR(0)="NO^1:365:0",DIR("A")="DAYS BETWEEN DISCHARGE AND ADMISSION",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"") K:DIR("B")="" DIR("B")
15 S DIR("?",1)="Enter the number of QAMDAYS between the patient's last discharge",DIR("?")="and current admission."
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
18EXIT K Y
19 K QAMPARAM
20Y Q
Note: See TracBrowser for help on using the repository browser.