SROAERR ;BIR/MAM - UPDATE ASSESSMENTS ENTERED IN ERROR ;05/05/10
;;3.0; Surgery ;**38,65,100,174**;24 Jun 93;Build 8
TRANS ; update assessments transmitted in error
I '$D(SRSTAT) S SRSTAT="T"
S SRSOUT=0 K SRNEW D ^SROASS I '$D(SRTN) S SRSOUT=1 G END
S SRASTAT=$P($G(^SRF(SRTN,"RA")),"^") I SRSTAT'=SRASTAT D GOOF I GOOF G END
ASK W !!,"Are you sure that you want to change the status of this assessment"
W !,"from "_$S(SRASTAT="C":"'COMPLETE'",1:"'TRANSMITTED'")_" to 'INCOMPLETE' ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
S SRYN=$E(SRYN) I "YyNn"'[SRYN D HELP G ASK
S:SRYN="" SRYN="Y" I "Nn"[SRYN G END
I $$LOCK^SROUTL(SRTN) D STAT Q
E W !!,"No action taken." G END
Q
STAT K DR S DIE=130,DA=SRTN,DR="235////I;393////"_$S(SRASTAT="T":1,1:"") D ^DIE K DR
I SRASTAT="C"&($P($G(^SRF(SRTN,"RA")),"^",3)'="1") K DR S DIE=130,DA=SRTN,DR="272///@;272.1///@" D ^DIE K DR
W !!,"The Assessment Status has been changed to 'INCOMPLETE'."
D UNLOCK^SROUTL(SRTN)
END I 'SRSOUT W !!,"Press <RET> to continue " R X:DTIME
D ^SRSKILL K SRTN W @IOF
Q
GOOF S GOOF=0 I SRASTAT="I" W !!,"This assessment already has the status, 'INCOMPLETE'." S GOOF=1 Q
Q
HELP W !!,"Enter RETURN if the assessment was "_$S(SRASTAT="C":"completed",1:"transmitted")_" in error and the status",!,"should be changed to 'INCOMPLETE' to allow editing. Otherwise, enter 'NO'."
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROAERR 1394 printed Nov 22, 2024@17:50:27 Page 2
SROAERR ;BIR/MAM - UPDATE ASSESSMENTS ENTERED IN ERROR ;05/05/10
+1 ;;3.0; Surgery ;**38,65,100,174**;24 Jun 93;Build 8
TRANS ; update assessments transmitted in error
+1 IF '$DATA(SRSTAT)
SET SRSTAT="T"
+2 SET SRSOUT=0
KILL SRNEW
DO ^SROASS
IF '$DATA(SRTN)
SET SRSOUT=1
GOTO END
+3 SET SRASTAT=$PIECE($GET(^SRF(SRTN,"RA")),"^")
IF SRSTAT'=SRASTAT
DO GOOF
IF GOOF
GOTO END
ASK WRITE !!,"Are you sure that you want to change the status of this assessment"
+1 WRITE !,"from "_$SELECT(SRASTAT="C":"'COMPLETE'",1:"'TRANSMITTED'")_" to 'INCOMPLETE' ? YES// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
GOTO END
+2 SET SRYN=$EXTRACT(SRYN)
IF "YyNn"'[SRYN
DO HELP
GOTO ASK
+3 if SRYN=""
SET SRYN="Y"
IF "Nn"[SRYN
GOTO END
+4 IF $$LOCK^SROUTL(SRTN)
DO STAT
QUIT
+5 IF '$TEST
WRITE !!,"No action taken."
GOTO END
+6 QUIT
STAT KILL DR
SET DIE=130
SET DA=SRTN
SET DR="235////I;393////"_$SELECT(SRASTAT="T":1,1:"")
DO ^DIE
KILL DR
+1 IF SRASTAT="C"&($PIECE($GET(^SRF(SRTN,"RA")),"^",3)'="1")
KILL DR
SET DIE=130
SET DA=SRTN
SET DR="272///@;272.1///@"
DO ^DIE
KILL DR
+2 WRITE !!,"The Assessment Status has been changed to 'INCOMPLETE'."
+3 DO UNLOCK^SROUTL(SRTN)
END IF 'SRSOUT
WRITE !!,"Press <RET> to continue "
READ X:DTIME
+1 DO ^SRSKILL
KILL SRTN
WRITE @IOF
+2 QUIT
GOOF SET GOOF=0
IF SRASTAT="I"
WRITE !!,"This assessment already has the status, 'INCOMPLETE'."
SET GOOF=1
QUIT
+1 QUIT
HELP WRITE !!,"Enter RETURN if the assessment was "_$SELECT(SRASTAT="C":"completed",1:"transmitted")_" in error and the status",!,"should be changed to 'INCOMPLETE' to allow editing. Otherwise, enter 'NO'."
+1 QUIT