source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR29GU.m@ 1042

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

initial load of WorldVistAEHR

File size: 2.3 KB
RevLine 
[613]1RMPR29GU ;HOIFO/SPS-CREATE 2529-3 GUI [ 10/17/05 8:55 AM ]
2 ;;3.0;PROSTHETICS;**75**;Feb 09, 1996;Build 25
3 ;
4A1(RMPRDA,RMPRSITE,RMPR668,RMPRPTR) ;
5 D IN
6 Q
7CR(RESULTS,RMPRDA,RMPRSITE,RMPR668,RMPRPTR) ;CREATE WORK ORDER
8IN D INF^RMPRSIT
9 S SCR=$P(^RMPR(664.1,RMPRDA,0),U,11)
10 K RMPRTMP I $P(^RMPR(664.1,RMPRDA,0),U,15)'=RMPR("STA") S RMPRTMP=1
11 N DIC,Y,DIR S RMPRWO=1 D FQ^RMPRDT Q:'$D(RMPRFY)!('$D(RMPRQTR)) S:'$D(RMPRTMP) RMPRWO=$$STAN^RMPR31U(RMPR("STA"))_"-"_RMPRFY_"-"_RMPRQTR I $D(RMPRTMP) D
12 .S RMPRWO=$$STAN^RMPR31U($P(^RMPR(664.1,RMPRDA,0),U,15))_"T-"_RMPRFY_"-"_RMPRQTR
13 I '$D(^RMPR(669.1,"B",RMPRWO)) K DD,D0 S DIC="^RMPR(669.1,",DLAYGO=669.1,DIC(0)="LZ",X=RMPRWO D FILE^DICN K DLAYGO,D0
14 S RDA=$O(^RMPR(669.1,"B",RMPRWO,0)) Q:'RDA
15 L +^RMPR(669.1,RDA,0):1 I '$T S RESULTS(0)="1^Someone is editing this record!" G EXIT
16 S RN=$P(^RMPR(669.1,RDA,0),U,2)+1 F I=1:1:4-$L(RN) S RN="0"_RN
17 S RMPRWO=RMPRWO_"-"_SCR_"-"_RN
18 S $P(^RMPR(669.1,RDA,0),U,2)=RN L -^RMPR(669.1,RDA,0)
19 S $P(^RMPR(664.1,RMPRDA,0),U,13)=$G(RMPRWO)
20 ;set no admin count/no lab count
21 I $P(^RMPR(664.1,RMPRDA,0),U,15)=RMPR("STA")&($P(^(0),U,4)'=RMPR("STA")) S $P(^(0),U,23)=1
22 I $P(^RMPR(664.1,RMPRDA,0),U,15)'=RMPR("STA") S $P(^(0),U,20)=1 S:$D(RMPR25) $P(^RMPR(664.1,RMPRDA,0),U,23)=1 S DIE="^RMPR(664.1,",DA=RMPRDA,DR="16///^S X=""PC""" D ^DIE
23 I '$P(^RMPR(664.1,RMPRDA,0),U,20) S DIE="^RMPR(664.1,",DA=RMPRDA,DR="16///^S X=""P""" D ^DIE
24 S RMDAT(664.1,RMPRDA_",",13)=DUZ
25 S RMDAT(664.1,RMPRDA_",",17)=DT
26 S RMDAT(664.1,RMPRDA_",",.05)=RMPR668
27 D FILE^DIE("","RMDAT","RMERROR")
28 I $D(RMERROR) S RMERR=1 D ERR
29 D IN5^VADPT S VAINDT=$P($G(VAIP(3)),U) D INP^VADPT
30 I VAIN(1) S DR="12//^S X=$P(VAIN(4),U,2)" D ^DIE
31 S RMSOP=$S($P(^RMPR(664.1,RMPRDA,0),U,11)="O":11,$P(^(0),U,11)="E":11,$P(^(0),U,11)="R":11,$P(^(0),U,11)="W":11,1:"")
32 I +RMSOP>0 D
33 .L +^RMPR(668,RMPR668):2
34 .I $T=0 S RESULTS(0)="1^Someone else is Editing this entry!" G EXIT
35 .S RMDAT(668,RMPR668_",",9)=RMSOP
36 .D FILE^DIE("","RMDAT","RMERROR")
37 .L -^RMPR(668,RMPR668)
38 .I $D(RMERROR) S RMERR=1 G ERR
39 D ^RMPR29GA
40 S RESULTS(0)=0_"^"_"Work Order Created: "_RMPRWO
41 ;ADD PRINT HERE.
42 I RMPRPTR=0 D PRT^RMPR29R
43 I +RMPRPTR D EN1^RMPR29R(RMPRPTR)
44 Q
45ERR ;QUIT ON ERROR
46 S RESULTS(0)="1^The following error has occured "_RMERROR
47 Q
48EXIT ;
49 K DA,DIE,DR,I,RDA,RMDAT,RMERR,RMERROR,RMPR,RMPR25,RMPRFY,RMPRQTR,RMPRWO
50 K RMSOP,RN,SCR,VAIN,VAINDT,VAIP,X
51 Q
Note: See TracBrowser for help on using the repository browser.