Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SRTPVAN

SRTPVAN.m

Go to the documentation of this file.
  1. SRTPVAN ;BIR/SJA - CHANGE ASSESSMENT TYPE ;02/29/08
  1. ;;3.0; Surgery ;**167**;24 Jun 93;Build 27
  1. I '$D(SRTPP) Q
  1. N SRYN,SRSTAT,SRATYPE,SRNTYPE,SRCHG,SRORG,SRVAR
  1. S SR("RA")=$G(^SRT(SRTPP,"RA")),SRSTAT=$P(SR("RA"),"^"),SRATYPE=$P(SR("RA"),"^",5),SRORG=$P(SR("RA"),"^",2)
  1. I SRSTAT="T" W !!,"This assessment has already been verified and transmitted. It cannot be",!,"changed. If the assessment was transmitted in error, use the option 'Update",!,"an Assessment Transmitted in Error'." D RET Q
  1. I SRSTAT="V" W !!,"This assessment has already been verified. It cannot be changed. If the",!,"assessment was verified in error, use the option 'Update an Assessment Verified",!,"in Error'." D RET Q
  1. CHG W !!,"This assessment has a current status of "_$S(SRSTAT="I":"'Incomplete'",1:"'Complete/Unverified'")
  1. W !,"The Transplant Assessment Indicator is a "_$S(SRATYPE="V":"VA",SRATYPE="N":"Non-VA",1:"")_" type"
  1. W !!,"Are you sure that you want to change the indicator to "_$S(SRATYPE="V":"Non-VA",SRATYPE="N":"VA",1:"")_"? NO// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 Q
  1. S SRYN=$E(SRYN) I "Nn"[SRYN W !!,"No action has been taken." D RET S SRSOUT=1 Q
  1. I "Yy"'[SRYN W !!,"Enter <RET> if this assessment was selected in error and the status should not ",!,"be changed. If you want to change this assessment type, enter 'YES'." G CHG
  1. I SRATYPE="N" S SRVA="V",SRCHG=1 D START^SRTPNEW I '$D(SRTN) W !!,"No action has been taken." D RET S SRSOUT=1 Q
  1. I SRATYPE="N" S $P(^SRT(SRTPP,0),"^",3)=SRTN K SRCHG,SRVA
  1. K DR,DIE,DA S DA=SRTPP,DIE=139.5,DR="185////"_$S(SRATYPE="V":"N",SRATYPE="N":"V",1:"") I SRATYPE="N" S DR=DR_";1////"_SRTPDT
  1. I SRATYPE="V" S $P(^SRT(SRTPP,0),"^",3)=""
  1. D ^DIE W !!,"Changing Assessment type..." D CLEAN,RET
  1. Q
  1. DEL ; delete assessment
  1. S SRSTAT=$P($G(^SRT(SRTPP,"RA")),"^")
  1. ST W !!,"Are you sure that you want to delete this assessment ? NO// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 Q
  1. S SRYN=$E(SRYN) I "Nn"[SRYN W !!,"No action has been taken." S SRSOUT=1 Q
  1. I "Yy"'[SRYN W !!,"Enter <RET> if this assessment was selected in error and should not be changed.",!,"If you want to delete this assessment, enter 'YES'." G ST
  1. I SRSTAT="T"!(SRSTAT="C") W !!,"This case has been completed/Transmitted and must remain in the file for your records." D RET Q
  1. K DR,DIE,DA S DA=SRTPP,DIE=139.5,DR="181///@;182///@;183///@;184///@" D ^DIE W !!,"Deleting Transplant Assessment..."
  1. K DA,DIK S DA=SRTPP,DIK="^SRT(" D ^DIK K DA,DIK
  1. Q
  1. CLEAN ; clean up the database after changing the transplant type
  1. S SRNTYPE=$P(^SRT(SRTPP,"RA"),"^",5),SRVAR=""
  1. I SRATYPE="V",(SRNTYPE="N") D ; changed from VA to non-VA
  1. .S SRVAR=$S(SRORG="LI":"81;82;83;109,110",SRORG="H":"108;153;75;154;115;81;82;90;83;109;110",SRORG="K":"133",1:"")
  1. I SRATYPE="N",(SRNTYPE="V") D ; changed from non-VA to VA
  1. .I SRORG="K" S SRVAR="4;5;147;145;132;146;131;116;117;118;119;192;121;122;123;124;125;126;127" Q
  1. .I SRORG="LU" S SRVAR="4;5;145;132;146;131;147;116;117;118;119;192;121;122;123;124;125;126;193" Q
  1. .I SRORG="LI" S SRVAR="4;5;147;116;117;118;119;192;121;122;123;124;125;126;193" Q
  1. .I SRORG="H" S SRVAR="4;5;76;169;177;173;174;175;176;171;172;179;178;132;41;147;193;170;192;191;190;119;189;148;118;121;122;130;109;110;167;168"
  1. S DR="",DIE=139.5 F I=1:1:$L(SRVAR) I $P(SRVAR,";",I)'="" S DR=$S(DR]"":DR_";"_$P(SRVAR,";",I)_"///@",1:$P(SRVAR,";",I)_"///@")
  1. D:DR]"" ^DIE K DR,DA
  1. Q
  1. RET W !!,"Press <RET> to continue " R X:DTIME K SRTPP
  1. Q