source: FOIAVistA/trunk/r/ONCOLOGY-ONC/ONCGENED.m@ 1654

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1ONCGENED ;Hines OIFO/GWB - EDITS API ; 3/7/07 4:21pm
2 ;;2.11;ONCOLOGY;**47**;Mar 07,1995;Build 19
3 ;
4NAACCR D CLEAR^ONCSAPIE(1)
5 K ^TMP("ONC",$J)
6 K ^TMP("ONC1",$J)
7 K ONCEDLST
8 N BLANK,NINE,ZERO,ZNINE,X
9 S BLANK=" "
10 S ZERO=0
11 S NINE=9
12 S ZNINE="09"
13 S EXTRACT=$O(^ONCO(160.16,"B","VACCR EXTRACT V11.1",0))
14 S EXT="VACCR"
15 S DEVICE=0,OIEN=0,PAGE=1,HDRIEN=12,OUT=0
16 S OSP=$O(^ONCO(160.1,"C",DUZ(2),0))
17 I OSP="" S OSP=$O(^ONCO(160.1,0))
18 S IINPNT=$P($G(^ONCO(160.1,OSP,1)),U,4)
19 S DXH=$$GET1^DIQ(160.19,IINPNT,.01,"I")
20 S STAT1=DXH
21 S PAGE=1
22 S IEN=D0
23 S ONCDST=$NA(^TMP("ONC",$J))
24 S MSGLST=$NA(^TMP("ONC1",$J))
25 ;
26 ;S RC=$$RBQPREP^ONCSED01(.ONCSAPI,.ONCDST,"DEBUG")
27 S RC=$$RBQPREP^ONCSED01(.ONCSAPI,.ONCDST)
28 ;S ERRFLG=RC
29 I RC<0 D PRTERRS^ONCSAPIE() Q
30 ;
31 N D0
32 D OUTPUT(IEN,EXTRACT,.OUT)
33 I $G(EDITS)="NO" D END^ONCSNACR(.ONCDST) Q
34 ;
35EDITS S RC=$$RBQEXEC^ONCSED01(.ONCSAPI,.ONCDST,MSGLST)
36 S ERRFLG=RC
37 I RC<0 D PRTERRS^ONCSAPIE()
38 I RC>0 D Q:RC<0
39 . N %ZIS,IOP,POP
40 . S %ZIS("B")="HOME"
41 . D ^%ZIS Q:$G(POP) U IO
42 . S RC=$$REPORT^ONCSED01(.ONCSAPI,MSGLST,"MT")
43 . D ^%ZISC
44 Q
45 ;
46OUTPUT(IEN,EXTRACT,OUT) ;
47 N POS
48 S ACD160=$P(^ONCO(165.5,IEN,0),U,2)
49 S POS=0
50 F S POS=$O(^ONCO(160.16,EXTRACT,"FIELD","B",POS)) Q:POS<1 D Q:OUT
51 .N NODE
52 .S NODE=0
53 .F S NODE=$O(^ONCO(160.16,EXTRACT,"FIELD","B",POS,NODE)) Q:NODE<1 D Q:OUT
54 ..N STRING,DEFAULT,FILL,LEN
55 ..Q:$G(^ONCO(160.16,EXTRACT,"FIELD",NODE,0))=""
56 ..S STRING=$TR(^ONCO(160.16,EXTRACT,"FIELD",NODE,1),"~","^")
57 ..S DEFAULT=^ONCO(160.16,EXTRACT,"FIELD",NODE,2)
58 ..S FILL=$P(^ONCO(160.16,EXTRACT,"FIELD",NODE,3),U,1)
59 ..S LEN=$P(^ONCO(160.16,EXTRACT,"FIELD",NODE,0),U,2)
60 ..D DATA(IEN,ACD160,STRING,DEFAULT,FILL,LEN,NODE,POS)
61 Q
62 ;
63DATA(IEN,ACD160,STRING,DEFAULT,FILL,LEN,NODE,POS) ;Data print
64 N ACDANS
65 X STRING
66 I ACDANS="" D Q
67 .N X,I
68 .S X=""
69 .I DEFAULT=8 D Q
70 ..F I=1:1:LEN D WRITE^ONCSNACR(.ONCDST,DEFAULT)
71 .I @DEFAULT="09" D WRITE^ONCSNACR(.ONCDST,@DEFAULT) Q
72 .F I=1:1:LEN D WRITE^ONCSNACR(.ONCDST,@DEFAULT)
73 I $L(ACDANS)=LEN D WRITE^ONCSNACR(.ONCDST,ACDANS) Q
74 I $L(ACDANS)>LEN D WRITE^ONCSNACR(.ONCDST,$E(ACDANS,1,LEN)) Q
75 E D Q
76 .N JUST,STUFF,I,REM,CAL
77 .S JUST=$P(FILL,","),STUFF=$P(FILL,",",2)
78 .S REM=LEN-$L(ACDANS)
79 .I JUST="R" D WRITE^ONCSNACR(.ONCDST,ACDANS)
80 .F I=1:1:REM D WRITE^ONCSNACR(.ONCDST,@STUFF)
81 .I JUST="L" D WRITE^ONCSNACR(.ONCDST,ACDANS)
82 Q
83 ;
84CHKSUM ;Compute checksum
85 Q:'$D(ONCDST)
86 Q:$P($G(^ONCO(165.5,D0,7)),U,2)'=3
87 W !," Computing checksum value for this abstract..."
88 S CHECKSUM=$$CRC32^ONCSNACR(.ONCDST)
89 S $P(^ONCO(165.5,D0,"EDITS"),U,1)=CHECKSUM
90 Q
91 ;
92CHANGE ;Check for change to ONCOLOGY PRIMARY (165.5) record
93 S EDITS="NO" D NAACCR K EDITS
94 S CHECKSUM=$$CRC32^ONCSNACR(.ONCDST)
95 Q:$P($G(^ONCO(165.5,ONCOD0P,"EDITS")),U,1)=""
96 I CHECKSUM'=$P($G(^ONCO(165.5,ONCOD0P,"EDITS")),U,1) D
97 .W !
98 .W !," You have made a change to a 'Completed' abstract."
99 .W !," This abstract needs to be re-run through the EDITS API."
100 .W !!," Calling EDITS API..."
101 .D ^ONCGENED
102 .I ERRFLG'=0 D Q
103 ..W !!," EDITS errors were encountered."
104 ..W !!," The ABSTRACT STATUS has been changed to 0 (Incomplete)."
105 ..S DIE="^ONCO(165.5,"
106 ..S DA=ONCOD0P
107 ..S DR="91///0;197///@;198///^S X=DT;199///^S X=DUZ"
108 ..D ^DIE
109 ..W !
110 ..K DIR S DIR(0)="YA"
111 ..S DIR("A")=" Do you wish to return to the Primary Menu Options? "
112 ..S DIR("B")="Yes" D ^DIR K DIR
113 ..I Y=1 S Y="@0"
114 .W !!," No EDITS errors or warnings. ABSTRACT STATUS = 3 (Complete)."
115 .S DIE="^ONCO(165.5,"
116 .S DA=ONCOD0P
117 .S DR="197///^S X=CHECKSUM;198///^S X=DT;199///^S X=DUZ"
118 .D ^DIE
119 .S EDITS="NO" D NAACCR K EDITS
120 .S CHECKSUM=$$CRC32^ONCSNACR(.ONCDST)
121 .S $P(^ONCO(165.5,D0,"EDITS"),U,1)=CHECKSUM
122 .W !
123 .K DIR S DIR(0)="E" D ^DIR
124 Q
Note: See TracBrowser for help on using the repository browser.