source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLS1.m@ 1046

Last change on this file since 1046 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1SPNLS1 ;ISCSF/RAH - Continuation Parts from SPNLS ;9/27/95 11:00
2 ;;2.0;Spinal Cord Dysfunction;;01/02/1997
3FINLUPD ;
4 S (SPNLPID,SPNLPID(0))=0,SPNLCT=0
5 F S SPNLPID=$O(^TMP("SPNLS",$J,SPNLPID)) Q:SPNLPID'>0 D
6 .S SPNLPTX=^TMP("SPNLS",$J,SPNLPID)
7 .S SPNLFDT=$P(SPNLPTX,U,2)
8 .S SPNLTDT=$P(SPNLPTX,U,3),SPNLCT=SPNLCT+1
9 .S DIE="^SPNL(154.9,",DR="1////^S X=SPNLFDT;2////^S X=SPNLTDT"
10 .S DA=SPNLPID D ^DIE K DIE
11 .S SPNLPID(0)=SPNLPID
12 K %,X D NOW^%DTC S SPNLT=%,$P(SPNLNODE,U,8,9)=SPNLT_"^"_SPNLCT K %,X
13 S $P(SPNLNODE,U,8,9)=SPNLSDT_U_SPNLCT
14 S DIE="^SPNL(154.93,",DA=SPNLTMP
15 S DR="2///^S X=SPNLT;4///^S X=SPNLCT;5///^S X=SPNLTYPE;6///^S X=SPNXRECS;7///^S X=SPNXRUN;9////^S X=SPNLPID(0)"
16 D ^DIE K DIE
17 I SPNLFULL D
18 .S $P(SPNLNODE,U,5)=SPNLT
19 .S DIE="^SPNL(154.93,",DA=SPNLTMP S DR="9////0" D ^DIE K Y,X,DIE,DR
20 .S SPNLHST=^SPNL(154.93,SPNLTMP,0)
21 .F SPNLX=1:1:10 S SPNL(SPNLX)=$P(SPNLHST,U,SPNLX)
22 .S $P(SPNLHST,U,1)=$P(SPNLHST,U,1)+1,SPNLHIEN=$P(SPNLHST,U,1)
23 .K DD,DIC,DINUM,DO S DIC(0)="LMN",DIC="^SPNL(154.94,",X=SPNLTMP,DINUM=SPNLTMP,DLAYGO=154.94 D FILE^DICN K DIC,Y,X
24 .S SPNLDR="" F SPNLX=1:1:9 S SPNLDR=SPNLDR_SPNL(SPNLX)_"^"
25 .S SPNLDR=$E(SPNLDR,1,$L(SPNLDR)-1) S ^SPNL(154.94,SPNLTMP,0)=SPNLDR
26 .K DD,DIC,DINUM,DO S DIC(0)="LMN",DIC="^SPNL(154.93,",X=SPNLHIEN,DINUM=SPNLHIEN,DLAYGO=154.93 D FILE^DICN K DIC
27 .S $P(SPNLHST,U,2)=SPNLT,$P(SPNLHST,U,3)="" S ^SPNL(154.93,SPNLHIEN,0)=SPNLHST
28 .S DA=SPNLTMP,DIK="^SPNL(154.93," D ^DIK K DIK,DA
29 D FINISHUP^SPNLGE(SPNLNODE)
30 ; fall thru
31RESCHED ;
32 Q S SPNLRRUN=$E($P(SPNLSTRT,".",2),1,4)
33 S SPNLTIME=$S($E(SPNLFREQ,$L(SPNLFREQ))="W":SPNLFREQ*7,$E(SPNLFREQ,$L(SPNLFREQ))="D":SPNLFREQ,1:1)
34 S SPNLYRS=$E(SPNLSDT,1,3),SPNLMOS=+$E(SPNLSDT,4,5),SPNLDYS=$E(SPNLSDT,6,7),SPNLDYS=SPNLTIME+SPNLDYS
35 I SPNLDYS>30 D
36 .F S SPNLDYS=SPNLDYS-30,SPNLMOS=SPNLMOS+1 Q:SPNLDYS'>30
37 .I SPNLMOS#12=2&(SPNLDYS>28) S SPNLDYS=28
38 I SPNLMOS>12 D
39 .F S SPNLMOS=SPNLMOS-12,SPNLYRS=SPNLYRS+1 Q:SPNLMOS'>12
40 S:SPNLMOS<10 SPNLMOS="0"_SPNLMOS S:SPNLDYS<10 SPNLDYS="0"_SPNLDYS
41 S ZTDTH=SPNLYRS_SPNLMOS_SPNLDYS_"."_SPNLRRUN,ZTIO=""
42 S ZTRTN="SPNLS",ZTDESC="SCD SPINAL CORD REGISTRY EXTRACT"
43 D ^%ZTLOAD
44 I '$D(ZTSK) S SPNLERR="6 COULD NOT (RE)TASK SCD EXTRACT" D ERRMSG^SPNLS
45 K SPNLDYS
46 Q
Note: See TracBrowser for help on using the repository browser.