source: WorldVistAEHR/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMC20.m@ 691

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

initial load of WorldVistAEHR

File size: 2.7 KB
RevLine 
[613]1QAMC20 ;HISC/DAD-CONDITION: ON SERVICE ;8/26/93 08:15
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3EN1 ; *** CONDITION CODE
4 S QAMGRP=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:0)
5 S QAMSMPSZ=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:","_^("P2")_",",1:0)
6 D EN^QAMTIME0
7 F QAMMOV=QAMTODAY-.0000001:0 S QAMMOV=$O(^DGPM("AMV3",QAMMOV)) Q:(QAMMOV'>0)!(QAMMOV>(QAMTODAY+.9999999))!(QAMMOV\1'?7N) F QAMDFN=0:0 S QAMDFN=$O(^DGPM("AMV3",QAMMOV,QAMDFN)) Q:QAMDFN'>0 S QAMXREF="AMV3" D LOOP11
8 S QAMWRD=""
9 F S QAMWRD=$O(^DPT("CN",QAMWRD)) Q:QAMWRD="" F QAMDFN=0:0 S QAMDFN=$O(^DPT("CN",QAMWRD,QAMDFN)) Q:QAMDFN'>0 S QAMXREF="ATID6" D LOOP1
10 K QAMGRP,QAMDFN,QAMMOV,QAMMOVDT,QAMMOVD0,QAMWRD,SERV,X
11 Q
12LOOP1 S QAMMOVDT=$O(^DGPM(QAMXREF,QAMDFN,9999999-QAMTODAY)) Q:(QAMMOVDT'>0)!(QAMMOVDT\1'?7N) S QAMMOVD0=$O(^DGPM(QAMXREF,QAMDFN,QAMMOVDT,0)) Q:QAMMOVD0'>0
13LOOP11 I QAMXREF="AMV3" D DC Q:QAMMOVD0'>0
14 S QAMMOVDT(0)=9999999.9999999-QAMMOVDT
15 I QAMGRP S SERV=+$S($D(^DGPM(QAMMOVD0,0))#2:$P(^(0),"^",9),1:0),SERV=$S($D(^DIC(45.7,SERV,0))#2:$P(^(0),"^",4),1:0) Q:$O(^QA(743.5,QAMGRP,"GRP","AB",+SERV,0))'>0
16 Q:QAMMOVDT(0)<+$O(^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN,0))
17 K ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)
18 I (QAMSMPSZ[",1,")!(QAMXREF="ATID6") S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="" ; *** TRF
19 I (QAMSMPSZ[",2,")!(QAMXREF="AMV3") S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="" ; *** D/C
20 I (QAMSMPSZ[",3,")!(QAMTODAY=QAMEND) S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="" ; *** IN-HOUSE ENDING
21 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN,QAMMOVDT(0))=QAMMOVD0
22 Q
23DC S QAMMOVDT=9999999.9999999-QAMMOV,QAMMOVDT=+$O(^DGPM("ATID6",QAMDFN,QAMMOVDT)),QAMMOVD0=$O(^DGPM("ATID6",QAMDFN,QAMMOVDT,0))
24 Q
25EN2 ; *** PARAMETER CODE
2621 K DIC,DIR,DIRUT S DIC=743.5,DIC(0)="EMNQZ",DIC("S")="I $P(^QA(743.5,+Y,0),""^"",2)=49"
27 S DIC("A")="SERVICE/SECTION GROUP: ",DIC("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:$P(^("P1"),"^",2),1:"") K:DIC("B")="" DIC("B")
28 S DIR("?",1)="Enter a GROUP name that contains MAS service/sections,",DIR("?")="or press 'RETURN' for all service/sections."
29 S QAMPARAM="P1" D EN2^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
30 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=+Y_"^"_Y(0,0)
3122 K DIR S DIR(0)="LO^1:3^K:X[""."" X",DIR("A")="COUNT SAMPLE SIZE BY",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"") K:DIR("B")="" DIR("B")
32 S DIR("?",1)="Choose one or more of the following:",DIR("?",2)=" 1 Transfers",DIR("?",3)=" 2 Discharges",DIR("?",4)=" 3 # in-house at ending of time frame",DIR("?",5)=""
33 S DIR("?")="Enter your selections separated by commas, e.g., 1,3"
34 S QAMPARAM="P2" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
35 S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
36EXIT K Y
37 K QAMPARAM,QAMY
38Y Q
Note: See TracBrowser for help on using the repository browser.