XINDEX fixes. almost clean except for long var names and big files

This commit is contained in:
george 2008-08-30 19:13:15 +00:00
parent 0333b2585b
commit 7fb48ee324
14 changed files with 202 additions and 245 deletions

View File

@ -1,5 +1,5 @@
CCRDPT ;CCRCCD/SMH - Routines to Extract Patient Data for CCDCCR; 6/15/08 CCRDPT ;CCRCCD/SMH - Routines to Extract Patient Data for CCDCCR; 6/15/08
;;0.1;CCRCCD;;Jun 15, 2008; ;;0.1;CCRCCD;;Jun 15, 2008;
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
;General Public License See attached copy of the License. ;General Public License See attached copy of the License.
; ;
@ -16,161 +16,156 @@ CCRDPT ;CCRCCD/SMH - Routines to Extract Patient Data for CCDCCR; 6/15/08
;You should have received a copy of the GNU General Public License along ;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., ;with this program; if not, write to the Free Software Foundation, Inc.,
;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
; NOTE TO PROGRAMMER: You need to call INIT(DPT) to initialize; and
; NOTE TO PROGRAMMER: You need to call INIT(DPT) to initialize; and ; DESTROY to clean-up.
; DESTROY to clean-up. ; The first line of every routine tests if the global exists.
;
; The first line of every routine tests if the global exists. ; CCRDPT 83 lines CCRCCD/SMH - Routines to Extract Patient Data for
; INIT 9 lines Copy DFN global to a local variable
; CCRDPT 83 lines CCRCCD/SMH - Routines to Extract Patient Data for ; DESTROY 6 lines Kill local variable
; INIT 9 lines Copy DFN global to a local variable ; FAMILY 6 lines Family Name
; DESTROY 6 lines Kill local variable ; GIVEN 6 lines Given Name
; FAMILY 6 lines Family Name ; MIDDLE 6 lines Middle Name
; GIVEN 6 lines Given Name ; SUFFIX 6 lines Suffix Name
; MIDDLE 6 lines Middle Name ; DISPNAME 5 lines Display Name
; SUFFIX 6 lines Suffix Name ; DOB 6 lines Date of Birth
; DISPNAME 5 lines Display Name ; GENDER 4 lines Get Gender
; DOB 6 lines Date of Birth ; SSN 4 lines Get SSN for ID
; GENDER 4 lines Get Gender ; ADDRTYPE 4 lines Get Home Address
; SSN 4 lines Get SSN for ID ; ADDR1 4 lines Get Home Address line 1
; ADDRTYPE 4 lines Get Home Address ; ADDR2 5 lines Get Home Address line 2
; ADDR1 4 lines Get Home Address line 1 ; CITY 4 lines Get City for Home Address
; ADDR2 5 lines Get Home Address line 2 ; STATE 11 lines Get State for Home Address
; CITY 4 lines Get City for Home Address ; ZIP 4 lines Get Zip code for Home Address
; STATE 11 lines Get State for Home Address ; COUNTY 4 lines Get County for our Address
; ZIP 4 lines Get Zip code for Home Address ; COUNTRY 4 lines Get Country for our Address
; COUNTY 4 lines Get County for our Address ; RESTEL 4 lines Residential Telephone
; COUNTRY 4 lines Get Country for our Address ; WORKTEL 4 lines Work Telephone
; RESTEL 4 lines Residential Telephone ; EMAIL 4 lines Email Adddress
; WORKTEL 4 lines Work Telephone ; CELLTEL 4 lines Cell Phone
; EMAIL 4 lines Email Adddress ; NOK1FAM 6 lines Next of Kin 1 (NOK1) Family Name
; CELLTEL 4 lines Cell Phone ; NOK1GIV 6 lines NOK1 Given Name
; NOK1FAM 6 lines Next of Kin 1 (NOK1) Family Name ; NOK1MID 6 lines NOK1 Middle Name
; NOK1GIV 6 lines NOK1 Given Name ; NOK1SUF 6 lines NOK1 Suffi Name
; NOK1MID 6 lines NOK1 Middle Name ; NOK1DISP 5 lines NOK1 Display Name
; NOK1SUF 6 lines NOK1 Suffi Name ; NOK1REL 4 lines NOK1 Relationship to the patient
; NOK1DISP 5 lines NOK1 Display Name ; NOK1ADD1 4 lines NOK1 Address 1
; NOK1REL 4 lines NOK1 Relationship to the patient ; NOK1ADD2 5 lines NOK1 Address 2
; NOK1ADD1 4 lines NOK1 Address 1 ; NOK1CITY 4 lines NOK1 City
; NOK1ADD2 5 lines NOK1 Address 2 ; NOK1STAT 5 lines NOK1 State
; NOK1CITY 4 lines NOK1 City ; NOK1ZIP 4 lines NOK1 Zip Code
; NOK1STAT 5 lines NOK1 State ; NOK1HTEL; 4 lines NOK1 Home Telephone
; NOK1ZIP 4 lines NOK1 Zip Code ; NOK1WTEL; 4 lines NOK1 Work Telephone
; NOK1HTEL; 4 lines NOK1 Home Telephone ; NOK1SAME; 4 lines Is NOK1's Address the same the patient?
; NOK1WTEL; 4 lines NOK1 Work Telephone ; NOK2FAM 6 lines NOK2 Family Name
; NOK1SAME; 4 lines Is NOK1's Address the same the patient? ; NOK2GIV 6 lines NOK2 Given Name
; NOK2FAM 6 lines NOK2 Family Name ; NOK2MID 6 lines NOK2 Middle Name
; NOK2GIV 6 lines NOK2 Given Name ; NOK2SUF 5 lines NOK2 Suffi Name
; NOK2MID 6 lines NOK2 Middle Name ; NOK2DISP 5 lines NOK2 Display Name
; NOK2SUF 5 lines NOK2 Suffi Name ; NOK2REL 4 lines NOK2 Relationship to the patient
; NOK2DISP 5 lines NOK2 Display Name ; NOK2ADD1 4 lines NOK2 Address 1
; NOK2REL 4 lines NOK2 Relationship to the patient ; NOK2ADD2 5 lines NOK2 Address 2
; NOK2ADD1 4 lines NOK2 Address 1 ; NOK2CITY 4 lines NOK2 City
; NOK2ADD2 5 lines NOK2 Address 2 ; NOK2STAT 5 lines NOK2 State
; NOK2CITY 4 lines NOK2 City ; NOK2ZIP 4 lines NOK2 Zip Code
; NOK2STAT 5 lines NOK2 State ; NOK2HTEL; 4 lines NOK2 Home Telephone
; NOK2ZIP 4 lines NOK2 Zip Code ; NOK2WTEL; 4 lines NOK2 Work Telephone
; NOK2HTEL; 4 lines NOK2 Home Telephone ; NOK2SAME; 4 lines Is NOK2's Address the same the patient?
; NOK2WTEL; 4 lines NOK2 Work Telephone ; EMERFAM 6 lines Emergency Contact (EMER) Family Name
; NOK2SAME; 4 lines Is NOK2's Address the same the patient? ; EMERGIV 6 lines EMER Given Name
; EMERFAM 6 lines Emergency Contact (EMER) Family Name ; EMERMID 6 lines EMER Middle Name
; EMERGIV 6 lines EMER Given Name ; EMERSUF 5 lines EMER Suffi Name
; EMERMID 6 lines EMER Middle Name ; EMERDISP 5 lines EMER Display Name
; EMERSUF 5 lines EMER Suffi Name ; EMERREL 4 lines EMER Relationship to the patient
; EMERDISP 5 lines EMER Display Name ; EMERADD1 4 lines EMER Address 1
; EMERREL 4 lines EMER Relationship to the patient ; EMERADD2 5 lines EMER Address 2
; EMERADD1 4 lines EMER Address 1 ; EMERCITY 4 lines EMER City
; EMERADD2 5 lines EMER Address 2 ; EMERSTAT 5 lines EMER State
; EMERCITY 4 lines EMER City ; EMERZIP 4 lines EMER Zip Code
; EMERSTAT 5 lines EMER State ; EMERHTEL; 4 lines EMER Home Telephone
; EMERZIP 4 lines EMER Zip Code ; EMERWTEL; 4 lines EMER Work Telephone
; EMERHTEL; 4 lines EMER Home Telephone ; EMERSAME; 4 lines Is EMER's Address the same the NOK?
; EMERWTEL; 4 lines EMER Work Telephone ;
; EMERSAME; 4 lines Is EMER's Address the same the NOK?
W "No Entry at top!" Q W "No Entry at top!" Q
; The following is a map of the relevant data in the patient global.
; The following is a map of the relevant data in the patient global. ;
; ; ^DPT(D0,0)= (#.01) NAME [1F] ^ (#.02) SEX [2S] ^ (#.03) DATE OF BIRTH [3D] ^
; ^DPT(D0,0)= (#.01) NAME [1F] ^ (#.02) SEX [2S] ^ (#.03) DATE OF BIRTH [3D] ^ ; ==>^ (#.05) MARITAL STATUS [5P:11] ^ (#.06) RACE [6P:10] ^ (#.07)
; ==>^ (#.05) MARITAL STATUS [5P:11] ^ (#.06) RACE [6P:10] ^ (#.07) ; ==>OCCUPATION [7F] ^ (#.08) RELIGIOUS PREFERENCE [8P:13] ^ (#.09)
; ==>OCCUPATION [7F] ^ (#.08) RELIGIOUS PREFERENCE [8P:13] ^ (#.09) ; ==>SOCIAL SECURITY NUMBER [9F] ^ (#.091) REMARKS [10F] ^ (#.092)
; ==>SOCIAL SECURITY NUMBER [9F] ^ (#.091) REMARKS [10F] ^ (#.092) ; ==>PLACE OF BIRTH [CITY] [11F] ^ (#.093) PLACE OF BIRTH [STATE]
; ==>PLACE OF BIRTH [CITY] [11F] ^ (#.093) PLACE OF BIRTH [STATE] ; ==>[12P:5] ^ ^ (#.14) CURRENT MEANS TEST STATUS [14P:408.32] ^
; ==>[12P:5] ^ ^ (#.14) CURRENT MEANS TEST STATUS [14P:408.32] ^ ; ==>(#.096) WHO ENTERED PATIENT [15P:200] ^ (#.097) DATE ENTERED INTO
; ==>(#.096) WHO ENTERED PATIENT [15P:200] ^ (#.097) DATE ENTERED INTO ; ==>FILE [16D] ^ (#.098) HOW WAS PATIENT ENTERED? [17S] ^ (#.081)
; ==>FILE [16D] ^ (#.098) HOW WAS PATIENT ENTERED? [17S] ^ (#.081) ; ==>DUPLICATE STATUS [18S] ^ (#.082) PATIENT MERGED TO [19P:2] ^
; ==>DUPLICATE STATUS [18S] ^ (#.082) PATIENT MERGED TO [19P:2] ^ ; ==>(#.083) CHECK FOR DUPLICATE [20S] ^ (#.6) TEST PATIENT INDICATOR
; ==>(#.083) CHECK FOR DUPLICATE [20S] ^ (#.6) TEST PATIENT INDICATOR ; ==>[21S] ^
; ==>[21S] ^ ; ^DPT(D0,.01,0)=^2.01^^ (#1) ALIAS
; ^DPT(D0,.01,0)=^2.01^^ (#1) ALIAS ; ^DPT(D0,.01,D1,0)= (#.01) ALIAS [1F] ^ (#1) ALIAS SSN [2F] ^ (#100.03) ALIAS
; ^DPT(D0,.01,D1,0)= (#.01) ALIAS [1F] ^ (#1) ALIAS SSN [2F] ^ (#100.03) ALIAS ; ==>COMPONENTS [3P:20] ^
; ==>COMPONENTS [3P:20] ^ ; ^DPT(D0,.11)= (#.111) STREET ADDRESS [LINE 1] [1F] ^ (#.112) STREET ADDRESS
; ^DPT(D0,.11)= (#.111) STREET ADDRESS [LINE 1] [1F] ^ (#.112) STREET ADDRESS ; ==>[LINE 2] [2F] ^ (#.113) STREET ADDRESS [LINE 3] [3F] ^ (#.114)
; ==>[LINE 2] [2F] ^ (#.113) STREET ADDRESS [LINE 3] [3F] ^ (#.114) ; ==>CITY [4F] ^ (#.115) STATE [5P:5] ^ (#.116) ZIP CODE [6F] ^
; ==>CITY [4F] ^ (#.115) STATE [5P:5] ^ (#.116) ZIP CODE [6F] ^ ; ==>(#.117) COUNTY [7N] ^ ^ ^ ^ ^ (#.1112) ZIP+4 [12F] ^
; ==>(#.117) COUNTY [7N] ^ ^ ^ ^ ^ (#.1112) ZIP+4 [12F] ^ ; ==>(#.118) ADDRESS CHANGE DT/TM [13D] ^ (#.119) ADDRESS CHANGE
; ==>(#.118) ADDRESS CHANGE DT/TM [13D] ^ (#.119) ADDRESS CHANGE ; ==>SOURCE [14S] ^ (#.12) ADDRESS CHANGE SITE [15P:4] ^ (#.121) BAD
; ==>SOURCE [14S] ^ (#.12) ADDRESS CHANGE SITE [15P:4] ^ (#.121) BAD ; ==>ADDRESS INDICATOR [16S] ^ (#.122) ADDRESS CHANGE USER [17P:200]
; ==>ADDRESS INDICATOR [16S] ^ (#.122) ADDRESS CHANGE USER [17P:200] ; ==>^
; ==>^ ; ^DPT(D0,.121)= (#.1211) TEMPORARY STREET [LINE 1] [1F] ^ (#.1212) TEMPORARY
; ^DPT(D0,.121)= (#.1211) TEMPORARY STREET [LINE 1] [1F] ^ (#.1212) TEMPORARY ; ==>STREET [LINE 2] [2F] ^ (#.1213) TEMPORARY STREET [LINE 3] [3F]
; ==>STREET [LINE 2] [2F] ^ (#.1213) TEMPORARY STREET [LINE 3] [3F] ; ==>^ (#.1214) TEMPORARY CITY [4F] ^ (#.1215) TEMPORARY STATE
; ==>^ (#.1214) TEMPORARY CITY [4F] ^ (#.1215) TEMPORARY STATE ; ==>[5P:5] ^ (#.1216) TEMPORARY ZIP CODE [6F] ^ (#.1217) TEMPORARY
; ==>[5P:5] ^ (#.1216) TEMPORARY ZIP CODE [6F] ^ (#.1217) TEMPORARY ; ==>ADDRESS START DATE [7D] ^ (#.1218) TEMPORARY ADDRESS END DATE
; ==>ADDRESS START DATE [7D] ^ (#.1218) TEMPORARY ADDRESS END DATE ; ==>[8D] ^ (#.12105) TEMPORARY ADDRESS ACTIVE? [9S] ^ (#.1219)
; ==>[8D] ^ (#.12105) TEMPORARY ADDRESS ACTIVE? [9S] ^ (#.1219) ; ==>TEMPORARY PHONE NUMBER [10F] ^ (#.12111) TEMPORARY ADDRESS
; ==>TEMPORARY PHONE NUMBER [10F] ^ (#.12111) TEMPORARY ADDRESS ; ==>COUNTY [11N] ^ (#.12112) TEMPORARY ZIP+4 [12F] ^ (#.12113)
; ==>COUNTY [11N] ^ (#.12112) TEMPORARY ZIP+4 [12F] ^ (#.12113) ; ==>TEMPORARY ADDRESS CHANGE DT/TM [13D] ^
; ==>TEMPORARY ADDRESS CHANGE DT/TM [13D] ^ ; ^DPT(D0,.121)= (#.12114) TEMPORARY ADDRESS CHANGE SITE [14P:4] ^
; ^DPT(D0,.121)= (#.12114) TEMPORARY ADDRESS CHANGE SITE [14P:4] ^ ; ^DPT(D0,.13)= (#.131) PHONE NUMBER [RESIDENCE] [1F] ^ (#.132) PHONE NUMBER
; ^DPT(D0,.13)= (#.131) PHONE NUMBER [RESIDENCE] [1F] ^ (#.132) PHONE NUMBER ; ==>[WORK] [2F] ^ (#.133) EMAIL ADDRESS [3F] ^ (#.134) PHONE NUMBER
; ==>[WORK] [2F] ^ (#.133) EMAIL ADDRESS [3F] ^ (#.134) PHONE NUMBER ; ==>[CELLULAR] [4F] ^ (#.135) PAGER NUMBER [5F] ^ (#.136) EMAIL
; ==>[CELLULAR] [4F] ^ (#.135) PAGER NUMBER [5F] ^ (#.136) EMAIL ; ==>ADDRESS CHANGE DT/TM [6D] ^ (#.137) EMAIL ADDRESS CHANGE SOURCE
; ==>ADDRESS CHANGE DT/TM [6D] ^ (#.137) EMAIL ADDRESS CHANGE SOURCE ; ==>[7S] ^ (#.138) EMAIL ADDRESS CHANGE SITE [8P:4] ^ (#.139)
; ==>[7S] ^ (#.138) EMAIL ADDRESS CHANGE SITE [8P:4] ^ (#.139) ; ==>CELLULAR NUMBER CHANGE DT/TM [9D] ^ (#.1311) CELLULAR NUMBER
; ==>CELLULAR NUMBER CHANGE DT/TM [9D] ^ (#.1311) CELLULAR NUMBER ; ==>CHANGE SOURCE [10S] ^ (#.13111) CELLULAR NUMBER CHANGE SITE
; ==>CHANGE SOURCE [10S] ^ (#.13111) CELLULAR NUMBER CHANGE SITE ; ==>[11P:4] ^ (#.1312) PAGER NUMBER CHANGE DT/TM [12D] ^ (#.1313)
; ==>[11P:4] ^ (#.1312) PAGER NUMBER CHANGE DT/TM [12D] ^ (#.1313) ; ==>PAGER NUMBER CHANGE SOURCE [13S] ^ (#.1314) PAGER NUMBER CHANGE
; ==>PAGER NUMBER CHANGE SOURCE [13S] ^ (#.1314) PAGER NUMBER CHANGE ; ==>SITE [14P:4] ^
; ==>SITE [14P:4] ^ ; ^DPT(D0,.21)= (#.211) K-NAME OF PRIMARY NOK [1F] ^ (#.212) K-RELATIONSHIP TO
; ^DPT(D0,.21)= (#.211) K-NAME OF PRIMARY NOK [1F] ^ (#.212) K-RELATIONSHIP TO ; ==>PATIENT [2F] ^ (#.213) K-STREET ADDRESS [LINE 1] [3F] ^ (#.214)
; ==>PATIENT [2F] ^ (#.213) K-STREET ADDRESS [LINE 1] [3F] ^ (#.214) ; ==>K-STREET ADDRESS [LINE 2] [4F] ^ (#.215) K-STREET ADDRESS [LINE
; ==>K-STREET ADDRESS [LINE 2] [4F] ^ (#.215) K-STREET ADDRESS [LINE ; ==>3] [5F] ^
; ==>3] [5F] ^ ; ^DPT(D0,.21)= (#.216) K-CITY [6F] ^ (#.217) K-STATE [7P:5] ^ (#.218) K-ZIP
; ^DPT(D0,.21)= (#.216) K-CITY [6F] ^ (#.217) K-STATE [7P:5] ^ (#.218) K-ZIP ; ==>CODE [8F] ^ (#.219) K-PHONE NUMBER [9F] ^ (#.2125) K-ADDRESS
; ==>CODE [8F] ^ (#.219) K-PHONE NUMBER [9F] ^ (#.2125) K-ADDRESS ; ==>SAME AS PATIENT'S? [10S] ^ (#.21011) K-WORK PHONE NUMBER [11F]
; ==>SAME AS PATIENT'S? [10S] ^ (#.21011) K-WORK PHONE NUMBER [11F] ; ==>^
; ==>^ ; ^DPT(D0,.211)= (#.2191) K2-NAME OF SECONDARY NOK [1F] ^ (#.2192)
; ^DPT(D0,.211)= (#.2191) K2-NAME OF SECONDARY NOK [1F] ^ (#.2192) ; ==>K2-RELATIONSHIP TO PATIENT [2F] ^ (#.2193) K2-STREET ADDRESS
; ==>K2-RELATIONSHIP TO PATIENT [2F] ^ (#.2193) K2-STREET ADDRESS ; ==>[LINE 1] [3F] ^ (#.2194) K2-STREET ADDRESS [LINE 2] [4F] ^
; ==>[LINE 1] [3F] ^ (#.2194) K2-STREET ADDRESS [LINE 2] [4F] ^ ; ==>(#.2195) K2-STREET ADDRESS [LINE 3] [5F] ^ (#.2196) K2-CITY
; ==>(#.2195) K2-STREET ADDRESS [LINE 3] [5F] ^ (#.2196) K2-CITY ; ==>[6F] ^ (#.2197) K2-STATE [7P:5] ^ (#.2198) K2-ZIP CODE [8F] ^
; ==>[6F] ^ (#.2197) K2-STATE [7P:5] ^ (#.2198) K2-ZIP CODE [8F] ^ ; ==>(#.2199) K2-PHONE NUMBER [9F] ^ (#.21925) K2-ADDRESS SAME AS
; ==>(#.2199) K2-PHONE NUMBER [9F] ^ (#.21925) K2-ADDRESS SAME AS ; ==>PATIENT'S? [10S] ^ (#.211011) K2-WORK PHONE NUMBER [11F] ^
; ==>PATIENT'S? [10S] ^ (#.211011) K2-WORK PHONE NUMBER [11F] ^ ; ^DPT(D0,.25)= (#.251) SPOUSE'S EMPLOYER NAME [1F] ^ (#.252) SPOUSE'S EMP
; ^DPT(D0,.25)= (#.251) SPOUSE'S EMPLOYER NAME [1F] ^ (#.252) SPOUSE'S EMP ; ==>STREET [LINE 1] [2F] ^ (#.253) SPOUSE'S EMP STREET [LINE 2]
; ==>STREET [LINE 1] [2F] ^ (#.253) SPOUSE'S EMP STREET [LINE 2] ; ==>[3F] ^ (#.254) SPOUSE'S EMP STREET [LINE 3] [4F] ^ (#.255)
; ==>[3F] ^ (#.254) SPOUSE'S EMP STREET [LINE 3] [4F] ^ (#.255) ; ==>SPOUSE'S EMPLOYER'S CITY [5F] ^ (#.256) SPOUSE'S EMPLOYER'S
; ==>SPOUSE'S EMPLOYER'S CITY [5F] ^ (#.256) SPOUSE'S EMPLOYER'S ; ==>STATE [6P:5] ^ (#.257) SPOUSE'S EMP ZIP CODE [7F] ^ (#.258)
; ==>STATE [6P:5] ^ (#.257) SPOUSE'S EMP ZIP CODE [7F] ^ (#.258) ; ==>SPOUSE'S EMP PHONE NUMBER [8F] ^ ^ ^ ^ ^ ^ (#.2514)
; ==>SPOUSE'S EMP PHONE NUMBER [8F] ^ ^ ^ ^ ^ ^ (#.2514) ; ==>SPOUSE'S OCCUPATION [14F] ^ (#.2515) SPOUSE'S EMPLOYMENT STATUS
; ==>SPOUSE'S OCCUPATION [14F] ^ (#.2515) SPOUSE'S EMPLOYMENT STATUS ; ==>[15S] ^ (#.2516) SPOUSE'S RETIREMENT DATE [16D] ^
; ==>[15S] ^ (#.2516) SPOUSE'S RETIREMENT DATE [16D] ^ ; ^DPT(D0,.33)= (#.331) E-NAME [1F] ^ (#.332) E-RELATIONSHIP TO PATIENT [2F] ^
; ^DPT(D0,.33)= (#.331) E-NAME [1F] ^ (#.332) E-RELATIONSHIP TO PATIENT [2F] ^ ; ==>(#.333) E-STREET ADDRESS [LINE 1] [3F] ^ (#.334) E-STREET
; ==>(#.333) E-STREET ADDRESS [LINE 1] [3F] ^ (#.334) E-STREET ; ==>ADDRESS [LINE 2] [4F] ^ (#.335) E-STREET ADDRESS [LINE 3] [5F]
; ==>ADDRESS [LINE 2] [4F] ^ (#.335) E-STREET ADDRESS [LINE 3] [5F] ; ==>^ (#.336) E-CITY [6F] ^ (#.337) E-STATE [7P:5] ^ (#.338) E-ZIP
; ==>^ (#.336) E-CITY [6F] ^ (#.337) E-STATE [7P:5] ^ (#.338) E-ZIP ; ==>CODE [8F] ^ (#.339) E-PHONE NUMBER [9F] ^ (#.3305) E-EMER.
; ==>CODE [8F] ^ (#.339) E-PHONE NUMBER [9F] ^ (#.3305) E-EMER. ; ==>CONTACT SAME AS NOK? [10S] ^ (#.33011) E-WORK PHONE NUMBER
; ==>CONTACT SAME AS NOK? [10S] ^ (#.33011) E-WORK PHONE NUMBER ; ==>[11F] ^DFN) ; Copy DFN global to a local variable; PUBLIC
; ==>[11F] ^ ; INPUT: Patient IEN (DFN)
; OUTPUT: PT in the Symbol Table, representing the patient global
INIT(DFN) ; Copy DFN global to a local variable; PUBLIC ; Instead of accessing a global each single read (SLOOOOW)
; INPUT: Patient IEN (DFN) ; read it off a local variable stored in Memory.
; OUTPUT: PT in the Symbol Table, representing the patient global INIT(DFN) ;
; Instead of accessing a global each single read (SLOOOOW)
; read it off a local variable stored in Memory.
M PT=^DPT(DFN) M PT=^DPT(DFN)
Q Q
; ;

View File

@ -1,4 +1,5 @@
CCRDPTT ; Unit Tester... CCRDPTT ; Unit Tester...
;;0.1;CCRCCD;;Jun 15, 2008;
; ;
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
;General Public License See attached copy of the License. ;General Public License See attached copy of the License.
@ -26,19 +27,19 @@ CCRDPTT ; Unit Tester...
; STATS(105,0)="GIVEN() ; Given Name; PUBLIC; Extrinsic" ; STATS(105,0)="GIVEN() ; Given Name; PUBLIC; Extrinsic"
; STATS(111,0)="MIDDLE() ; Middle Name; PUBLIC; Extrinsic " ; STATS(111,0)="MIDDLE() ; Middle Name; PUBLIC; Extrinsic "
; etc. ; etc.
;
; Load Routine Entry points; We get a sweeeeeet array ; Load Routine Entry points; We get a sweeeeeet array
D ANALYZE^ARJTXRD("CCRDPT",.OUT) ; Analyze a routine in the directory D ANALYZE^ARJTXRD("CCRDPT",.OUT) ; Analyze a routine in the directory
N X,Y N X,Y
; Select Patient ; Select Patient
S DIC=2,DIC(0)="AEMQ" D ^DIC S DIC=2,DIC(0)="AEMQ" D ^DIC
;
W "You have selected patient "_Y,!! W "You have selected patient "_Y,!!
D INIT^CCRDPT($P(Y,"^")) D INIT^CCRDPT($P(Y,"^"))
ZWR PT ; ZWR PT
N I S I=165 F S I=$O(OUT(I)) Q:I="" D N I S I=165 F S I=$O(OUT(I)) Q:I="" D
. W "OUT("_I_",0)"_" is "_$P(OUT(I,0)," ")_" " . W "OUT("_I_",0)"_" is "_$P(OUT(I,0)," ")_" "
. W "valued at " . W "valued at "
. W @("$$"_$P(OUT(I,0),"()")_"^"_"CCRDPT"_"()") . W @("$$"_$P(OUT(I,0),"()")_"^"_"CCRDPT"_"()")
. W ! . W !
Q Q

View File

@ -18,18 +18,17 @@ CCRSYS ;CCDCCR/SMH - Routine to Get EHR System Information;6JUL2008
;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
; ;
W "Enter at appropriate points." Q W "Enter at appropriate points." Q
;
; Originally, I was going to use VEPERVER, but VEPERVER ; Originally, I was going to use VEPERVER, but VEPERVER
; actually kills ^TMP($J), outputs it to the screen in a user-friendly ; actually kills ^TMP($J), outputs it to the screen in a user-friendly
; manner (press any key to continue), ; manner (press any key to continue),
; and is really a very half finished routine ; and is really a very half finished routine
;
; So for now, I am hard-coding the values. ; So for now, I am hard-coding the values.
;
SYSNAME() ;Get EHR System Name; PUBLIC; Extrinsic SYSNAME() ;Get EHR System Name; PUBLIC; Extrinsic
Q "WorldVistA EHR/VOE" Q "WorldVistA EHR/VOE"
; ;
SYSVER() ;Get EHR System Version; PUBLIC; Extrinsic SYSVER() ;Get EHR System Version; PUBLIC; Extrinsic
Q "1.0" Q "1.0"
; ;

View File

@ -1,22 +1,23 @@
CCRUNIT ; A routine that tests some crap CCRUNIT ; A routine that tests some crap
Q ;;0.1;CCDCCR;;JUL 13, 2007;Build 0
; Q
;
MEDS MEDS
N DEBUG S DEBUG=0 N DEBUG S DEBUG=0
N DFN S DFN=1 N DFN S DFN=1
K ^TMP($J) K ^TMP($J)
W "Loading CCR Template into T using LOAD^GPLCCR0($NA(^TMP($J,""CCR"")))",!! W "Loading CCR Template into T using LOAD^GPLCCR0($NA(^TMP($J,""CCR"")))",!!
N T S T=$NA(^TMP($J,"CCR")) D LOAD^GPLCCR0(T) N T S T=$NA(^TMP($J,"CCR")) D LOAD^GPLCCR0(T)
B B
N XPATH S XPATH="//ContinuityOfCareRecord/Body/Medications" N XPATH S XPATH="//ContinuityOfCareRecord/Body/Medications"
W "XPATH is: "_XPATH,! W "XPATH is: "_XPATH,!
W "Getting Med Template into INXML using",! W "Getting Med Template into INXML using",!
W "QUERY^GPLXPATH(T,XPATH,""INXML"")",!! W "QUERY^GPLXPATH(T,XPATH,""INXML"")",!!
N INXML N INXML
D QUERY^GPLXPATH(T,XPATH,"INXML") D QUERY^GPLXPATH(T,XPATH,"INXML")
B B
W "Executing EXTRACT^GPLMEDS(""INXML"",DFN,OUTXML)",! W "Executing EXTRACT^GPLMEDS(""INXML"",DFN,OUTXML)",!
W "OUTXML will be ^TMP($J,""OUT"")",! W "OUTXML will be ^TMP($J,""OUT"")",!
N OUTXML S OUTXML=$NA(^TMP($J,"OUT")) N OUTXML S OUTXML=$NA(^TMP($J,"OUT"))
D EXTRACT^GPLMEDS("INXML",DFN,OUTXML) D EXTRACT^GPLMEDS("INXML",DFN,OUTXML)
Q Q

View File

@ -69,8 +69,8 @@ SORTDT(V1,V2,ORDR) ; DATE SORT ARRAY AND RETURN INDEX IN V1 AND COUNT
. . ; S VSRT($P(V2(ZTMP),U,4)_"000000"_ZCNT)=ZCNT ; PULL DATE . . ; S VSRT($P(V2(ZTMP),U,4)_"000000"_ZCNT)=ZCNT ; PULL DATE
. I DEBUG W "ZTMP=",ZTMP," " . I DEBUG W "ZTMP=",ZTMP," "
S V1(0)=ZCNT ; ARRAYS ARE THE SAME SIZE S V1(0)=ZCNT ; ARRAYS ARE THE SAME SIZE
I DEBUG ZWR V2 ; I DEBUG ZWR V2
I DEBUG ZWR VSRT ; I DEBUG ZWR VSRT
N ZD,ZT ; DATA AND TIME ITERATORS N ZD,ZT ; DATA AND TIME ITERATORS
N ZDONE ; DONE FLAG N ZDONE ; DONE FLAG
S (ZD,ZT)="" S (ZD,ZT)=""

View File

@ -19,9 +19,9 @@ CCRVA200 ;WV/CCDCCR/SMH - Routine to get Provider Data;07/13/2008
Q Q
; This routine uses Kernel APIs and Direct Global Access to get ; This routine uses Kernel APIs and Direct Global Access to get
; Proivder Data from File 200. ; Proivder Data from File 200.
;
; The Global is VA(200,*) ; The Global is VA(200,*)
;
FAMILY(DUZ) ; Get Family Name; PUBLIC; EXTRINSIC FAMILY(DUZ) ; Get Family Name; PUBLIC; EXTRINSIC
; INPUT: DUZ (i.e. File 200 IEN) ByVal ; INPUT: DUZ (i.e. File 200 IEN) ByVal
; OUTPUT: String ; OUTPUT: String
@ -75,7 +75,7 @@ SPEC(DUZ) ; Get Provider Specialty, PUBLIC; EXTRINSIC
; OUTPUT: String: ProviderType/Specialty/Subspecialty OR "" ; OUTPUT: String: ProviderType/Specialty/Subspecialty OR ""
; Uses a Kernel API. Returns -1 if a specialty is not specified ; Uses a Kernel API. Returns -1 if a specialty is not specified
; in file 200. ; in file 200.
; Otherwise, returns IEN^Profession^Specialty^Sub­ specialty^Effect date^Expired date^VA code ; Otherwise, returns IEN^Profession^Specialty^Sub­specialty^Effect date^Expired date^VA code
N STR S STR=$$GET^XUA4A72(DUZ) N STR S STR=$$GET^XUA4A72(DUZ)
Q:+STR<0 "" Q:+STR<0 ""
; Sometimes we have 3 pieces, or 2. Deal with that. ; Sometimes we have 3 pieces, or 2. Deal with that.
@ -90,11 +90,11 @@ ADDTYPE(DUZ) ; Get Address Type, PUBLIC; EXTRINSIC
ADDLINE1(DUZ) ; Get Address associated with this instituation; PUBLIC; EXTRINSIC ADDLINE1(DUZ) ; Get Address associated with this instituation; PUBLIC; EXTRINSIC
; INPUT: DUZ ByVal ; INPUT: DUZ ByVal
; Output: String. ; Output: String.
;
; First, get site number from the institution file. ; First, get site number from the institution file.
; 1st piece returned by $$SITE^VASITE, which gets the system institution ; 1st piece returned by $$SITE^VASITE, which gets the system institution
N INST S INST=$P($$SITE^VASITE(),U) N INST S INST=$P($$SITE^VASITE(),U)
;
; Second, get mailing address ; Second, get mailing address
; There are two APIs to get the address, one for physical and one for ; There are two APIs to get the address, one for physical and one for
; mailing. We will check if mailing exists first, since that's the ; mailing. We will check if mailing exists first, since that's the
@ -165,4 +165,3 @@ EMAIL(DUZ) ; Get Provider's Email. PUBLIC; EXTRINSIC
N EMAIL S EMAIL=$G(^VA(200,DUZ,.15)) N EMAIL S EMAIL=$G(^VA(200,DUZ,.15))
Q $P(EMAIL,U) Q $P(EMAIL,U)
; ;

View File

@ -81,7 +81,7 @@ PATIENT(INXML,AIEN,AOID,OUTXML) ; PROCESS A PATIENT ACTOR
N AMAP,ZX N AMAP,ZX
S AMAP=$NA(^TMP($J,"AMAP")) S AMAP=$NA(^TMP($J,"AMAP"))
K @AMAP K @AMAP
D INIT^CCRDPT(AIEN) D INIT^CCRDPT(AIEN)
S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
S @AMAP@("ACTORGIVENNAME")=$$GIVEN^CCRDPT S @AMAP@("ACTORGIVENNAME")=$$GIVEN^CCRDPT
S @AMAP@("ACTORMIDDLENAME")=$$MIDDLE^CCRDPT S @AMAP@("ACTORMIDDLENAME")=$$MIDDLE^CCRDPT

View File

@ -86,7 +86,7 @@ CCDRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
K ACTT1 K ACCT2 K ACTT1 K ACCT2
; MAPPING THE PROVIDER ORGANIZATION,AUTHOR,INFORMANT,CUSTODIAN CDA HEADER ; MAPPING THE PROVIDER ORGANIZATION,AUTHOR,INFORMANT,CUSTODIAN CDA HEADER
; FOR NOW, THEY ARE ALL THE SAME AND RESOLVE TO ORGANIZATION ; FOR NOW, THEY ARE ALL THE SAME AND RESOLVE TO ORGANIZATION
D ORG^GPLACTORS(CCDGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG D ORG^GPLACTOR(CCDGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG
D CP^GPLXPATH("ACTT2",CCDGLO) D CP^GPLXPATH("ACTT2",CCDGLO)
; ;
K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
@ -115,10 +115,10 @@ CCDRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
; NEED TO ADD BACK IN ACTOR PROCESSING AFTER WE FIGURE OUT LINKAGE ; NEED TO ADD BACK IN ACTOR PROCESSING AFTER WE FIGURE OUT LINKAGE
; D ACTLST^GPLCCR(CCDGLO,ACTGLO) ; GEN THE ACTOR LIST ; D ACTLST^GPLCCR(CCDGLO,ACTGLO) ; GEN THE ACTOR LIST
; D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT") ; D QUERY^GPLXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT")
; D EXTRACT^GPLACTORS("ACTT",ACTGLO,"ACTT2") ; D EXTRACT^GPLACTOR("ACTT",ACTGLO,"ACTT2")
; D INSINNER^GPLXPATH(CCDGLO,"ACTT2","//ContinuityOfCareRecord/Actors") ; D INSINNER^GPLXPATH(CCDGLO,"ACTT2","//ContinuityOfCareRecord/Actors")
N I,J,DONE S DONE=0 N I,J,DONE S DONE=0
F I=0:0 D Q:DONE ; DELETE UNTIL ALL EMPTY ELEMENTS ARE GONE F I=0:0 D Q:DONE ; DELETE UNTIL ALL EMPTY ELEMENTS ARE GONE
. S J=$$TRIM^GPLXPATH(CCDGLO) ; DELETE EMPTY ELEMENTS . S J=$$TRIM^GPLXPATH(CCDGLO) ; DELETE EMPTY ELEMENTS
. W "TRIMMED",J,! . W "TRIMMED",J,!
. I J=0 S DONE=1 ; DONE WHEN TRIM RETURNS FALSE . I J=0 S DONE=1 ; DONE WHEN TRIM RETURNS FALSE

View File

@ -1,4 +1,4 @@
GPLCCD0 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08 GPLCCD1 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08
;;0.1;CCDCCR;nopatch;noreleasedate ;;0.1;CCDCCR;nopatch;noreleasedate
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
;General Public License See attached copy of the License. ;General Public License See attached copy of the License.
@ -25,9 +25,9 @@ ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
; ZARY IS PASSED BY NAME ; ZARY IS PASSED BY NAME
; BAT is a string identifying the section ; BAT is a string identifying the section
; LINE is a test which will evaluate to true or false ; LINE is a test which will evaluate to true or false
; I '$G(@ZARY) D ; I '$G(@ZARY) D ; IF ZARY DOES NOT EXIST '
. S @ZARY@(0)=0 ; initially there are no elements ; . S @ZARY@(0)=0 ; initially there are no elements
. W "GOT HERE LOADING "_LINE,! ; . W "GOT HERE LOADING "_LINE,!
N CNT ; count of array elements N CNT ; count of array elements
S CNT=@ZARY@(0) ; contains array count S CNT=@ZARY@(0) ; contains array count
S CNT=CNT+1 ; increment count S CNT=CNT+1 ; increment count

View File

@ -25,9 +25,9 @@ ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
; ZARY IS PASSED BY NAME ; ZARY IS PASSED BY NAME
; BAT is a string identifying the section ; BAT is a string identifying the section
; LINE is a test which will evaluate to true or false ; LINE is a test which will evaluate to true or false
; I '$G(@ZARY) D ; I '$G(@ZARY) D ;
. S @ZARY@(0)=0 ; initially there are no elements ; . S @ZARY@(0)=0 ; initially there are no elements
. W "GOT HERE LOADING "_LINE,! ; . W "GOT HERE LOADING "_LINE,!
N CNT ; count of array elements N CNT ; count of array elements
S CNT=@ZARY@(0) ; contains array count S CNT=@ZARY@(0) ; contains array count
S CNT=CNT+1 ; increment count S CNT=CNT+1 ; increment count

View File

@ -31,7 +31,7 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
. W "ERROR RUNNINIG MEDICATIONS RPC",! . W "ERROR RUNNINIG MEDICATIONS RPC",!
. S @MEDOUTXML@(0)=0 . S @MEDOUTXML@(0)=0
. Q . Q
I DEBUG ZWR MEDRSLT ; I DEBUG ZWR MEDRSLT
M GPLMEDS=MEDRSLT M GPLMEDS=MEDRSLT
S MEDTVMAP=$NA(^TMP("GPLCCR",$J,"MEDICATIONS")) S MEDTVMAP=$NA(^TMP("GPLCCR",$J,"MEDICATIONS"))
S MEDTARYTMP=$NA(^TMP("GPLCCR",$J,"MEDARYTMP")) S MEDTARYTMP=$NA(^TMP("GPLCCR",$J,"MEDARYTMP"))

View File

@ -37,7 +37,7 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
. W "NULL RESULT FROM LIST^ORQQPL3 ",! . W "NULL RESULT FROM LIST^ORQQPL3 ",!
. S @OUTXML@(0)=0 . S @OUTXML@(0)=0
. ; Q . ; Q
I DEBUG ZWR RPCRSLT ; I DEBUG ZWR RPCRSLT
F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST
. S VMAP=$NA(@TVMAP@(J)) . S VMAP=$NA(@TVMAP@(J))
. K @VMAP . K @VMAP

View File

@ -112,7 +112,7 @@ TEST ; RUN ALL THE TEST CASES
W "FAILED: ",TFAILED,! W "FAILED: ",TFAILED,!
W ! W !
W "THE TESTS!",! W "THE TESTS!",!
I DEBUG ZWR ZTMP ; I DEBUG ZWR ZTMP
Q Q
; ;
GTSTS(GTZARY,RTN) ; return an array of test names GTSTS(GTZARY,RTN) ; return an array of test names

View File

@ -38,7 +38,7 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE
K @VITTVMAP,@VITTARYTMP ; KILL OLD ARRAY VALUES K @VITTVMAP,@VITTARYTMP ; KILL OLD ARRAY VALUES
N VSORT,VDATES,VCNT ; ARRAY FOR DATE SORTED VITALS INDEX N VSORT,VDATES,VCNT ; ARRAY FOR DATE SORTED VITALS INDEX
D VITDATES(.VDATES) ; PULL OUT THE DATES INTO AN ARRAY D VITDATES(.VDATES) ; PULL OUT THE DATES INTO AN ARRAY
I DEBUG ZWR VDATES ;DEBUG ; I DEBUG ZWR VDATES ;DEBUG
S VCNT=$$SORTDT^CCRUTIL(.VSORT,.VDATES,-1) ; PUT VITALS IN REVERSE S VCNT=$$SORTDT^CCRUTIL(.VSORT,.VDATES,-1) ; PUT VITALS IN REVERSE
; DATE ORDER AND COUNT THEM. VSORT CONTAINS INDIRECT INDEXES ONLY ; DATE ORDER AND COUNT THEM. VSORT CONTAINS INDIRECT INDEXES ONLY
F J=1:1:VCNT D ; FOR EACH VITAL IN THE LIST F J=1:1:VCNT D ; FOR EACH VITAL IN THE LIST
@ -174,7 +174,7 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE
. . I J>1 D ; AFTER THE FIRST, INSERT INNER XML . . I J>1 D ; AFTER THE FIRST, INSERT INNER XML
. . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP) . . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
; ZWR ^TMP($J,"VITALS",*) ; ZWR ^TMP($J,"VITALS",*)
ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS ; ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
I DEBUG D PARY^GPLXPATH(VITOUTXML) I DEBUG D PARY^GPLXPATH(VITOUTXML)
N VITTMP,I N VITTMP,I
D MISSING^GPLXPATH(VITOUTXML,"VITTMP") ; SEARCH XML FOR MISSING VARS D MISSING^GPLXPATH(VITOUTXML,"VITTMP") ; SEARCH XML FOR MISSING VARS
@ -183,44 +183,6 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE
. F I=1:1:VITTMP(0) W VITTMP(I),! . F I=1:1:VITTMP(0) W VITTMP(I),!
Q Q
; ;
VITSORT(V1,V2) ; DEPRECATED USE $$RSORTDT^CCRUTIL
; DATE SORT VITALS ARRAY AND RETURN INDEX IN V1 AND COUNT
; AS EXTRINSIC
; BOTH V1 AND V2 ARE PASSED BY REFERENCE
N VSRT ; TEMP FOR HASHING DATES
N ZI,ZJ,ZTMP,ZCNT,ZP1,ZP2
S ZCNT=0 ; COUNTING NUMBER OF VITALS
S ZTMP="" ;
F ZI=0:0 D Q:$O(V2(ZTMP))="" ; FOR EACH VITAL IN THE ARRAY
. S ZCNT=ZCNT+1 ; INCREMENT THE COUNT
. S ZTMP=$O(V2(ZTMP)) ; NEXT VITAL
. I $D(V2(ZTMP)) D ; IF THE RESULT EXISTS
. . S ZP1=$P($P(V2(ZTMP),U,4),".",1) ; THE DATE PIECE
. . S ZP2=$P($P(V2(ZTMP),U,4),".",2) ; THE TIME PIECE
. . S VSRT(ZP1,ZP2_"00000"_ZCNT)=ZCNT ; HASH ON DATE AND TIME
. . ; S VSRT($P(V2(ZTMP),U,4)_"000000"_ZCNT)=ZCNT ; PULL DATE
. I DEBUG W "ZTMP=",ZTMP," "
S V1(0)=ZCNT ; ARRAYS ARE THE SAME SIZE
I DEBUG ZWR V2
I DEBUG ZWR VSRT
N ZD,ZT ; DATA AND TIME ITERATORS
N ZDONE ; DONE FLAG
S (ZD,ZT)=""
S ZDONE=0
N ZZCNT S ZZCNT=0 ; ANOTHER COUNTER
F ZI=0:0 D Q:ZDONE ; VISIT THE ARRAY IN DATE ORDER
. S ZD=$O(VSRT(ZD),-1) ; NEXT DATE
. I ZD="" S ZDONE=1
. I 'ZDONE D ; MORE DATES
. . S ZT="" ; WANT FIRST TIME FOR THIS DATE
. . F ZJ=0:0 D Q:$O(VSRT(ZD,ZT),-1)="" ; LOOP THROUGH ALL TIMES
. . . S ZT=$O(VSRT(ZD,ZT),-1) ; NEXT TIME
. . . S ZZCNT=ZZCNT+1 ; INCREMENT COUNTER
. . . S V1(ZZCNT)=VSRT(ZD,ZT) ; PULL OUT THE INDEX
. ; S V1(ZI)=ZI ; PLUG FOR NOW, DATES NOT SORTED
I DEBUG ZWR V1
Q ZCNT
;
VITDATES(VDT) ; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY VITDATES(VDT) ; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY
; OF DATES IN THE VITALS RESULTS ; OF DATES IN THE VITALS RESULTS
N VDTI,VDTJ,VTDCNT N VDTI,VDTJ,VTDCNT