source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOCKI.m@ 1211

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1ONCOCKI ;Hines OIFO/GWB - EDIT CHECKS/INPUT TRANSFORM EDIT CHECKS ;12/15/99
2 ;;2.11;ONCOLOGY;**1,6,16,25,37,42**;Mar 07, 1995
3 ;
411 S Y=$P(^ONCO(165.5,D0,0),U,2),Y=$S($D(^ONCO(160,+Y,1)):$P(^(1),U,2),1:"") Q:(Y=""!(X<Y)!(X=Y))
5 S Y=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_($E(Y,1,3)+1700) W !!,"*****DATE DX is after LAST DATE CONTACT***** ",Y,! K X,Y
6 Q
7ACN ;Accession Number check
8 Q:$D(^ONCO(165.5,"AE",X,$P(^ONCO(165.5,D0,0),U,2))) Q:'$D(^ONCO(165.5,"AE",X)) W *7,?50,"Number is already assigned!!" K X
9 Q
10SGAN ;SET GREATEST ACCESSION NUMBER @ ACCESSION YEAR
11 S YR=$E(X,1,2) I '$D(^ONCO(165.5,"AGAN",YR)) S ^ONCO(165.5,"AGAN",YR)=X G EX
12 S:X>^ONCO(165.5,"AGAN",YR) ^(YR)=X G EX
13KGAN ;RESET GREATEST ACCESSION NUMBER @YEAR
14 S YR=$E(X,1,2) G RE:'$D(^ONCO(165.5,"AGAN",YR)),EX:X<^(YR),GN:X=^(YR)
15RE W !?10,"NEED TO RE-INITIALIAZE FILE" G EX
16GN ;GET NEXT GREATEST ACCESSION NUMBER
17 F AC=X-1:-1:YR_"0001" I $D(^ONCO(165.5,"AE",X)) S ^ONCO(165.5,"AGAN",YR)=AC G EX
18 K ^ONCO(165.5,"AGAN",YR) G EX
19KACD ;CHECK DELETED NUMBER
20 S ^ONCO(165.5,"ACD",YR,$E(X,3,6))="" G EX ;THIS WILL LEAVE LARGE NUMBER IN DELGLED LIST IF NOT CHECKED
21 ;
22SEQ ;SEQUENCE NUMBER (165.5,.06)
23 S XX=$P(^ONCO(165.5,D0,0),U,5)
24 I XX="" K X,XX W *7,?50,"No ACCESSION NUMBER assigned",!! Q
25 ;S XX=$E(XX,1,4)_"-"_$E(XX,5,9)_"/"_X Q:'$D(^ONCO(165.5,"D",XX))
26 ;W *7,?40,XX," is assigned.",! D SDP^ONCOCOM K X,XX Q
27 Q
28 ;
29PSEX ;PATIENT NAME (165.5,.02) INPUT TRANSFORM
30 S XX=$P(^ONCO(165.5,D0,0),U,1),XD0=X
31SEX Q:(XX<43!(XX>52))
32 S SX=$P(^ONCO(160,XD0,0),U,8)
33 I SX=1 Q:((XX>49)&(XX<53)) D K X Q
34 .S SG=$P($G(^ONCO(164.2,XX,0)),U,1)
35 .W !!?10,"SEX = Male. SITE/GP ",SG," is inappropriate."
36 I SX=2 Q:((XX>42)&(XX<49)) D K X Q
37 .S SG=$P($G(^ONCO(164.2,XX,0)),U,1)
38 .W !!?10,"SEX = Female. SITE/GP ",SG," is inappropriate."
39 ;
40EX ;Kill variables and Exit
41 K AC,YR,XX,XD0,SX
42 Q
Note: See TracBrowser for help on using the repository browser.