AMHGMSR ; IHS/CMI/MAW - AMHG Help 5/19/2009 11:39:22 AM ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
;
;
HELP(RETVAL,AMHSTR) ;-- return measurement help
N AMHMTYP,AMHROU,AMHL,L,AMHURET,P
N VAL,AMHI
S P="|"
S VAL=$P(AMHSTR,P)
K ^AMHTMP($J)
S RETVAL="^AMHTMP("_$J_")"
S AMHMTYP="H"_VAL S:AMHMTYP="HVU" AMHMTYP="HVC"
S AMHROU="AUPNVMS2"
S @RETVAL@(0)="T00080Help"_$C(30)
I $T(@AMHMTYP^@AMHROU)="" D Q
. S @RETVAL@(1)=$C(31)
F %AUI=1:1 D Q:L=""!($P(L,";;",1)'=" ")
. S L=$T(@AMHMTYP+%AUI^@AMHROU)
. Q:L=""!($P(L,";;",1)'=" ")
. S AMHL=$P(L,";;",2)
. S @RETVAL@(%AUI)=AMHL_$C(30)
K AMHMTYP
S @RETVAL@(%AUI)=$C(31)
Q
;
VAL(RETVAL,AMHSTR) ;-- validate input data
N AMHMTYP,AMHROU,AMHL,L,AMHURET,P
N VAL,AMHMTYP,AMHI
S P="|"
S AMHI=0
S AMHMTYP=$P(AMHSTR,P)
S VAL=$P(AMHSTR,P,2)
K ^AMHTMP($J)
S RETVAL="^AMHTMP("_$J_")"
S:AMHMTYP="VU" AMHMTYP="VC"
S AMHROU="AUPNVMSR"
S @RETVAL@(AMHI)="T00080Validate"_$C(30)
I $T(@AMHMTYP^@AMHROU)="" D Q
. S @RETVAL@(AMHI+1)=$C(31)
S X=VAL
D @AMHMTYP^@AMHROU
I '$D(X) D
. N AMHHTYP,AMHHROU
. S AMHHTYP="H"_AMHMTYP,AMHHROU="AUPNVMS2"
. F %AUI=1:1 D Q:L=""!($P(L,";;",1)'=" ")
.. S L=$T(@AMHHTYP+%AUI^@AMHHROU)
.. Q:L=""!($P(L,";;",1)'=" ")
.. S AMHL=$P(L,";;",2)
.. S AMHI=AMHI+1
.. S @RETVAL@(AMHI)=AMHL_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
AMHGMSR ; IHS/CMI/MAW - AMHG Help 5/19/2009 11:39:22 AM ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
+5 ;
HELP(RETVAL,AMHSTR) ;-- return measurement help
+1 NEW AMHMTYP,AMHROU,AMHL,L,AMHURET,P
+2 NEW VAL,AMHI
+3 SET P="|"
+4 SET VAL=$PIECE(AMHSTR,P)
+5 KILL ^AMHTMP($JOB)
+6 SET RETVAL="^AMHTMP("_$JOB_")"
+7 SET AMHMTYP="H"_VAL
IF AMHMTYP="HVU"
SET AMHMTYP="HVC"
+8 SET AMHROU="AUPNVMS2"
+9 SET @RETVAL@(0)="T00080Help"_$CHAR(30)
+10 IF $TEXT(@AMHMTYP^@AMHROU)=""
Begin DoDot:1
+11 SET @RETVAL@(1)=$CHAR(31)
End DoDot:1
QUIT
+12 FOR %AUI=1:1
Begin DoDot:1
+13 SET L=$TEXT(@AMHMTYP+%AUI^@AMHROU)
+14 IF L=""!($PIECE(L,";;",1)'=" ")
QUIT
+15 SET AMHL=$PIECE(L,";;",2)
+16 SET @RETVAL@(%AUI)=AMHL_$CHAR(30)
End DoDot:1
IF L=""!($PIECE(L,";;",1)'=" ")
QUIT
+17 KILL AMHMTYP
+18 SET @RETVAL@(%AUI)=$CHAR(31)
+19 QUIT
+20 ;
VAL(RETVAL,AMHSTR) ;-- validate input data
+1 NEW AMHMTYP,AMHROU,AMHL,L,AMHURET,P
+2 NEW VAL,AMHMTYP,AMHI
+3 SET P="|"
+4 SET AMHI=0
+5 SET AMHMTYP=$PIECE(AMHSTR,P)
+6 SET VAL=$PIECE(AMHSTR,P,2)
+7 KILL ^AMHTMP($JOB)
+8 SET RETVAL="^AMHTMP("_$JOB_")"
+9 IF AMHMTYP="VU"
SET AMHMTYP="VC"
+10 SET AMHROU="AUPNVMSR"
+11 SET @RETVAL@(AMHI)="T00080Validate"_$CHAR(30)
+12 IF $TEXT(@AMHMTYP^@AMHROU)=""
Begin DoDot:1
+13 SET @RETVAL@(AMHI+1)=$CHAR(31)
End DoDot:1
QUIT
+14 SET X=VAL
+15 DO @AMHMTYP^@AMHROU
+16 IF '$DATA(X)
Begin DoDot:1
+17 NEW AMHHTYP,AMHHROU
+18 SET AMHHTYP="H"_AMHMTYP
SET AMHHROU="AUPNVMS2"
+19 FOR %AUI=1:1
Begin DoDot:2
+20 SET L=$TEXT(@AMHHTYP+%AUI^@AMHHROU)
+21 IF L=""!($PIECE(L,";;",1)'=" ")
QUIT
+22 SET AMHL=$PIECE(L,";;",2)
+23 SET AMHI=AMHI+1
+24 SET @RETVAL@(AMHI)=AMHL_$CHAR(30)
End DoDot:2
IF L=""!($PIECE(L,";;",1)'=" ")
QUIT
End DoDot:1
+25 SET @RETVAL@(AMHI+1)=$CHAR(31)
+26 QUIT
+27 ;