VistA-ccr/p/CCRSYS.m

55 lines
2.2 KiB
Mathematica
Raw Normal View History

CCRSYS ;CCDCCR/SMH - Routine to Get EHR System Information;6JUL2008
2008-07-17 15:55:07 -04:00
;;0.1;CCDCCR;;;
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
;General Public License See attached copy of the License.
;
;This program is free software; you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
;the Free Software Foundation; either version 2 of the License, or
;(at your option) any later version.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License along
;with this program; if not, write to the Free Software Foundation, Inc.,
;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
W "Enter at appropriate points." Q
;
2008-07-17 15:55:07 -04:00
; Originally, I was going to use VEPERVER, but VEPERVER
; actually kills ^TMP($J), outputs it to the screen in a user-friendly
; manner (press any key to continue),
; and is really a very half finished routine
;
2008-07-17 15:55:07 -04:00
; So for now, I am hard-coding the values.
;
SYSNAME() ;Get EHR System Name; PUBLIC; Extrinsic
2008-07-17 15:55:07 -04:00
Q "WorldVistA EHR/VOE"
;
SYSVER() ;Get EHR System Version; PUBLIC; Extrinsic
2008-07-17 15:55:07 -04:00
Q "1.0"
;
PTST(DFN) ;TEST TO SEE IF PATIENT MERGED OR A TEST PATIENT
; DFN = IEN of the Patient to be tested
; 1 = Merged or Test Patient
; 0 = Non-test Patient
;
I $D(^DPT(DFN,-9)) Q 1 ;This patient has been merged
I $G(^DPT(DFN,0))="" Q 1 ;Missing zeroth node <---add
;
I '$D(CCRTEST) S CCRTEST=1 ; DEFAULT IS THAT WE ARE TESTING
I 'CCRTEST D ; IF WE ARE NOT TESTING, SKIP TEST PATIENTS
. N DIERR,DATA
. S DATA=+$$GET1^DIQ(2,DFN_",",.6,"I") ;Test Patient Indicator
. ; 1 = Test Patient
. ; 0 = Non-test Patient
. I DATA Q DATA
. S DATA=$$GET1^DIQ(2,DFN_",",.09,"I") ;SSN test
. D CLEAN^DILF
. I $E(DATA,1,3)="000" Q 1
. I $E(DATA,1,3)="666" Q 1
Q 0
;