source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDOEPRV.m@ 1141

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

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1SDOEPRV ;ALB/MJK - ACRP Provider APIs For An Encounter ;8/12/96
2 ;;5.3;Scheduling;**131**;Aug 13, 1993
3 ;
4PRV(SDOE,SDERR) ; -- SDOE ASSIGNED A PROVIDER
5 ; API ID: 63
6 ;
7 ;
8 N SDOK
9 S SDOK=0
10 ;
11 ; -- do validation checks
12 IF '$$VALOE^SDOEOE(.SDOE,$G(SDERR)) G PRVQ
13 IF $$OLD^SDOEUT(SDOE) S SDOK=$$OLDPRV(SDOE) G PRVQ
14 ;
15 S SDOK=$$PRV^PXAPIOE($$VIEN^SDOEUT(.SDOE),$G(SDERR))
16PRVQ Q SDOK
17 ;
18 ;
19GETPRV(SDOE,SDPRV,SDERR) ; -- SDOE GET PROVIDERS
20 ; API ID: 58
21 ;
22 ;
23GETPRVG ;; -- goto entry point
24 ; -- do validation checks
25 IF '$$VALOE^SDOEOE(.SDOE,$G(SDERR)) G GETPRVQ
26 IF $$OLD^SDOEUT(SDOE) D OLDPRVS(SDOE,.SDPRV) G GETPRVQ
27 ;
28 D GETPRV^PXAPIOE($$VIEN^SDOEUT(.SDOE),.SDPRV,$G(SDERR))
29GETPRVQ Q
30 ;
31 ;
32FINDPRV(SDOE,SDPRVID,SDERR) ; -- SDOE FIND PROVIDER
33 ; API ID: 69
34 ;
35 ;
36 N SDPRVS,SDOK,I
37 S SDPRVS="SDPRVS"
38 ;
39 ; -- do validation checks
40 IF '$$VALPRV(.SDPRVID,$G(SDERR)) S SDOK=0 G FINDPRVQ
41 ;
42 D GETPRV(.SDOE,.SDPRVS,$G(SDERR))
43 S (I,SDOK)=0
44 F S I=$O(SDPRVS(I)) Q:'I S SDOK=(+SDPRVS(I)=SDPRVID) Q:SDOK
45FINDPRVQ Q SDOK
46 ;
47 ;
48VALPRV(SDPRVID,SDERR) ; -- validate provider input
49 ;
50 ; -- do checks
51 IF SDPRVID,$D(^VA(200,SDPRVID,0)) Q 1
52 ;
53 ; -- build error msg
54 N SDIN,SDOUT
55 S SDIN("ID")=SDPRVID
56 S SDOUT("ID")=SDPRVID
57 D BLD^SDQVAL(4096800.003,.SDIN,.SDOUT,$G(SDERR))
58 Q 0
59 ;
60 ;
61OLDPRV(SDOE) ; -- at least one provider for OLD encounter?
62 Q ($O(^SDD(409.44,"OE",+SDOE,0))>0)
63 ;
64OLDPRVS(SDOE,SDARY) ; -- get provider's for OLD encounter
65 N SDIEN,SDCNT,Y,X
66 S (SDIEN,SDCNT)=0
67 F S SDIEN=$O(^SDD(409.44,"OE",SDOE,SDIEN)) Q:'SDIEN D
68 . S SDCNT=SDCNT+1,X=$G(^SDD(409.44,SDIEN,0))
69 . S $P(Y,U,1)=+X ; -- person ien
70 . S $P(Y,U,6)=$P(X,"^",3) ; -- person class
71 . S @SDARY@(SDIEN)=Y
72 S @SDARY=SDCNT
73 Q
74 ;
Note: See TracBrowser for help on using the repository browser.