source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCQCAV.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: 1.8 KB
Line 
1FSCQCAV ;SLC/STAFF-NOIS Query Criteria Ask Value ;8/25/94 17:14
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4VALUE(COND,TYPE) ; from FSCLMPME, FSCQB
5 N DIC,DIR,VALUE1,VALUE2
6 S VALUE=""
7 I $P(COND,U,3)="exists" Q
8 I $P(COND,U,3)="not exists" Q
9 S DIR("?")="^D HELP^FSCQD"
10 ;
11 ; free-text values
12 I TYPE["F"!(TYPE["W") D Q
13 .S DIR(0)="FAO^1:30",DIR("A")="Text: "
14 .S DIR("?",1)="Enter the text to be used in the search."
15 .S DIR("??")="FSC U1 NOIS"
16 .D ^DIR
17 .S VALUE=Y_U_""""_Y_""""
18 ;
19 ; date values
20 I TYPE["D" D Q
21 .S DIR(0)="DAO^:DT:EX",DIR("A")="Date: "
22 .S DIR("?",1)="Enter the date to be used in the search."
23 .S DIR("??")="FSC U1 NOIS"
24 .I $P(COND,U,3)["range" D Q
25 ..S DIR("A")="First Date: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE1=Y,VALUE=VALUE1_U_$$FMTE^XLFDT(VALUE1)_" to "
26 ..S DIR("A")="Last Date: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE2=Y
27 ..S:VALUE1>VALUE2 X=VALUE1,VALUE1=VALUE2,VALUE2=X
28 ..S VALUE=VALUE1_"-"_VALUE2_U_$$FMTE^XLFDT(VALUE1)_" to "_$$FMTE^XLFDT(VALUE2)
29 .D ^DIR
30 .S VALUE=Y_U_$$FMTE^XLFDT(Y)
31 ;
32 ; numeric values
33 I TYPE["N" D Q
34 .S DIR(0)="NOA^0:999:2",DIR("A")="Number: "
35 .S DIR("?",1)="Enter a numeric value to be used in the search."
36 .S DIR("?",2)="The number may include two decimal places"
37 .S DIR("??")="FSC U1 NOIS"
38 .I $P(COND,U,3)["range" D Q
39 ..S DIR("A")="First Number: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE1=Y,VALUE=VALUE1_U_VALUE1_" to "
40 ..S DIR("A")="Last Number: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE2=Y
41 ..S:VALUE1>VALUE2 X=VALUE1,VALUE1=VALUE2,VALUE2=X
42 ..S VALUE=VALUE1_"-"_VALUE2_U_VALUE1_" to "_VALUE2
43 .D ^DIR
44 .S VALUE=+Y_U_Y
45 ;
46 ; pointer values
47 I TYPE["P" D Q
48 .S DIC=+$P(TYPE,"P",2),DIC(0)="EMOQZ",DIC("A")="Select "_$P(FIELD,U,2)_": "
49 .I $L($G(^FSC("FLD",+FIELD,.1))) S DIC("S")=^(.1)
50 .S DIR("?",1)="Select the value of the field."
51 .D LOOK^FSCQU(.DIC,.DIR)
52 .S VALUE=+Y_U_$G(Y(0,0))
53 Q
Note: See TracBrowser for help on using the repository browser.