source: ccr/trunk/p/CCRSYS.m@ 358

Last change on this file since 358 was 148, checked in by George Lilly, 16 years ago

enhancements to check for test patients

File size: 2.4 KB
Line 
1CCRSYS ;CCDCCR/SMH - Routine to Get EHR System Information;6JUL2008
2 ;;0.1;CCDCCR;;;
3 ;Copyright 2008 WorldVistA. 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 W "Enter at appropriate points." Q
21 ;
22 ; Originally, I was going to use VEPERVER, but VEPERVER
23 ; actually kills ^TMP($J), outputs it to the screen in a user-friendly
24 ; manner (press any key to continue),
25 ; and is really a very half finished routine
26 ;
27 ; So for now, I am hard-coding the values.
28 ;
29SYSNAME() ;Get EHR System Name; PUBLIC; Extrinsic
30 Q "WorldVistA EHR/VOE"
31 ;
32SYSVER() ;Get EHR System Version; PUBLIC; Extrinsic
33 Q "1.0"
34 ;
35PTST(DFN) ;TEST TO SEE IF PATIENT MERGED OR A TEST PATIENT
36 ; DFN = IEN of the Patient to be tested
37 ; 1 = Merged or Test Patient
38 ; 0 = Non-test Patient
39 ;
40 I DFN="" Q 0 ; BAD DFN PASSED
41 I $D(^DPT(DFN,-9)) Q 1 ;This patient has been merged
42 I $G(^DPT(DFN,0))="" Q 1 ;Missing zeroth node <---add
43 ;
44 I '$D(CCRTEST) S CCRTEST=1 ; DEFAULT IS THAT WE ARE TESTING
45 I CCRTEST Q 0 ; IF WE ARE TESTING, DON'T REJECT TEST PATIENTS
46 N DIERR,DATA
47 I $$TESTPAT^VADPT(DFN) Q 1 ; QUIT IF IT'S A VA TEST PATIENT
48 S DATA=+$$GET1^DIQ(2,DFN_",",.6,"I") ;Test Patient Indicator
49 ; 1 = Test Patient
50 ; 0 = Non-test Patient
51 I DATA Q DATA
52 S DATA=$$GET1^DIQ(2,DFN_",",.09,"I") ;SSN test
53 D CLEAN^DILF
54 I "Pp"[$E(DATA,$L(DATA),$L(DATA)) Q 0 ;Allow Pseudo SSN
55 I $E(DATA,1,3)="000" Q 1
56 I $E(DATA,1,3)="666" Q 1
57 Q 0
58 ;
Note: See TracBrowser for help on using the repository browser.