source: FOIAVistA/tag/r/SCHEDULING-SD-SC/SDOERPC.m@ 1233

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

initial load of FOIAVistA 6/30/08 version

File size: 4.1 KB
Line 
1SDOERPC ;ALB/MJK - ACRP RPCs For An Encounter ;8/12/96
2 ;;5.3;Scheduling;**131,196**;Aug 13, 1993
3 ;06/22/99 ACS - Added CPT modifier logic for the AMB CARE toolkit
4 ;
5 ; ------------------------- cpt rpcs --------------------------
6 ;
7CPT(SDOEY,SDOE) ; -- SDOE ASSIGNED A PROCEDURE [API ID: 65]
8 S SDOEY=$$CPT^SDOECPT(SDOE)
9 Q
10 ;
11GETCPT(SDOEY,SDOE) ; -- SDOE GET PROCEDURES [API ID: 61]
12 D GETCPT^SDOECPT(.SDOE,"SDOEY")
13 ;
14 ; The following logic will remove the 2nd level subscripts
15 ; (containing modifier information) from the CPT array because they
16 ; aren't relevant for this routine
17 N LEVEL1,LEVEL2
18 S (LEVEL1,LEVEL2)=""
19 F S LEVEL1=$O(SDOEY(LEVEL1)) Q:'LEVEL1 D
20 . F S LEVEL2=$O(SDOEY(LEVEL1,LEVEL2)) Q:LEVEL2="" D
21 .. K SDOEY(LEVEL1,LEVEL2)
22 .. Q
23 . Q
24 Q
25 ;
26FINDCPT(SDOEY,SDOE,SDCPTID) ; -- SDOE FIND PROCEDURE [API ID: 71]
27 S SDOEY=$$FINDCPT^SDOECPT(SDOE,SDCPTID)
28 Q
29 ;
30 ; ------------------------- dx rpcs --------------------------
31 ;
32DX(SDOEY,SDOE) ; -- SDOE ASSIGNED A DIAGNOSIS [API ID: 64]
33 S SDOEY=$$DX^SDOEDX(SDOE)
34 Q
35 ;
36GETDX(SDOEY,SDOE) ; -- SDOE GET DIAGNOSES [API ID: 56]
37 D GETDX^SDOEDX(.SDOE,"SDOEY")
38 Q
39 ;
40FINDDX(SDOEY,SDOE,SDDXID) ; -- SDOE FIND DIAGNOSIS [API ID: 70]
41 S SDOEY=$$FINDDX^SDOEDX(SDOE,SDDXID)
42 Q
43 ;
44GETPDX(SDOEY,SDOE) ; -- SDOE GET PRIMARY DIAGNOSIS [API ID: 73]
45 S SDOEY=$$GETPDX^SDOEDX(SDOE)
46 Q
47 ;
48 ; ------------------------- provider rpcs --------------------------
49 ;
50PRV(SDOEY,SDOE) ; -- SDOE ASSIGNED A PROVIDER [API ID: 63]
51 S SDOEY=$$PRV^SDOEPRV(SDOE)
52 Q
53 ;
54GETPRV(SDOEY,SDOE) ; -- SDOE GET PROVIDERS [API ID: 58]
55 D GETPRV^SDOEPRV(.SDOE,"SDOEY")
56 Q
57 ;
58FINDPRV(SDOEY,SDOE,SDPRVID) ; -- SDOE FIND PROVIDER [API ID: 69]
59 S SDOEY=$$FINDPRV^SDOEPRV(SDOE,SDPRVID)
60 Q
61 ;
62 ; --------------------------------oe rpcs--------------------------
63 ;
64GETOE(SDOEY,SDOE) ; -- SDOE GET ZERO NODE [API ID: 98]
65 S SDOEY=$$GETOE^SDOEOE(SDOE)
66 Q
67 ;
68GETGEN(SDOEY,SDOE) ; -- SDOE GET GENERAL DATA [API ID: 76]
69 N SDAT,SDATAOE
70 S SDAT="SDATAOE"
71 D GETGEN^SDOEOE(.SDOE,.SDAT)
72 D BUILD(.SDATAOE,.SDOEY)
73 Q
74 ;
75PARSE(SDOEY,SDATA,SDFMT) ; -- SDOE PARSE GENERAL DATA [API ID: 78]
76 N SDY
77 S SDY="SDATAOE"
78 D PARSE^SDOEOE(.SDATA,.SDFMT,.SDY)
79 D BUILD(.SDATAOE,.SDOEY)
80 Q
81 ;
82EXAE(SDOEY,DFN,SDBEG,SDEND,SDFLAGS) ; -- SDOE FIND FIRST STANDALONE [API ID: 72]
83 S SDOEY=$$EXAE^SDOEOE(.DFN,.SDBEG,.SDEND,$G(SDFLAGS))
84 Q
85 ;
86GETLAST(SDOEY,DFN,SDBEG,SDFLAGS) ; -- SDOE FIND LAST STANDALONE [API ID: 75]
87 S SDOEY=$$GETLAST^SDOEOE(.DFN,.SDBEG,$G(SDFLAGS))
88 Q
89 ;
90EXOE(SDOEY,DFN,SDBEG,SDEND,SDFLAGS) ; -- SDOE FIND FIRST ENCOUNTER [API ID: 74]
91 S SDOEY=$$EXOE^SDOEOE(.DFN,.SDBEG,.SDEND,$G(SDFLAGS))
92 Q
93 ;
94 ;
95LIST(SDOEY,SDBEG,SDEND) ; -- RPC: SDOE LIST ENCOUNTERS FOR DATES
96 N SDQID
97 D OPEN(.SDOEY,.SDQID)
98 IF '$$ERRCHK^SDQUT() D INDEX^SDQ(.SDQID,"DATE/TIME","SET")
99 IF '$$ERRCHK^SDQUT() D DATE^SDQ(.SDQID,SDBEG,SDEND,"SET")
100 D CLOSE(.SDQID)
101LISTQ Q
102 ;
103LISTPAT(SDOEY,SDFN,SDBEG,SDEND) ; -- RPC: SDOE LIST ENCOUNTERS FOR PAT
104 N SDQID
105 D OPEN(.SDOEY,.SDQID)
106 IF '$$ERRCHK^SDQUT() D INDEX^SDQ(.SDQID,"PATIENT/DATE","SET")
107 IF '$$ERRCHK^SDQUT() D PAT^SDQ(.SDQID,SDFN,"SET")
108 IF '$$ERRCHK^SDQUT() D DATE^SDQ(.SDQID,SDBEG,SDEND,"SET")
109 D CLOSE(.SDQID)
110LISTPATQ Q
111 ;
112LISTVST(SDOEY,SDVST) ; -- RPC: SDOE LIST ENCOUNTERS FOR VISIT
113 N SDQID
114 D OPEN(.SDOEY,.SDQID)
115 IF '$$ERRCHK^SDQUT() D INDEX^SDQ(.SDQID,"VISIT","SET")
116 IF '$$ERRCHK^SDQUT() D VISIT^SDQ(.SDQID,SDVST,"SET")
117 D CLOSE(.SDQID)
118LISTVSTQ Q
119 ;
120OPEN(SDOEY,SDQID) ; -- initialize query
121 S SDOEY=$NA(^TMP("SD ENCOUNTER LIST",$J))
122 K ^TMP("SD ENCOUNTER LIST",$J)
123 D OPEN^SDQ(.SDQID)
124OPENQ Q
125 ;
126CLOSE(SDQID) ; -- finalize query + scan + close
127 IF '$$ERRCHK^SDQUT() D SCANCB^SDQ(.SDQID,"D CB^SDOERPC(Y,Y0,.SDSTOP)","SET")
128 IF '$$ERRCHK^SDQUT() D ACTIVE^SDQ(.SDQID,"TRUE","SET")
129 IF '$$ERRCHK^SDQUT() D SCAN^SDQ(.SDQID)
130 D CLOSE^SDQ(.SDQID)
131CLOSEQ Q
132 ;
133CB(SDOE,SDOE0,SDSTOP) ; -- callback for LIST* tags
134 S ^TMP("SD ENCOUNTER LIST",$J,SDOE)=SDOE_";;"_SDOE0
135 Q
136 ;
137BUILD(IN,OUT) ; -- build array for rpc lists
138 N IEN
139 S IEN=""
140 F S IEN=$O(IN(IEN)) Q:IEN="" S OUT(IEN)=IEN_";;"_IN(IEN)
141 Q
142 ;
Note: See TracBrowser for help on using the repository browser.