VistA-WorldVistAEHR/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLCNV1.m

109 lines
3.5 KiB
Mathematica

SPNLCNV1 ;HISC/DAD-CONVERSION ;6/1/95 15:28
;;2.0;Spinal Cord Dysfunction;;01/02/1997
;
; *** Etiology conversion table
F OFFSET=1:1 S SPNLINE=$P($T(ETIOLOGY+OFFSET),";",3) Q:SPNLINE="" D
. S SPNOLD(0)=$P(SPNLINE,U),SPNNEW(0)=$P(SPNLINE,U,2)
. S SPNTYPE=$P(SPNLINE,U,3)
. D FINDNEW I SPNNEWD0 D FINDOLD
. Q
; *** Registration status conversion table
F OFFSET=1:1 S SPNLINE=$P($T(REGSTAT+OFFSET),";",3) Q:SPNLINE="" D
. S SPNOLD=$P(SPNLINE,U),SPNNEW=$P(SPNLINE,U,2)
. S ^TMP($J,"SPN REGSTAT",SPNOLD)=SPNNEW
. S ^TMP($J,"SPN REGSTAT",SPNNEW)=SPNNEW
. Q
; *** Source of NLOI conversion table
F OFFSET=1:1 S SPNLINE=$P($T(NLOI+OFFSET),";",3) Q:SPNLINE="" D
. S SPNOLD=$P(SPNLINE,U),SPNNEW=$P(SPNLINE,U,2)
. S ^TMP($J,"SPN NLOI",SPNOLD)=SPNNEW
. S ^TMP($J,"SPN NLOI",SPNNEW)=SPNNEW
. Q
Q
;
FINDNEW ; *** Find the new etiology entry in file #154.03
S (SPNNEW,SPNNEWD0)=0
F S SPNNEW=$O(^SPNL(154.03,"B",SPNNEW(0),SPNNEW)) Q:SPNNEW'>0!SPNNEWD0 D
. I $P($G(^SPNL(154.03,SPNNEW,0)),U,1,2)'=(SPNNEW(0)_U_SPNTYPE) Q
. S SPNNEWD0=SPNNEW
. Q
I SPNNEWD0'>0 D
. S X="Cannot convert '"_SPNNEW(0)_"' ("_SPNTYPE_"), not found in SCD"
. S X=X_" ETIOLOGY file (#154.03), affects all SCD Registry records"
. D ERR^SPNLCNV0(X)
. Q
Q
;
FINDOLD ; *** Find the old etiology entry in file #154.02
S SPNOLD=0,SPNEXIT=1
F S SPNOLD=$O(^SPNL(154.02,"B",SPNOLD(0),SPNOLD)) Q:SPNOLD'>0 D
. I $P($G(^SPNL(154.02,SPNOLD,0)),U)'=SPNOLD(0) Q
. S ^TMP($J,"SPN ETIOLOGY",SPNOLD)=SPNNEWD0,SPNEXIT=0
. Q
I SPNEXIT=1 D
. S X="Cannot convert '"_SPNOLD(0)_"', not found in *SCD ETIOLOGY CATEGORY"
. S X=X_" file (#154.02), affects all SCD Registry records"
. D ERR^SPNLCNV0(X)
. Q
Q
;
ETIOLOGY ;; Old_Value ^ New_Value ^ Type_of_Cause
;;AIR SPORTS^SPORTS ACTIVITY^TC
;;ALL OTHER PENETRATING WOUNDS^ACT OF VIOLENCE^TC
;;ALL TERRAIN VEHICLE & CYCLE^VEHICULAR^TC
;;AUTO ACCIDENT^VEHICULAR^TC
;;BASEBALL/SOFTBALL^SPORTS ACTIVITY^TC
;;BASKETBALL/VOLLEYBALL^SPORTS ACTIVITY^TC
;;BICYCLE^VEHICULAR^TC
;;BOAT^VEHICULAR^TC
;;DIVING^SPORTS ACTIVITY^TC
;;EXPLOSION^ACT OF VIOLENCE^TC
;;FALL^FALL^TC
;;FIELD SPORTS^SPORTS ACTIVITY^TC
;;FIXED-WING AIRCRAFT^VEHICULAR^TC
;;FOOTBALL^SPORTS ACTIVITY^TC
;;GUNSHOT WOUND^ACT OF VIOLENCE^TC
;;GYMNASTICS^SPORTS ACTIVITY^TC
;;HANG GLIDING^SPORTS ACTIVITY^TC
;;HIT BY FALLING/FLYING OBJECT^ACT OF VIOLENCE^TC
;;HORSEBACK RIDING^SPORTS ACTIVITY^TC
;;INTERSPINAL ABSCESS^INFECTION OR ABSCESS^NTC
;;MEDICAL/SURGICAL COMPLICATION^OTHER - TRAUMATIC^TC
;;MOTOR NEURON DISEASE^MOTOR NEURON DISEASE^NTC
;;MOTORCYCLE ACCIDENT^VEHICULAR^TC
;;MULTIPLE SCLEROSIS^MULTIPLE SCLEROSIS^NTC
;;NEOPLSM AFCTNG SPNL& RLTD STRC^TUMOR^NTC
;;OTHER^OTHER^U
;;OTHER DESEASE OF THE SPNL CORD^OTHER - DISEASE^NTC
;;OTHER SPORT - UNCLASSIFIED^SPORTS ACTIVITY^TC
;;OTHER UNCLASSIFIED^OTHER^U
;;OTHER VEHICULAR - UNCLASSIFIED^VEHICULAR^TC
;;PEDESTRIAN^OTHER - TRAUMATIC^TC
;;PERSON-TO-PERSON CONTACT^ACT OF VIOLENCE^TC
;;POLIOMYELITIS^POLIOMYELITIS^NTC
;;RODEO^SPORTS ACTIVITY^TC
;;ROTATING WING AIRCRAFT^VEHICULAR^TC
;;SKATEBOARD^SPORTS ACTIVITY^TC
;;SNOW SKIING^SPORTS ACTIVITY^TC
;;SNOWMOBILE^SPORTS ACTIVITY^TC
;;SPINOCEREBELLAR DISEASES^OTHER - DISEASE^NTC
;;SPONDYLOSIS^OTHER - DISEASE^NTC
;;SURFING^SPORTS ACTIVITY^TC
;;TRACK & FIELD^SPORTS ACTIVITY^TC
;;TRAMPOLINE^SPORTS ACTIVITY^TC
;;UNKNOWN -DISEASE^UNKNOWN^NTC
;;UNKNOWN -TRAUMATIC^UNKNOWN^TC
;;WATER SKIING^SPORTS ACTIVITY^TC
;;WINTER SPORTS^SPORTS ACTIVITY^TC
;;WRESTLING^SPORTS ACTIVITY^TC
;;
REGSTAT ;; Old_Value ^ New_Value
;;A^1
;;I^2
;;
NLOI ;; Old_Value ^ New_Value
;;PS^1
;;CO^2
;;CA^3
;;