AMHGSCM ; IHS/CMI/MAW - AMHG Save Case Management 3/3/2009 4:59:31 PM ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
;
;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
D DEBUG^%Serenji("PH^AMHGSCM(.RETVAL,.AMHSTR)")
Q
;
CM(RETVAL,AMHSTR) ;-- save case management called from the clsCaseManagement.SaveCaseManagement method
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHDM,AMHREC,AMHPRO,AMHCO,AMHPP,AMHCA,AMHNR,AMHDC,AMHDSP,AMHCMT,AMHP,AMHPV,AMHER
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHPRO=$P(AMHSTR,P,3)
S AMHPRO=$$SCI^AMHGT(9002011,.02,AMHPRO)
S AMHCO=$P(AMHSTR,P,4)
S AMHPP=$P(AMHSTR,P,5)
S AMHPV=$P(AMHSTR,P,6)
S AMHCA=$P(AMHSTR,P,7)
S AMHNR=$P(AMHSTR,P,8)
S AMHDC=$P(AMHSTR,P,9)
S AMHDSP=$P(AMHSTR,P,10)
S AMHCMT=$P(AMHSTR,P,11)
S AMHP=$P(AMHSTR,P,12)
D CM^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHPRO,AMHCO,AMHPP,AMHPV,AMHCA,AMHNR,AMHDC,AMHDSP,AMHP,AMHCMT)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHREC)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
PI(RETVAL,AMHSTR) ;-- save patient information called from clsCaseManagement.SavePatientInformation method
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN,AMHER
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHDMP=$P(AMHSTR,P,3)
S AMHDSP=$P(AMHSTR,P,4)
S AMHDCP=$P(AMHSTR,P,5)
S AMHDPO=$P(AMHSTR,P,6)
S AMHDONA=$P(AMHSTR,P,7)
S AMHDONB=$P(AMHSTR,P,8)
S AMHFLG=$P(AMHSTR,P,9)
S AMHFLGN=$P(AMHSTR,P,10)
D PI^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHREC)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
PH(RETVAL,AMHSTR) ;-- file personal history called from clsCaseManagement.SavePersonalHistory method
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN,AMHP,AMHPHSTR,AMHER
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHPHSTR=$P(AMHSTR,P,3)
D PH^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHPHSTR)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHREC)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
DEL(RETVAL,AMHSTR) ;-- delete case data
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N P,R,AMHCASE,AMHI,AMHER
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHCASE=$P(AMHSTR,P)
S DIK="^AMHPCASE(",DA=AMHCASE D ^DIK
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHCASE)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
AMHGSCM ; IHS/CMI/MAW - AMHG Save Case Management 3/3/2009 4:59:31 PM ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
+5 ;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
+1 DO DEBUG^%Serenji("PH^AMHGSCM(.RETVAL,.AMHSTR)")
+2 QUIT
+3 ;
CM(RETVAL,AMHSTR) ;-- save case management called from the clsCaseManagement.SaveCaseManagement method
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHDM,AMHREC,AMHPRO,AMHCO,AMHPP,AMHCA,AMHNR,AMHDC,AMHDSP,AMHCMT,AMHP,AMHPV,AMHER
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+8 SET AMHDM=$PIECE(AMHSTR,P)
+9 SET AMHREC=$PIECE(AMHSTR,P,2)
+10 SET AMHPRO=$PIECE(AMHSTR,P,3)
+11 SET AMHPRO=$$SCI^AMHGT(9002011,.02,AMHPRO)
+12 SET AMHCO=$PIECE(AMHSTR,P,4)
+13 SET AMHPP=$PIECE(AMHSTR,P,5)
+14 SET AMHPV=$PIECE(AMHSTR,P,6)
+15 SET AMHCA=$PIECE(AMHSTR,P,7)
+16 SET AMHNR=$PIECE(AMHSTR,P,8)
+17 SET AMHDC=$PIECE(AMHSTR,P,9)
+18 SET AMHDSP=$PIECE(AMHSTR,P,10)
+19 SET AMHCMT=$PIECE(AMHSTR,P,11)
+20 SET AMHP=$PIECE(AMHSTR,P,12)
+21 DO CM^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHPRO,AMHCO,AMHPP,AMHPV,AMHCA,AMHNR,AMHDC,AMHDSP,AMHP,AMHCMT)
+22 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+23 SET AMHI=AMHI+1
+24 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHREC)_$CHAR(30)
+25 SET @RETVAL@(AMHI+1)=$CHAR(31)
+26 QUIT
+27 ;
PI(RETVAL,AMHSTR) ;-- save patient information called from clsCaseManagement.SavePatientInformation method
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN,AMHER
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+8 SET AMHDM=$PIECE(AMHSTR,P)
+9 SET AMHREC=$PIECE(AMHSTR,P,2)
+10 SET AMHDMP=$PIECE(AMHSTR,P,3)
+11 SET AMHDSP=$PIECE(AMHSTR,P,4)
+12 SET AMHDCP=$PIECE(AMHSTR,P,5)
+13 SET AMHDPO=$PIECE(AMHSTR,P,6)
+14 SET AMHDONA=$PIECE(AMHSTR,P,7)
+15 SET AMHDONB=$PIECE(AMHSTR,P,8)
+16 SET AMHFLG=$PIECE(AMHSTR,P,9)
+17 SET AMHFLGN=$PIECE(AMHSTR,P,10)
+18 DO PI^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN)
+19 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+20 SET AMHI=AMHI+1
+21 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHREC)_$CHAR(30)
+22 SET @RETVAL@(AMHI+1)=$CHAR(31)
+23 QUIT
+24 ;
PH(RETVAL,AMHSTR) ;-- file personal history called from clsCaseManagement.SavePersonalHistory method
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN,AMHP,AMHPHSTR,AMHER
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+8 SET AMHDM=$PIECE(AMHSTR,P)
+9 SET AMHREC=$PIECE(AMHSTR,P,2)
+10 SET AMHPHSTR=$PIECE(AMHSTR,P,3)
+11 DO PH^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHPHSTR)
+12 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+13 SET AMHI=AMHI+1
+14 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHREC)_$CHAR(30)
+15 SET @RETVAL@(AMHI+1)=$CHAR(31)
+16 QUIT
+17 ;
DEL(RETVAL,AMHSTR) ;-- delete case data
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW P,R,AMHCASE,AMHI,AMHER
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+8 SET AMHCASE=$PIECE(AMHSTR,P)
+9 SET DIK="^AMHPCASE("
SET DA=AMHCASE
DO ^DIK
+10 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+11 SET AMHI=AMHI+1
+12 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHCASE)_$CHAR(30)
+13 SET @RETVAL@(AMHI+1)=$CHAR(31)
+14 QUIT
+15 ;