source: WorldVistAEHR/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMC6.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.1 KB
RevLine 
[613]1QAMC6 ;HISC/DAD-CONDITION: LENGTH OF STAY SINCE ADMISSION ;2/10/92 07:33
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3EN1 ; *** CONDITION CODE
4 S LOS=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:0)
5 S X1=QAMTODAY,X2=-LOS D C^%DTC S (X1,ADMSTART)=X,X2=1 D C^%DTC S ADMEND=X,ADMSTART=ADMSTART-.0000001
6 F ADMDT=ADMSTART:0 S ADMDT=$O(^DGPM("AMV1",ADMDT)) Q:(ADMDT'>0)!(ADMDT'<ADMEND)!(ADMDT\1'?7N) F QAMDFN=0:0 S QAMDFN=$O(^DGPM("AMV1",ADMDT,QAMDFN)) Q:QAMDFN'>0 D LOOP0
7 K LOS,X1,X2,ADMEND,ADMSTART,QAMDC
8 Q
9LOOP0 F IEN=0:0 S IEN=$O(^DGPM("AMV1",ADMDT,QAMDFN,IEN)) Q:IEN'>0 D LOOP1
10 Q
11LOOP1 S QAMDC=$O(^DGPM("APTT3",QAMDFN,ADMDT)) Q:(QAMDC'>QAMTODAY)&QAMDC
12 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,QAMTODAY)=IEN
13 Q
14EN2 ; *** PARAMETER CODE
15 K DIR,DIRUT S DIR(0)="NO^1:365:0",DIR("A")="LENGTH OF STAY",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"") K:DIR("B")="" DIR("B")
16 S DIR("?",1)="Enter the LOS from the date of the patient's admission.",DIR("?")="Enter the length of stay from 1-365 days."
17 S QAMPARAM="P1" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
18 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=Y
19EXIT K Y
20 K QAMPARAM
21Y Q
Note: See TracBrowser for help on using the repository browser.