source: ePrescribing/trunk/p/C0PPAT.m@ 1680

Last change on this file since 1680 was 1595, checked in by George Lilly, 12 years ago

initial release of ePrescribing

File size: 3.8 KB
Line 
1C0PPAT ; ERX/GPL - ERX PATIENT utilities; 8/26/09 ; 12/10/09 6:46pm
2 ;;1.0;C0P;;Apr 25, 2012;Build 103
3 ;Copyright 2009 George Lilly. Licensed under the terms of the GNU
4 ;General Public License See attached copy of the License.
5 ;
6 ;This program is free software; you can redistribute it and/or modify
7 ;it under the terms of the GNU General Public License as published by
8 ;the Free Software Foundation; either version 2 of the License, or
9 ;(at your option) any later version.
10 ;
11 ;This program is distributed in the hope that it will be useful,
12 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;GNU General Public License for more details.
15 ;
16 ;You should have received a copy of the GNU General Public License along
17 ;with this program; if not, write to the Free Software Foundation, Inc.,
18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ;
20 Q
21 ;
22 ; THIS ROUTINE IS CALLED AS PART OF ERX WEB SERVICES PROCESSING
23 ; TO POPULATE INFORMATION ABOUT THE PATIENT TO BE MAPPED INTO XML
24 ; AND SENT TO THE EPRESCRIBING PROVIDER TO DEFINE THE PATIENT ON THEIR
25 ; SYSTEM. ALL WEB SERVICE CALLS REGARDING A PATIENT WILL USE THIS ROUTINE
26 ; AND SEND A COMPLETE REPRESENTATION OF THE PATIENT.
27 ; GPL JUN 2010
28 ;
29EN(RTNVAR,C0PDFN) ; INITIALIZE PATIENT VARIABLE ARRAY FOR PATIENT C0PDFN
30 ; RTNVAR IS PASSED BY NAME. VARIABLES ARE PREFIXED WITH "PATIENT-"
31 ; HERE IS A LIST OF THE VARIABLES THAT ARE POPULATED FOR THE PATIENT:
32 ;GPL("PATIENT-ACTORADDRESSCITY")="ALTON"
33 ;GPL("PATIENT-ACTORADDRESSLINE1")="1234 Somewhere Lane"
34 ;GPL("PATIENT-ACTORADDRESSLINE2")=""
35 ;GPL("PATIENT-ACTORADDRESSSOURCEID")="WS_PATIENT2"
36 ;GPL("PATIENT-ACTORADDRESSSTATE")="KANSAS"
37 ;GPL("PATIENT-ACTORADDRESSTYPE")="Home"
38 ;GPL("PATIENT-ACTORADDRESSZIPCODE")=67623
39 ;GPL("PATIENT-ACTORCELLTEL")=""
40 ;GPL("PATIENT-ACTORCELLTELTEXT")=""
41 ;GPL("PATIENT-ACTORDATEOFBIRTH")="1957-12-25"
42 ;GPL("PATIENT-ACTOREMAIL")=""
43 ;GPL("PATIENT-ACTORFAMILYNAME")="ZZ PATIENT"
44 ;GPL("PATIENT-ACTORGENDER")="MALE"
45 ;GPL("PATIENT-ACTORGIVENNAME")="TEST"
46 ;GPL("PATIENT-ACTORIEN")=2
47 ;GPL("PATIENT-ACTORMIDDLENAME")="TWO"
48 ;GPL("PATIENT-ACTOROBJECTID")="WS_PATIENT2"
49 ;GPL("PATIENT-ACTORRESTEL")="888-555-1212"
50 ;GPL("PATIENT-ACTORRESTELTEXT")="Residential Telephone"
51 ;GPL("PATIENT-ACTORSOURCEID")="ACTORSYSTEM_1"
52 ;GPL("PATIENT-ACTORSSN")="769122557P"
53 ;GPL("PATIENT-ACTORSSNSOURCEID")="WS_PATIENT2"
54 ;GPL("PATIENT-ACTORSSNTEXT")="SSN"
55 ;GPL("PATIENT-ACTORSUFFIXNAME")=""
56 ;GPL("PATIENT-ACTORWORKTEL")="888-121-1212"
57 ;GPL("PATIENT-ACTORWORKTELTEXT")="Work Telephone"
58 ;GPL("PATIENTID")="PATIENT2"
59 N C0PTMP
60 D PEXTRACT^C0CACTOR("C0PTMP",C0PDFN,"WS_PATIENT_"_C0PDFN)
61 ; todo: for state, use extended syntax
62 N ZG
63 S C0PTMP("PATIENTID")="PATIENT"_C0PDFN ; PATIENT ID BASED ON DFN
64 S C0PTMP("IDTYPE")="" ; DON'T KNOW WHAT SHOULD GO HERE
65 S C0PTMP("STARTHISTORY")="2004-01-01T00:00:00" ; DEFAULT... CHANGE THIS
66 S C0PTMP("ENDHISTORY")="2010-01-01T00:00:00" ; DEFAULT... CHANGE THIS
67 S C0PTMP("PRESCRIPTIONSTATUS")="C" ; DEFAULT... CHANGE THIS
68 S C0PTMP("PRESCRIPTIONSUBSTATUS")="S" ; DEFAULT... CHANGE THIS
69 S C0PTMP("ARCHIVESTATUS")="N" ; DEFAULT... CHANGE THIS
70 S ZG=$$GET1^DIQ(2,C0PDFN,.115,"I") ;NEED ABBREVIATION
71 S C0PTMP("ACTORADDRESSSTATE")=$$GET1^DIQ(5,ZG_",",1) ;STATE ABBREVIATION
72 I C0PTMP("ACTORGENDER")="MALE" S C0PTMP("ACTORGENDER")="M"
73 I C0PTMP("ACTORGENDER")="FEMALE" S C0PTMP("ACTORGENDER")="F"
74 S C0PTMP("ACTORDATEOFBIRTH")=$TR(C0PTMP("ACTORDATEOFBIRTH"),"-") ;REMOVE DASHES FROM DOB
75 S C0PTMP("ACTORSSN")=$TR(C0PTMP("ACTORSSN"),"P","") ;REMOVE P FROM TEST SSN
76 N ZI
77 S ZI=""
78 F S ZI=$O(C0PTMP(ZI)) Q:ZI="" D ; FOR EACH VARIABLE RETURNED
79 . S @RTNVAR@("PATIENT-"_ZI)=C0PTMP(ZI) ; RETURN PREFIXED VARIABLE
80 S @RTNVAR@("PATIENT-ACTORADDRESSCOUNTRY")="US" ;FIX THIS FOR INTERNATIONAL
81 S @RTNVAR@("PATIENT-ACTORMEMO")="" ; DON'T KNOW WHAT TO PUT HERE GPL
82 Q
83 ;
Note: See TracBrowser for help on using the repository browser.