source: FOIAVistA/trunk/r/CLINICAL_PROCEDURES-MD/MDRPCOP1.m@ 1722

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1MDRPCOP1 ; HOIFO/DP - Object RPCs (TMDPatient) - Cont. ; 01-09-2003 15:21
2 ;;1.0;CLINICAL PROCEDURES;**6**;Apr 01, 2004;Build 102
3 ; Integration Agreements:
4 ; IA# 3027 [Supported] Calls to DGSEC4
5 ; IA# 3266 [Subscription] Call to DPTLK1
6 ; IA# 10035 [Supported] DPT references
7 ; IA# 3267 [Subscription] Call to DPTLK1
8 ; IA# 3593 [Supported] Access to routine DPTLK6 utilities for lookup
9 ;
10ADD(X) ; [Procedure] Add line to @RESULTS@(...
11 S @RESULTS@(+$O(@RESULTS@(""),-1)+1)=X
12 Q
13 ;
14SELECT ; [Procedure] Select patient
15 I '$D(^DPT(+$G(DFN),0))#2 S @RESULTS@(0)="-1^No such patient" Q
16 S @RESULTS@(0)="1^Required Identifiers & messages"
17 S IENS=DFN_","
18 D FILE^DID(2,,"REQUIRED IDENTIFIERS","MDIDS")
19 F MDX=0:0 S MDX=$O(MDIDS("REQUIRED IDENTIFIERS",MDX)) Q:'MDX D
20 .S MDFLD=MDIDS("REQUIRED IDENTIFIERS",MDX,"FIELD")
21 .S MDID="$$PTID^"_$$GET1^DID(2,MDFLD,"","LABEL")
22 .S MDID=MDID_U_$$GET1^DIQ(2,IENS,MDFLD)
23 .D:MDFLD=.03
24 ..S MDID=MDID_" ("_$$GET1^DIQ(2,IENS,.033)_")"
25 ..S MDID=MDID_U_$$DOB^DPTLK1(+IENS)
26 .D:MDFLD=.09
27 ..S X=$P(MDID,U,3),X=$E(X,1,3)_"-"_$E(X,4,5)_"-"_$E(X,6,10)
28 ..S $P(MDID,U,3)=X,$P(MDID,U,4)=$$SSN^DPTLK1(+IENS)
29 .S @RESULTS@($O(@RESULTS@(""),-1)+1)=MDID
30 S MDID="$$PTID^"_$$GET1^DID(2,.1,"","LABEL")
31 S MDID=MDID_U_$$GET1^DIQ(2,IENS,.1)
32 S @RESULTS@($O(@RESULTS@(""),-1)+1)=MDID
33 S MDID="$$PTID^"_$$GET1^DID(2,.101,"","LABEL")
34 S MDID=MDID_U_$$GET1^DIQ(2,IENS,.101)
35 S @RESULTS@($O(@RESULTS@(""),-1)+1)=MDID
36 K MDRET
37 D GUIBS5A^DPTLK6(.MDRET,DFN) D:MDRET(1)=1
38 .D ADD("$$MSGHDR^2^SAME LAST NAME AND LAST 4")
39 .S MDX=1
40 .F S MDX=$O(MDRET(MDX)) Q:'MDX!(+$G(MDRET(MDX))) D
41 ..D ADD($P(MDRET(MDX),U,2))
42 .D ADD(" ")
43 .S MDX=1
44 .F S MDX=$O(MDRET(MDX)) Q:'MDX D:+MDRET(MDX)
45 ..S MDDFN=+$P(MDRET(MDX),U,2)
46 ..D ADD($$GET1^DIQ(2,MDDFN_",",.01)_" "_$$DOB^DPTLK1(MDDFN)_" "_$$SSN^DPTLK1(MDDFN))
47 .D ADD(" ")
48 .D ADD("Please review carefully before continuing")
49 .D ADD("$$MSGEND")
50 K MDRET
51 D PTSEC^DGSEC4(.MDRET,DFN) D:MDRET(1)'=0
52 .D:MDRET(1)=3
53 ..D ADD("$$MSGHDR^0^CAN'T ACCESS YOUR OWN RECORD!!")
54 .D:MDRET(1)=-1
55 ..D ADD("$$MSGHDR^0^INCOMPLETE INFORMATION - CAN'T PROCEED")
56 .D:MDRET(1)=1
57 ..D ADD("$$MSGHDR^1^SENSITIVE RECORD ACCESS")
58 .D:MDRET(1)'=-1&(MDRET(1)'=3)&(MDRET(1)'=1)
59 ..D ADD("$$MSGHDR^3^SENSITIVE RECORD ACCESS")
60 .S MDX=1
61 .F S MDX=$O(MDRET(MDX)) Q:'MDX D ADD($TR(MDRET(MDX),"*"," "))
62 .D ADD("$$MSGEND")
63 D GUIMTD^DPTLK6(.MDRET,DFN) D:MDRET(1)=1
64 .D ADD("$$MSGHDR^1^NOTICE")
65 .F MDX=1:0 S MDX=$O(MDRET(MDX)) Q:'MDX D ADD(MDRET(MDX))
66 .D ADD("$$MSGEND")
67 Q
68 ;
69X2FM(X) ; [Function] return FM date given relative date
70 N %DT S %DT="TS" D ^%DT
71 Q Y
72 ;
Note: See TracBrowser for help on using the repository browser.