source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDUTL3.m@ 836

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1SDUTL3 ;ALB/REW - Primary Care API Calls ; 29 Jun 99 04:11PM
2 ;;5.3;Scheduling;**30,39,41,148,177**;Aug 13, 1993
3 ;
4OUTPTPR(DFN,SCDATE,SCPCROLE) ;given patient, return internal^external of the pc practitioner
5 ; Input: DFN - ien of patient file (#2)
6 ; SCDATE - Relevant Date (Default=DT)
7 ; SCPCROLE - Type of PC Role (Default =1 (PC Practitioner),2=Attending
8 ; Returned: pointer to file #200^external value of name
9 ; or, if error or none defined, returns a 0 or null
10 ; Note: This call will continue to be supported with the PCMM release
11 ;
12 ; *** SUPPORTED API ***
13 ;
14 Q:'$G(DFN) 0
15 S SCDATE=$G(SCDATE,DT)
16 S SCPCROLE=$G(SCPCROLE) I $L(SCPCROLE)'=1!(12'[SCPCROLE) S SCPCROLE=1
17 Q $$NMPCPR^SCAPMCU2(.DFN,.SCDATE,.SCPCROLE)
18 ;
19OUTPTAP(DFN,SCDATE) ;given patient, return internal^external of the pc associate provider
20 ; Input: DFN - ien of patient file (#2)
21 ; SCDATE - Relevant Date (Default=DT)
22 ; Returned: pointer to file #200^external value of name
23 ; or, if error or none defined, returns a 0 or null
24 ;
25 ; *** SUPPORTED API ***
26 ;
27 Q:'$G(DFN) 0
28 S SCDATE=$G(SCDATE,DT)
29 Q $$NMPCPR^SCAPMCU2(.DFN,.SCDATE,3)
30 ;
31OUTPTTM(DFN,SCDATE,ASSTYPE) ;given patient, return internal^external of the pc team
32 ;Input: DFN - ien of patient file (#2)
33 ; SCDATE - Date of interest (Default=dt)
34 ; ASSTYPE - Assignment Type (Default=1: PC Team)
35 ;
36 ; Returned: pointer to team file (#404.51)
37 ; or, if error or none defined, returns 0 or null
38 ; Note: This call will continue to be supported with the PCMM release
39 ; additional, optional parameters may be added (e.g. effective dt)
40 ;
41 Q:'$G(DFN) 0
42 S SCDATE=$G(SCDATE,DT)
43 S ASSTYPE=$G(ASSTYPE,1)
44 Q $$NMPCTM^SCAPMCU2(.DFN,.SCDATE,.ASSTYPE)
45 ;
46INPTPR(DFN,PRACT) ;store current PC practitioner; return SDOKS=1, if OK
47 ; Input: DFN: ien of patient file (#2)
48 ; PRACT: ien of file #200 if adding,changing field
49 ; null or '@' if deleting field
50 ; Output:SDOKS: 0, if fails to store, 1 otherwise
51 ;
52 ; Note: This data is stored in field #404.01 of the patient file.
53 ; With the release of PCMM, this is no longer a valid method
54 ; to enter provider information for PCMM.
55 ;
56 ; **** PLANNED FOR REMOVAL IN THE FUTURE ****
57 ;
58 ; Selected NEW PERSON entry must be active and must hold provider key
59 I '$G(DFN)!('$D(PRACT)#2)!('$D(^DPT(+DFN,0))) S SDOKS=0 Q
60 D EN^DDIOL("Note: This is NOT automatically added to PCMM Files")
61 D EN^DDIOL("This data should now be entered via PCMM Input Screens")
62 S SDOKS=1
63 N DIE,DIC,DR,DA,X
64 I PRACT=""!(PRACT="@") D G QTIPR
65 .S DIE="^DPT("
66 .S DR="404.01////^S X=""@"""
67 .S DA=DFN
68 .D ^DIE
69 I '$$SCREEN^DGPMDD(PRACT) S SDOKS=0 Q
70 I $D(^VA(200,+PRACT,0)) D
71 .S DIE="^DPT("
72 .S DR="404.01////^S X=+PRACT"
73 .S DA=DFN
74 .D ^DIE
75 E D
76 .S SDOKS=0
77QTIPR Q
78INPTTM(DFN,TEAM) ;store current PC team; return SDOKS=0, if fails
79 ; Input: DFN: ien of patient file (#2)
80 ; TEAM: ien of file #404.51 if adding,changing field
81 ; null or '@' if deleting field
82 ; Output:SDOKS: 0, if fails to store, 1 otherwise
83 ;
84 ; Note: This data is stored in field #404.02 of the patient file.
85 ; With the release of PCMM, this is no longer a valid method
86 ; to enter team information for PCMM.
87 ;
88 ; **** PLANNED FOR REMOVAL IN THE FUTURE ****
89 ;
90 I '$G(DFN)!('$D(TEAM)#2)!('$D(^DPT(+DFN,0))) S SDOKS=0 Q
91 D EN^DDIOL("This data should now be entered via PCMM Input Screens")
92 N DIE,DIC,DR,DA,X
93 S SDOKS=1
94 I TEAM=""!(TEAM="@") D G QTITM
95 .S DIE="^DPT("
96 .S DR="404.02////^S X=""@"""
97 .S DA=DFN
98 .D ^DIE
99 I $D(^SCTM(404.51,+TEAM,0)) D
100 .S DIE="^DPT("
101 .S DR="404.02////^S X=+TEAM"
102 .S DA=DFN
103 .D ^DIE
104 E D
105 .S SDOKS=0
106QTITM Q
Note: See TracBrowser for help on using the repository browser.