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

GMTSSCD.m

Go to the documentation of this file.
GMTSSCD ; HIN/JCC,SLC/SBW,KER - Spinal Cord Dysfunction ; 01/31/2002
 ;;2.7;Health Summary;**13,28,50**;Oct 20, 1995
 ;                     
 ; External References
 ;   DBIA  1517  EN^SPNHS0
 ;                     
MAIN ; Control branching
 N GMCB,GMCI,GMCOR,GMD0,GMD1,GMDATA,GMDATE,GMDCS,GMDMS,GMDTS,GMDTY
 N GMEP,GMET,GMHI,GMIS,GMON,GMPC,GMRS,GMMSST,GMWRT,X
 K ^TMP("SPN",$J)
 D EN^SPNHS0(DFN,GMTSBEG,GMTSEND,$G(GMTSNDM))
 Q:'$D(^TMP("SPN",$J))
 D WRT
 K ^TMP("SPN",$J)
 Q
WRT ; Print data
 S GMDATA=^TMP("SPN",$J,0),GMRS=$P(GMDATA,U,1),GMHI=$P(GMDATA,U,2)
 S GMIS=$P(GMDATA,U,3),GMCI=$P(GMDATA,U,4),GMEP=$P(GMDATA,U,5)
 S GMPC=$P(GMDATA,U,6),GMCOR=$P(GMDATA,U,7),GMMSST=$P(GMDATA,U,8)
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W "Registration Status:",?29,GMRS,!
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W "SCI Level:",?29,GMHI,!
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W "Primary Care Provider:",?29,GMPC,!
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W "SCI/SCD Coordinator:",?29,GMCOR,!
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W "Sensory/Motor Loss:",?29,GMCI,!
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W "Classification of Paralysis:",?29,GMEP,!
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W:GMMSST'="" "MS Subtype:",?29,GMMSST,!
 S GMD0="",GMWRT=1
 F  S GMD0=$O(^TMP("SPN",$J,154,GMD0)) Q:GMD0=""!$D(GMTSQIT)  D
 . S GMDATA=^TMP("SPN",$J,154,GMD0)
 . S X=$P(GMDATA,U) D REGDTM4^GMTSU S GMON=X
 . S GMET=$P(GMDATA,U,2)
 . S GMCB=$P(GMDATA,U,3)
 . D:GMWRT HDR1
 . D CKP^GMTSUP Q:$D(GMTSQIT)  D:GMTSNPG HDR1
 . W GMON,?18,GMET,?50,$E(GMCB,1,29),!
 . S GMWRT=0
 S GMD0=0,GMWRT=1
 F  S GMD0=$O(^TMP("SPN",$J,154.1,GMD0)) Q:GMD0'>0!$D(GMTSQIT)  D
 . S GMD1=0
 . F  S GMD1=$O(^TMP("SPN",$J,154.1,GMD0,GMD1)) Q:GMD1'>0!$D(GMTSQIT)  D
 . . S GMDATA=^TMP("SPN",$J,154.1,GMD0,GMD1)
 . . S X=$P(GMDATA,U) D REGDTM4^GMTSU S GMDATE=X
 . . S GMDMS=$P(GMDATA,U,2),GMDCS=$P(GMDATA,U,3),GMDTS=$P(GMDATA,U,4),GMDTY=$P(GMDATA,U,5)
 . . D:+GMWRT HDR2
 . . D CKP^GMTSUP Q:$D(GMTSQIT)  D:GMTSNPG HDR2
 . . W GMDATE,?18,GMDMS,?32,GMDCS,?50,GMDTS,?64,$E(GMDTY,1,15),!
 . . S GMWRT=0
 Q
HDR1 ; 1st header
 D CKP^GMTSUP Q:$D(GMTSQIT)  W:+GMTSNPG'>0 !
 D CKP^GMTSUP Q:$D(GMTSQIT)  W "Date of Onset ",?16,"Etiology ",?48,"Onset of SCD Caused by Trauma",!
 Q
HDR2 ; 2nd header
 D CKP^GMTSUP Q:$D(GMTSQIT)  W:+GMTSNPG'>0 !
 D CKP^GMTSUP Q:$D(GMTSQIT)  W "Date Recorded",?16,"Motor Score",?30,"Cognitive Score",?48,"Total Score",?62,"Record Type",!
 Q