FSCQCAV ;SLC/STAFF-NOIS Query Criteria Ask Value ;8/25/94 17:14
;;1.1;NOIS;;Sep 06, 1998
;
VALUE(COND,TYPE) ; from FSCLMPME, FSCQB
N DIC,DIR,VALUE1,VALUE2
S VALUE=""
I $P(COND,U,3)="exists" Q
I $P(COND,U,3)="not exists" Q
S DIR("?")="^D HELP^FSCQD"
;
; free-text values
I TYPE["F"!(TYPE["W") D Q
.S DIR(0)="FAO^1:30",DIR("A")="Text: "
.S DIR("?",1)="Enter the text to be used in the search."
.S DIR("??")="FSC U1 NOIS"
.D ^DIR
.S VALUE=Y_U_""""_Y_""""
;
; date values
I TYPE["D" D Q
.S DIR(0)="DAO^:DT:EX",DIR("A")="Date: "
.S DIR("?",1)="Enter the date to be used in the search."
.S DIR("??")="FSC U1 NOIS"
.I $P(COND,U,3)["range" D Q
..S DIR("A")="First Date: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE1=Y,VALUE=VALUE1_U_$$FMTE^XLFDT(VALUE1)_" to "
..S DIR("A")="Last Date: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE2=Y
..S:VALUE1>VALUE2 X=VALUE1,VALUE1=VALUE2,VALUE2=X
..S VALUE=VALUE1_"-"_VALUE2_U_$$FMTE^XLFDT(VALUE1)_" to "_$$FMTE^XLFDT(VALUE2)
.D ^DIR
.S VALUE=Y_U_$$FMTE^XLFDT(Y)
;
; numeric values
I TYPE["N" D Q
.S DIR(0)="NOA^0:999:2",DIR("A")="Number: "
.S DIR("?",1)="Enter a numeric value to be used in the search."
.S DIR("?",2)="The number may include two decimal places"
.S DIR("??")="FSC U1 NOIS"
.I $P(COND,U,3)["range" D Q
..S DIR("A")="First Number: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE1=Y,VALUE=VALUE1_U_VALUE1_" to "
..S DIR("A")="Last Number: " D ^DIR Q:$D(DTOUT) Q:$D(DUOUT) S VALUE2=Y
..S:VALUE1>VALUE2 X=VALUE1,VALUE1=VALUE2,VALUE2=X
..S VALUE=VALUE1_"-"_VALUE2_U_VALUE1_" to "_VALUE2
.D ^DIR
.S VALUE=+Y_U_Y
;
; pointer values
I TYPE["P" D Q
.S DIC=+$P(TYPE,"P",2),DIC(0)="EMOQZ",DIC("A")="Select "_$P(FIELD,U,2)_": "
.I $L($G(^FSC("FLD",+FIELD,.1))) S DIC("S")=^(.1)
.S DIR("?",1)="Select the value of the field."
.D LOOK^FSCQU(.DIC,.DIR)
.S VALUE=+Y_U_$G(Y(0,0))
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCQCAV 1914 printed Oct 16, 2024@18:19:30 Page 2
FSCQCAV ;SLC/STAFF-NOIS Query Criteria Ask Value ;8/25/94 17:14
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
VALUE(COND,TYPE) ; from FSCLMPME, FSCQB
+1 NEW DIC,DIR,VALUE1,VALUE2
+2 SET VALUE=""
+3 IF $PIECE(COND,U,3)="exists"
QUIT
+4 IF $PIECE(COND,U,3)="not exists"
QUIT
+5 SET DIR("?")="^D HELP^FSCQD"
+6 ;
+7 ; free-text values
+8 IF TYPE["F"!(TYPE["W")
Begin DoDot:1
+9 SET DIR(0)="FAO^1:30"
SET DIR("A")="Text: "
+10 SET DIR("?",1)="Enter the text to be used in the search."
+11 SET DIR("??")="FSC U1 NOIS"
+12 DO ^DIR
+13 SET VALUE=Y_U_""""_Y_""""
End DoDot:1
QUIT
+14 ;
+15 ; date values
+16 IF TYPE["D"
Begin DoDot:1
+17 SET DIR(0)="DAO^:DT:EX"
SET DIR("A")="Date: "
+18 SET DIR("?",1)="Enter the date to be used in the search."
+19 SET DIR("??")="FSC U1 NOIS"
+20 IF $PIECE(COND,U,3)["range"
Begin DoDot:2
+21 SET DIR("A")="First Date: "
DO ^DIR
if $DATA(DTOUT)
QUIT
if $DATA(DUOUT)
QUIT
SET VALUE1=Y
SET VALUE=VALUE1_U_$$FMTE^XLFDT(VALUE1)_" to "
+22 SET DIR("A")="Last Date: "
DO ^DIR
if $DATA(DTOUT)
QUIT
if $DATA(DUOUT)
QUIT
SET VALUE2=Y
+23 if VALUE1>VALUE2
SET X=VALUE1
SET VALUE1=VALUE2
SET VALUE2=X
+24 SET VALUE=VALUE1_"-"_VALUE2_U_$$FMTE^XLFDT(VALUE1)_" to "_$$FMTE^XLFDT(VALUE2)
End DoDot:2
QUIT
+25 DO ^DIR
+26 SET VALUE=Y_U_$$FMTE^XLFDT(Y)
End DoDot:1
QUIT
+27 ;
+28 ; numeric values
+29 IF TYPE["N"
Begin DoDot:1
+30 SET DIR(0)="NOA^0:999:2"
SET DIR("A")="Number: "
+31 SET DIR("?",1)="Enter a numeric value to be used in the search."
+32 SET DIR("?",2)="The number may include two decimal places"
+33 SET DIR("??")="FSC U1 NOIS"
+34 IF $PIECE(COND,U,3)["range"
Begin DoDot:2
+35 SET DIR("A")="First Number: "
DO ^DIR
if $DATA(DTOUT)
QUIT
if $DATA(DUOUT)
QUIT
SET VALUE1=Y
SET VALUE=VALUE1_U_VALUE1_" to "
+36 SET DIR("A")="Last Number: "
DO ^DIR
if $DATA(DTOUT)
QUIT
if $DATA(DUOUT)
QUIT
SET VALUE2=Y
+37 if VALUE1>VALUE2
SET X=VALUE1
SET VALUE1=VALUE2
SET VALUE2=X
+38 SET VALUE=VALUE1_"-"_VALUE2_U_VALUE1_" to "_VALUE2
End DoDot:2
QUIT
+39 DO ^DIR
+40 SET VALUE=+Y_U_Y
End DoDot:1
QUIT
+41 ;
+42 ; pointer values
+43 IF TYPE["P"
Begin DoDot:1
+44 SET DIC=+$PIECE(TYPE,"P",2)
SET DIC(0)="EMOQZ"
SET DIC("A")="Select "_$PIECE(FIELD,U,2)_": "
+45 IF $LENGTH($GET(^FSC("FLD",+FIELD,.1)))
SET DIC("S")=^(.1)
+46 SET DIR("?",1)="Select the value of the field."
+47 DO LOOK^FSCQU(.DIC,.DIR)
+48 SET VALUE=+Y_U_$GET(Y(0,0))
End DoDot:1
QUIT
+49 QUIT