source: WorldVistAEHR/trunk/r/ASISTS-OOPS/OOPSGUID.m@ 1800

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

initial load of WorldVistAEHR

File size: 5.9 KB
RevLine 
[613]1OOPSGUID ;WIOFO/LLH-RPC routine for GET/SET CA7 ;04/29/04
2 ;;2.0;ASISTS;**8**;Jun 03, 2002
3 ;
4SAVECA7 ; saves CA7 data to database
5 S (RESULTS,RESULTS(1),RESULTS(2))=""
6 I $G(IEN)="NEW" D NEWCA7 I $P(RESULTS(2),U,2)'="CA7 Created" Q
7 ;
8 S RESULTS(1)=IEN_U_"UPDATE FAILED"
9 K DR S DIE="^OOPS(2264,",DA=IEN,DR=""
10 S DR(1,2264,1)="1///^S X=ARR(6)"
11 S DR(1,2264,2)="2////^S X=ARR(7)"
12 S DR(1,2264,3)="3///^S X=ARR(8)"
13 S DR(1,2264,4)="4///^S X=ARR(9)"
14 S DR(1,2264,5)="5////^S X=ARR(10)"
15 S DR(1,2264,6)="6///^S X=ARR(11)"
16 S DR(1,2264,7)="7///^S X=ARR(12)"
17 S DR(1,2264,8)="8///^S X=ARR(13)"
18 S DR(1,2264,11)="9///^S X=ARR(14)"
19 S DR(1,2264,12)="10///^S X=ARR(15)"
20 S DR(1,2264,13)="11///^S X=ARR(16)"
21 S DR(1,2264,14)="12///^S X=ARR(17)"
22 S DR(1,2264,15)="13///^S X=ARR(18)"
23 S DR(1,2264,16)="14///^S X=ARR(19)"
24 S DR(1,2264,17)="15///^S X=ARR(20)"
25 S DR(1,2264,18)="16///^S X=ARR(21)"
26 S DR(1,2264,19)="17///^S X=ARR(22)"
27 S DR(1,2264,20)="18///^S X=ARR(23)"
28 S DR(1,2264,21)="19///^S X=ARR(24)"
29 S DR(1,2264,22)="20///^S X=ARR(25)"
30 S DR(1,2264,24)="21///^S X=ARR(26)"
31 S DR(1,2264,25)="22///^S X=ARR(27)"
32 S DR(1,2264,26)="23///^S X=ARR(28)"
33 S DR(1,2264,27)="24///^S X=ARR(29)"
34 S DR(1,2264,28)="25///^S X=ARR(30)"
35 S DR(1,2264,29)="27///^S X=ARR(31)"
36 S DR(1,2264,30)="28///^S X=ARR(32)"
37 S DR(1,2264,31)="29///^S X=ARR(33)"
38 S DR(1,2264,32)="30///^S X=ARR(34)"
39 S DR(1,2264,33)="31///^S X=ARR(35)"
40 S DR(1,2264,34)="32///^S X=ARR(36)"
41 S DR(1,2264,35)="33///^S X=ARR(37)"
42 S DR(1,2264,36)="34///^S X=ARR(38)"
43 S DR(1,2264,37)="35///^S X=ARR(39)"
44 S DR(1,2264,38)="36///^S X=ARR(40)"
45 S DR(1,2264,39)="37///^S X=ARR(41)"
46 S DR(1,2264,40)="38///^S X=ARR(42)"
47 S DR(1,2264,41)="39///^S X=ARR(43)"
48 S DR(1,2264,42)="40///^S X=ARR(44)"
49 S DR(1,2264,43)="41///^S X=ARR(45)"
50 S DR(1,2264,44)="41.3///^S X=ARR(46)"
51 S DR(1,2264,45)="41.6///^S X=ARR(47)"
52 S DR(1,2264,46)="42///^S X=ARR(48)"
53 S DR(1,2264,47)="43///^S X=ARR(49)"
54 S DR(1,2264,48)="44///^S X=ARR(50)"
55 S DR(1,2264,49)="45///^S X=ARR(51)"
56 S DR(1,2264,50)="46///^S X=ARR(52)"
57 S DR(1,2264,51)="47///^S X=ARR(53)"
58 S DR(1,2264,52)="48///^S X=ARR(54)"
59 S DR(1,2264,53)="49///^S X=ARR(55)"
60 S DR(1,2264,54)="50///^S X=ARR(56)"
61 S DR(1,2264,55)="51///^S X=ARR(57)"
62 D ^DIE
63 I '($D(Y)=0) Q
64 K DR S DIE="^OOPS(2264,",DA=IEN,DR=""
65 S DR(1,2264,56)="52///^S X=ARR(58)"
66 S DR(1,2264,57)="53///^S X=ARR(59)"
67 S DR(1,2264,58)="54///^S X=ARR(60)"
68 S DR(1,2264,59)="56///^S X=ARR(61)"
69 S DR(1,2264,60)="57///^S X=ARR(62)"
70 S DR(1,2264,61)="58///^S X=ARR(63)"
71 S DR(1,2264,62)="59///^S X=ARR(64)"
72 S DR(1,2264,63)="60///^S X=ARR(65)"
73 S DR(1,2264,64)="62///^S X=ARR(66)"
74 S DR(1,2264,65)="63///^S X=ARR(67)"
75 S DR(1,2264,66)="64///^S X=ARR(68)"
76 S DR(1,2264,67)="65///^S X=ARR(69)"
77 S DR(1,2264,68)="67///^S X=ARR(70)"
78 S DR(1,2264,69)="68///^S X=ARR(71)"
79 S DR(1,2264,70)="69///^S X=ARR(72)"
80 S DR(1,2264,71)="70///^S X=ARR(73)"
81 S DR(1,2264,72)="71///^S X=ARR(74)"
82 S DR(1,2264,73)="72///^S X=ARR(75)"
83 S DR(1,2264,74)="73///^S X=ARR(76)"
84 S DR(1,2264,75)="74///^S X=ARR(77)"
85 S DR(1,2264,76)="75///^S X=ARR(78)"
86 S DR(1,2264,77)="76///^S X=ARR(79)"
87 S DR(1,2264,78)="78///^S X=ARR(80)"
88 S DR(1,2264,79)="79///^S X=ARR(81)"
89 S DR(1,2264,80)="80///^S X=ARR(82)"
90 S DR(1,2264,81)="81///^S X=ARR(83)"
91 S DR(1,2264,82)="82///^S X=ARR(84)"
92 S DR(1,2264,83)="83///^S X=ARR(85)"
93 S DR(1,2264,84)="84///^S X=ARR(86)"
94 S DR(1,2264,85)="85///^S X=ARR(87)"
95 S DR(1,2264,86)="86///^S X=ARR(88)"
96 S DR(1,2264,87)="87///^S X=ARR(89)"
97 S DR(1,2264,88)="88///^S X=ARR(90)"
98 S DR(1,2264,89)="89///^S X=ARR(91)"
99 S DR(1,2264,90)="90///^S X=ARR(92)"
100 S DR(1,2264,91)="91///^S X=ARR(93)"
101 S DR(1,2264,92)="92///^S X=ARR(94)"
102 S DR(1,2264,93)="93///^S X=ARR(95)"
103 S DR(1,2264,94)="94///^S X=ARR(96)"
104 D ^DIE
105 ;Check the return of ^DIE
106 I $D(Y)=0 S RESULTS(1)=IEN_U_ARR(0)_U_"UPDATE COMPLETED"
107 Q
108NEWCA7 ; need to file the CA7 first, then file the remaining data
109 N ACLAIM,CA7,DLAYGO,DR,DIC,I,X
110 S CA7=""
111 I '$G(ARR(3)) S (RESULTS,RESULTS(1))="No ASISTS IEN, cannot file" Q
112 I '$D(^OOPS(2260,ARR(3),0)) D Q
113 . S (RESULTS,RESULTS(1))="ASISTS claim not on file, cannot continue"
114 S ACLAIM=$$GET1^DIQ(2260,ARR(3),.01)
115 I $G(ACLAIM)="" D Q
116 . S (RESULTS,RESULTS(1))="No ASISTS claim number, cannot continue"
117 S ARR(0)=$$CA7NUM()
118 I $G(ARR(0))="" D Q
119 . S (RESULTS,RESULTS(1))="Could not build CA7 Number, cannot continue"
120 S ARR(1)=$$NOW()
121 K DD,DO S DLAYGO=2264,DIC="^OOPS(2264,",DIC(0)="L",X=ARR(0)
122 S DIC("DR")=".3////^S X=ARR(1);.5////^S X=DUZ;.7////^S X=ARR(3);.8////^S X=ARR(4);.9////^S X=ARR(5)"
123 D FILE^DICN I +Y>0 D
124 . S (RESULTS,RESULTS(2))=IEN_U_"CA7 Created"
125 . S IEN=+Y
126 Q
127CA7NUM() ; gets next CA-7 number
128 N CASE,NUM,CA7TEST
129 S CA7TEST=ACLAIM_"-CA7"
130 S CASE="^OOPS(2264,"_"""B"""_","""_CA7TEST_""")"
131 F S CASE=$Q(@CASE) Q:$P(CASE,",",3)'[ACLAIM S CA7=$P(CASE,",",3)
132 S NUM=$P(CA7,"-",4)+1,NUM=$E("000",1,3-$L(NUM))_NUM
133 Q $P(CA7TEST,"-",1,3)_"-"_NUM
134 ;
135NOW() ; returns current date and time
136 N %,%I,%H,X
137 D NOW^%DTC
138 Q %
139DUAL(RESULTS,INPUT,DATA) ; new sub for filing DUAL node fields -
140 ; need to add parameters back
141 ; for the Dual Benefit form answered from the CA1 or CA2
142 ;
143 ; Input: INPUT - IEN^FORM; first piece is the record identifier
144 ; 2nd piece is the form, CA1 or CA2
145 ; DATA - data string, p1=fld 303, p2=304, p3=305, p4=306
146 ; p5=307, p6=308
147 ; data does not include electronic signature fields
148 ; for the node
149 ;
150 N ARR,CN,DA,DIE,DR,LP,IEN
151 S RESULTS="No Changes Filed"
152 S IEN=$P($G(INPUT),U)
153 I '$G(IEN) S RESULTS="No IEN passed in - save failed" Q
154 K DR S DIE="^OOPS(2260,",DA=IEN,DR=""
155 I '$L($TR(DATA,"^","")) S RESULTS="No data to save" Q
156 F LP=1:1:6 S ARR(LP)=$P($G(DATA),U,LP)
157 S DR(1,2260,1)="303///^S X=ARR(1)"
158 S DR(1,2260,2)="304///^S X=ARR(2)"
159 S DR(1,2260,3)="305///^S X=ARR(3)"
160 S DR(1,2260,4)="306///^S X=ARR(4)"
161 S DR(1,2260,5)="307///^S X=ARR(5)"
162 S DR(1,2260,6)="308///^S X=ARR(6)"
163 D ^DIE
164 I $D(Y)=0 S RESULTS="UPDATE COMPLETED"
165 Q
Note: See TracBrowser for help on using the repository browser.